(MX-Board Owner) Posts 566 08 Nov 2011 13:37
| We use a couple of test cases like the one below with our processor test bench. The test bench has a little set of IO register. Only the $00D0000C register is really used. This register can trigger a simulation break point if a none zero value is written to.
; Definitions assert_zero EQU $00D0000C ; Vector base ORG $0000 _reset_init_stack DC.L $00001000 _reset_init_pc DC.L $00000200 _access_fault DC.L $00000000 _addr_error DC.L $00000000 _illegal_inst DC.L $00000000 _divide_by_zero DC.L $00000000 _chk_inst DC.L $00000000 _trap_inst DC.L $00000000 _privilge_violation DC.L $00000000 _trace DC.L $00000000 _line_1010_emulator DC.L $00000000 _line_1111_emulator DC.L $00000000 _reserved_12 DC.L $00000000 _coprocessor_violation DC.L $00000000 _format_error DC.L $00000000 _uninitialized_interrupt DC.L $00000000 _reserved_16to23 DC.L 0,0,0,0,0,0,0,0 _spurious_int DC.L $00000000 _lvevel1_int DC.L $00000000 _lvevel2_int DC.L $00000000 _lvevel3_int DC.L $00000000 _lvevel4_int DC.L $00000000 _lvevel5_int DC.L $00000000 _lvevel6_int DC.L $00000000 _lvevel7_int DC.L $00000000 _trap0d15_inst DC.L 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 _FP_exceptions DC.L 0,0,0,0,0,0,0,0 _MMU_errors DC.L 0,0,0 _reserved_59to63 DC.L 0,0,0,0,0 _userdefined_64to255 DC.L 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 DC.L 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 DC.L 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 DC.L 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ORG $0200 START: ; first instruction of program ; /* ADDQ, ADD, ADDA, ADDI Test */ moveq #0,D0 ; Setup moveq #-1,D1 ; Setup moveq #-1,D2 ; Setup sub.l A0,A0 ; Setup move.l #$1000,A1 ; Setup move.l #$0,(A1) ; Setup ; # Some AddQ Test addq.l #1,D0 ; D0 == 00000001 ? addq.l #1,D0 ; D0 == 00000002 ? addq.l #8,D0 ; D0 == 0000000A ? addq.w #1,D1 ; D1 == FFFF0000 ? addq.b #1,D2 ; D2 == FFFFFF00 ? add.l D0,D2 ; D2 == FFFFFF0A ? sub.l #$ffff0000,D1 move.l D1,assert_zero ; test sub.l #$ffffff0A,D2 move.l D2,assert_zero ; test addq.l #1,A0 ; A0 == 00000001 ? adda.l D0,A0 ; A0 == 0000000B ? adda.l #$1000,A0 ; A0 == 0000100B ? adda.w #$2000,A0 ; A0 == 0000300B ? sub.l #$0000300B,A0 move.l A0,assert_zero ; test addq.l #1,(A1) ; 1000 => $00000001 ? addq.l #1,(A1) ; 1000 => $00000002 ? addq.l #1,(A1) ; 1000 => $00000003 ? addq.w #4,(A1) ; 1000 => $00040003 ? addq.b #1,(A1) ; 1000 => $01040003 ? addq.b #4,(A1) ; 1000 == $05040003 ? addq.b #4,(A1) ; 1000 == $09040003 ? addq.b #7,2(A1) ; 1000 == $09040703 ? move.l #$09040703,D0 sub.l (a1),D0 move.l D0,assert_zero ; test nop STOP #0 end start
The EASy68K seems to be use full for the first steps. We have a memory in the test bench that can directly read Motorola S-Records file format as used by several other tools as well (Macroassembler AS, gnu objdump, srec_cat).
|