Hi, I have a multi stage process and each step need some time. I want to create some sequencer which is able to generate positive edges at certain intervals and at the end /beginning of the cycle reset this signals. Not that complicated, I thought, but I fail totally.
If I do it in hardware: Counter, 11 bit wide, increments at each clock cycle, some comparators, comparing the actual count against a constant and if equal, set the output for one clock cycle, ==> get my positive edge.
If I do it in Verilog:
1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
I tried two options. In the simulation, everything is fine. In real nothing works.
I use the RTL viewer and it was funny to see what the compiler thought that I want to do.
Can some body help me and tell me, how I can implement such a simple sequencer in Verilog or should I better start drawing a schematic using primitives in my Quartus Prime?
What is the target: At negedge, the counter advances/resets. At the posedge (the counter value is stable I guess ...) the counter value is compared with some constants and if there is one found to be equal, the output is 1, 0 otherwise.
I get posedges at certain poits in time (relative to the start), synchronized with the posedge of my clock.
Sorry about code formatting ..
With best regards
Gerhard