Altera_Forum
Honored Contributor
16 years agoVerilog Synthesization
I could really use some help understanding how Quartus synthesizes. Below is a simple example that I believe will help me understand. I am trying to use the Vector Waveform to simulate what is happening. What I am trying to do it do is output Y1, Y2, Y3 every other time X is input (X is an 8-bit binary).
For the simulation I give X a random value every 10ns. The first time this happens I would expect Y1 to equal X, and Y2, Y3 to equal xxxxxxxx. Then the next time for Y2 to equal to first X that was input, Y1 to equal the new X, and Y3 to equal xxxxxxxx. I also expect these values to be output this time since it is every other (but this should not be relevant when looking at the values of Y1, Y2, Y3 in the waveform simulation and how they change over time). But the problem is that Y1, Y2, Y3 all equal the input value of X with every new input. So every 10ns, the value of X, Y1, Y2, Y3 are all the same, equal to whatever X was set to input at. I am sure there is something basic that I am not understanding, I really appreciate any help. Thanks. module test(X, Y1, Y2, Y3); input [7:0] X; output [7:0] Y1, Y2, Y3; reg [7:0] Y1, Y2, Y3; reg ready = 1'b1; always @(X) begin Y3 = Y2; Y2 = Y1; Y1 = X; if(ready) ready = 0; else ready = 1; if(ready) /* Output Y1, Y2, and Y3 */ end endmodule