Line 27... |
Line 27... |
/* */
|
/* */
|
/* Author(s): */
|
/* Author(s): */
|
/* - Olivier Girard, olgirard@gmail.com */
|
/* - Olivier Girard, olgirard@gmail.com */
|
/* */
|
/* */
|
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
/* $Rev: 102 $ */
|
/* $Rev: 111 $ */
|
/* $LastChangedBy: olivier.girard $ */
|
/* $LastChangedBy: olivier.girard $ */
|
/* $LastChangedDate: 2011-03-04 23:02:09 +0100 (Fri, 04 Mar 2011) $ */
|
/* $LastChangedDate: 2011-05-20 22:39:02 +0200 (Fri, 20 May 2011) $ */
|
/*===========================================================================*/
|
/*===========================================================================*/
|
|
|
initial
|
initial
|
begin
|
begin
|
$display(" ===============================================");
|
$display(" ===============================================");
|
Line 44... |
Line 44... |
|
|
/* -------------- TEST INSTRUCTION IN WORD MODE ------------------- */
|
/* -------------- TEST INSTRUCTION IN WORD MODE ------------------- */
|
|
|
// Initialization
|
// Initialization
|
@(r15==16'h1000);
|
@(r15==16'h1000);
|
if (r1 !==16'h0252) tb_error("====== SP initialization (R1 value) =====");
|
if (r1 !==(`PER_SIZE+16'h0052)) tb_error("====== SP initialization (R1 value) =====");
|
if (mem250 !==16'h0000) tb_error("====== RAM Initialization (@0x0250 value) =====");
|
if (mem250 !==16'h0000) tb_error("====== RAM Initialization (@0x0250 value) =====");
|
if (mem24E !==16'h0000) tb_error("====== RAM Initialization (@0x024e value) =====");
|
if (mem24E !==16'h0000) tb_error("====== RAM Initialization (@0x024e value) =====");
|
if (mem24C !==16'h0000) tb_error("====== RAM Initialization (@0x024c value) =====");
|
if (mem24C !==16'h0000) tb_error("====== RAM Initialization (@0x024c value) =====");
|
if (mem24A !==16'h0000) tb_error("====== RAM Initialization (@0x024a value) =====");
|
if (mem24A !==16'h0000) tb_error("====== RAM Initialization (@0x024a value) =====");
|
if (mem248 !==16'h0000) tb_error("====== RAM Initialization (@0x0248 value) =====");
|
if (mem248 !==16'h0000) tb_error("====== RAM Initialization (@0x0248 value) =====");
|
Line 66... |
Line 66... |
if (mem230 !==16'h0000) tb_error("====== RAM Initialization (@0x0230 value) =====");
|
if (mem230 !==16'h0000) tb_error("====== RAM Initialization (@0x0230 value) =====");
|
|
|
|
|
// Addressing mode: Rn
|
// Addressing mode: Rn
|
@(r15==16'h2000);
|
@(r15==16'h2000);
|
if (r1 !==16'h024E) tb_error("====== PUSH (Rn mode): SP value =====");
|
if (r1 !==(`PER_SIZE+16'h004E)) tb_error("====== PUSH (Rn mode): SP value =====");
|
if (mem250 !==16'h7524) tb_error("====== PUSH (Rn mode): @0x0250 value =====");
|
if (mem250 !==16'h7524) tb_error("====== PUSH (Rn mode): @0x0250 value =====");
|
if (mem24E !==16'h1cb6) tb_error("====== PUSH (Rn mode): @0x024E value =====");
|
if (mem24E !==16'h1cb6) tb_error("====== PUSH (Rn mode): @0x024E value =====");
|
if (mem24C !==16'h0000) tb_error("====== PUSH (Rn mode): @0x024c value =====");
|
if (mem24C !==16'h0000) tb_error("====== PUSH (Rn mode): @0x024c value =====");
|
if (mem24A !==16'h0000) tb_error("====== PUSH (Rn mode): @0x024a value =====");
|
if (mem24A !==16'h0000) tb_error("====== PUSH (Rn mode): @0x024a value =====");
|
if (mem248 !==16'h0000) tb_error("====== PUSH (Rn mode): @0x0248 value =====");
|
if (mem248 !==16'h0000) tb_error("====== PUSH (Rn mode): @0x0248 value =====");
|
Line 88... |
Line 88... |
if (mem230 !==16'h0000) tb_error("====== PUSH (Rn mode): @0x0230 value =====");
|
if (mem230 !==16'h0000) tb_error("====== PUSH (Rn mode): @0x0230 value =====");
|
|
|
|
|
// Addressing mode: @Rn
|
// Addressing mode: @Rn
|
@(r15==16'h3000);
|
@(r15==16'h3000);
|
if (r1 !==16'h024A) tb_error("====== PUSH (@Rn mode): SP value =====");
|
if (r1 !==(`PER_SIZE+16'h004A)) tb_error("====== PUSH (@Rn mode): SP value =====");
|
if (mem250 !==16'h7524) tb_error("====== PUSH (@Rn mode): @0x0250 value =====");
|
if (mem250 !==16'h7524) tb_error("====== PUSH (@Rn mode): @0x0250 value =====");
|
if (mem24E !==16'h1cb6) tb_error("====== PUSH (@Rn mode): @0x024E value =====");
|
if (mem24E !==16'h1cb6) tb_error("====== PUSH (@Rn mode): @0x024E value =====");
|
if (mem24C !==16'h1234) tb_error("====== PUSH (@Rn mode): @0x024c value =====");
|
if (mem24C !==16'h1234) tb_error("====== PUSH (@Rn mode): @0x024c value =====");
|
if (mem24A !==16'h5678) tb_error("====== PUSH (@Rn mode): @0x024a value =====");
|
if (mem24A !==16'h5678) tb_error("====== PUSH (@Rn mode): @0x024a value =====");
|
if (mem248 !==16'h0000) tb_error("====== PUSH (@Rn mode): @0x0248 value =====");
|
if (mem248 !==16'h0000) tb_error("====== PUSH (@Rn mode): @0x0248 value =====");
|
Line 110... |
Line 110... |
if (mem230 !==16'h0000) tb_error("====== PUSH (@Rn mode): @0x0230 value =====");
|
if (mem230 !==16'h0000) tb_error("====== PUSH (@Rn mode): @0x0230 value =====");
|
|
|
|
|
// Addressing mode: @Rn+
|
// Addressing mode: @Rn+
|
@(r15==16'h4000);
|
@(r15==16'h4000);
|
if (r4 !==16'h021A) tb_error("====== PUSH (@Rn+ mode): R4 value =====");
|
if (r4 !==(`PER_SIZE+16'h001A)) tb_error("====== PUSH (@Rn+ mode): R4 value =====");
|
if (r1 !==16'h0246) tb_error("====== PUSH (@Rn+ mode): SP value =====");
|
if (r1 !==(`PER_SIZE+16'h0046)) tb_error("====== PUSH (@Rn+ mode): SP value =====");
|
if (mem250 !==16'h7524) tb_error("====== PUSH (@Rn+ mode): @0x0250 value =====");
|
if (mem250 !==16'h7524) tb_error("====== PUSH (@Rn+ mode): @0x0250 value =====");
|
if (mem24E !==16'h1cb6) tb_error("====== PUSH (@Rn+ mode): @0x024E value =====");
|
if (mem24E !==16'h1cb6) tb_error("====== PUSH (@Rn+ mode): @0x024E value =====");
|
if (mem24C !==16'h1234) tb_error("====== PUSH (@Rn+ mode): @0x024c value =====");
|
if (mem24C !==16'h1234) tb_error("====== PUSH (@Rn+ mode): @0x024c value =====");
|
if (mem24A !==16'h5678) tb_error("====== PUSH (@Rn+ mode): @0x024a value =====");
|
if (mem24A !==16'h5678) tb_error("====== PUSH (@Rn+ mode): @0x024a value =====");
|
if (mem248 !==16'h9abc) tb_error("====== PUSH (@Rn+ mode): @0x0248 value =====");
|
if (mem248 !==16'h9abc) tb_error("====== PUSH (@Rn+ mode): @0x0248 value =====");
|
Line 133... |
Line 133... |
if (mem230 !==16'h0000) tb_error("====== PUSH (@Rn+ mode): @0x0230 value =====");
|
if (mem230 !==16'h0000) tb_error("====== PUSH (@Rn+ mode): @0x0230 value =====");
|
|
|
|
|
// Addressing mode: X(Rn)
|
// Addressing mode: X(Rn)
|
@(r15==16'h5000);
|
@(r15==16'h5000);
|
if (r1 !==16'h0242) tb_error("====== PUSH (X(Rn) mode): SP value =====");
|
if (r1 !==(`PER_SIZE+16'h0042)) tb_error("====== PUSH (X(Rn) mode): SP value =====");
|
if (mem250 !==16'h7524) tb_error("====== PUSH (X(Rn) mode): @0x0250 value =====");
|
if (mem250 !==16'h7524) tb_error("====== PUSH (X(Rn) mode): @0x0250 value =====");
|
if (mem24E !==16'h1cb6) tb_error("====== PUSH (X(Rn) mode): @0x024E value =====");
|
if (mem24E !==16'h1cb6) tb_error("====== PUSH (X(Rn) mode): @0x024E value =====");
|
if (mem24C !==16'h1234) tb_error("====== PUSH (X(Rn) mode): @0x024c value =====");
|
if (mem24C !==16'h1234) tb_error("====== PUSH (X(Rn) mode): @0x024c value =====");
|
if (mem24A !==16'h5678) tb_error("====== PUSH (X(Rn) mode): @0x024a value =====");
|
if (mem24A !==16'h5678) tb_error("====== PUSH (X(Rn) mode): @0x024a value =====");
|
if (mem248 !==16'h9abc) tb_error("====== PUSH (X(Rn) mode): @0x0248 value =====");
|
if (mem248 !==16'h9abc) tb_error("====== PUSH (X(Rn) mode): @0x0248 value =====");
|
Line 155... |
Line 155... |
if (mem230 !==16'h0000) tb_error("====== PUSH (X(Rn) mode): @0x0230 value =====");
|
if (mem230 !==16'h0000) tb_error("====== PUSH (X(Rn) mode): @0x0230 value =====");
|
|
|
|
|
// Addressing mode: EDE
|
// Addressing mode: EDE
|
@(r15==16'h6000);
|
@(r15==16'h6000);
|
if (r1 !==16'h023E) tb_error("====== PUSH (EDE mode): SP value =====");
|
if (r1 !==(`PER_SIZE+16'h003E)) tb_error("====== PUSH (EDE mode): SP value =====");
|
if (mem250 !==16'h7524) tb_error("====== PUSH (EDE mode): @0x0250 value =====");
|
if (mem250 !==16'h7524) tb_error("====== PUSH (EDE mode): @0x0250 value =====");
|
if (mem24E !==16'h1cb6) tb_error("====== PUSH (EDE mode): @0x024E value =====");
|
if (mem24E !==16'h1cb6) tb_error("====== PUSH (EDE mode): @0x024E value =====");
|
if (mem24C !==16'h1234) tb_error("====== PUSH (EDE mode): @0x024c value =====");
|
if (mem24C !==16'h1234) tb_error("====== PUSH (EDE mode): @0x024c value =====");
|
if (mem24A !==16'h5678) tb_error("====== PUSH (EDE mode): @0x024a value =====");
|
if (mem24A !==16'h5678) tb_error("====== PUSH (EDE mode): @0x024a value =====");
|
if (mem248 !==16'h9abc) tb_error("====== PUSH (EDE mode): @0x0248 value =====");
|
if (mem248 !==16'h9abc) tb_error("====== PUSH (EDE mode): @0x0248 value =====");
|
Line 177... |
Line 177... |
if (mem230 !==16'h0000) tb_error("====== PUSH (EDE mode): @0x0230 value =====");
|
if (mem230 !==16'h0000) tb_error("====== PUSH (EDE mode): @0x0230 value =====");
|
|
|
|
|
// Addressing mode: &EDE
|
// Addressing mode: &EDE
|
@(r15==16'h7000);
|
@(r15==16'h7000);
|
if (r1 !==16'h023A) tb_error("====== PUSH (&EDE mode): SP value =====");
|
if (r1 !==(`PER_SIZE+16'h003A)) tb_error("====== PUSH (&EDE mode): SP value =====");
|
if (mem250 !==16'h7524) tb_error("====== PUSH (&EDE mode): @0x0250 value =====");
|
if (mem250 !==16'h7524) tb_error("====== PUSH (&EDE mode): @0x0250 value =====");
|
if (mem24E !==16'h1cb6) tb_error("====== PUSH (&EDE mode): @0x024E value =====");
|
if (mem24E !==16'h1cb6) tb_error("====== PUSH (&EDE mode): @0x024E value =====");
|
if (mem24C !==16'h1234) tb_error("====== PUSH (&EDE mode): @0x024c value =====");
|
if (mem24C !==16'h1234) tb_error("====== PUSH (&EDE mode): @0x024c value =====");
|
if (mem24A !==16'h5678) tb_error("====== PUSH (&EDE mode): @0x024a value =====");
|
if (mem24A !==16'h5678) tb_error("====== PUSH (&EDE mode): @0x024a value =====");
|
if (mem248 !==16'h9abc) tb_error("====== PUSH (&EDE mode): @0x0248 value =====");
|
if (mem248 !==16'h9abc) tb_error("====== PUSH (&EDE mode): @0x0248 value =====");
|
Line 199... |
Line 199... |
if (mem230 !==16'h0000) tb_error("====== PUSH (&EDE mode): @0x0230 value =====");
|
if (mem230 !==16'h0000) tb_error("====== PUSH (&EDE mode): @0x0230 value =====");
|
|
|
|
|
// Addressing mode: #N
|
// Addressing mode: #N
|
@(r15==16'h7001);
|
@(r15==16'h7001);
|
if (r1 !==16'h0236) tb_error("====== PUSH (#N mode): SP value =====");
|
if (r1 !==(`PER_SIZE+16'h0036)) tb_error("====== PUSH (#N mode): SP value =====");
|
if (mem250 !==16'h7524) tb_error("====== PUSH (#N mode): @0x0250 value =====");
|
if (mem250 !==16'h7524) tb_error("====== PUSH (#N mode): @0x0250 value =====");
|
if (mem24E !==16'h1cb6) tb_error("====== PUSH (#N mode): @0x024E value =====");
|
if (mem24E !==16'h1cb6) tb_error("====== PUSH (#N mode): @0x024E value =====");
|
if (mem24C !==16'h1234) tb_error("====== PUSH (#N mode): @0x024c value =====");
|
if (mem24C !==16'h1234) tb_error("====== PUSH (#N mode): @0x024c value =====");
|
if (mem24A !==16'h5678) tb_error("====== PUSH (#N mode): @0x024a value =====");
|
if (mem24A !==16'h5678) tb_error("====== PUSH (#N mode): @0x024a value =====");
|
if (mem248 !==16'h9abc) tb_error("====== PUSH (#N mode): @0x0248 value =====");
|
if (mem248 !==16'h9abc) tb_error("====== PUSH (#N mode): @0x0248 value =====");
|
Line 223... |
Line 223... |
|
|
/* -------------- TEST INSTRUCTION IN BYTE MODE ------------------- */
|
/* -------------- TEST INSTRUCTION IN BYTE MODE ------------------- */
|
|
|
// Initialization
|
// Initialization
|
@(r15==16'h8000);
|
@(r15==16'h8000);
|
if (r1 !==16'h0252) tb_error("====== SP initialization (R1 value) =====");
|
if (r1 !==(`PER_SIZE+16'h0052)) tb_error("====== SP initialization (R1 value) =====");
|
if (mem250 !==16'h7524) tb_error("====== RAM Initialization (@0x0250 value) =====");
|
if (mem250 !==16'h7524) tb_error("====== RAM Initialization (@0x0250 value) =====");
|
if (mem24E !==16'h1cb6) tb_error("====== RAM Initialization (@0x024E value) =====");
|
if (mem24E !==16'h1cb6) tb_error("====== RAM Initialization (@0x024E value) =====");
|
if (mem24C !==16'h1234) tb_error("====== RAM Initialization (@0x024c value) =====");
|
if (mem24C !==16'h1234) tb_error("====== RAM Initialization (@0x024c value) =====");
|
if (mem24A !==16'h5678) tb_error("====== RAM Initialization (@0x024a value) =====");
|
if (mem24A !==16'h5678) tb_error("====== RAM Initialization (@0x024a value) =====");
|
if (mem248 !==16'h9abc) tb_error("====== RAM Initialization (@0x0248 value) =====");
|
if (mem248 !==16'h9abc) tb_error("====== RAM Initialization (@0x0248 value) =====");
|
Line 245... |
Line 245... |
if (mem230 !==16'h0000) tb_error("====== RAM Initialization (@0x0230 value) =====");
|
if (mem230 !==16'h0000) tb_error("====== RAM Initialization (@0x0230 value) =====");
|
|
|
|
|
// Addressing mode: Rn
|
// Addressing mode: Rn
|
@(r15==16'h9000);
|
@(r15==16'h9000);
|
if (r1 !==16'h024E) tb_error("====== PUSH.B (Rn mode): SP value =====");
|
if (r1 !==(`PER_SIZE+16'h004E)) tb_error("====== PUSH.B (Rn mode): SP value =====");
|
if (mem250 !==16'h75e2) tb_error("====== PUSH.B (Rn mode): @0x0250 value =====");
|
if (mem250 !==16'h75e2) tb_error("====== PUSH.B (Rn mode): @0x0250 value =====");
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH.B (Rn mode): @0x024E value =====");
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH.B (Rn mode): @0x024E value =====");
|
if (mem24C !==16'h1234) tb_error("====== PUSH.B (Rn mode): @0x024c value =====");
|
if (mem24C !==16'h1234) tb_error("====== PUSH.B (Rn mode): @0x024c value =====");
|
if (mem24A !==16'h5678) tb_error("====== PUSH.B (Rn mode): @0x024a value =====");
|
if (mem24A !==16'h5678) tb_error("====== PUSH.B (Rn mode): @0x024a value =====");
|
if (mem248 !==16'h9abc) tb_error("====== PUSH.B (Rn mode): @0x0248 value =====");
|
if (mem248 !==16'h9abc) tb_error("====== PUSH.B (Rn mode): @0x0248 value =====");
|
Line 267... |
Line 267... |
if (mem230 !==16'h0000) tb_error("====== PUSH.B (Rn mode): @0x0230 value =====");
|
if (mem230 !==16'h0000) tb_error("====== PUSH.B (Rn mode): @0x0230 value =====");
|
|
|
|
|
// Addressing mode: @Rn
|
// Addressing mode: @Rn
|
@(r15==16'hA000);
|
@(r15==16'hA000);
|
if (r1 !==16'h024A) tb_error("====== PUSH.B (@Rn mode): SP value =====");
|
if (r1 !==(`PER_SIZE+16'h004A)) tb_error("====== PUSH.B (@Rn mode): SP value =====");
|
if (mem250 !==16'h75e2) tb_error("====== PUSH.B (@Rn mode): @0x0250 value =====");
|
if (mem250 !==16'h75e2) tb_error("====== PUSH.B (@Rn mode): @0x0250 value =====");
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH.B (@Rn mode): @0x024E value =====");
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH.B (@Rn mode): @0x024E value =====");
|
if (mem24C !==16'h12a6) tb_error("====== PUSH.B (@Rn mode): @0x024c value =====");
|
if (mem24C !==16'h12a6) tb_error("====== PUSH.B (@Rn mode): @0x024c value =====");
|
if (mem24A !==16'h5679) tb_error("====== PUSH.B (@Rn mode): @0x024a value =====");
|
if (mem24A !==16'h5679) tb_error("====== PUSH.B (@Rn mode): @0x024a value =====");
|
if (mem248 !==16'h9abc) tb_error("====== PUSH.B (@Rn mode): @0x0248 value =====");
|
if (mem248 !==16'h9abc) tb_error("====== PUSH.B (@Rn mode): @0x0248 value =====");
|
Line 289... |
Line 289... |
if (mem230 !==16'h0000) tb_error("====== PUSH.B (@Rn mode): @0x0230 value =====");
|
if (mem230 !==16'h0000) tb_error("====== PUSH.B (@Rn mode): @0x0230 value =====");
|
|
|
|
|
// Addressing mode: @Rn+
|
// Addressing mode: @Rn+
|
@(r15==16'hB000);
|
@(r15==16'hB000);
|
if (r4 !==16'h0218) tb_error("====== PUSH.B (@Rn+ mode): R4 value =====");
|
if (r4 !==(`PER_SIZE+16'h0018)) tb_error("====== PUSH.B (@Rn+ mode): R4 value =====");
|
if (r1 !==16'h0246) tb_error("====== PUSH.B (@Rn+ mode): SP value =====");
|
if (r1 !==(`PER_SIZE+16'h0046)) tb_error("====== PUSH.B (@Rn+ mode): SP value =====");
|
if (mem250 !==16'h75e2) tb_error("====== PUSH.B (@Rn+ mode): @0x0250 value =====");
|
if (mem250 !==16'h75e2) tb_error("====== PUSH.B (@Rn+ mode): @0x0250 value =====");
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH.B (@Rn+ mode): @0x024E value =====");
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH.B (@Rn+ mode): @0x024E value =====");
|
if (mem24C !==16'h12a6) tb_error("====== PUSH.B (@Rn+ mode): @0x024c value =====");
|
if (mem24C !==16'h12a6) tb_error("====== PUSH.B (@Rn+ mode): @0x024c value =====");
|
if (mem24A !==16'h5679) tb_error("====== PUSH.B (@Rn+ mode): @0x024a value =====");
|
if (mem24A !==16'h5679) tb_error("====== PUSH.B (@Rn+ mode): @0x024a value =====");
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH.B (@Rn+ mode): @0x0248 value =====");
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH.B (@Rn+ mode): @0x0248 value =====");
|
Line 312... |
Line 312... |
if (mem230 !==16'h0000) tb_error("====== PUSH.B (@Rn+ mode): @0x0230 value =====");
|
if (mem230 !==16'h0000) tb_error("====== PUSH.B (@Rn+ mode): @0x0230 value =====");
|
|
|
|
|
// Addressing mode: X(Rn)
|
// Addressing mode: X(Rn)
|
@(r15==16'hC000);
|
@(r15==16'hC000);
|
if (r1 !==16'h0242) tb_error("====== PUSH.B (X(Rn) mode): SP value =====");
|
if (r1 !==(`PER_SIZE+16'h0042)) tb_error("====== PUSH.B (X(Rn) mode): SP value =====");
|
if (mem250 !==16'h75e2) tb_error("====== PUSH.B (X(Rn) mode): @0x0250 value =====");
|
if (mem250 !==16'h75e2) tb_error("====== PUSH.B (X(Rn) mode): @0x0250 value =====");
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH.B (X(Rn) mode): @0x024E value =====");
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH.B (X(Rn) mode): @0x024E value =====");
|
if (mem24C !==16'h12a6) tb_error("====== PUSH.B (X(Rn) mode): @0x024c value =====");
|
if (mem24C !==16'h12a6) tb_error("====== PUSH.B (X(Rn) mode): @0x024c value =====");
|
if (mem24A !==16'h5679) tb_error("====== PUSH.B (X(Rn) mode): @0x024a value =====");
|
if (mem24A !==16'h5679) tb_error("====== PUSH.B (X(Rn) mode): @0x024a value =====");
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH.B (X(Rn) mode): @0x0248 value =====");
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH.B (X(Rn) mode): @0x0248 value =====");
|
Line 334... |
Line 334... |
if (mem230 !==16'h0000) tb_error("====== PUSH.B (X(Rn) mode): @0x0230 value =====");
|
if (mem230 !==16'h0000) tb_error("====== PUSH.B (X(Rn) mode): @0x0230 value =====");
|
|
|
|
|
// Addressing mode: EDE
|
// Addressing mode: EDE
|
@(r15==16'hD000);
|
@(r15==16'hD000);
|
if (r1 !==16'h023E) tb_error("====== PUSH.B (EDE mode): SP value =====");
|
if (r1 !==(`PER_SIZE+16'h003E)) tb_error("====== PUSH.B (EDE mode): SP value =====");
|
if (mem250 !==16'h75e2) tb_error("====== PUSH.B (EDE mode): @0x0250 value =====");
|
if (mem250 !==16'h75e2) tb_error("====== PUSH.B (EDE mode): @0x0250 value =====");
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH.B (EDE mode): @0x024E value =====");
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH.B (EDE mode): @0x024E value =====");
|
if (mem24C !==16'h12a6) tb_error("====== PUSH.B (EDE mode): @0x024c value =====");
|
if (mem24C !==16'h12a6) tb_error("====== PUSH.B (EDE mode): @0x024c value =====");
|
if (mem24A !==16'h5679) tb_error("====== PUSH.B (EDE mode): @0x024a value =====");
|
if (mem24A !==16'h5679) tb_error("====== PUSH.B (EDE mode): @0x024a value =====");
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH.B (EDE mode): @0x0248 value =====");
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH.B (EDE mode): @0x0248 value =====");
|
Line 356... |
Line 356... |
if (mem230 !==16'h0000) tb_error("====== PUSH.B (EDE mode): @0x0230 value =====");
|
if (mem230 !==16'h0000) tb_error("====== PUSH.B (EDE mode): @0x0230 value =====");
|
|
|
|
|
// Addressing mode: &EDE
|
// Addressing mode: &EDE
|
@(r15==16'hE000);
|
@(r15==16'hE000);
|
if (r1 !==16'h023A) tb_error("====== PUSH.B (&EDE mode): SP value =====");
|
if (r1 !==(`PER_SIZE+16'h003A)) tb_error("====== PUSH.B (&EDE mode): SP value =====");
|
if (mem250 !==16'h75e2) tb_error("====== PUSH.B (&EDE mode): @0x0250 value =====");
|
if (mem250 !==16'h75e2) tb_error("====== PUSH.B (&EDE mode): @0x0250 value =====");
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH.B (&EDE mode): @0x024E value =====");
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH.B (&EDE mode): @0x024E value =====");
|
if (mem24C !==16'h12a6) tb_error("====== PUSH.B (&EDE mode): @0x024c value =====");
|
if (mem24C !==16'h12a6) tb_error("====== PUSH.B (&EDE mode): @0x024c value =====");
|
if (mem24A !==16'h5679) tb_error("====== PUSH.B (&EDE mode): @0x024a value =====");
|
if (mem24A !==16'h5679) tb_error("====== PUSH.B (&EDE mode): @0x024a value =====");
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH.B (&EDE mode): @0x0248 value =====");
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH.B (&EDE mode): @0x0248 value =====");
|
Line 378... |
Line 378... |
if (mem230 !==16'h0000) tb_error("====== PUSH.B (&EDE mode): @0x0230 value =====");
|
if (mem230 !==16'h0000) tb_error("====== PUSH.B (&EDE mode): @0x0230 value =====");
|
|
|
|
|
// Addressing mode: #N
|
// Addressing mode: #N
|
@(r15==16'hF000);
|
@(r15==16'hF000);
|
if (r1 !==16'h0236) tb_error("====== PUSH.B (#N mode): SP value =====");
|
if (r1 !==(`PER_SIZE+16'h0036)) tb_error("====== PUSH.B (#N mode): SP value =====");
|
if (mem250 !==16'h75e2) tb_error("====== PUSH.B (#N mode): @0x0250 value =====");
|
if (mem250 !==16'h75e2) tb_error("====== PUSH.B (#N mode): @0x0250 value =====");
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH.B (#N mode): @0x024E value =====");
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH.B (#N mode): @0x024E value =====");
|
if (mem24C !==16'h12a6) tb_error("====== PUSH.B (#N mode): @0x024c value =====");
|
if (mem24C !==16'h12a6) tb_error("====== PUSH.B (#N mode): @0x024c value =====");
|
if (mem24A !==16'h5679) tb_error("====== PUSH.B (#N mode): @0x024a value =====");
|
if (mem24A !==16'h5679) tb_error("====== PUSH.B (#N mode): @0x024a value =====");
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH.B (#N mode): @0x0248 value =====");
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH.B (#N mode): @0x0248 value =====");
|
Line 401... |
Line 401... |
|
|
/* -------------- TEST INSTRUCTION WITH SR AS ARGUMENT ------------------- */
|
/* -------------- TEST INSTRUCTION WITH SR AS ARGUMENT ------------------- */
|
|
|
// Addressing mode: SR
|
// Addressing mode: SR
|
@(r15==16'hF100);
|
@(r15==16'hF100);
|
if (r1 !==16'h0232) tb_error("====== PUSH SR : SP value =====");
|
if (r1 !==(`PER_SIZE+16'h0032)) tb_error("====== PUSH SR : SP value =====");
|
if (mem250 !==16'h75e2) tb_error("====== PUSH SR : @0x0250 value =====");
|
if (mem250 !==16'h75e2) tb_error("====== PUSH SR : @0x0250 value =====");
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH SR : @0x024E value =====");
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH SR : @0x024E value =====");
|
if (mem24C !==16'h12a6) tb_error("====== PUSH SR : @0x024c value =====");
|
if (mem24C !==16'h12a6) tb_error("====== PUSH SR : @0x024c value =====");
|
if (mem24A !==16'h5679) tb_error("====== PUSH SR : @0x024a value =====");
|
if (mem24A !==16'h5679) tb_error("====== PUSH SR : @0x024a value =====");
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH SR : @0x0248 value =====");
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH SR : @0x0248 value =====");
|
Line 416... |
Line 416... |
if (mem23E !==16'h43fe) tb_error("====== PUSH SR : @0x023e value =====");
|
if (mem23E !==16'h43fe) tb_error("====== PUSH SR : @0x023e value =====");
|
if (mem23C !==16'h1fc2) tb_error("====== PUSH SR : @0x023c value =====");
|
if (mem23C !==16'h1fc2) tb_error("====== PUSH SR : @0x023c value =====");
|
if (mem23A !==16'h3d3b) tb_error("====== PUSH SR : @0x023a value =====");
|
if (mem23A !==16'h3d3b) tb_error("====== PUSH SR : @0x023a value =====");
|
if (mem238 !==16'h71d9) tb_error("====== PUSH SR : @0x0238 value =====");
|
if (mem238 !==16'h71d9) tb_error("====== PUSH SR : @0x0238 value =====");
|
if (mem236 !==16'h178d) tb_error("====== PUSH SR : @0x0236 value =====");
|
if (mem236 !==16'h178d) tb_error("====== PUSH SR : @0x0236 value =====");
|
if (mem234 !==16'h0234) tb_error("====== PUSH SR : @0x0234 value =====");
|
if (mem234 !==(`PER_SIZE+16'h0034)) tb_error("====== PUSH SR : @0x0234 value =====");
|
if (mem232 !==16'h0232) tb_error("====== PUSH SR : @0x0232 value =====");
|
if (mem232 !==(`PER_SIZE+16'h0032)) tb_error("====== PUSH SR : @0x0232 value =====");
|
if (mem230 !==16'h0000) tb_error("====== PUSH SR : @0x0230 value =====");
|
if (mem230 !==16'h0000) tb_error("====== PUSH SR : @0x0230 value =====");
|
|
|
// Addressing mode: @SR
|
// Addressing mode: @SR
|
@(r15==16'hF200);
|
@(r15==16'hF200);
|
if (r1 !==16'h022E) tb_error("====== PUSH @SR : SP value =====");
|
if (r1 !==(`PER_SIZE+16'h002E)) tb_error("====== PUSH @SR : SP value =====");
|
if (mem250 !==16'h75e2) tb_error("====== PUSH @SR : @0x0250 value =====");
|
if (mem250 !==16'h75e2) tb_error("====== PUSH @SR : @0x0250 value =====");
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH @SR : @0x024E value =====");
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH @SR : @0x024E value =====");
|
if (mem24C !==16'h12a6) tb_error("====== PUSH @SR : @0x024c value =====");
|
if (mem24C !==16'h12a6) tb_error("====== PUSH @SR : @0x024c value =====");
|
if (mem24A !==16'h5679) tb_error("====== PUSH @SR : @0x024a value =====");
|
if (mem24A !==16'h5679) tb_error("====== PUSH @SR : @0x024a value =====");
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH @SR : @0x0248 value =====");
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH @SR : @0x0248 value =====");
|
Line 437... |
Line 437... |
if (mem23E !==16'h43fe) tb_error("====== PUSH @SR : @0x023e value =====");
|
if (mem23E !==16'h43fe) tb_error("====== PUSH @SR : @0x023e value =====");
|
if (mem23C !==16'h1fc2) tb_error("====== PUSH @SR : @0x023c value =====");
|
if (mem23C !==16'h1fc2) tb_error("====== PUSH @SR : @0x023c value =====");
|
if (mem23A !==16'h3d3b) tb_error("====== PUSH @SR : @0x023a value =====");
|
if (mem23A !==16'h3d3b) tb_error("====== PUSH @SR : @0x023a value =====");
|
if (mem238 !==16'h71d9) tb_error("====== PUSH @SR : @0x0238 value =====");
|
if (mem238 !==16'h71d9) tb_error("====== PUSH @SR : @0x0238 value =====");
|
if (mem236 !==16'h178d) tb_error("====== PUSH @SR : @0x0236 value =====");
|
if (mem236 !==16'h178d) tb_error("====== PUSH @SR : @0x0236 value =====");
|
if (mem234 !==16'h0234) tb_error("====== PUSH @SR : @0x0234 value =====");
|
if (mem234 !==(`PER_SIZE+16'h0034)) tb_error("====== PUSH @SR : @0x0234 value =====");
|
if (mem232 !==16'h0232) tb_error("====== PUSH @SR : @0x0232 value =====");
|
if (mem232 !==(`PER_SIZE+16'h0032)) tb_error("====== PUSH @SR : @0x0232 value =====");
|
if (mem230 !==16'h0000) tb_error("====== PUSH @SR : @0x0230 value =====");
|
if (mem230 !==16'h0000) tb_error("====== PUSH @SR : @0x0230 value =====");
|
if (mem22E !==16'h1234) tb_error("====== PUSH @SR : @0x022E value =====");
|
if (mem22E !==16'h1234) tb_error("====== PUSH @SR : @0x022E value =====");
|
if (mem22C !==16'h5678) tb_error("====== PUSH @SR : @0x022C value =====");
|
if (mem22C !==16'h5678) tb_error("====== PUSH @SR : @0x022C value =====");
|
|
|
// Addressing mode: @SR+
|
// Addressing mode: @SR+
|
@(r15==16'hF300);
|
@(r15==16'hF300);
|
if (r1 !==16'h022E) tb_error("====== PUSH @SR : SP value =====");
|
if (r1 !==(`PER_SIZE+16'h002E)) tb_error("====== PUSH @SR : SP value =====");
|
if (mem250 !==16'h75e2) tb_error("====== PUSH @SR : @0x0250 value =====");
|
if (mem250 !==16'h75e2) tb_error("====== PUSH @SR : @0x0250 value =====");
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH @SR : @0x024E value =====");
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH @SR : @0x024E value =====");
|
if (mem24C !==16'h12a6) tb_error("====== PUSH @SR : @0x024c value =====");
|
if (mem24C !==16'h12a6) tb_error("====== PUSH @SR : @0x024c value =====");
|
if (mem24A !==16'h5679) tb_error("====== PUSH @SR : @0x024a value =====");
|
if (mem24A !==16'h5679) tb_error("====== PUSH @SR : @0x024a value =====");
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH @SR : @0x0248 value =====");
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH @SR : @0x0248 value =====");
|
Line 460... |
Line 460... |
if (mem23E !==16'h43fe) tb_error("====== PUSH @SR : @0x023e value =====");
|
if (mem23E !==16'h43fe) tb_error("====== PUSH @SR : @0x023e value =====");
|
if (mem23C !==16'h1fc2) tb_error("====== PUSH @SR : @0x023c value =====");
|
if (mem23C !==16'h1fc2) tb_error("====== PUSH @SR : @0x023c value =====");
|
if (mem23A !==16'h3d3b) tb_error("====== PUSH @SR : @0x023a value =====");
|
if (mem23A !==16'h3d3b) tb_error("====== PUSH @SR : @0x023a value =====");
|
if (mem238 !==16'h71d9) tb_error("====== PUSH @SR : @0x0238 value =====");
|
if (mem238 !==16'h71d9) tb_error("====== PUSH @SR : @0x0238 value =====");
|
if (mem236 !==16'h178d) tb_error("====== PUSH @SR : @0x0236 value =====");
|
if (mem236 !==16'h178d) tb_error("====== PUSH @SR : @0x0236 value =====");
|
if (mem234 !==16'h0234) tb_error("====== PUSH @SR : @0x0234 value =====");
|
if (mem234 !==(`PER_SIZE+16'h0034)) tb_error("====== PUSH @SR : @0x0234 value =====");
|
if (mem232 !==16'h0232) tb_error("====== PUSH @SR : @0x0232 value =====");
|
if (mem232 !==(`PER_SIZE+16'h0032)) tb_error("====== PUSH @SR : @0x0232 value =====");
|
if (mem230 !==16'h0000) tb_error("====== PUSH @SR : @0x0230 value =====");
|
if (mem230 !==16'h0000) tb_error("====== PUSH @SR : @0x0230 value =====");
|
if (mem22E !==16'h1234) tb_error("====== PUSH @SR : @0x022E value =====");
|
if (mem22E !==16'h1234) tb_error("====== PUSH @SR : @0x022E value =====");
|
if (mem22C !==16'h5678) tb_error("====== PUSH @SR : @0x022C value =====");
|
if (mem22C !==16'h5678) tb_error("====== PUSH @SR : @0x022C value =====");
|
if (mem22A !==16'h0000) tb_error("====== PUSH @SR : @0x022A value =====");
|
if (mem22A !==16'h0000) tb_error("====== PUSH @SR : @0x022A value =====");
|
if (mem228 !==16'h0000) tb_error("====== PUSH @SR : @0x0228 value =====");
|
if (mem228 !==16'h0000) tb_error("====== PUSH @SR : @0x0228 value =====");
|
|
|
// Addressing mode: x(SR)
|
// Addressing mode: x(SR)
|
@(r15==16'hF400);
|
@(r15==16'hF400);
|
if (r1 !==16'h022A) tb_error("====== PUSH @SR : SP value =====");
|
if (r1 !==(`PER_SIZE+16'h002A)) tb_error("====== PUSH @SR : SP value =====");
|
if (mem250 !==16'h75e2) tb_error("====== PUSH @SR : @0x0250 value =====");
|
if (mem250 !==16'h75e2) tb_error("====== PUSH @SR : @0x0250 value =====");
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH @SR : @0x024E value =====");
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH @SR : @0x024E value =====");
|
if (mem24C !==16'h12a6) tb_error("====== PUSH @SR : @0x024c value =====");
|
if (mem24C !==16'h12a6) tb_error("====== PUSH @SR : @0x024c value =====");
|
if (mem24A !==16'h5679) tb_error("====== PUSH @SR : @0x024a value =====");
|
if (mem24A !==16'h5679) tb_error("====== PUSH @SR : @0x024a value =====");
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH @SR : @0x0248 value =====");
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH @SR : @0x0248 value =====");
|
Line 485... |
Line 485... |
if (mem23E !==16'h43fe) tb_error("====== PUSH @SR : @0x023e value =====");
|
if (mem23E !==16'h43fe) tb_error("====== PUSH @SR : @0x023e value =====");
|
if (mem23C !==16'h1fc2) tb_error("====== PUSH @SR : @0x023c value =====");
|
if (mem23C !==16'h1fc2) tb_error("====== PUSH @SR : @0x023c value =====");
|
if (mem23A !==16'h3d3b) tb_error("====== PUSH @SR : @0x023a value =====");
|
if (mem23A !==16'h3d3b) tb_error("====== PUSH @SR : @0x023a value =====");
|
if (mem238 !==16'h71d9) tb_error("====== PUSH @SR : @0x0238 value =====");
|
if (mem238 !==16'h71d9) tb_error("====== PUSH @SR : @0x0238 value =====");
|
if (mem236 !==16'h178d) tb_error("====== PUSH @SR : @0x0236 value =====");
|
if (mem236 !==16'h178d) tb_error("====== PUSH @SR : @0x0236 value =====");
|
if (mem234 !==16'h0234) tb_error("====== PUSH @SR : @0x0234 value =====");
|
if (mem234 !==(`PER_SIZE+16'h0034)) tb_error("====== PUSH @SR : @0x0234 value =====");
|
if (mem232 !==16'h0232) tb_error("====== PUSH @SR : @0x0232 value =====");
|
if (mem232 !==(`PER_SIZE+16'h0032)) tb_error("====== PUSH @SR : @0x0232 value =====");
|
if (mem230 !==16'h0000) tb_error("====== PUSH @SR : @0x0230 value =====");
|
if (mem230 !==16'h0000) tb_error("====== PUSH @SR : @0x0230 value =====");
|
if (mem22E !==16'h1234) tb_error("====== PUSH @SR : @0x022E value =====");
|
if (mem22E !==16'h1234) tb_error("====== PUSH @SR : @0x022E value =====");
|
if (mem22C !==16'h71d9) tb_error("====== PUSH @SR : @0x022C value =====");
|
if (mem22C !==16'h71d9) tb_error("====== PUSH @SR : @0x022C value =====");
|
if (mem22A !==16'h178d) tb_error("====== PUSH @SR : @0x022A value =====");
|
if (mem22A !==16'h178d) tb_error("====== PUSH @SR : @0x022A value =====");
|
if (mem228 !==16'h0000) tb_error("====== PUSH @SR : @0x0228 value =====");
|
if (mem228 !==16'h0000) tb_error("====== PUSH @SR : @0x0228 value =====");
|
Line 498... |
Line 498... |
|
|
/* -------------- TEST POP INSTRUCTION WITH SR AS ARGUMENT ------------------- */
|
/* -------------- TEST POP INSTRUCTION WITH SR AS ARGUMENT ------------------- */
|
|
|
// Addressing mode: x(SR)
|
// Addressing mode: x(SR)
|
@(r15==16'hF500);
|
@(r15==16'hF500);
|
if (r1 !==16'h022E) tb_error("====== PUSH @SR : SP value =====");
|
if (r1 !==(`PER_SIZE+16'h002E)) tb_error("====== PUSH @SR : SP value =====");
|
if (mem250 !==16'h75e2) tb_error("====== PUSH @SR : @0x0250 value =====");
|
if (mem250 !==16'h75e2) tb_error("====== PUSH @SR : @0x0250 value =====");
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH @SR : @0x024E value =====");
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH @SR : @0x024E value =====");
|
if (mem24C !==16'h12a6) tb_error("====== PUSH @SR : @0x024c value =====");
|
if (mem24C !==16'h12a6) tb_error("====== PUSH @SR : @0x024c value =====");
|
if (mem24A !==16'h5679) tb_error("====== PUSH @SR : @0x024a value =====");
|
if (mem24A !==16'h5679) tb_error("====== PUSH @SR : @0x024a value =====");
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH @SR : @0x0248 value =====");
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH @SR : @0x0248 value =====");
|