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: RRC[.B] INSTRUCTION */
|
25 |
|
|
/*---------------------------------------------------------------------------*/
|
26 |
|
|
/* Test the RRC[.B] 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 |
|
|
|
46 |
|
|
// RRC (WORD MODE)
|
47 |
|
|
//--------------------------------------------------------
|
48 |
|
|
|
49 |
|
|
// Addressing mode: Rn
|
50 |
|
|
@(r15==16'h1000);
|
51 |
|
|
if (r4 !==16'h1999) tb_error("====== RRC (Rn mode): test 1 (result) =====");
|
52 |
|
|
if (r5 !==16'h0000) tb_error("====== RRC (Rn mode): test 1 (C flag) =====");
|
53 |
|
|
|
54 |
|
|
if (r6 !==16'h1999) tb_error("====== RRC (Rn mode): test 2 (result) =====");
|
55 |
|
|
if (r7 !==16'h0001) tb_error("====== RRC (Rn mode): test 2 (C flag) =====");
|
56 |
|
|
|
57 |
|
|
if (r8 !==16'h9999) tb_error("====== RRC (Rn mode): test 3 (result) =====");
|
58 |
|
|
if (r9 !==16'h0004) tb_error("====== RRC (Rn mode): test 3 (C flag) =====");
|
59 |
|
|
|
60 |
|
|
if (r10 !==16'h9999) tb_error("====== RRC (Rn mode): test 4 (result) =====");
|
61 |
|
|
if (r11 !==16'h0005) tb_error("====== RRC (Rn mode): test 4 (C flag) =====");
|
62 |
|
|
|
63 |
|
|
|
64 |
|
|
// Addressing mode: @Rn
|
65 |
|
|
@(r15==16'h2000);
|
66 |
111 |
olivier.gi |
if (mem200 !==16'h1999) tb_error("====== RRC (@Rn mode): test 1 (result) =====");
|
67 |
|
|
if (r4 !==(`PER_SIZE+16'h0000)) tb_error("====== RRC (@Rn mode): test 1 (address) =====");
|
68 |
|
|
if (r5 !==16'h0000) tb_error("====== RRC (@Rn mode): test 1 (C flag) =====");
|
69 |
2 |
olivier.gi |
|
70 |
111 |
olivier.gi |
if (mem202 !==16'h1999) tb_error("====== RRC (@Rn mode): test 2 (result) =====");
|
71 |
|
|
if (r6 !==(`PER_SIZE+16'h0002)) tb_error("====== RRC (@Rn mode): test 2 (address) =====");
|
72 |
|
|
if (r7 !==16'h0001) tb_error("====== RRC (@Rn mode): test 2 (C flag) =====");
|
73 |
2 |
olivier.gi |
|
74 |
111 |
olivier.gi |
if (mem204 !==16'h9999) tb_error("====== RRC (@Rn mode): test 3 (result) =====");
|
75 |
|
|
if (r8 !==(`PER_SIZE+16'h0004)) tb_error("====== RRC (@Rn mode): test 3 (address) =====");
|
76 |
|
|
if (r9 !==16'h0004) tb_error("====== RRC (@Rn mode): test 3 (C flag) =====");
|
77 |
2 |
olivier.gi |
|
78 |
111 |
olivier.gi |
if (mem206 !==16'h9999) tb_error("====== RRC (@Rn mode): test 4 (result) =====");
|
79 |
|
|
if (r10 !==(`PER_SIZE+16'h0006)) tb_error("====== RRC (@Rn mode): test 4 (address) =====");
|
80 |
|
|
if (r11 !==16'h0005) tb_error("====== RRC (@Rn mode): test 4 (C flag) =====");
|
81 |
2 |
olivier.gi |
|
82 |
|
|
|
83 |
|
|
// Addressing mode: @Rn+
|
84 |
|
|
@(r15==16'h3000);
|
85 |
111 |
olivier.gi |
if (mem208 !==16'h1999) tb_error("====== RRC (@Rn+ mode): test 1 (result) =====");
|
86 |
|
|
if (r4 !==(`PER_SIZE+16'h000A)) tb_error("====== RRC (@Rn+ mode): test 1 (address) =====");
|
87 |
|
|
if (r5 !==16'h0000) tb_error("====== RRC (@Rn+ mode): test 1 (C flag) =====");
|
88 |
2 |
olivier.gi |
|
89 |
111 |
olivier.gi |
if (mem20A !==16'h1999) tb_error("====== RRC (@Rn+ mode): test 2 (result) =====");
|
90 |
|
|
if (r6 !==(`PER_SIZE+16'h000C)) tb_error("====== RRC (@Rn+ mode): test 2 (address) =====");
|
91 |
|
|
if (r7 !==16'h0001) tb_error("====== RRC (@Rn+ mode): test 2 (C flag) =====");
|
92 |
2 |
olivier.gi |
|
93 |
111 |
olivier.gi |
if (mem20C !==16'h9999) tb_error("====== RRC (@Rn+ mode): test 3 (result) =====");
|
94 |
|
|
if (r8 !==(`PER_SIZE+16'h000E)) tb_error("====== RRC (@Rn+ mode): test 3 (address) =====");
|
95 |
|
|
if (r9 !==16'h0004) tb_error("====== RRC (@Rn+ mode): test 3 (C flag) =====");
|
96 |
2 |
olivier.gi |
|
97 |
111 |
olivier.gi |
if (mem20E !==16'h9999) tb_error("====== RRC (@Rn+ mode): test 4 (result) =====");
|
98 |
|
|
if (r10 !==(`PER_SIZE+16'h0010)) tb_error("====== RRC (@Rn+ mode): test 4 (address) =====");
|
99 |
|
|
if (r11 !==16'h0005) tb_error("====== RRC (@Rn+ mode): test 4 (C flag) =====");
|
100 |
2 |
olivier.gi |
|
101 |
|
|
|
102 |
|
|
// Addressing mode: X(Rn)
|
103 |
|
|
@(r15==16'h4000);
|
104 |
|
|
if (mem210 !==16'h1999) tb_error("====== RRC (X(Rn) mode): test 1 (result) =====");
|
105 |
|
|
if (r5 !==16'h0000) tb_error("====== RRC (X(Rn) mode): test 1 (C flag) =====");
|
106 |
|
|
|
107 |
|
|
if (mem212 !==16'h1999) tb_error("====== RRC (X(Rn) mode): test 2 (result) =====");
|
108 |
|
|
if (r7 !==16'h0001) tb_error("====== RRC (X(Rn) mode): test 2 (C flag) =====");
|
109 |
|
|
|
110 |
|
|
if (mem214 !==16'h9999) tb_error("====== RRC (X(Rn) mode): test 3 (result) =====");
|
111 |
|
|
if (r9 !==16'h0004) tb_error("====== RRC (X(Rn) mode): test 3 (C flag) =====");
|
112 |
|
|
|
113 |
|
|
if (mem216 !==16'h9999) tb_error("====== RRC (X(Rn) mode): test 4 (result) =====");
|
114 |
|
|
if (r11 !==16'h0005) tb_error("====== RRC (X(Rn) mode): test 4 (C flag) =====");
|
115 |
|
|
|
116 |
|
|
|
117 |
|
|
// Addressing mode: EDE
|
118 |
|
|
@(r15==16'h5000);
|
119 |
|
|
if (mem218 !==16'h1999) tb_error("====== RRC (EDE mode): test 1 (result) =====");
|
120 |
|
|
if (r5 !==16'h0000) tb_error("====== RRC (EDE mode): test 1 (C flag) =====");
|
121 |
|
|
|
122 |
|
|
if (mem21A !==16'h1999) tb_error("====== RRC (EDE mode): test 2 (result) =====");
|
123 |
|
|
if (r7 !==16'h0001) tb_error("====== RRC (EDE mode): test 2 (C flag) =====");
|
124 |
|
|
|
125 |
|
|
if (mem21C !==16'h9999) tb_error("====== RRC (EDE mode): test 3 (result) =====");
|
126 |
|
|
if (r9 !==16'h0004) tb_error("====== RRC (EDE mode): test 3 (C flag) =====");
|
127 |
|
|
|
128 |
|
|
if (mem21E !==16'h9999) tb_error("====== RRC (EDE mode): test 4 (result) =====");
|
129 |
|
|
if (r11 !==16'h0005) tb_error("====== RRC (EDE mode): test 4 (C flag) =====");
|
130 |
|
|
|
131 |
|
|
|
132 |
|
|
// Addressing mode: &EDE
|
133 |
|
|
@(r15==16'h6000);
|
134 |
|
|
if (mem220 !==16'h1999) tb_error("====== RRC (&EDE mode): test 1 (result) =====");
|
135 |
|
|
if (r5 !==16'h0000) tb_error("====== RRC (&EDE mode): test 1 (C flag) =====");
|
136 |
|
|
|
137 |
|
|
if (mem222 !==16'h1999) tb_error("====== RRC (&EDE mode): test 2 (result) =====");
|
138 |
|
|
if (r7 !==16'h0001) tb_error("====== RRC (&EDE mode): test 2 (C flag) =====");
|
139 |
|
|
|
140 |
|
|
if (mem224 !==16'h9999) tb_error("====== RRC (&EDE mode): test 3 (result) =====");
|
141 |
|
|
if (r9 !==16'h0004) tb_error("====== RRC (&EDE mode): test 3 (C flag) =====");
|
142 |
|
|
|
143 |
|
|
if (mem226 !==16'h9999) tb_error("====== RRC (&EDE mode): test 4 (result) =====");
|
144 |
|
|
if (r11 !==16'h0005) tb_error("====== RRC (&EDE mode): test 4 (C flag) =====");
|
145 |
|
|
|
146 |
|
|
|
147 |
|
|
// Clear Memory
|
148 |
|
|
//--------------------------------------------------------
|
149 |
|
|
@(r15==16'h7000);
|
150 |
|
|
|
151 |
|
|
|
152 |
|
|
// RRC (BYTE MODE)
|
153 |
|
|
//--------------------------------------------------------
|
154 |
|
|
|
155 |
|
|
// Addressing mode: Rn
|
156 |
|
|
@(r15==16'h8000);
|
157 |
|
|
if (r4 !==16'h0019) tb_error("====== RRC.B (Rn mode): test 1 (result) =====");
|
158 |
|
|
if (r5 !==16'h0000) tb_error("====== RRC.B (Rn mode): test 1 (C flag) =====");
|
159 |
|
|
|
160 |
|
|
if (r6 !==16'h0019) tb_error("====== RRC.B (Rn mode): test 2 (result) =====");
|
161 |
|
|
if (r7 !==16'h0001) tb_error("====== RRC.B (Rn mode): test 2 (C flag) =====");
|
162 |
|
|
|
163 |
|
|
if (r8 !==16'h0099) tb_error("====== RRC.B (Rn mode): test 3 (result) =====");
|
164 |
|
|
if (r9 !==16'h0004) tb_error("====== RRC.B (Rn mode): test 3 (C flag) =====");
|
165 |
|
|
|
166 |
|
|
if (r10 !==16'h0099) tb_error("====== RRC.B (Rn mode): test 4 (result) =====");
|
167 |
|
|
if (r11 !==16'h0005) tb_error("====== RRC.B (Rn mode): test 4 (C flag) =====");
|
168 |
|
|
|
169 |
|
|
|
170 |
|
|
// Addressing mode: @Rn (low byte)
|
171 |
|
|
@(r15==16'h9000);
|
172 |
111 |
olivier.gi |
if (mem200 !==16'h2519) tb_error("====== RRC.B (@Rn mode): test 1, low byte (result) =====");
|
173 |
|
|
if (r4 !==(`PER_SIZE+16'h0000)) tb_error("====== RRC.B (@Rn mode): test 1, low byte (address) =====");
|
174 |
|
|
if (r5 !==16'h0000) tb_error("====== RRC.B (@Rn mode): test 1, low byte (C flag) =====");
|
175 |
2 |
olivier.gi |
|
176 |
111 |
olivier.gi |
if (mem202 !==16'h2519) tb_error("====== RRC.B (@Rn mode): test 2, low byte (result) =====");
|
177 |
|
|
if (r6 !==(`PER_SIZE+16'h0002)) tb_error("====== RRC.B (@Rn mode): test 2, low byte (address) =====");
|
178 |
|
|
if (r7 !==16'h0001) tb_error("====== RRC.B (@Rn mode): test 2, low byte (C flag) =====");
|
179 |
2 |
olivier.gi |
|
180 |
111 |
olivier.gi |
if (mem204 !==16'h2599) tb_error("====== RRC.B (@Rn mode): test 3, low byte (result) =====");
|
181 |
|
|
if (r8 !==(`PER_SIZE+16'h0004)) tb_error("====== RRC.B (@Rn mode): test 3, low byte (address) =====");
|
182 |
|
|
if (r9 !==16'h0004) tb_error("====== RRC.B (@Rn mode): test 3, low byte (C flag) =====");
|
183 |
2 |
olivier.gi |
|
184 |
111 |
olivier.gi |
if (mem206 !==16'h2599) tb_error("====== RRC.B (@Rn mode): test 4, low byte (result) =====");
|
185 |
|
|
if (r10 !==(`PER_SIZE+16'h0006)) tb_error("====== RRC.B (@Rn mode): test 4, low byte (address) =====");
|
186 |
|
|
if (r11 !==16'h0005) tb_error("====== RRC.B (@Rn mode): test 4, low byte (C flag) =====");
|
187 |
2 |
olivier.gi |
|
188 |
|
|
// Addressing mode: @Rn (high byte)
|
189 |
|
|
@(r15==16'h9001);
|
190 |
111 |
olivier.gi |
if (mem208 !==16'h1925) tb_error("====== RRC.B (@Rn mode): test 1, high byte (result) =====");
|
191 |
|
|
if (r4 !==(`PER_SIZE+16'h0009)) tb_error("====== RRC.B (@Rn mode): test 1, high byte (address) =====");
|
192 |
|
|
if (r5 !==16'h0000) tb_error("====== RRC.B (@Rn mode): test 1, high byte (C flag) =====");
|
193 |
2 |
olivier.gi |
|
194 |
111 |
olivier.gi |
if (mem20A !==16'h1925) tb_error("====== RRC.B (@Rn mode): test 2, high byte (result) =====");
|
195 |
|
|
if (r6 !==(`PER_SIZE+16'h000B)) tb_error("====== RRC.B (@Rn mode): test 2, high byte (address) =====");
|
196 |
|
|
if (r7 !==16'h0001) tb_error("====== RRC.B (@Rn mode): test 2, high byte (C flag) =====");
|
197 |
2 |
olivier.gi |
|
198 |
111 |
olivier.gi |
if (mem20C !==16'h9925) tb_error("====== RRC.B (@Rn mode): test 3, high byte (result) =====");
|
199 |
|
|
if (r8 !==(`PER_SIZE+16'h000D)) tb_error("====== RRC.B (@Rn mode): test 3, high byte (address) =====");
|
200 |
|
|
if (r9 !==16'h0004) tb_error("====== RRC.B (@Rn mode): test 3, high byte (C flag) =====");
|
201 |
2 |
olivier.gi |
|
202 |
111 |
olivier.gi |
if (mem20E !==16'h9925) tb_error("====== RRC.B (@Rn mode): test 4, high byte (result) =====");
|
203 |
|
|
if (r10 !==(`PER_SIZE+16'h000F)) tb_error("====== RRC.B (@Rn mode): test 4, high byte (address) =====");
|
204 |
|
|
if (r11 !==16'h0005) tb_error("====== RRC.B (@Rn mode): test 4, high byte (C flag) =====");
|
205 |
2 |
olivier.gi |
|
206 |
|
|
|
207 |
|
|
// Addressing mode: @Rn+ (low byte)
|
208 |
|
|
@(r15==16'hA000);
|
209 |
111 |
olivier.gi |
if (mem210 !==16'h2519) tb_error("====== RRC.B (@Rn+ mode): test 1, low byte (result) =====");
|
210 |
|
|
if (r4 !==(`PER_SIZE+16'h0011)) tb_error("====== RRC.B (@Rn+ mode): test 1, low byte (address) =====");
|
211 |
|
|
if (r5 !==16'h0000) tb_error("====== RRC.B (@Rn+ mode): test 1, low byte (C flag) =====");
|
212 |
2 |
olivier.gi |
|
213 |
111 |
olivier.gi |
if (mem212 !==16'h2519) tb_error("====== RRC.B (@Rn+ mode): test 2, low byte (result) =====");
|
214 |
|
|
if (r6 !==(`PER_SIZE+16'h0013)) tb_error("====== RRC.B (@Rn+ mode): test 2, low byte (address) =====");
|
215 |
|
|
if (r7 !==16'h0001) tb_error("====== RRC.B (@Rn+ mode): test 2, low byte (C flag) =====");
|
216 |
2 |
olivier.gi |
|
217 |
111 |
olivier.gi |
if (mem214 !==16'h2599) tb_error("====== RRC.B (@Rn+ mode): test 3, low byte (result) =====");
|
218 |
|
|
if (r8 !==(`PER_SIZE+16'h0015)) tb_error("====== RRC.B (@Rn+ mode): test 3, low byte (address) =====");
|
219 |
|
|
if (r9 !==16'h0004) tb_error("====== RRC.B (@Rn+ mode): test 3, low byte (C flag) =====");
|
220 |
2 |
olivier.gi |
|
221 |
111 |
olivier.gi |
if (mem216 !==16'h2599) tb_error("====== RRC.B (@Rn+ mode): test 4, low byte (result) =====");
|
222 |
|
|
if (r10 !==(`PER_SIZE+16'h0017)) tb_error("====== RRC.B (@Rn+ mode): test 4, low byte (address) =====");
|
223 |
|
|
if (r11 !==16'h0005) tb_error("====== RRC.B (@Rn+ mode): test 4, low byte (C flag) =====");
|
224 |
2 |
olivier.gi |
|
225 |
|
|
// Addressing mode: @Rn+ (high byte)
|
226 |
|
|
@(r15==16'hA001);
|
227 |
111 |
olivier.gi |
if (mem218 !==16'h1925) tb_error("====== RRC.B (@Rn+ mode): test 1, high byte (result) =====");
|
228 |
|
|
if (r4 !==(`PER_SIZE+16'h001A)) tb_error("====== RRC.B (@Rn+ mode): test 1, high byte (address) =====");
|
229 |
|
|
if (r5 !==16'h0000) tb_error("====== RRC.B (@Rn+ mode): test 1, high byte (C flag) =====");
|
230 |
2 |
olivier.gi |
|
231 |
111 |
olivier.gi |
if (mem21A !==16'h1925) tb_error("====== RRC.B (@Rn+ mode): test 2, high byte (result) =====");
|
232 |
|
|
if (r6 !==(`PER_SIZE+16'h001C)) tb_error("====== RRC.B (@Rn+ mode): test 2, high byte (address) =====");
|
233 |
|
|
if (r7 !==16'h0001) tb_error("====== RRC.B (@Rn+ mode): test 2, high byte (C flag) =====");
|
234 |
2 |
olivier.gi |
|
235 |
111 |
olivier.gi |
if (mem21C !==16'h9925) tb_error("====== RRC.B (@Rn+ mode): test 3, high byte (result) =====");
|
236 |
|
|
if (r8 !==(`PER_SIZE+16'h001E)) tb_error("====== RRC.B (@Rn+ mode): test 3, high byte (address) =====");
|
237 |
|
|
if (r9 !==16'h0004) tb_error("====== RRC.B (@Rn+ mode): test 3, high byte (C flag) =====");
|
238 |
2 |
olivier.gi |
|
239 |
111 |
olivier.gi |
if (mem21E !==16'h9925) tb_error("====== RRC.B (@Rn+ mode): test 4, high byte (result) =====");
|
240 |
|
|
if (r10 !==(`PER_SIZE+16'h0020)) tb_error("====== RRC.B (@Rn+ mode): test 4, high byte (address) =====");
|
241 |
|
|
if (r11 !==16'h0005) tb_error("====== RRC.B (@Rn+ mode): test 4, high byte (C flag) =====");
|
242 |
2 |
olivier.gi |
|
243 |
|
|
|
244 |
|
|
// Addressing mode: X(Rn) (low byte)
|
245 |
|
|
@(r15==16'hB000);
|
246 |
|
|
if (mem220 !==16'h2519) tb_error("====== RRC.B (X(Rn) mode): test 1, low byte (result) =====");
|
247 |
|
|
if (r5 !==16'h0000) tb_error("====== RRC.B (X(Rn) mode): test 1, low byte (C flag) =====");
|
248 |
|
|
|
249 |
|
|
if (mem222 !==16'h2519) tb_error("====== RRC.B (X(Rn) mode): test 2, low byte (result) =====");
|
250 |
|
|
if (r7 !==16'h0001) tb_error("====== RRC.B (X(Rn) mode): test 2, low byte (C flag) =====");
|
251 |
|
|
|
252 |
|
|
if (mem224 !==16'h2599) tb_error("====== RRC.B (X(Rn) mode): test 3, low byte (result) =====");
|
253 |
|
|
if (r9 !==16'h0004) tb_error("====== RRC.B (X(Rn) mode): test 3, low byte (C flag) =====");
|
254 |
|
|
|
255 |
|
|
if (mem226 !==16'h2599) tb_error("====== RRC.B (X(Rn) mode): test 4, low byte (result) =====");
|
256 |
|
|
if (r11 !==16'h0005) tb_error("====== RRC.B (X(Rn) mode): test 4, low byte (C flag) =====");
|
257 |
|
|
|
258 |
|
|
// Addressing mode: X(Rn) (high byte)
|
259 |
|
|
@(r15==16'hB001);
|
260 |
|
|
if (mem228 !==16'h1925) tb_error("====== RRC.B (X(Rn) mode): test 1, high byte (result) =====");
|
261 |
|
|
if (r5 !==16'h0000) tb_error("====== RRC.B (X(Rn) mode): test 1, high byte (C flag) =====");
|
262 |
|
|
|
263 |
|
|
if (mem22A !==16'h1925) tb_error("====== RRC.B (X(Rn) mode): test 2, high byte (result) =====");
|
264 |
|
|
if (r7 !==16'h0001) tb_error("====== RRC.B (X(Rn) mode): test 2, high byte (C flag) =====");
|
265 |
|
|
|
266 |
|
|
if (mem22C !==16'h9925) tb_error("====== RRC.B (X(Rn) mode): test 3, high byte (result) =====");
|
267 |
|
|
if (r9 !==16'h0004) tb_error("====== RRC.B (X(Rn) mode): test 3, high byte (C flag) =====");
|
268 |
|
|
|
269 |
|
|
if (mem22E !==16'h9925) tb_error("====== RRC.B (X(Rn) mode): test 4, high byte (result) =====");
|
270 |
|
|
if (r11 !==16'h0005) tb_error("====== RRC.B (X(Rn) mode): test 4, high byte (C flag) =====");
|
271 |
|
|
|
272 |
|
|
// Addressing mode: EDE (low byte)
|
273 |
|
|
@(r15==16'hC000);
|
274 |
|
|
if (mem230 !==16'h2519) tb_error("====== RRC.B (EDE mode): test 1, low byte (result) =====");
|
275 |
|
|
if (r5 !==16'h0000) tb_error("====== RRC.B (EDE mode): test 1, low byte (C flag) =====");
|
276 |
|
|
|
277 |
|
|
if (mem232 !==16'h2519) tb_error("====== RRC.B (EDE mode): test 2, low byte (result) =====");
|
278 |
|
|
if (r7 !==16'h0001) tb_error("====== RRC.B (EDE mode): test 2, low byte (C flag) =====");
|
279 |
|
|
|
280 |
|
|
if (mem234 !==16'h2599) tb_error("====== RRC.B (EDE mode): test 3, low byte (result) =====");
|
281 |
|
|
if (r9 !==16'h0004) tb_error("====== RRC.B (EDE mode): test 3, low byte (C flag) =====");
|
282 |
|
|
|
283 |
|
|
if (mem236 !==16'h2599) tb_error("====== RRC.B (EDE mode): test 4, low byte (result) =====");
|
284 |
|
|
if (r11 !==16'h0005) tb_error("====== RRC.B (EDE mode): test 4, low byte (C flag) =====");
|
285 |
|
|
|
286 |
|
|
// Addressing mode: EDE (high byte)
|
287 |
|
|
@(r15==16'hC001);
|
288 |
|
|
if (mem238 !==16'h1925) tb_error("====== RRC.B (EDE mode): test 1, high byte (result) =====");
|
289 |
|
|
if (r5 !==16'h0000) tb_error("====== RRC.B (EDE mode): test 1, high byte (C flag) =====");
|
290 |
|
|
|
291 |
|
|
if (mem23A !==16'h1925) tb_error("====== RRC.B (EDE mode): test 2, high byte (result) =====");
|
292 |
|
|
if (r7 !==16'h0001) tb_error("====== RRC.B (EDE mode): test 2, high byte (C flag) =====");
|
293 |
|
|
|
294 |
|
|
if (mem23C !==16'h9925) tb_error("====== RRC.B (EDE mode): test 3, high byte (result) =====");
|
295 |
|
|
if (r9 !==16'h0004) tb_error("====== RRC.B (EDE mode): test 3, high byte (C flag) =====");
|
296 |
|
|
|
297 |
|
|
if (mem23E !==16'h9925) tb_error("====== RRC.B (EDE mode): test 4, high byte (result) =====");
|
298 |
|
|
if (r11 !==16'h0005) tb_error("====== RRC.B (EDE mode): test 4, high byte (C flag) =====");
|
299 |
|
|
|
300 |
|
|
|
301 |
|
|
// Addressing mode: &EDE (low byte)
|
302 |
|
|
@(r15==16'hD000);
|
303 |
|
|
if (mem240 !==16'h2519) tb_error("====== RRC.B (&EDE mode): test 1, low byte (result) =====");
|
304 |
|
|
if (r5 !==16'h0000) tb_error("====== RRC.B (&EDE mode): test 1, low byte (C flag) =====");
|
305 |
|
|
|
306 |
|
|
if (mem242 !==16'h2519) tb_error("====== RRC.B (&EDE mode): test 2, low byte (result) =====");
|
307 |
|
|
if (r7 !==16'h0001) tb_error("====== RRC.B (&EDE mode): test 2, low byte (C flag) =====");
|
308 |
|
|
|
309 |
|
|
if (mem244 !==16'h2599) tb_error("====== RRC.B (&EDE mode): test 3, low byte (result) =====");
|
310 |
|
|
if (r9 !==16'h0004) tb_error("====== RRC.B (&EDE mode): test 3, low byte (C flag) =====");
|
311 |
|
|
|
312 |
|
|
if (mem246 !==16'h2599) tb_error("====== RRC.B (&EDE mode): test 4, low byte (result) =====");
|
313 |
|
|
if (r11 !==16'h0005) tb_error("====== RRC.B (&EDE mode): test 4, low byte (C flag) =====");
|
314 |
|
|
|
315 |
|
|
// Addressing mode: &EDE (high byte)
|
316 |
|
|
@(r15==16'hD001);
|
317 |
|
|
if (mem248 !==16'h1925) tb_error("====== RRC.B (&EDE mode): test 1, high byte (result) =====");
|
318 |
|
|
if (r5 !==16'h0000) tb_error("====== RRC.B (&EDE mode): test 1, high byte (C flag) =====");
|
319 |
|
|
|
320 |
|
|
if (mem24A !==16'h1925) tb_error("====== RRC.B (&EDE mode): test 2, high byte (result) =====");
|
321 |
|
|
if (r7 !==16'h0001) tb_error("====== RRC.B (&EDE mode): test 2, high byte (C flag) =====");
|
322 |
|
|
|
323 |
|
|
if (mem24C !==16'h9925) tb_error("====== RRC.B (&EDE mode): test 3, high byte (result) =====");
|
324 |
|
|
if (r9 !==16'h0004) tb_error("====== RRC.B (&EDE mode): test 3, high byte (C flag) =====");
|
325 |
|
|
|
326 |
|
|
if (mem24E !==16'h9925) tb_error("====== RRC.B (&EDE mode): test 4, high byte (result) =====");
|
327 |
|
|
if (r11 !==16'h0005) tb_error("====== RRC.B (&EDE mode): test 4, high byte (C flag) =====");
|
328 |
|
|
|
329 |
|
|
stimulus_done = 1;
|
330 |
|
|
end
|
331 |
|
|
|