1 |
2 |
olivier.gi |
/*===========================================================================*/
|
2 |
|
|
/* Copyright (C) 2001 Authors */
|
3 |
|
|
/* */
|
4 |
|
|
/* This source file may be used and distributed without restriction provided */
|
5 |
|
|
/* that this copyright statement is not removed from the file and that any */
|
6 |
|
|
/* derivative work contains the original copyright notice and the associated */
|
7 |
|
|
/* disclaimer. */
|
8 |
|
|
/* */
|
9 |
|
|
/* This source file is free software; you can redistribute it and/or modify */
|
10 |
|
|
/* it under the terms of the GNU Lesser General Public License as published */
|
11 |
|
|
/* by the Free Software Foundation; either version 2.1 of the License, or */
|
12 |
|
|
/* (at your option) any later version. */
|
13 |
|
|
/* */
|
14 |
|
|
/* This source is distributed in the hope that it will be useful, but WITHOUT*/
|
15 |
|
|
/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
|
16 |
|
|
/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
|
17 |
|
|
/* License for more details. */
|
18 |
|
|
/* */
|
19 |
|
|
/* You should have received a copy of the GNU Lesser General Public License */
|
20 |
|
|
/* along with this source; if not, write to the Free Software Foundation, */
|
21 |
|
|
/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
|
22 |
|
|
/* */
|
23 |
|
|
/*===========================================================================*/
|
24 |
|
|
/* SINGLE-OPERAND ARITHMETIC: PUSH INSTRUCTION */
|
25 |
|
|
/*---------------------------------------------------------------------------*/
|
26 |
|
|
/* Test the PUSH instruction. */
|
27 |
18 |
olivier.gi |
/* */
|
28 |
|
|
/* Author(s): */
|
29 |
|
|
/* - Olivier Girard, olgirard@gmail.com */
|
30 |
|
|
/* */
|
31 |
|
|
/*---------------------------------------------------------------------------*/
|
32 |
19 |
olivier.gi |
/* $Rev: 111 $ */
|
33 |
|
|
/* $LastChangedBy: olivier.girard $ */
|
34 |
|
|
/* $LastChangedDate: 2011-05-20 22:39:02 +0200 (Fri, 20 May 2011) $ */
|
35 |
2 |
olivier.gi |
/*===========================================================================*/
|
36 |
|
|
|
37 |
|
|
initial
|
38 |
|
|
begin
|
39 |
|
|
$display(" ===============================================");
|
40 |
|
|
$display("| START SIMULATION |");
|
41 |
|
|
$display(" ===============================================");
|
42 |
|
|
repeat(5) @(posedge mclk);
|
43 |
|
|
stimulus_done = 0;
|
44 |
|
|
|
45 |
|
|
/* -------------- TEST INSTRUCTION IN WORD MODE ------------------- */
|
46 |
|
|
|
47 |
|
|
// Initialization
|
48 |
|
|
@(r15==16'h1000);
|
49 |
111 |
olivier.gi |
if (r1 !==(`PER_SIZE+16'h0052)) tb_error("====== SP initialization (R1 value) =====");
|
50 |
2 |
olivier.gi |
if (mem250 !==16'h0000) tb_error("====== RAM Initialization (@0x0250 value) =====");
|
51 |
|
|
if (mem24E !==16'h0000) tb_error("====== RAM Initialization (@0x024e value) =====");
|
52 |
|
|
if (mem24C !==16'h0000) tb_error("====== RAM Initialization (@0x024c value) =====");
|
53 |
|
|
if (mem24A !==16'h0000) tb_error("====== RAM Initialization (@0x024a value) =====");
|
54 |
|
|
if (mem248 !==16'h0000) tb_error("====== RAM Initialization (@0x0248 value) =====");
|
55 |
|
|
if (mem246 !==16'h0000) tb_error("====== RAM Initialization (@0x0246 value) =====");
|
56 |
|
|
if (mem244 !==16'h0000) tb_error("====== RAM Initialization (@0x0244 value) =====");
|
57 |
|
|
if (mem242 !==16'h0000) tb_error("====== RAM Initialization (@0x0242 value) =====");
|
58 |
|
|
if (mem240 !==16'h0000) tb_error("====== RAM Initialization (@0x0240 value) =====");
|
59 |
|
|
if (mem23E !==16'h0000) tb_error("====== RAM Initialization (@0x023e value) =====");
|
60 |
|
|
if (mem23C !==16'h0000) tb_error("====== RAM Initialization (@0x023c value) =====");
|
61 |
|
|
if (mem23A !==16'h0000) tb_error("====== RAM Initialization (@0x023a value) =====");
|
62 |
|
|
if (mem238 !==16'h0000) tb_error("====== RAM Initialization (@0x0238 value) =====");
|
63 |
|
|
if (mem236 !==16'h0000) tb_error("====== RAM Initialization (@0x0236 value) =====");
|
64 |
|
|
if (mem234 !==16'h0000) tb_error("====== RAM Initialization (@0x0234 value) =====");
|
65 |
|
|
if (mem232 !==16'h0000) tb_error("====== RAM Initialization (@0x0232 value) =====");
|
66 |
|
|
if (mem230 !==16'h0000) tb_error("====== RAM Initialization (@0x0230 value) =====");
|
67 |
|
|
|
68 |
|
|
|
69 |
|
|
// Addressing mode: Rn
|
70 |
|
|
@(r15==16'h2000);
|
71 |
111 |
olivier.gi |
if (r1 !==(`PER_SIZE+16'h004E)) tb_error("====== PUSH (Rn mode): SP value =====");
|
72 |
2 |
olivier.gi |
if (mem250 !==16'h7524) tb_error("====== PUSH (Rn mode): @0x0250 value =====");
|
73 |
|
|
if (mem24E !==16'h1cb6) tb_error("====== PUSH (Rn mode): @0x024E value =====");
|
74 |
|
|
if (mem24C !==16'h0000) tb_error("====== PUSH (Rn mode): @0x024c value =====");
|
75 |
|
|
if (mem24A !==16'h0000) tb_error("====== PUSH (Rn mode): @0x024a value =====");
|
76 |
|
|
if (mem248 !==16'h0000) tb_error("====== PUSH (Rn mode): @0x0248 value =====");
|
77 |
|
|
if (mem246 !==16'h0000) tb_error("====== PUSH (Rn mode): @0x0246 value =====");
|
78 |
|
|
if (mem244 !==16'h0000) tb_error("====== PUSH (Rn mode): @0x0244 value =====");
|
79 |
|
|
if (mem242 !==16'h0000) tb_error("====== PUSH (Rn mode): @0x0242 value =====");
|
80 |
|
|
if (mem240 !==16'h0000) tb_error("====== PUSH (Rn mode): @0x0240 value =====");
|
81 |
|
|
if (mem23E !==16'h0000) tb_error("====== PUSH (Rn mode): @0x023e value =====");
|
82 |
|
|
if (mem23C !==16'h0000) tb_error("====== PUSH (Rn mode): @0x023c value =====");
|
83 |
|
|
if (mem23A !==16'h0000) tb_error("====== PUSH (Rn mode): @0x023a value =====");
|
84 |
|
|
if (mem238 !==16'h0000) tb_error("====== PUSH (Rn mode): @0x0238 value =====");
|
85 |
|
|
if (mem236 !==16'h0000) tb_error("====== PUSH (Rn mode): @0x0236 value =====");
|
86 |
|
|
if (mem234 !==16'h0000) tb_error("====== PUSH (Rn mode): @0x0234 value =====");
|
87 |
|
|
if (mem232 !==16'h0000) tb_error("====== PUSH (Rn mode): @0x0232 value =====");
|
88 |
|
|
if (mem230 !==16'h0000) tb_error("====== PUSH (Rn mode): @0x0230 value =====");
|
89 |
|
|
|
90 |
|
|
|
91 |
|
|
// Addressing mode: @Rn
|
92 |
|
|
@(r15==16'h3000);
|
93 |
111 |
olivier.gi |
if (r1 !==(`PER_SIZE+16'h004A)) tb_error("====== PUSH (@Rn mode): SP value =====");
|
94 |
2 |
olivier.gi |
if (mem250 !==16'h7524) tb_error("====== PUSH (@Rn mode): @0x0250 value =====");
|
95 |
|
|
if (mem24E !==16'h1cb6) tb_error("====== PUSH (@Rn mode): @0x024E value =====");
|
96 |
|
|
if (mem24C !==16'h1234) tb_error("====== PUSH (@Rn mode): @0x024c value =====");
|
97 |
|
|
if (mem24A !==16'h5678) tb_error("====== PUSH (@Rn mode): @0x024a value =====");
|
98 |
|
|
if (mem248 !==16'h0000) tb_error("====== PUSH (@Rn mode): @0x0248 value =====");
|
99 |
|
|
if (mem246 !==16'h0000) tb_error("====== PUSH (@Rn mode): @0x0246 value =====");
|
100 |
|
|
if (mem244 !==16'h0000) tb_error("====== PUSH (@Rn mode): @0x0244 value =====");
|
101 |
|
|
if (mem242 !==16'h0000) tb_error("====== PUSH (@Rn mode): @0x0242 value =====");
|
102 |
|
|
if (mem240 !==16'h0000) tb_error("====== PUSH (@Rn mode): @0x0240 value =====");
|
103 |
|
|
if (mem23E !==16'h0000) tb_error("====== PUSH (@Rn mode): @0x023e value =====");
|
104 |
|
|
if (mem23C !==16'h0000) tb_error("====== PUSH (@Rn mode): @0x023c value =====");
|
105 |
|
|
if (mem23A !==16'h0000) tb_error("====== PUSH (@Rn mode): @0x023a value =====");
|
106 |
|
|
if (mem238 !==16'h0000) tb_error("====== PUSH (@Rn mode): @0x0238 value =====");
|
107 |
|
|
if (mem236 !==16'h0000) tb_error("====== PUSH (@Rn mode): @0x0236 value =====");
|
108 |
|
|
if (mem234 !==16'h0000) tb_error("====== PUSH (@Rn mode): @0x0234 value =====");
|
109 |
|
|
if (mem232 !==16'h0000) tb_error("====== PUSH (@Rn mode): @0x0232 value =====");
|
110 |
|
|
if (mem230 !==16'h0000) tb_error("====== PUSH (@Rn mode): @0x0230 value =====");
|
111 |
|
|
|
112 |
|
|
|
113 |
|
|
// Addressing mode: @Rn+
|
114 |
|
|
@(r15==16'h4000);
|
115 |
111 |
olivier.gi |
if (r4 !==(`PER_SIZE+16'h001A)) tb_error("====== PUSH (@Rn+ mode): R4 value =====");
|
116 |
|
|
if (r1 !==(`PER_SIZE+16'h0046)) tb_error("====== PUSH (@Rn+ mode): SP value =====");
|
117 |
2 |
olivier.gi |
if (mem250 !==16'h7524) tb_error("====== PUSH (@Rn+ mode): @0x0250 value =====");
|
118 |
|
|
if (mem24E !==16'h1cb6) tb_error("====== PUSH (@Rn+ mode): @0x024E value =====");
|
119 |
|
|
if (mem24C !==16'h1234) tb_error("====== PUSH (@Rn+ mode): @0x024c value =====");
|
120 |
|
|
if (mem24A !==16'h5678) tb_error("====== PUSH (@Rn+ mode): @0x024a value =====");
|
121 |
|
|
if (mem248 !==16'h9abc) tb_error("====== PUSH (@Rn+ mode): @0x0248 value =====");
|
122 |
|
|
if (mem246 !==16'hdef0) tb_error("====== PUSH (@Rn+ mode): @0x0246 value =====");
|
123 |
|
|
if (mem244 !==16'h0000) tb_error("====== PUSH (@Rn+ mode): @0x0244 value =====");
|
124 |
|
|
if (mem242 !==16'h0000) tb_error("====== PUSH (@Rn+ mode): @0x0242 value =====");
|
125 |
|
|
if (mem240 !==16'h0000) tb_error("====== PUSH (@Rn+ mode): @0x0240 value =====");
|
126 |
|
|
if (mem23E !==16'h0000) tb_error("====== PUSH (@Rn+ mode): @0x023e value =====");
|
127 |
|
|
if (mem23C !==16'h0000) tb_error("====== PUSH (@Rn+ mode): @0x023c value =====");
|
128 |
|
|
if (mem23A !==16'h0000) tb_error("====== PUSH (@Rn+ mode): @0x023a value =====");
|
129 |
|
|
if (mem238 !==16'h0000) tb_error("====== PUSH (@Rn+ mode): @0x0238 value =====");
|
130 |
|
|
if (mem236 !==16'h0000) tb_error("====== PUSH (@Rn+ mode): @0x0236 value =====");
|
131 |
|
|
if (mem234 !==16'h0000) tb_error("====== PUSH (@Rn+ mode): @0x0234 value =====");
|
132 |
|
|
if (mem232 !==16'h0000) tb_error("====== PUSH (@Rn+ mode): @0x0232 value =====");
|
133 |
|
|
if (mem230 !==16'h0000) tb_error("====== PUSH (@Rn+ mode): @0x0230 value =====");
|
134 |
|
|
|
135 |
|
|
|
136 |
|
|
// Addressing mode: X(Rn)
|
137 |
|
|
@(r15==16'h5000);
|
138 |
111 |
olivier.gi |
if (r1 !==(`PER_SIZE+16'h0042)) tb_error("====== PUSH (X(Rn) mode): SP value =====");
|
139 |
2 |
olivier.gi |
if (mem250 !==16'h7524) tb_error("====== PUSH (X(Rn) mode): @0x0250 value =====");
|
140 |
|
|
if (mem24E !==16'h1cb6) tb_error("====== PUSH (X(Rn) mode): @0x024E value =====");
|
141 |
|
|
if (mem24C !==16'h1234) tb_error("====== PUSH (X(Rn) mode): @0x024c value =====");
|
142 |
|
|
if (mem24A !==16'h5678) tb_error("====== PUSH (X(Rn) mode): @0x024a value =====");
|
143 |
|
|
if (mem248 !==16'h9abc) tb_error("====== PUSH (X(Rn) mode): @0x0248 value =====");
|
144 |
|
|
if (mem246 !==16'hdef0) tb_error("====== PUSH (X(Rn) mode): @0x0246 value =====");
|
145 |
|
|
if (mem244 !==16'h0fed) tb_error("====== PUSH (X(Rn) mode): @0x0244 value =====");
|
146 |
|
|
if (mem242 !==16'hcba9) tb_error("====== PUSH (X(Rn) mode): @0x0242 value =====");
|
147 |
|
|
if (mem240 !==16'h0000) tb_error("====== PUSH (X(Rn) mode): @0x0240 value =====");
|
148 |
|
|
if (mem23E !==16'h0000) tb_error("====== PUSH (X(Rn) mode): @0x023e value =====");
|
149 |
|
|
if (mem23C !==16'h0000) tb_error("====== PUSH (X(Rn) mode): @0x023c value =====");
|
150 |
|
|
if (mem23A !==16'h0000) tb_error("====== PUSH (X(Rn) mode): @0x023a value =====");
|
151 |
|
|
if (mem238 !==16'h0000) tb_error("====== PUSH (X(Rn) mode): @0x0238 value =====");
|
152 |
|
|
if (mem236 !==16'h0000) tb_error("====== PUSH (X(Rn) mode): @0x0236 value =====");
|
153 |
|
|
if (mem234 !==16'h0000) tb_error("====== PUSH (X(Rn) mode): @0x0234 value =====");
|
154 |
|
|
if (mem232 !==16'h0000) tb_error("====== PUSH (X(Rn) mode): @0x0232 value =====");
|
155 |
|
|
if (mem230 !==16'h0000) tb_error("====== PUSH (X(Rn) mode): @0x0230 value =====");
|
156 |
|
|
|
157 |
|
|
|
158 |
|
|
// Addressing mode: EDE
|
159 |
|
|
@(r15==16'h6000);
|
160 |
111 |
olivier.gi |
if (r1 !==(`PER_SIZE+16'h003E)) tb_error("====== PUSH (EDE mode): SP value =====");
|
161 |
2 |
olivier.gi |
if (mem250 !==16'h7524) tb_error("====== PUSH (EDE mode): @0x0250 value =====");
|
162 |
|
|
if (mem24E !==16'h1cb6) tb_error("====== PUSH (EDE mode): @0x024E value =====");
|
163 |
|
|
if (mem24C !==16'h1234) tb_error("====== PUSH (EDE mode): @0x024c value =====");
|
164 |
|
|
if (mem24A !==16'h5678) tb_error("====== PUSH (EDE mode): @0x024a value =====");
|
165 |
|
|
if (mem248 !==16'h9abc) tb_error("====== PUSH (EDE mode): @0x0248 value =====");
|
166 |
|
|
if (mem246 !==16'hdef0) tb_error("====== PUSH (EDE mode): @0x0246 value =====");
|
167 |
|
|
if (mem244 !==16'h0fed) tb_error("====== PUSH (EDE mode): @0x0244 value =====");
|
168 |
|
|
if (mem242 !==16'hcba9) tb_error("====== PUSH (EDE mode): @0x0242 value =====");
|
169 |
|
|
if (mem240 !==16'h8765) tb_error("====== PUSH (EDE mode): @0x0240 value =====");
|
170 |
|
|
if (mem23E !==16'h4321) tb_error("====== PUSH (EDE mode): @0x023e value =====");
|
171 |
|
|
if (mem23C !==16'h0000) tb_error("====== PUSH (EDE mode): @0x023c value =====");
|
172 |
|
|
if (mem23A !==16'h0000) tb_error("====== PUSH (EDE mode): @0x023a value =====");
|
173 |
|
|
if (mem238 !==16'h0000) tb_error("====== PUSH (EDE mode): @0x0238 value =====");
|
174 |
|
|
if (mem236 !==16'h0000) tb_error("====== PUSH (EDE mode): @0x0236 value =====");
|
175 |
|
|
if (mem234 !==16'h0000) tb_error("====== PUSH (EDE mode): @0x0234 value =====");
|
176 |
|
|
if (mem232 !==16'h0000) tb_error("====== PUSH (EDE mode): @0x0232 value =====");
|
177 |
|
|
if (mem230 !==16'h0000) tb_error("====== PUSH (EDE mode): @0x0230 value =====");
|
178 |
|
|
|
179 |
|
|
|
180 |
|
|
// Addressing mode: &EDE
|
181 |
|
|
@(r15==16'h7000);
|
182 |
111 |
olivier.gi |
if (r1 !==(`PER_SIZE+16'h003A)) tb_error("====== PUSH (&EDE mode): SP value =====");
|
183 |
2 |
olivier.gi |
if (mem250 !==16'h7524) tb_error("====== PUSH (&EDE mode): @0x0250 value =====");
|
184 |
|
|
if (mem24E !==16'h1cb6) tb_error("====== PUSH (&EDE mode): @0x024E value =====");
|
185 |
|
|
if (mem24C !==16'h1234) tb_error("====== PUSH (&EDE mode): @0x024c value =====");
|
186 |
|
|
if (mem24A !==16'h5678) tb_error("====== PUSH (&EDE mode): @0x024a value =====");
|
187 |
|
|
if (mem248 !==16'h9abc) tb_error("====== PUSH (&EDE mode): @0x0248 value =====");
|
188 |
|
|
if (mem246 !==16'hdef0) tb_error("====== PUSH (&EDE mode): @0x0246 value =====");
|
189 |
|
|
if (mem244 !==16'h0fed) tb_error("====== PUSH (&EDE mode): @0x0244 value =====");
|
190 |
|
|
if (mem242 !==16'hcba9) tb_error("====== PUSH (&EDE mode): @0x0242 value =====");
|
191 |
|
|
if (mem240 !==16'h8765) tb_error("====== PUSH (&EDE mode): @0x0240 value =====");
|
192 |
|
|
if (mem23E !==16'h4321) tb_error("====== PUSH (&EDE mode): @0x023e value =====");
|
193 |
|
|
if (mem23C !==16'h1f2e) tb_error("====== PUSH (&EDE mode): @0x023c value =====");
|
194 |
|
|
if (mem23A !==16'h3d4c) tb_error("====== PUSH (&EDE mode): @0x023a value =====");
|
195 |
|
|
if (mem238 !==16'h0000) tb_error("====== PUSH (&EDE mode): @0x0238 value =====");
|
196 |
|
|
if (mem236 !==16'h0000) tb_error("====== PUSH (&EDE mode): @0x0236 value =====");
|
197 |
|
|
if (mem234 !==16'h0000) tb_error("====== PUSH (&EDE mode): @0x0234 value =====");
|
198 |
|
|
if (mem232 !==16'h0000) tb_error("====== PUSH (&EDE mode): @0x0232 value =====");
|
199 |
|
|
if (mem230 !==16'h0000) tb_error("====== PUSH (&EDE mode): @0x0230 value =====");
|
200 |
|
|
|
201 |
|
|
|
202 |
|
|
// Addressing mode: #N
|
203 |
|
|
@(r15==16'h7001);
|
204 |
111 |
olivier.gi |
if (r1 !==(`PER_SIZE+16'h0036)) tb_error("====== PUSH (#N mode): SP value =====");
|
205 |
2 |
olivier.gi |
if (mem250 !==16'h7524) tb_error("====== PUSH (#N mode): @0x0250 value =====");
|
206 |
|
|
if (mem24E !==16'h1cb6) tb_error("====== PUSH (#N mode): @0x024E value =====");
|
207 |
|
|
if (mem24C !==16'h1234) tb_error("====== PUSH (#N mode): @0x024c value =====");
|
208 |
|
|
if (mem24A !==16'h5678) tb_error("====== PUSH (#N mode): @0x024a value =====");
|
209 |
|
|
if (mem248 !==16'h9abc) tb_error("====== PUSH (#N mode): @0x0248 value =====");
|
210 |
|
|
if (mem246 !==16'hdef0) tb_error("====== PUSH (#N mode): @0x0246 value =====");
|
211 |
|
|
if (mem244 !==16'h0fed) tb_error("====== PUSH (#N mode): @0x0244 value =====");
|
212 |
|
|
if (mem242 !==16'hcba9) tb_error("====== PUSH (#N mode): @0x0242 value =====");
|
213 |
|
|
if (mem240 !==16'h8765) tb_error("====== PUSH (#N mode): @0x0240 value =====");
|
214 |
|
|
if (mem23E !==16'h4321) tb_error("====== PUSH (#N mode): @0x023e value =====");
|
215 |
|
|
if (mem23C !==16'h1f2e) tb_error("====== PUSH (#N mode): @0x023c value =====");
|
216 |
|
|
if (mem23A !==16'h3d4c) tb_error("====== PUSH (#N mode): @0x023a value =====");
|
217 |
|
|
if (mem238 !==16'h71c8) tb_error("====== PUSH (#N mode): @0x0238 value =====");
|
218 |
|
|
if (mem236 !==16'h178c) tb_error("====== PUSH (#N mode): @0x0236 value =====");
|
219 |
|
|
if (mem234 !==16'h0000) tb_error("====== PUSH (#N mode): @0x0234 value =====");
|
220 |
|
|
if (mem232 !==16'h0000) tb_error("====== PUSH (#N mode): @0x0232 value =====");
|
221 |
|
|
if (mem230 !==16'h0000) tb_error("====== PUSH (#N mode): @0x0230 value =====");
|
222 |
|
|
|
223 |
|
|
|
224 |
|
|
/* -------------- TEST INSTRUCTION IN BYTE MODE ------------------- */
|
225 |
|
|
|
226 |
|
|
// Initialization
|
227 |
|
|
@(r15==16'h8000);
|
228 |
111 |
olivier.gi |
if (r1 !==(`PER_SIZE+16'h0052)) tb_error("====== SP initialization (R1 value) =====");
|
229 |
2 |
olivier.gi |
if (mem250 !==16'h7524) tb_error("====== RAM Initialization (@0x0250 value) =====");
|
230 |
|
|
if (mem24E !==16'h1cb6) tb_error("====== RAM Initialization (@0x024E value) =====");
|
231 |
|
|
if (mem24C !==16'h1234) tb_error("====== RAM Initialization (@0x024c value) =====");
|
232 |
|
|
if (mem24A !==16'h5678) tb_error("====== RAM Initialization (@0x024a value) =====");
|
233 |
|
|
if (mem248 !==16'h9abc) tb_error("====== RAM Initialization (@0x0248 value) =====");
|
234 |
|
|
if (mem246 !==16'hdef0) tb_error("====== RAM Initialization (@0x0246 value) =====");
|
235 |
|
|
if (mem244 !==16'h0fed) tb_error("====== RAM Initialization (@0x0244 value) =====");
|
236 |
|
|
if (mem242 !==16'hcba9) tb_error("====== RAM Initialization (@0x0242 value) =====");
|
237 |
|
|
if (mem240 !==16'h8765) tb_error("====== RAM Initialization (@0x0240 value) =====");
|
238 |
|
|
if (mem23E !==16'h4321) tb_error("====== RAM Initialization (@0x023e value) =====");
|
239 |
|
|
if (mem23C !==16'h1f2e) tb_error("====== RAM Initialization (@0x023c value) =====");
|
240 |
|
|
if (mem23A !==16'h3d4c) tb_error("====== RAM Initialization (@0x023a value) =====");
|
241 |
|
|
if (mem238 !==16'h71c8) tb_error("====== RAM Initialization (@0x0238 value) =====");
|
242 |
|
|
if (mem236 !==16'h178c) tb_error("====== RAM Initialization (@0x0236 value) =====");
|
243 |
|
|
if (mem234 !==16'h0000) tb_error("====== RAM Initialization (@0x0234 value) =====");
|
244 |
|
|
if (mem232 !==16'h0000) tb_error("====== RAM Initialization (@0x0232 value) =====");
|
245 |
|
|
if (mem230 !==16'h0000) tb_error("====== RAM Initialization (@0x0230 value) =====");
|
246 |
|
|
|
247 |
|
|
|
248 |
|
|
// Addressing mode: Rn
|
249 |
|
|
@(r15==16'h9000);
|
250 |
111 |
olivier.gi |
if (r1 !==(`PER_SIZE+16'h004E)) tb_error("====== PUSH.B (Rn mode): SP value =====");
|
251 |
2 |
olivier.gi |
if (mem250 !==16'h75e2) tb_error("====== PUSH.B (Rn mode): @0x0250 value =====");
|
252 |
|
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH.B (Rn mode): @0x024E value =====");
|
253 |
|
|
if (mem24C !==16'h1234) tb_error("====== PUSH.B (Rn mode): @0x024c value =====");
|
254 |
|
|
if (mem24A !==16'h5678) tb_error("====== PUSH.B (Rn mode): @0x024a value =====");
|
255 |
|
|
if (mem248 !==16'h9abc) tb_error("====== PUSH.B (Rn mode): @0x0248 value =====");
|
256 |
|
|
if (mem246 !==16'hdef0) tb_error("====== PUSH.B (Rn mode): @0x0246 value =====");
|
257 |
|
|
if (mem244 !==16'h0fed) tb_error("====== PUSH.B (Rn mode): @0x0244 value =====");
|
258 |
|
|
if (mem242 !==16'hcba9) tb_error("====== PUSH.B (Rn mode): @0x0242 value =====");
|
259 |
|
|
if (mem240 !==16'h8765) tb_error("====== PUSH.B (Rn mode): @0x0240 value =====");
|
260 |
|
|
if (mem23E !==16'h4321) tb_error("====== PUSH.B (Rn mode): @0x023e value =====");
|
261 |
|
|
if (mem23C !==16'h1f2e) tb_error("====== PUSH.B (Rn mode): @0x023c value =====");
|
262 |
|
|
if (mem23A !==16'h3d4c) tb_error("====== PUSH.B (Rn mode): @0x023a value =====");
|
263 |
|
|
if (mem238 !==16'h71c8) tb_error("====== PUSH.B (Rn mode): @0x0238 value =====");
|
264 |
|
|
if (mem236 !==16'h178c) tb_error("====== PUSH.B (Rn mode): @0x0236 value =====");
|
265 |
|
|
if (mem234 !==16'h0000) tb_error("====== PUSH.B (Rn mode): @0x0234 value =====");
|
266 |
|
|
if (mem232 !==16'h0000) tb_error("====== PUSH.B (Rn mode): @0x0232 value =====");
|
267 |
|
|
if (mem230 !==16'h0000) tb_error("====== PUSH.B (Rn mode): @0x0230 value =====");
|
268 |
|
|
|
269 |
|
|
|
270 |
|
|
// Addressing mode: @Rn
|
271 |
|
|
@(r15==16'hA000);
|
272 |
111 |
olivier.gi |
if (r1 !==(`PER_SIZE+16'h004A)) tb_error("====== PUSH.B (@Rn mode): SP value =====");
|
273 |
2 |
olivier.gi |
if (mem250 !==16'h75e2) tb_error("====== PUSH.B (@Rn mode): @0x0250 value =====");
|
274 |
|
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH.B (@Rn mode): @0x024E value =====");
|
275 |
|
|
if (mem24C !==16'h12a6) tb_error("====== PUSH.B (@Rn mode): @0x024c value =====");
|
276 |
|
|
if (mem24A !==16'h5679) tb_error("====== PUSH.B (@Rn mode): @0x024a value =====");
|
277 |
|
|
if (mem248 !==16'h9abc) tb_error("====== PUSH.B (@Rn mode): @0x0248 value =====");
|
278 |
|
|
if (mem246 !==16'hdef0) tb_error("====== PUSH.B (@Rn mode): @0x0246 value =====");
|
279 |
|
|
if (mem244 !==16'h0fed) tb_error("====== PUSH.B (@Rn mode): @0x0244 value =====");
|
280 |
|
|
if (mem242 !==16'hcba9) tb_error("====== PUSH.B (@Rn mode): @0x0242 value =====");
|
281 |
|
|
if (mem240 !==16'h8765) tb_error("====== PUSH.B (@Rn mode): @0x0240 value =====");
|
282 |
|
|
if (mem23E !==16'h4321) tb_error("====== PUSH.B (@Rn mode): @0x023e value =====");
|
283 |
|
|
if (mem23C !==16'h1f2e) tb_error("====== PUSH.B (@Rn mode): @0x023c value =====");
|
284 |
|
|
if (mem23A !==16'h3d4c) tb_error("====== PUSH.B (@Rn mode): @0x023a value =====");
|
285 |
|
|
if (mem238 !==16'h71c8) tb_error("====== PUSH.B (@Rn mode): @0x0238 value =====");
|
286 |
|
|
if (mem236 !==16'h178c) tb_error("====== PUSH.B (@Rn mode): @0x0236 value =====");
|
287 |
|
|
if (mem234 !==16'h0000) tb_error("====== PUSH.B (@Rn mode): @0x0234 value =====");
|
288 |
|
|
if (mem232 !==16'h0000) tb_error("====== PUSH.B (@Rn mode): @0x0232 value =====");
|
289 |
|
|
if (mem230 !==16'h0000) tb_error("====== PUSH.B (@Rn mode): @0x0230 value =====");
|
290 |
|
|
|
291 |
|
|
|
292 |
|
|
// Addressing mode: @Rn+
|
293 |
|
|
@(r15==16'hB000);
|
294 |
111 |
olivier.gi |
if (r4 !==(`PER_SIZE+16'h0018)) tb_error("====== PUSH.B (@Rn+ mode): R4 value =====");
|
295 |
|
|
if (r1 !==(`PER_SIZE+16'h0046)) tb_error("====== PUSH.B (@Rn+ mode): SP value =====");
|
296 |
2 |
olivier.gi |
if (mem250 !==16'h75e2) tb_error("====== PUSH.B (@Rn+ mode): @0x0250 value =====");
|
297 |
|
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH.B (@Rn+ mode): @0x024E value =====");
|
298 |
|
|
if (mem24C !==16'h12a6) tb_error("====== PUSH.B (@Rn+ mode): @0x024c value =====");
|
299 |
|
|
if (mem24A !==16'h5679) tb_error("====== PUSH.B (@Rn+ mode): @0x024a value =====");
|
300 |
|
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH.B (@Rn+ mode): @0x0248 value =====");
|
301 |
|
|
if (mem246 !==16'hde97) tb_error("====== PUSH.B (@Rn+ mode): @0x0246 value =====");
|
302 |
|
|
if (mem244 !==16'h0fed) tb_error("====== PUSH.B (@Rn+ mode): @0x0244 value =====");
|
303 |
|
|
if (mem242 !==16'hcba9) tb_error("====== PUSH.B (@Rn+ mode): @0x0242 value =====");
|
304 |
|
|
if (mem240 !==16'h8765) tb_error("====== PUSH.B (@Rn+ mode): @0x0240 value =====");
|
305 |
|
|
if (mem23E !==16'h4321) tb_error("====== PUSH.B (@Rn+ mode): @0x023e value =====");
|
306 |
|
|
if (mem23C !==16'h1f2e) tb_error("====== PUSH.B (@Rn+ mode): @0x023c value =====");
|
307 |
|
|
if (mem23A !==16'h3d4c) tb_error("====== PUSH.B (@Rn+ mode): @0x023a value =====");
|
308 |
|
|
if (mem238 !==16'h71c8) tb_error("====== PUSH.B (@Rn+ mode): @0x0238 value =====");
|
309 |
|
|
if (mem236 !==16'h178c) tb_error("====== PUSH.B (@Rn+ mode): @0x0236 value =====");
|
310 |
|
|
if (mem234 !==16'h0000) tb_error("====== PUSH.B (@Rn+ mode): @0x0234 value =====");
|
311 |
|
|
if (mem232 !==16'h0000) tb_error("====== PUSH.B (@Rn+ mode): @0x0232 value =====");
|
312 |
|
|
if (mem230 !==16'h0000) tb_error("====== PUSH.B (@Rn+ mode): @0x0230 value =====");
|
313 |
|
|
|
314 |
|
|
|
315 |
|
|
// Addressing mode: X(Rn)
|
316 |
|
|
@(r15==16'hC000);
|
317 |
111 |
olivier.gi |
if (r1 !==(`PER_SIZE+16'h0042)) tb_error("====== PUSH.B (X(Rn) mode): SP value =====");
|
318 |
2 |
olivier.gi |
if (mem250 !==16'h75e2) tb_error("====== PUSH.B (X(Rn) mode): @0x0250 value =====");
|
319 |
|
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH.B (X(Rn) mode): @0x024E value =====");
|
320 |
|
|
if (mem24C !==16'h12a6) tb_error("====== PUSH.B (X(Rn) mode): @0x024c value =====");
|
321 |
|
|
if (mem24A !==16'h5679) tb_error("====== PUSH.B (X(Rn) mode): @0x024a value =====");
|
322 |
|
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH.B (X(Rn) mode): @0x0248 value =====");
|
323 |
|
|
if (mem246 !==16'hde97) tb_error("====== PUSH.B (X(Rn) mode): @0x0246 value =====");
|
324 |
|
|
if (mem244 !==16'h0f4c) tb_error("====== PUSH.B (X(Rn) mode): @0x0244 value =====");
|
325 |
|
|
if (mem242 !==16'hcbc3) tb_error("====== PUSH.B (X(Rn) mode): @0x0242 value =====");
|
326 |
|
|
if (mem240 !==16'h8765) tb_error("====== PUSH.B (X(Rn) mode): @0x0240 value =====");
|
327 |
|
|
if (mem23E !==16'h4321) tb_error("====== PUSH.B (X(Rn) mode): @0x023e value =====");
|
328 |
|
|
if (mem23C !==16'h1f2e) tb_error("====== PUSH.B (X(Rn) mode): @0x023c value =====");
|
329 |
|
|
if (mem23A !==16'h3d4c) tb_error("====== PUSH.B (X(Rn) mode): @0x023a value =====");
|
330 |
|
|
if (mem238 !==16'h71c8) tb_error("====== PUSH.B (X(Rn) mode): @0x0238 value =====");
|
331 |
|
|
if (mem236 !==16'h178c) tb_error("====== PUSH.B (X(Rn) mode): @0x0236 value =====");
|
332 |
|
|
if (mem234 !==16'h0000) tb_error("====== PUSH.B (X(Rn) mode): @0x0234 value =====");
|
333 |
|
|
if (mem232 !==16'h0000) tb_error("====== PUSH.B (X(Rn) mode): @0x0232 value =====");
|
334 |
|
|
if (mem230 !==16'h0000) tb_error("====== PUSH.B (X(Rn) mode): @0x0230 value =====");
|
335 |
|
|
|
336 |
|
|
|
337 |
|
|
// Addressing mode: EDE
|
338 |
|
|
@(r15==16'hD000);
|
339 |
111 |
olivier.gi |
if (r1 !==(`PER_SIZE+16'h003E)) tb_error("====== PUSH.B (EDE mode): SP value =====");
|
340 |
2 |
olivier.gi |
if (mem250 !==16'h75e2) tb_error("====== PUSH.B (EDE mode): @0x0250 value =====");
|
341 |
|
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH.B (EDE mode): @0x024E value =====");
|
342 |
|
|
if (mem24C !==16'h12a6) tb_error("====== PUSH.B (EDE mode): @0x024c value =====");
|
343 |
|
|
if (mem24A !==16'h5679) tb_error("====== PUSH.B (EDE mode): @0x024a value =====");
|
344 |
|
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH.B (EDE mode): @0x0248 value =====");
|
345 |
|
|
if (mem246 !==16'hde97) tb_error("====== PUSH.B (EDE mode): @0x0246 value =====");
|
346 |
|
|
if (mem244 !==16'h0f4c) tb_error("====== PUSH.B (EDE mode): @0x0244 value =====");
|
347 |
|
|
if (mem242 !==16'hcbc3) tb_error("====== PUSH.B (EDE mode): @0x0242 value =====");
|
348 |
|
|
if (mem240 !==16'h870e) tb_error("====== PUSH.B (EDE mode): @0x0240 value =====");
|
349 |
|
|
if (mem23E !==16'h43fe) tb_error("====== PUSH.B (EDE mode): @0x023e value =====");
|
350 |
|
|
if (mem23C !==16'h1f2e) tb_error("====== PUSH.B (EDE mode): @0x023c value =====");
|
351 |
|
|
if (mem23A !==16'h3d4c) tb_error("====== PUSH.B (EDE mode): @0x023a value =====");
|
352 |
|
|
if (mem238 !==16'h71c8) tb_error("====== PUSH.B (EDE mode): @0x0238 value =====");
|
353 |
|
|
if (mem236 !==16'h178c) tb_error("====== PUSH.B (EDE mode): @0x0236 value =====");
|
354 |
|
|
if (mem234 !==16'h0000) tb_error("====== PUSH.B (EDE mode): @0x0234 value =====");
|
355 |
|
|
if (mem232 !==16'h0000) tb_error("====== PUSH.B (EDE mode): @0x0232 value =====");
|
356 |
|
|
if (mem230 !==16'h0000) tb_error("====== PUSH.B (EDE mode): @0x0230 value =====");
|
357 |
|
|
|
358 |
|
|
|
359 |
|
|
// Addressing mode: &EDE
|
360 |
|
|
@(r15==16'hE000);
|
361 |
111 |
olivier.gi |
if (r1 !==(`PER_SIZE+16'h003A)) tb_error("====== PUSH.B (&EDE mode): SP value =====");
|
362 |
2 |
olivier.gi |
if (mem250 !==16'h75e2) tb_error("====== PUSH.B (&EDE mode): @0x0250 value =====");
|
363 |
|
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH.B (&EDE mode): @0x024E value =====");
|
364 |
|
|
if (mem24C !==16'h12a6) tb_error("====== PUSH.B (&EDE mode): @0x024c value =====");
|
365 |
|
|
if (mem24A !==16'h5679) tb_error("====== PUSH.B (&EDE mode): @0x024a value =====");
|
366 |
|
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH.B (&EDE mode): @0x0248 value =====");
|
367 |
|
|
if (mem246 !==16'hde97) tb_error("====== PUSH.B (&EDE mode): @0x0246 value =====");
|
368 |
|
|
if (mem244 !==16'h0f4c) tb_error("====== PUSH.B (&EDE mode): @0x0244 value =====");
|
369 |
|
|
if (mem242 !==16'hcbc3) tb_error("====== PUSH.B (&EDE mode): @0x0242 value =====");
|
370 |
|
|
if (mem240 !==16'h870e) tb_error("====== PUSH.B (&EDE mode): @0x0240 value =====");
|
371 |
|
|
if (mem23E !==16'h43fe) tb_error("====== PUSH.B (&EDE mode): @0x023e value =====");
|
372 |
|
|
if (mem23C !==16'h1fc2) tb_error("====== PUSH.B (&EDE mode): @0x023c value =====");
|
373 |
|
|
if (mem23A !==16'h3d3b) tb_error("====== PUSH.B (&EDE mode): @0x023a value =====");
|
374 |
|
|
if (mem238 !==16'h71c8) tb_error("====== PUSH.B (&EDE mode): @0x0238 value =====");
|
375 |
|
|
if (mem236 !==16'h178c) tb_error("====== PUSH.B (&EDE mode): @0x0236 value =====");
|
376 |
|
|
if (mem234 !==16'h0000) tb_error("====== PUSH.B (&EDE mode): @0x0234 value =====");
|
377 |
|
|
if (mem232 !==16'h0000) tb_error("====== PUSH.B (&EDE mode): @0x0232 value =====");
|
378 |
|
|
if (mem230 !==16'h0000) tb_error("====== PUSH.B (&EDE mode): @0x0230 value =====");
|
379 |
|
|
|
380 |
|
|
|
381 |
|
|
// Addressing mode: #N
|
382 |
|
|
@(r15==16'hF000);
|
383 |
111 |
olivier.gi |
if (r1 !==(`PER_SIZE+16'h0036)) tb_error("====== PUSH.B (#N mode): SP value =====");
|
384 |
2 |
olivier.gi |
if (mem250 !==16'h75e2) tb_error("====== PUSH.B (#N mode): @0x0250 value =====");
|
385 |
|
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH.B (#N mode): @0x024E value =====");
|
386 |
|
|
if (mem24C !==16'h12a6) tb_error("====== PUSH.B (#N mode): @0x024c value =====");
|
387 |
|
|
if (mem24A !==16'h5679) tb_error("====== PUSH.B (#N mode): @0x024a value =====");
|
388 |
|
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH.B (#N mode): @0x0248 value =====");
|
389 |
|
|
if (mem246 !==16'hde97) tb_error("====== PUSH.B (#N mode): @0x0246 value =====");
|
390 |
|
|
if (mem244 !==16'h0f4c) tb_error("====== PUSH.B (#N mode): @0x0244 value =====");
|
391 |
|
|
if (mem242 !==16'hcbc3) tb_error("====== PUSH.B (#N mode): @0x0242 value =====");
|
392 |
|
|
if (mem240 !==16'h870e) tb_error("====== PUSH.B (#N mode): @0x0240 value =====");
|
393 |
|
|
if (mem23E !==16'h43fe) tb_error("====== PUSH.B (#N mode): @0x023e value =====");
|
394 |
|
|
if (mem23C !==16'h1fc2) tb_error("====== PUSH.B (#N mode): @0x023c value =====");
|
395 |
|
|
if (mem23A !==16'h3d3b) tb_error("====== PUSH.B (#N mode): @0x023a value =====");
|
396 |
|
|
if (mem238 !==16'h71d9) tb_error("====== PUSH.B (#N mode): @0x0238 value =====");
|
397 |
|
|
if (mem236 !==16'h178d) tb_error("====== PUSH.B (#N mode): @0x0236 value =====");
|
398 |
|
|
if (mem234 !==16'h0000) tb_error("====== PUSH.B (#N mode): @0x0234 value =====");
|
399 |
|
|
if (mem232 !==16'h0000) tb_error("====== PUSH.B (#N mode): @0x0232 value =====");
|
400 |
|
|
if (mem230 !==16'h0000) tb_error("====== PUSH.B (#N mode): @0x0230 value =====");
|
401 |
|
|
|
402 |
102 |
olivier.gi |
/* -------------- TEST INSTRUCTION WITH SR AS ARGUMENT ------------------- */
|
403 |
2 |
olivier.gi |
|
404 |
102 |
olivier.gi |
// Addressing mode: SR
|
405 |
|
|
@(r15==16'hF100);
|
406 |
111 |
olivier.gi |
if (r1 !==(`PER_SIZE+16'h0032)) tb_error("====== PUSH SR : SP value =====");
|
407 |
102 |
olivier.gi |
if (mem250 !==16'h75e2) tb_error("====== PUSH SR : @0x0250 value =====");
|
408 |
|
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH SR : @0x024E value =====");
|
409 |
|
|
if (mem24C !==16'h12a6) tb_error("====== PUSH SR : @0x024c value =====");
|
410 |
|
|
if (mem24A !==16'h5679) tb_error("====== PUSH SR : @0x024a value =====");
|
411 |
|
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH SR : @0x0248 value =====");
|
412 |
|
|
if (mem246 !==16'hde97) tb_error("====== PUSH SR : @0x0246 value =====");
|
413 |
|
|
if (mem244 !==16'h0f4c) tb_error("====== PUSH SR : @0x0244 value =====");
|
414 |
|
|
if (mem242 !==16'hcbc3) tb_error("====== PUSH SR : @0x0242 value =====");
|
415 |
|
|
if (mem240 !==16'h870e) tb_error("====== PUSH SR : @0x0240 value =====");
|
416 |
|
|
if (mem23E !==16'h43fe) tb_error("====== PUSH SR : @0x023e value =====");
|
417 |
|
|
if (mem23C !==16'h1fc2) tb_error("====== PUSH SR : @0x023c value =====");
|
418 |
|
|
if (mem23A !==16'h3d3b) tb_error("====== PUSH SR : @0x023a value =====");
|
419 |
|
|
if (mem238 !==16'h71d9) tb_error("====== PUSH SR : @0x0238 value =====");
|
420 |
|
|
if (mem236 !==16'h178d) tb_error("====== PUSH SR : @0x0236 value =====");
|
421 |
111 |
olivier.gi |
if (mem234 !==(`PER_SIZE+16'h0034)) tb_error("====== PUSH SR : @0x0234 value =====");
|
422 |
|
|
if (mem232 !==(`PER_SIZE+16'h0032)) tb_error("====== PUSH SR : @0x0232 value =====");
|
423 |
102 |
olivier.gi |
if (mem230 !==16'h0000) tb_error("====== PUSH SR : @0x0230 value =====");
|
424 |
|
|
|
425 |
|
|
// Addressing mode: @SR
|
426 |
|
|
@(r15==16'hF200);
|
427 |
111 |
olivier.gi |
if (r1 !==(`PER_SIZE+16'h002E)) tb_error("====== PUSH @SR : SP value =====");
|
428 |
102 |
olivier.gi |
if (mem250 !==16'h75e2) tb_error("====== PUSH @SR : @0x0250 value =====");
|
429 |
|
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH @SR : @0x024E value =====");
|
430 |
|
|
if (mem24C !==16'h12a6) tb_error("====== PUSH @SR : @0x024c value =====");
|
431 |
|
|
if (mem24A !==16'h5679) tb_error("====== PUSH @SR : @0x024a value =====");
|
432 |
|
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH @SR : @0x0248 value =====");
|
433 |
|
|
if (mem246 !==16'hde97) tb_error("====== PUSH @SR : @0x0246 value =====");
|
434 |
|
|
if (mem244 !==16'h0f4c) tb_error("====== PUSH @SR : @0x0244 value =====");
|
435 |
|
|
if (mem242 !==16'hcbc3) tb_error("====== PUSH @SR : @0x0242 value =====");
|
436 |
|
|
if (mem240 !==16'h870e) tb_error("====== PUSH @SR : @0x0240 value =====");
|
437 |
|
|
if (mem23E !==16'h43fe) tb_error("====== PUSH @SR : @0x023e value =====");
|
438 |
|
|
if (mem23C !==16'h1fc2) tb_error("====== PUSH @SR : @0x023c value =====");
|
439 |
|
|
if (mem23A !==16'h3d3b) tb_error("====== PUSH @SR : @0x023a value =====");
|
440 |
|
|
if (mem238 !==16'h71d9) tb_error("====== PUSH @SR : @0x0238 value =====");
|
441 |
|
|
if (mem236 !==16'h178d) tb_error("====== PUSH @SR : @0x0236 value =====");
|
442 |
111 |
olivier.gi |
if (mem234 !==(`PER_SIZE+16'h0034)) tb_error("====== PUSH @SR : @0x0234 value =====");
|
443 |
|
|
if (mem232 !==(`PER_SIZE+16'h0032)) tb_error("====== PUSH @SR : @0x0232 value =====");
|
444 |
102 |
olivier.gi |
if (mem230 !==16'h0000) tb_error("====== PUSH @SR : @0x0230 value =====");
|
445 |
|
|
if (mem22E !==16'h1234) tb_error("====== PUSH @SR : @0x022E value =====");
|
446 |
|
|
if (mem22C !==16'h5678) tb_error("====== PUSH @SR : @0x022C value =====");
|
447 |
|
|
|
448 |
|
|
// Addressing mode: @SR+
|
449 |
|
|
@(r15==16'hF300);
|
450 |
111 |
olivier.gi |
if (r1 !==(`PER_SIZE+16'h002E)) tb_error("====== PUSH @SR : SP value =====");
|
451 |
102 |
olivier.gi |
if (mem250 !==16'h75e2) tb_error("====== PUSH @SR : @0x0250 value =====");
|
452 |
|
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH @SR : @0x024E value =====");
|
453 |
|
|
if (mem24C !==16'h12a6) tb_error("====== PUSH @SR : @0x024c value =====");
|
454 |
|
|
if (mem24A !==16'h5679) tb_error("====== PUSH @SR : @0x024a value =====");
|
455 |
|
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH @SR : @0x0248 value =====");
|
456 |
|
|
if (mem246 !==16'hde97) tb_error("====== PUSH @SR : @0x0246 value =====");
|
457 |
|
|
if (mem244 !==16'h0f4c) tb_error("====== PUSH @SR : @0x0244 value =====");
|
458 |
|
|
if (mem242 !==16'hcbc3) tb_error("====== PUSH @SR : @0x0242 value =====");
|
459 |
|
|
if (mem240 !==16'h870e) tb_error("====== PUSH @SR : @0x0240 value =====");
|
460 |
|
|
if (mem23E !==16'h43fe) tb_error("====== PUSH @SR : @0x023e value =====");
|
461 |
|
|
if (mem23C !==16'h1fc2) tb_error("====== PUSH @SR : @0x023c value =====");
|
462 |
|
|
if (mem23A !==16'h3d3b) tb_error("====== PUSH @SR : @0x023a value =====");
|
463 |
|
|
if (mem238 !==16'h71d9) tb_error("====== PUSH @SR : @0x0238 value =====");
|
464 |
|
|
if (mem236 !==16'h178d) tb_error("====== PUSH @SR : @0x0236 value =====");
|
465 |
111 |
olivier.gi |
if (mem234 !==(`PER_SIZE+16'h0034)) tb_error("====== PUSH @SR : @0x0234 value =====");
|
466 |
|
|
if (mem232 !==(`PER_SIZE+16'h0032)) tb_error("====== PUSH @SR : @0x0232 value =====");
|
467 |
102 |
olivier.gi |
if (mem230 !==16'h0000) tb_error("====== PUSH @SR : @0x0230 value =====");
|
468 |
|
|
if (mem22E !==16'h1234) tb_error("====== PUSH @SR : @0x022E value =====");
|
469 |
|
|
if (mem22C !==16'h5678) tb_error("====== PUSH @SR : @0x022C value =====");
|
470 |
|
|
if (mem22A !==16'h0000) tb_error("====== PUSH @SR : @0x022A value =====");
|
471 |
|
|
if (mem228 !==16'h0000) tb_error("====== PUSH @SR : @0x0228 value =====");
|
472 |
|
|
|
473 |
|
|
// Addressing mode: x(SR)
|
474 |
|
|
@(r15==16'hF400);
|
475 |
111 |
olivier.gi |
if (r1 !==(`PER_SIZE+16'h002A)) tb_error("====== PUSH @SR : SP value =====");
|
476 |
102 |
olivier.gi |
if (mem250 !==16'h75e2) tb_error("====== PUSH @SR : @0x0250 value =====");
|
477 |
|
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH @SR : @0x024E value =====");
|
478 |
|
|
if (mem24C !==16'h12a6) tb_error("====== PUSH @SR : @0x024c value =====");
|
479 |
|
|
if (mem24A !==16'h5679) tb_error("====== PUSH @SR : @0x024a value =====");
|
480 |
|
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH @SR : @0x0248 value =====");
|
481 |
|
|
if (mem246 !==16'hde97) tb_error("====== PUSH @SR : @0x0246 value =====");
|
482 |
|
|
if (mem244 !==16'h0f4c) tb_error("====== PUSH @SR : @0x0244 value =====");
|
483 |
|
|
if (mem242 !==16'hcbc3) tb_error("====== PUSH @SR : @0x0242 value =====");
|
484 |
|
|
if (mem240 !==16'h870e) tb_error("====== PUSH @SR : @0x0240 value =====");
|
485 |
|
|
if (mem23E !==16'h43fe) tb_error("====== PUSH @SR : @0x023e value =====");
|
486 |
|
|
if (mem23C !==16'h1fc2) tb_error("====== PUSH @SR : @0x023c value =====");
|
487 |
|
|
if (mem23A !==16'h3d3b) tb_error("====== PUSH @SR : @0x023a value =====");
|
488 |
|
|
if (mem238 !==16'h71d9) tb_error("====== PUSH @SR : @0x0238 value =====");
|
489 |
|
|
if (mem236 !==16'h178d) tb_error("====== PUSH @SR : @0x0236 value =====");
|
490 |
111 |
olivier.gi |
if (mem234 !==(`PER_SIZE+16'h0034)) tb_error("====== PUSH @SR : @0x0234 value =====");
|
491 |
|
|
if (mem232 !==(`PER_SIZE+16'h0032)) tb_error("====== PUSH @SR : @0x0232 value =====");
|
492 |
102 |
olivier.gi |
if (mem230 !==16'h0000) tb_error("====== PUSH @SR : @0x0230 value =====");
|
493 |
|
|
if (mem22E !==16'h1234) tb_error("====== PUSH @SR : @0x022E value =====");
|
494 |
|
|
if (mem22C !==16'h71d9) tb_error("====== PUSH @SR : @0x022C value =====");
|
495 |
|
|
if (mem22A !==16'h178d) tb_error("====== PUSH @SR : @0x022A value =====");
|
496 |
|
|
if (mem228 !==16'h0000) tb_error("====== PUSH @SR : @0x0228 value =====");
|
497 |
|
|
|
498 |
|
|
|
499 |
|
|
/* -------------- TEST POP INSTRUCTION WITH SR AS ARGUMENT ------------------- */
|
500 |
|
|
|
501 |
|
|
// Addressing mode: x(SR)
|
502 |
|
|
@(r15==16'hF500);
|
503 |
111 |
olivier.gi |
if (r1 !==(`PER_SIZE+16'h002E)) tb_error("====== PUSH @SR : SP value =====");
|
504 |
102 |
olivier.gi |
if (mem250 !==16'h75e2) tb_error("====== PUSH @SR : @0x0250 value =====");
|
505 |
|
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH @SR : @0x024E value =====");
|
506 |
|
|
if (mem24C !==16'h12a6) tb_error("====== PUSH @SR : @0x024c value =====");
|
507 |
|
|
if (mem24A !==16'h5679) tb_error("====== PUSH @SR : @0x024a value =====");
|
508 |
|
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH @SR : @0x0248 value =====");
|
509 |
|
|
if (mem246 !==16'hde97) tb_error("====== PUSH @SR : @0x0246 value =====");
|
510 |
|
|
if (mem244 !==16'h0f4c) tb_error("====== PUSH @SR : @0x0244 value =====");
|
511 |
|
|
if (mem242 !==16'hcbc3) tb_error("====== PUSH @SR : @0x0242 value =====");
|
512 |
|
|
if (mem240 !==16'h870e) tb_error("====== PUSH @SR : @0x0240 value =====");
|
513 |
|
|
if (mem23E !==16'h43fe) tb_error("====== PUSH @SR : @0x023e value =====");
|
514 |
|
|
if (mem23C !==16'h1fc2) tb_error("====== PUSH @SR : @0x023c value =====");
|
515 |
|
|
if (mem23A !==16'h3d3b) tb_error("====== PUSH @SR : @0x023a value =====");
|
516 |
|
|
if (mem238 !==16'h71d9) tb_error("====== PUSH @SR : @0x0238 value =====");
|
517 |
|
|
if (mem236 !==16'h178d) tb_error("====== PUSH @SR : @0x0236 value =====");
|
518 |
|
|
if (mem234 !==16'h71d9) tb_error("====== PUSH @SR : @0x0234 value =====");
|
519 |
|
|
if (mem232 !==16'h178d) tb_error("====== PUSH @SR : @0x0232 value =====");
|
520 |
|
|
if (mem230 !==16'h0000) tb_error("====== PUSH @SR : @0x0230 value =====");
|
521 |
|
|
if (mem22E !==16'h1234) tb_error("====== PUSH @SR : @0x022E value =====");
|
522 |
|
|
if (mem22C !==16'h71d9) tb_error("====== PUSH @SR : @0x022C value =====");
|
523 |
|
|
if (mem22A !==16'h178d) tb_error("====== PUSH @SR : @0x022A value =====");
|
524 |
|
|
if (mem228 !==16'h0000) tb_error("====== PUSH @SR : @0x0228 value =====");
|
525 |
|
|
|
526 |
|
|
// Addressing mode: SR
|
527 |
|
|
@(r15==16'hF600);
|
528 |
|
|
if (r1 !==16'h1234) tb_error("====== PUSH @SR : SP value =====");
|
529 |
|
|
if (mem250 !==16'h75e2) tb_error("====== PUSH @SR : @0x0250 value =====");
|
530 |
|
|
if (mem24E !==16'h1cc4) tb_error("====== PUSH @SR : @0x024E value =====");
|
531 |
|
|
if (mem24C !==16'h12a6) tb_error("====== PUSH @SR : @0x024c value =====");
|
532 |
|
|
if (mem24A !==16'h5679) tb_error("====== PUSH @SR : @0x024a value =====");
|
533 |
|
|
if (mem248 !==16'h9a6a) tb_error("====== PUSH @SR : @0x0248 value =====");
|
534 |
|
|
if (mem246 !==16'hde97) tb_error("====== PUSH @SR : @0x0246 value =====");
|
535 |
|
|
if (mem244 !==16'h0f4c) tb_error("====== PUSH @SR : @0x0244 value =====");
|
536 |
|
|
if (mem242 !==16'hcbc3) tb_error("====== PUSH @SR : @0x0242 value =====");
|
537 |
|
|
if (mem240 !==16'h870e) tb_error("====== PUSH @SR : @0x0240 value =====");
|
538 |
|
|
if (mem23E !==16'h43fe) tb_error("====== PUSH @SR : @0x023e value =====");
|
539 |
|
|
if (mem23C !==16'h1fc2) tb_error("====== PUSH @SR : @0x023c value =====");
|
540 |
|
|
if (mem23A !==16'h3d3b) tb_error("====== PUSH @SR : @0x023a value =====");
|
541 |
|
|
if (mem238 !==16'h71d9) tb_error("====== PUSH @SR : @0x0238 value =====");
|
542 |
|
|
if (mem236 !==16'h178d) tb_error("====== PUSH @SR : @0x0236 value =====");
|
543 |
|
|
if (mem234 !==16'h71d9) tb_error("====== PUSH @SR : @0x0234 value =====");
|
544 |
|
|
if (mem232 !==16'h178d) tb_error("====== PUSH @SR : @0x0232 value =====");
|
545 |
|
|
if (mem230 !==16'h0000) tb_error("====== PUSH @SR : @0x0230 value =====");
|
546 |
|
|
if (mem22E !==16'h1234) tb_error("====== PUSH @SR : @0x022E value =====");
|
547 |
|
|
if (mem22C !==16'h71d9) tb_error("====== PUSH @SR : @0x022C value =====");
|
548 |
|
|
if (mem22A !==16'h178d) tb_error("====== PUSH @SR : @0x022A value =====");
|
549 |
|
|
if (mem228 !==16'h0000) tb_error("====== PUSH @SR : @0x0228 value =====");
|
550 |
|
|
|
551 |
2 |
olivier.gi |
stimulus_done = 1;
|
552 |
|
|
end
|
553 |
|
|
|