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