OpenCores
URL https://opencores.org/ocsvn/zipcpu/zipcpu/trunk

Subversion Repositories zipcpu

[/] [zipcpu/] [trunk/] [sw/] [zasm/] [test.S] - Diff between revs 105 and 123

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 105 Rev 123
Line 89... Line 89...
#define PIPELINE_STACK_TEST
#define PIPELINE_STACK_TEST
#define MEM_PIPELINE_TEST
#define MEM_PIPELINE_TEST
#define CONDITIONAL_EXECUTION_TEST
#define CONDITIONAL_EXECUTION_TEST
#define NOWAIT_PIPELINE_TEST    // Were wait states btwn regs removed properly?
#define NOWAIT_PIPELINE_TEST    // Were wait states btwn regs removed properly?
#define BCMEM_TEST      // Do memory and conditions work well together?
#define BCMEM_TEST      // Do memory and conditions work well together?
 
#define PIPELINE_MEMORY_RACE_CONDITIONS
test:
test:
#ifdef  DO_TEST_ASSEMBLER
#ifdef  DO_TEST_ASSEMBLER
; We start out by testing our assembler.  We give it some instructions, which
; We start out by testing our assembler.  We give it some instructions, which
; are then manually checked  by disassembling/dumping the result and making
; are then manually checked  by disassembling/dumping the result and making
; certain they match.  This is not an automated test, but it is an important
; certain they match.  This is not an automated test, but it is an important
Line 404... Line 405...
        mov     stack(pc),usp
        mov     stack(pc),usp
        ldi     0x8000ffff,r0   ; Clear interrupts, turn all vectors off
        ldi     0x8000ffff,r0   ; Clear interrupts, turn all vectors off
        sto     r0,(r12)
        sto     r0,(r12)
        rtu
        rtu
        mov     ucc,r0
        mov     ucc,r0
 
        and     0x0ffff,r0
        CMP     sys.cctrap+sys.gie,r0
        CMP     sys.cctrap+sys.gie,r0
        bnz     test_failure
        bnz     test_failure
        halt
        halt
// Go into an infinite loop if the trap fails
// Go into an infinite loop if the trap fails
// Permanent loop instruction -- a busy halt if you will
// Permanent loop instruction -- a busy halt if you will
Line 742... Line 744...
        BRA     end_bcmemtest
        BRA     end_bcmemtest
bcmemtestloc:
bcmemtestloc:
        WORD    0
        WORD    0
end_bcmemtest:
end_bcmemtest:
#endif
#endif
 
 
 
#ifdef  PIPELINE_MEMORY_RACE_CONDITIONS
 
        LDI     0x14000,R11
 
        FJSR(pipeline_memory_race_test,R0)
 
#endif // PIPELINE_MEMORY_RACE_CONDITIONS
 
 
// Return success / Test the trap interrupt
// Return success / Test the trap interrupt
        clr     r11
        clr     r11
        trap    r11     // FAILS HERE FAILS FAILS FAILS !!!!!!!!!!!
        trap    r11     // FAILS HERE FAILS FAILS FAILS !!!!!!!!!!!
        noop
        noop
        noop
        noop
Line 983... Line 991...
        LOD     4(SP),R4
        LOD     4(SP),R4
        ADD     6,SP
        ADD     6,SP
        JMP     R0
        JMP     R0
#endif  // NOWAIT_PIPELINE_TEST
#endif  // NOWAIT_PIPELINE_TEST
 
 
 
#ifdef  PIPELINE_MEMORY_RACE_CONDITIONS
 
pipeline_memory_race_test:
 
        SUB     3,SP
 
        STO     R0,(SP)
 
        STO     R1,1(SP)
 
        STO     R2,2(SP)
 
 
 
        MOV     pipeline_memory_test_data(PC),R0
 
        LOD     (R0),R0
 
        LOD     (R0),R0
 
        CMP     275,R0
 
        MOV.NZ  R11,CC
 
 
 
        MOV     pipeline_memory_test_data(PC),R0
 
        ; Here's the test sequence
 
        LOD     (R0),R1
 
        LOD     1(R0),R2
 
        STO     R2,1(R1)
 
        ; Make sure we clear the load pipeline
 
        LOD     (R0),R1
 
        ; Load our written value
 
        LOD     2(R0),R2
 
        CMP     275,R2
 
        MOV.NZ  R11,CC
 
 
 
        ;
 
        ; Next failing sequence:
 
        ;       LOD -x(R12),R0
 
        ;       LOD y(R0),R0
 
        MOV     pipeline_memory_test_data(PC),R0
 
        MOV     1(R0),R1
 
        STO     R1,1(R0)
 
        LDI     3588,R2         ; Just some random value
 
        STO     R2,2(R0)
 
        MOV     R0,R1
 
        ; Here's the test sequence
 
        LOD     (R0),R1
 
        LOD     1(R1),R1
 
        CMP     R2,R1
 
        MOV.NZ  R11,CC
 
 
 
        LOD     (SP),R0
 
        LOD     1(SP),R1
 
        LOD     2(SP),R2
 
        ADD     3,SP
 
        JMP     R0
 
pipeline_memory_test_data:
 
        .dat    __here__+0x0100000+1
 
        .dat    275
 
        .dat    0
 
#endif
 
 
 
 
        fill    512,0
        fill    512,0
stack:  // Must point to a valid word initially
stack:  // Must point to a valid word initially
        word    0
        word    0

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.