source:
trunk/Octopus/test.v@
172
Last change on this file since 172 was 102, checked in by , 15 years ago | |
---|---|
File size: 5.4 KB |
Rev | Line | |
---|---|---|
[102] | 1 | module test |
2 | ( | |
3 | input wire clk, | |
4 | output wire [11:0] data | |
5 | ); | |
6 | ||
7 | reg [11:0] int_data; | |
8 | reg [15:0] counter; | |
9 | // reg [5:0] counter; | |
10 | reg [5:0] state; | |
11 | ||
12 | always @(posedge clk) | |
13 | begin | |
14 | case (state) | |
15 | /* | |
16 | 0: | |
17 | begin | |
18 | int_data <= 12'd0; | |
19 | state <= 6'd1; | |
20 | end | |
21 | ||
22 | 1: | |
23 | begin | |
24 | int_data <= 12'd1024; | |
25 | state <= 6'd2; | |
26 | end | |
27 | ||
28 | 2: | |
29 | begin | |
30 | int_data <= 12'd2048; | |
31 | state <= 6'd3; | |
32 | end | |
33 | ||
34 | 3: | |
35 | begin | |
36 | int_data <= 12'd3072; | |
37 | state <= 6'd4; | |
38 | end | |
39 | ||
40 | 4: | |
41 | begin | |
42 | int_data <= 12'd4095; | |
43 | state <= 6'd5; | |
44 | end | |
45 | ||
46 | 5: | |
47 | begin | |
48 | int_data <= 12'd3072; | |
49 | state <= 6'd6; | |
50 | end | |
51 | ||
52 | 6: | |
53 | begin | |
54 | int_data <= 12'd2048; | |
55 | state <= 6'd7; | |
56 | end | |
57 | ||
58 | 7: | |
59 | begin | |
60 | int_data <= 12'd1024; | |
61 | state <= 6'd8; | |
62 | end | |
63 | ||
64 | 8: | |
65 | begin | |
66 | int_data <= 12'd0; | |
67 | counter <= counter + 6'd1; | |
68 | if (&counter) | |
69 | begin | |
70 | state <= 6'd0; | |
71 | end | |
72 | end | |
73 | */ | |
74 | ||
75 | 6'd0: | |
76 | begin | |
77 | int_data <= 12'h030; | |
78 | state <= 6'd1; | |
79 | end | |
80 | ||
81 | 6'd1: | |
82 | begin | |
83 | int_data <= 12'h034; | |
84 | state <= 6'd2; | |
85 | end | |
86 | ||
87 | 6'd2: | |
88 | begin | |
89 | int_data <= 12'h081; | |
90 | state <= 6'd3; | |
91 | end | |
92 | ||
93 | 6'd3: | |
94 | begin | |
95 | int_data <= 12'h0f5; | |
96 | state <= 6'd4; | |
97 | end | |
98 | ||
99 | 6'd4: | |
100 | begin | |
101 | int_data <= 12'h10a; | |
102 | state <= 6'd5; | |
103 | end | |
104 | ||
105 | 6'd5: | |
106 | begin | |
107 | int_data <= 12'h11a; | |
108 | state <= 6'd6; | |
109 | end | |
110 | ||
111 | 6'd6: | |
112 | begin | |
113 | int_data <= 12'h124; | |
114 | state <= 6'd7; | |
115 | end | |
116 | ||
117 | 6'd7: | |
118 | begin | |
119 | int_data <= 12'h124; | |
120 | state <= 6'd8; | |
121 | end | |
122 | ||
123 | 6'd8: | |
124 | begin | |
125 | int_data <= 12'h12b; | |
126 | state <= 6'd9; | |
127 | end | |
128 | ||
129 | 6'd9: | |
130 | begin | |
131 | int_data <= 12'h12a; | |
132 | state <= 6'd10; | |
133 | end | |
134 | ||
135 | 6'd10: | |
136 | begin | |
137 | int_data <= 12'h12a; | |
138 | state <= 6'd11; | |
139 | end | |
140 | ||
141 | 6'd11: | |
142 | begin | |
143 | int_data <= 12'h12b; | |
144 | state <= 6'd12; | |
145 | end | |
146 | ||
147 | 6'd12: | |
148 | begin | |
149 | int_data <= 12'h12a; | |
150 | state <= 6'd13; | |
151 | end | |
152 | ||
153 | 6'd13: | |
154 | begin | |
155 | int_data <= 12'h12e; | |
156 | state <= 6'd14; | |
157 | end | |
158 | ||
159 | 6'd14: | |
160 | begin | |
161 | int_data <= 12'h12b; | |
162 | state <= 6'd15; | |
163 | end | |
164 | ||
165 | 6'd15: | |
166 | begin | |
167 | int_data <= 12'h12b; | |
168 | state <= 6'd16; | |
169 | end | |
170 | ||
171 | 6'd16: | |
172 | begin | |
173 | int_data <= 12'h12e; | |
174 | state <= 6'd17; | |
175 | end | |
176 | ||
177 | 6'd17: | |
178 | begin | |
179 | int_data <= 12'h12b; | |
180 | state <= 6'd18; | |
181 | end | |
182 | ||
183 | 6'd18: | |
184 | begin | |
185 | int_data <= 12'h12a; | |
186 | state <= 6'd19; | |
187 | end | |
188 | ||
189 | 6'd19: | |
190 | begin | |
191 | int_data <= 12'h12e; | |
192 | state <= 6'd20; | |
193 | end | |
194 | ||
195 | 6'd20: | |
196 | begin | |
197 | int_data <= 12'h12b; | |
198 | state <= 6'd21; | |
199 | end | |
200 | ||
201 | 6'd21: | |
202 | begin | |
203 | int_data <= 12'h12e; | |
204 | state <= 6'd22; | |
205 | end | |
206 | ||
207 | 6'd22: | |
208 | begin | |
209 | int_data <= 12'h12f; | |
210 | state <= 6'd23; | |
211 | end | |
212 | ||
213 | 6'd23: | |
214 | begin | |
215 | int_data <= 12'h12f; | |
216 | state <= 6'd24; | |
217 | end | |
218 | ||
219 | 6'd24: | |
220 | begin | |
221 | int_data <= 12'h12b; | |
222 | state <= 6'd25; | |
223 | end | |
224 | ||
225 | 6'd25: | |
226 | begin | |
227 | int_data <= 12'h12b; | |
228 | state <= 6'd26; | |
229 | end | |
230 | ||
231 | 6'd26: | |
232 | begin | |
233 | int_data <= 12'h12b; | |
234 | state <= 6'd27; | |
235 | end | |
236 | ||
237 | 6'd27: | |
238 | begin | |
239 | int_data <= 12'h12e; | |
240 | state <= 6'd28; | |
241 | end | |
242 | ||
243 | 6'd28: | |
244 | begin | |
245 | int_data <= 12'h12e; | |
246 | state <= 6'd29; | |
247 | end | |
248 | ||
249 | 6'd29: | |
250 | begin | |
251 | int_data <= 12'h12e; | |
252 | state <= 6'd30; | |
253 | end | |
254 | ||
255 | 6'd30: | |
256 | begin | |
257 | int_data <= 12'h12e; | |
258 | state <= 6'd31; | |
259 | end | |
260 | ||
261 | 6'd31: | |
262 | begin | |
263 | int_data <= 12'h12b; | |
264 | state <= 6'd32; | |
265 | end | |
266 | ||
267 | 6'd32: | |
268 | begin | |
269 | int_data <= 12'h12b; | |
270 | state <= 6'd33; | |
271 | end | |
272 | ||
273 | 6'd33: | |
274 | begin | |
275 | int_data <= 12'h12b; | |
276 | state <= 6'd34; | |
277 | end | |
278 | ||
279 | 6'd34: | |
280 | begin | |
281 | int_data <= 12'h12e; | |
282 | state <= 6'd35; | |
283 | end | |
284 | ||
285 | 6'd35: | |
286 | begin | |
287 | int_data <= 12'h12e; | |
288 | state <= 6'd36; | |
289 | end | |
290 | ||
291 | 6'd36: | |
292 | begin | |
293 | int_data <= 12'h12e; | |
294 | state <= 6'd37; | |
295 | end | |
296 | ||
297 | 6'd37: | |
298 | begin | |
299 | int_data <= 12'h12e; | |
300 | state <= 6'd38; | |
301 | end | |
302 | ||
303 | 6'd38: | |
304 | begin | |
305 | int_data <= 12'h12f; | |
306 | state <= 6'd39; | |
307 | end | |
308 | ||
309 | 6'd39: | |
310 | begin | |
311 | int_data <= 12'h12b; | |
312 | state <= 6'd40; | |
313 | end | |
314 | ||
315 | 6'd40: | |
316 | begin | |
317 | int_data <= 12'h12e; | |
318 | state <= 6'd41; | |
319 | end | |
320 | ||
321 | 6'd41: | |
322 | begin | |
323 | int_data <= 12'h12f; | |
324 | state <= 6'd42; | |
325 | end | |
326 | ||
327 | 6'd42: | |
328 | begin | |
329 | int_data <= 12'h0fb; | |
330 | state <= 6'd43; | |
331 | end | |
332 | ||
333 | 6'd43: | |
334 | begin | |
335 | int_data <= 12'h07e; | |
336 | state <= 6'd44; | |
337 | end | |
338 | ||
339 | 6'd44: | |
340 | begin | |
341 | int_data <= 12'h070; | |
342 | state <= 6'd45; | |
343 | end | |
344 | ||
345 | 6'd45: | |
346 | begin | |
347 | int_data <= 12'h05a; | |
348 | state <= 6'd46; | |
349 | end | |
350 | ||
351 | 6'd46: | |
352 | begin | |
353 | int_data <= 12'h045; | |
354 | state <= 6'd47; | |
355 | end | |
356 | ||
357 | 6'd47: | |
358 | begin | |
359 | int_data <= 12'h03f; | |
360 | state <= 6'd48; | |
361 | end | |
362 | ||
363 | 6'd48: | |
364 | begin | |
365 | int_data <= 12'h03b; | |
366 | state <= 6'd49; | |
367 | end | |
368 | ||
369 | 6'd49: | |
370 | begin | |
371 | int_data <= 12'h034; | |
372 | state <= 6'd50; | |
373 | end | |
374 | ||
375 | 6'd50: | |
376 | begin | |
377 | int_data <= 12'h035; | |
378 | state <= 6'd51; | |
379 | end | |
380 | ||
381 | 6'd51: | |
382 | begin | |
383 | int_data <= 12'h034; | |
384 | state <= 6'd52; | |
385 | end | |
386 | ||
387 | 6'd52: | |
388 | begin | |
389 | int_data <= 12'h034; | |
390 | state <= 6'd53; | |
391 | end | |
392 | ||
393 | 6'd53: | |
394 | begin | |
395 | int_data <= 12'h030; | |
396 | state <= 6'd54; | |
397 | end | |
398 | ||
399 | 6'd54: | |
400 | begin | |
401 | int_data <= 12'h030; | |
402 | counter <= counter + 16'd1; | |
403 | if (&counter) | |
404 | begin | |
405 | state <= 6'd0; | |
406 | end | |
407 | end | |
408 | ||
409 | default: | |
410 | begin | |
411 | state <= 6'd0; | |
412 | end | |
413 | endcase | |
414 | end | |
415 | ||
416 | assign data = int_data; | |
417 | ||
418 | endmodule |
Note:
See TracBrowser
for help on using the repository browser.