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 |
|
|
/* TIMER A */
|
25 |
|
|
/*---------------------------------------------------------------------------*/
|
26 |
|
|
/* Test the timer A: */
|
27 |
|
|
/* - Check the timer output unit. */
|
28 |
18 |
olivier.gi |
/* */
|
29 |
|
|
/* Author(s): */
|
30 |
|
|
/* - Olivier Girard, olgirard@gmail.com */
|
31 |
|
|
/* */
|
32 |
|
|
/*---------------------------------------------------------------------------*/
|
33 |
19 |
olivier.gi |
/* $Rev: 19 $ */
|
34 |
|
|
/* $LastChangedBy: olivier.girard $ */
|
35 |
|
|
/* $LastChangedDate: 2009-08-04 23:47:15 +0200 (Tue, 04 Aug 2009) $ */
|
36 |
2 |
olivier.gi |
/*===========================================================================*/
|
37 |
|
|
|
38 |
|
|
integer my_counter;
|
39 |
|
|
always @ (posedge mclk)
|
40 |
|
|
my_counter <= my_counter+1;
|
41 |
|
|
|
42 |
|
|
wire [15:0] tar = timerA_0.tar;
|
43 |
|
|
|
44 |
|
|
initial
|
45 |
|
|
begin
|
46 |
|
|
$display(" ===============================================");
|
47 |
|
|
$display("| START SIMULATION |");
|
48 |
|
|
$display(" ===============================================");
|
49 |
|
|
repeat(5) @(posedge mclk);
|
50 |
|
|
stimulus_done = 0;
|
51 |
|
|
|
52 |
|
|
// TIMER A TEST: COMPARATOR 0
|
53 |
|
|
//--------------------------------------------------------
|
54 |
|
|
|
55 |
|
|
// --------- Output (mode 0) ----------
|
56 |
|
|
@(mem200 === 16'h0001);
|
57 |
|
|
if (ta_out0 !== 1'b1) tb_error("====== TIMER_A COMPARE 0: Output (mode 0) =====");
|
58 |
|
|
@(mem200 === 16'h0002);
|
59 |
|
|
if (ta_out0 !== 1'b0) tb_error("====== TIMER_A COMPARE 0: Output (mode 0) =====");
|
60 |
|
|
|
61 |
|
|
|
62 |
|
|
// --------- Set (mode 1) ----------
|
63 |
|
|
@(mem200 === 16'h0003);
|
64 |
|
|
@(tar === 16'h0014);
|
65 |
|
|
if (ta_out0 !== 1'b0) tb_error("====== TIMER_A COMPARE 0: Set (mode 1) =====");
|
66 |
|
|
@(tar === 16'h0015);
|
67 |
|
|
if (ta_out0 !== 1'b1) tb_error("====== TIMER_A COMPARE 0: Set (mode 1) =====");
|
68 |
|
|
@(tar === 16'h0014);
|
69 |
|
|
if (ta_out0 !== 1'b1) tb_error("====== TIMER_A COMPARE 0: Set (mode 1) =====");
|
70 |
|
|
@(tar === 16'h0015);
|
71 |
|
|
if (ta_out0 !== 1'b1) tb_error("====== TIMER_A COMPARE 0: Set (mode 1) =====");
|
72 |
|
|
@(mem200 === 16'h0004);
|
73 |
|
|
if (ta_out0 !== 1'b0) tb_error("====== TIMER_A COMPARE 0: Set (mode 1) =====");
|
74 |
|
|
|
75 |
|
|
|
76 |
|
|
// --------- Toggle (mode 4) ----------
|
77 |
|
|
@(mem200 === 16'h0005);
|
78 |
|
|
@(tar === 16'h0014);
|
79 |
|
|
if (ta_out0 !== 1'b0) tb_error("====== TIMER_A COMPARE 0: Toggle (mode 4) =====");
|
80 |
|
|
@(tar === 16'h0015);
|
81 |
|
|
if (ta_out0 !== 1'b1) tb_error("====== TIMER_A COMPARE 0: Toggle (mode 4) =====");
|
82 |
|
|
@(tar === 16'h0014);
|
83 |
|
|
if (ta_out0 !== 1'b1) tb_error("====== TIMER_A COMPARE 0: Toggle (mode 4) =====");
|
84 |
|
|
@(tar === 16'h0015);
|
85 |
|
|
if (ta_out0 !== 1'b0) tb_error("====== TIMER_A COMPARE 0: Toggle (mode 4) =====");
|
86 |
|
|
|
87 |
|
|
|
88 |
|
|
// --------- Reset (mode 5) ----------
|
89 |
|
|
@(mem200 === 16'h0006);
|
90 |
|
|
@(tar === 16'h0014);
|
91 |
|
|
if (ta_out0 !== 1'b1) tb_error("====== TIMER_A COMPARE 0: Reset (mode 5) =====");
|
92 |
|
|
@(tar === 16'h0015);
|
93 |
|
|
if (ta_out0 !== 1'b0) tb_error("====== TIMER_A COMPARE 0: Reset (mode 5) =====");
|
94 |
|
|
@(tar === 16'h0014);
|
95 |
|
|
if (ta_out0 !== 1'b0) tb_error("====== TIMER_A COMPARE 0: Reset (mode 5) =====");
|
96 |
|
|
@(tar === 16'h0015);
|
97 |
|
|
if (ta_out0 !== 1'b0) tb_error("====== TIMER_A COMPARE 0: Reset (mode 5) =====");
|
98 |
|
|
|
99 |
|
|
|
100 |
|
|
// TIMER A TEST: COMPARATOR 1
|
101 |
|
|
//--------------------------------------------------------
|
102 |
|
|
@(r15 === 16'h1000);
|
103 |
|
|
|
104 |
|
|
// --------- Output (mode 0) ----------
|
105 |
|
|
@(mem200 === 16'h0001);
|
106 |
|
|
if (ta_out1 !== 1'b1) tb_error("====== TIMER_A COMPARE 1: Output (mode 0) =====");
|
107 |
|
|
@(mem200 === 16'h0002);
|
108 |
|
|
if (ta_out1 !== 1'b0) tb_error("====== TIMER_A COMPARE 1: Output (mode 0) =====");
|
109 |
|
|
|
110 |
|
|
|
111 |
|
|
// --------- Set (mode 1) ----------
|
112 |
|
|
@(mem200 === 16'h0003);
|
113 |
|
|
@(tar === 16'h0014);
|
114 |
|
|
if (ta_out1 !== 1'b0) tb_error("====== TIMER_A COMPARE 1: Set (mode 1) =====");
|
115 |
|
|
@(tar === 16'h0015);
|
116 |
|
|
if (ta_out1 !== 1'b1) tb_error("====== TIMER_A COMPARE 1: Set (mode 1) =====");
|
117 |
|
|
@(tar === 16'h0014);
|
118 |
|
|
if (ta_out1 !== 1'b1) tb_error("====== TIMER_A COMPARE 1: Set (mode 1) =====");
|
119 |
|
|
@(tar === 16'h0015);
|
120 |
|
|
if (ta_out1 !== 1'b1) tb_error("====== TIMER_A COMPARE 1: Set (mode 1) =====");
|
121 |
|
|
@(mem200 === 16'h0004);
|
122 |
|
|
if (ta_out1 !== 1'b0) tb_error("====== TIMER_A COMPARE 1: Set (mode 1) =====");
|
123 |
|
|
|
124 |
|
|
|
125 |
|
|
// --------- Toggle/Reset (mode 2) ----------
|
126 |
|
|
@(mem200 === 16'h0005);
|
127 |
|
|
@(tar === 16'h0014);
|
128 |
|
|
if (ta_out1 !== 1'b0) tb_error("====== TIMER_A COMPARE 1: Toggle/Reset (mode 2) =====");
|
129 |
|
|
@(tar === 16'h0015);
|
130 |
|
|
if (ta_out1 !== 1'b1) tb_error("====== TIMER_A COMPARE 1: Toggle/Reset (mode 2) =====");
|
131 |
|
|
@(tar === 16'h001f);
|
132 |
|
|
if (ta_out1 !== 1'b1) tb_error("====== TIMER_A COMPARE 1: Toggle/Reset (mode 2) =====");
|
133 |
|
|
@(tar === 16'h0020);
|
134 |
|
|
if (ta_out1 !== 1'b0) tb_error("====== TIMER_A COMPARE 1: Toggle/Reset (mode 2) =====");
|
135 |
|
|
|
136 |
|
|
@(mem200 === 16'h0006);
|
137 |
|
|
@(tar === 16'h0014);
|
138 |
|
|
if (ta_out1 !== 1'b1) tb_error("====== TIMER_A COMPARE 1: Toggle/Reset (mode 2) =====");
|
139 |
|
|
@(tar === 16'h0015);
|
140 |
|
|
if (ta_out1 !== 1'b0) tb_error("====== TIMER_A COMPARE 1: Toggle/Reset (mode 2) =====");
|
141 |
|
|
@(tar === 16'h001f);
|
142 |
|
|
if (ta_out1 !== 1'b0) tb_error("====== TIMER_A COMPARE 1: Toggle/Reset (mode 2) =====");
|
143 |
|
|
@(tar === 16'h0020);
|
144 |
|
|
if (ta_out1 !== 1'b0) tb_error("====== TIMER_A COMPARE 1: Toggle/Reset (mode 2) =====");
|
145 |
|
|
|
146 |
|
|
|
147 |
|
|
// --------- Set/Reset (mode 3) ----------
|
148 |
|
|
@(mem200 === 16'h0007);
|
149 |
|
|
@(tar === 16'h0014);
|
150 |
|
|
if (ta_out1 !== 1'b0) tb_error("====== TIMER_A COMPARE 1: Set/Reset (mode 3) =====");
|
151 |
|
|
@(tar === 16'h0015);
|
152 |
|
|
if (ta_out1 !== 1'b1) tb_error("====== TIMER_A COMPARE 1: Set/Reset (mode 3) =====");
|
153 |
|
|
@(tar === 16'h001f);
|
154 |
|
|
if (ta_out1 !== 1'b1) tb_error("====== TIMER_A COMPARE 1: Set/Reset (mode 3) =====");
|
155 |
|
|
@(tar === 16'h0020);
|
156 |
|
|
if (ta_out1 !== 1'b0) tb_error("====== TIMER_A COMPARE 1: Set/Reset (mode 3) =====");
|
157 |
|
|
|
158 |
|
|
@(mem200 === 16'h0008);
|
159 |
|
|
@(tar === 16'h0014);
|
160 |
|
|
if (ta_out1 !== 1'b1) tb_error("====== TIMER_A COMPARE 1: Set/Reset (mode 3) =====");
|
161 |
|
|
@(tar === 16'h0015);
|
162 |
|
|
if (ta_out1 !== 1'b1) tb_error("====== TIMER_A COMPARE 1: Set/Reset (mode 3) =====");
|
163 |
|
|
@(tar === 16'h001f);
|
164 |
|
|
if (ta_out1 !== 1'b1) tb_error("====== TIMER_A COMPARE 1: Set/Reset (mode 3) =====");
|
165 |
|
|
@(tar === 16'h0020);
|
166 |
|
|
if (ta_out1 !== 1'b0) tb_error("====== TIMER_A COMPARE 1: Set/Reset (mode 3) =====");
|
167 |
|
|
|
168 |
|
|
|
169 |
|
|
// --------- Toggle (mode 4) ----------
|
170 |
|
|
@(mem200 === 16'h0009);
|
171 |
|
|
@(tar === 16'h0014);
|
172 |
|
|
if (ta_out1 !== 1'b0) tb_error("====== TIMER_A COMPARE 1: Toggle (mode 4) =====");
|
173 |
|
|
@(tar === 16'h0015);
|
174 |
|
|
if (ta_out1 !== 1'b1) tb_error("====== TIMER_A COMPARE 1: Toggle (mode 4) =====");
|
175 |
|
|
@(tar === 16'h0014);
|
176 |
|
|
if (ta_out1 !== 1'b1) tb_error("====== TIMER_A COMPARE 1: Toggle (mode 4) =====");
|
177 |
|
|
@(tar === 16'h0015);
|
178 |
|
|
if (ta_out1 !== 1'b0) tb_error("====== TIMER_A COMPARE 1: Toggle (mode 4) =====");
|
179 |
|
|
|
180 |
|
|
|
181 |
|
|
// --------- Reset (mode 5) ----------
|
182 |
|
|
@(mem200 === 16'h000A);
|
183 |
|
|
@(tar === 16'h0014);
|
184 |
|
|
if (ta_out1 !== 1'b1) tb_error("====== TIMER_A COMPARE 1: Reset (mode 5) =====");
|
185 |
|
|
@(tar === 16'h0015);
|
186 |
|
|
if (ta_out1 !== 1'b0) tb_error("====== TIMER_A COMPARE 1: Reset (mode 5) =====");
|
187 |
|
|
@(tar === 16'h0014);
|
188 |
|
|
if (ta_out1 !== 1'b0) tb_error("====== TIMER_A COMPARE 1: Reset (mode 5) =====");
|
189 |
|
|
@(tar === 16'h0015);
|
190 |
|
|
if (ta_out1 !== 1'b0) tb_error("====== TIMER_A COMPARE 1: Reset (mode 5) =====");
|
191 |
|
|
|
192 |
|
|
|
193 |
|
|
// --------- Toggle/Set (mode 6) ----------
|
194 |
|
|
@(mem200 === 16'h000B);
|
195 |
|
|
@(tar === 16'h0014);
|
196 |
|
|
if (ta_out1 !== 1'b0) tb_error("====== TIMER_A COMPARE 1: Toggle/Set (mode 6) =====");
|
197 |
|
|
@(tar === 16'h0015);
|
198 |
|
|
if (ta_out1 !== 1'b1) tb_error("====== TIMER_A COMPARE 1: Toggle/Set (mode 6) =====");
|
199 |
|
|
@(tar === 16'h001f);
|
200 |
|
|
if (ta_out1 !== 1'b1) tb_error("====== TIMER_A COMPARE 1: Toggle/Set (mode 6) =====");
|
201 |
|
|
@(tar === 16'h0020);
|
202 |
|
|
if (ta_out1 !== 1'b1) tb_error("====== TIMER_A COMPARE 1: Toggle/Set (mode 6) =====");
|
203 |
|
|
|
204 |
|
|
@(mem200 === 16'h000C);
|
205 |
|
|
@(tar === 16'h0014);
|
206 |
|
|
if (ta_out1 !== 1'b1) tb_error("====== TIMER_A COMPARE 1: Toggle/Set (mode 6) =====");
|
207 |
|
|
@(tar === 16'h0015);
|
208 |
|
|
if (ta_out1 !== 1'b0) tb_error("====== TIMER_A COMPARE 1: Toggle/Set (mode 6) =====");
|
209 |
|
|
@(tar === 16'h001f);
|
210 |
|
|
if (ta_out1 !== 1'b0) tb_error("====== TIMER_A COMPARE 1: Toggle/Set (mode 6) =====");
|
211 |
|
|
@(tar === 16'h0020);
|
212 |
|
|
if (ta_out1 !== 1'b1) tb_error("====== TIMER_A COMPARE 1: Toggle/Set (mode 6) =====");
|
213 |
|
|
|
214 |
|
|
|
215 |
|
|
// --------- Reset/Set (mode 7) ----------
|
216 |
|
|
@(mem200 === 16'h000D);
|
217 |
|
|
@(tar === 16'h0014);
|
218 |
|
|
if (ta_out1 !== 1'b0) tb_error("====== TIMER_A COMPARE 1: Reset/Set (mode 7) =====");
|
219 |
|
|
@(tar === 16'h0015);
|
220 |
|
|
if (ta_out1 !== 1'b0) tb_error("====== TIMER_A COMPARE 1: Reset/Set (mode 7) =====");
|
221 |
|
|
@(tar === 16'h001f);
|
222 |
|
|
if (ta_out1 !== 1'b0) tb_error("====== TIMER_A COMPARE 1: Reset/Set (mode 7) =====");
|
223 |
|
|
@(tar === 16'h0020);
|
224 |
|
|
if (ta_out1 !== 1'b1) tb_error("====== TIMER_A COMPARE 1: Reset/Set (mode 7) =====");
|
225 |
|
|
|
226 |
|
|
@(mem200 === 16'h000E);
|
227 |
|
|
@(tar === 16'h0014);
|
228 |
|
|
if (ta_out1 !== 1'b1) tb_error("====== TIMER_A COMPARE 1: Reset/Set (mode 7) =====");
|
229 |
|
|
@(tar === 16'h0015);
|
230 |
|
|
if (ta_out1 !== 1'b0) tb_error("====== TIMER_A COMPARE 1: Reset/Set (mode 7) =====");
|
231 |
|
|
@(tar === 16'h001f);
|
232 |
|
|
if (ta_out1 !== 1'b0) tb_error("====== TIMER_A COMPARE 1: Reset/Set (mode 7) =====");
|
233 |
|
|
@(tar === 16'h0020);
|
234 |
|
|
if (ta_out1 !== 1'b1) tb_error("====== TIMER_A COMPARE 1: Reset/Set (mode 7) =====");
|
235 |
|
|
|
236 |
|
|
|
237 |
|
|
// TIMER A TEST: COMPARATOR 2
|
238 |
|
|
//--------------------------------------------------------
|
239 |
|
|
@(r15 === 16'h2000);
|
240 |
|
|
|
241 |
|
|
// --------- Output (mode 0) ----------
|
242 |
|
|
@(mem200 === 16'h0001);
|
243 |
|
|
if (ta_out2 !== 1'b1) tb_error("====== TIMER_A COMPARE 2: Output (mode 0) =====");
|
244 |
|
|
@(mem200 === 16'h0002);
|
245 |
|
|
if (ta_out2 !== 1'b0) tb_error("====== TIMER_A COMPARE 2: Output (mode 0) =====");
|
246 |
|
|
|
247 |
|
|
|
248 |
|
|
// --------- Set (mode 1) ----------
|
249 |
|
|
@(mem200 === 16'h0003);
|
250 |
|
|
@(tar === 16'h0014);
|
251 |
|
|
if (ta_out2 !== 1'b0) tb_error("====== TIMER_A COMPARE 2: Set (mode 1) =====");
|
252 |
|
|
@(tar === 16'h0015);
|
253 |
|
|
if (ta_out2 !== 1'b1) tb_error("====== TIMER_A COMPARE 2: Set (mode 1) =====");
|
254 |
|
|
@(tar === 16'h0014);
|
255 |
|
|
if (ta_out2 !== 1'b1) tb_error("====== TIMER_A COMPARE 2: Set (mode 1) =====");
|
256 |
|
|
@(tar === 16'h0015);
|
257 |
|
|
if (ta_out2 !== 1'b1) tb_error("====== TIMER_A COMPARE 2: Set (mode 1) =====");
|
258 |
|
|
@(mem200 === 16'h0004);
|
259 |
|
|
if (ta_out2 !== 1'b0) tb_error("====== TIMER_A COMPARE 2: Set (mode 1) =====");
|
260 |
|
|
|
261 |
|
|
|
262 |
|
|
// --------- Toggle/Reset (mode 2) ----------
|
263 |
|
|
@(mem200 === 16'h0005);
|
264 |
|
|
@(tar === 16'h0014);
|
265 |
|
|
if (ta_out2 !== 1'b0) tb_error("====== TIMER_A COMPARE 2: Toggle/Reset (mode 2) =====");
|
266 |
|
|
@(tar === 16'h0015);
|
267 |
|
|
if (ta_out2 !== 1'b1) tb_error("====== TIMER_A COMPARE 2: Toggle/Reset (mode 2) =====");
|
268 |
|
|
@(tar === 16'h001f);
|
269 |
|
|
if (ta_out2 !== 1'b1) tb_error("====== TIMER_A COMPARE 2: Toggle/Reset (mode 2) =====");
|
270 |
|
|
@(tar === 16'h0020);
|
271 |
|
|
if (ta_out2 !== 1'b0) tb_error("====== TIMER_A COMPARE 2: Toggle/Reset (mode 2) =====");
|
272 |
|
|
|
273 |
|
|
@(mem200 === 16'h0006);
|
274 |
|
|
@(tar === 16'h0014);
|
275 |
|
|
if (ta_out2 !== 1'b1) tb_error("====== TIMER_A COMPARE 2: Toggle/Reset (mode 2) =====");
|
276 |
|
|
@(tar === 16'h0015);
|
277 |
|
|
if (ta_out2 !== 1'b0) tb_error("====== TIMER_A COMPARE 2: Toggle/Reset (mode 2) =====");
|
278 |
|
|
@(tar === 16'h001f);
|
279 |
|
|
if (ta_out2 !== 1'b0) tb_error("====== TIMER_A COMPARE 2: Toggle/Reset (mode 2) =====");
|
280 |
|
|
@(tar === 16'h0020);
|
281 |
|
|
if (ta_out2 !== 1'b0) tb_error("====== TIMER_A COMPARE 2: Toggle/Reset (mode 2) =====");
|
282 |
|
|
|
283 |
|
|
|
284 |
|
|
// --------- Set/Reset (mode 3) ----------
|
285 |
|
|
@(mem200 === 16'h0007);
|
286 |
|
|
@(tar === 16'h0014);
|
287 |
|
|
if (ta_out2 !== 1'b0) tb_error("====== TIMER_A COMPARE 2: Set/Reset (mode 3) =====");
|
288 |
|
|
@(tar === 16'h0015);
|
289 |
|
|
if (ta_out2 !== 1'b1) tb_error("====== TIMER_A COMPARE 2: Set/Reset (mode 3) =====");
|
290 |
|
|
@(tar === 16'h001f);
|
291 |
|
|
if (ta_out2 !== 1'b1) tb_error("====== TIMER_A COMPARE 2: Set/Reset (mode 3) =====");
|
292 |
|
|
@(tar === 16'h0020);
|
293 |
|
|
if (ta_out2 !== 1'b0) tb_error("====== TIMER_A COMPARE 2: Set/Reset (mode 3) =====");
|
294 |
|
|
|
295 |
|
|
@(mem200 === 16'h0008);
|
296 |
|
|
@(tar === 16'h0014);
|
297 |
|
|
if (ta_out2 !== 1'b1) tb_error("====== TIMER_A COMPARE 2: Set/Reset (mode 3) =====");
|
298 |
|
|
@(tar === 16'h0015);
|
299 |
|
|
if (ta_out2 !== 1'b1) tb_error("====== TIMER_A COMPARE 2: Set/Reset (mode 3) =====");
|
300 |
|
|
@(tar === 16'h001f);
|
301 |
|
|
if (ta_out2 !== 1'b1) tb_error("====== TIMER_A COMPARE 2: Set/Reset (mode 3) =====");
|
302 |
|
|
@(tar === 16'h0020);
|
303 |
|
|
if (ta_out2 !== 1'b0) tb_error("====== TIMER_A COMPARE 2: Set/Reset (mode 3) =====");
|
304 |
|
|
|
305 |
|
|
|
306 |
|
|
// --------- Toggle (mode 4) ----------
|
307 |
|
|
@(mem200 === 16'h0009);
|
308 |
|
|
@(tar === 16'h0014);
|
309 |
|
|
if (ta_out2 !== 1'b0) tb_error("====== TIMER_A COMPARE 2: Toggle (mode 4) =====");
|
310 |
|
|
@(tar === 16'h0015);
|
311 |
|
|
if (ta_out2 !== 1'b1) tb_error("====== TIMER_A COMPARE 2: Toggle (mode 4) =====");
|
312 |
|
|
@(tar === 16'h0014);
|
313 |
|
|
if (ta_out2 !== 1'b1) tb_error("====== TIMER_A COMPARE 2: Toggle (mode 4) =====");
|
314 |
|
|
@(tar === 16'h0015);
|
315 |
|
|
if (ta_out2 !== 1'b0) tb_error("====== TIMER_A COMPARE 2: Toggle (mode 4) =====");
|
316 |
|
|
|
317 |
|
|
|
318 |
|
|
// --------- Reset (mode 5) ----------
|
319 |
|
|
@(mem200 === 16'h000A);
|
320 |
|
|
@(tar === 16'h0014);
|
321 |
|
|
if (ta_out2 !== 1'b1) tb_error("====== TIMER_A COMPARE 2: Reset (mode 5) =====");
|
322 |
|
|
@(tar === 16'h0015);
|
323 |
|
|
if (ta_out2 !== 1'b0) tb_error("====== TIMER_A COMPARE 2: Reset (mode 5) =====");
|
324 |
|
|
@(tar === 16'h0014);
|
325 |
|
|
if (ta_out2 !== 1'b0) tb_error("====== TIMER_A COMPARE 2: Reset (mode 5) =====");
|
326 |
|
|
@(tar === 16'h0015);
|
327 |
|
|
if (ta_out2 !== 1'b0) tb_error("====== TIMER_A COMPARE 2: Reset (mode 5) =====");
|
328 |
|
|
|
329 |
|
|
|
330 |
|
|
// --------- Toggle/Set (mode 6) ----------
|
331 |
|
|
@(mem200 === 16'h000B);
|
332 |
|
|
@(tar === 16'h0014);
|
333 |
|
|
if (ta_out2 !== 1'b0) tb_error("====== TIMER_A COMPARE 2: Toggle/Set (mode 6) =====");
|
334 |
|
|
@(tar === 16'h0015);
|
335 |
|
|
if (ta_out2 !== 1'b1) tb_error("====== TIMER_A COMPARE 2: Toggle/Set (mode 6) =====");
|
336 |
|
|
@(tar === 16'h001f);
|
337 |
|
|
if (ta_out2 !== 1'b1) tb_error("====== TIMER_A COMPARE 2: Toggle/Set (mode 6) =====");
|
338 |
|
|
@(tar === 16'h0020);
|
339 |
|
|
if (ta_out2 !== 1'b1) tb_error("====== TIMER_A COMPARE 2: Toggle/Set (mode 6) =====");
|
340 |
|
|
|
341 |
|
|
@(mem200 === 16'h000C);
|
342 |
|
|
@(tar === 16'h0014);
|
343 |
|
|
if (ta_out2 !== 1'b1) tb_error("====== TIMER_A COMPARE 2: Toggle/Set (mode 6) =====");
|
344 |
|
|
@(tar === 16'h0015);
|
345 |
|
|
if (ta_out2 !== 1'b0) tb_error("====== TIMER_A COMPARE 2: Toggle/Set (mode 6) =====");
|
346 |
|
|
@(tar === 16'h001f);
|
347 |
|
|
if (ta_out2 !== 1'b0) tb_error("====== TIMER_A COMPARE 2: Toggle/Set (mode 6) =====");
|
348 |
|
|
@(tar === 16'h0020);
|
349 |
|
|
if (ta_out2 !== 1'b1) tb_error("====== TIMER_A COMPARE 2: Toggle/Set (mode 6) =====");
|
350 |
|
|
|
351 |
|
|
|
352 |
|
|
// --------- Reset/Set (mode 7) ----------
|
353 |
|
|
@(mem200 === 16'h000D);
|
354 |
|
|
@(tar === 16'h0014);
|
355 |
|
|
if (ta_out2 !== 1'b0) tb_error("====== TIMER_A COMPARE 2: Reset/Set (mode 7) =====");
|
356 |
|
|
@(tar === 16'h0015);
|
357 |
|
|
if (ta_out2 !== 1'b0) tb_error("====== TIMER_A COMPARE 2: Reset/Set (mode 7) =====");
|
358 |
|
|
@(tar === 16'h001f);
|
359 |
|
|
if (ta_out2 !== 1'b0) tb_error("====== TIMER_A COMPARE 2: Reset/Set (mode 7) =====");
|
360 |
|
|
@(tar === 16'h0020);
|
361 |
|
|
if (ta_out2 !== 1'b1) tb_error("====== TIMER_A COMPARE 2: Reset/Set (mode 7) =====");
|
362 |
|
|
|
363 |
|
|
@(mem200 === 16'h000E);
|
364 |
|
|
@(tar === 16'h0014);
|
365 |
|
|
if (ta_out2 !== 1'b1) tb_error("====== TIMER_A COMPARE 2: Reset/Set (mode 7) =====");
|
366 |
|
|
@(tar === 16'h0015);
|
367 |
|
|
if (ta_out2 !== 1'b0) tb_error("====== TIMER_A COMPARE 2: Reset/Set (mode 7) =====");
|
368 |
|
|
@(tar === 16'h001f);
|
369 |
|
|
if (ta_out2 !== 1'b0) tb_error("====== TIMER_A COMPARE 2: Reset/Set (mode 7) =====");
|
370 |
|
|
@(tar === 16'h0020);
|
371 |
|
|
if (ta_out2 !== 1'b1) tb_error("====== TIMER_A COMPARE 2: Reset/Set (mode 7) =====");
|
372 |
|
|
|
373 |
|
|
|
374 |
|
|
stimulus_done = 1;
|
375 |
|
|
end
|
376 |
|
|
|