Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
12 years ago

a pipelining module

I am designing a pipelining module which takes the outputs (I, Q) from the previous IC (block) as it inputs. After 8 posedge of clock, it will output its result (yI, yQ). At each posedge of clk, yI<=yI+yQ; YQ<=YI-YQ; (iteratively) Therefore, somehow, I need to initialize (yI, YQ) = (I, Q) in the very beginning before the iteration. I use a initial block for this initialization. However, I keep getting warning: initial value for variables (yI, yQ) should not be constant. Any ideas on this problem? What should be the correct way to handle the situation? Simplified module as follows:module test(I, Q, clk yI, yQ);

input signed [17:0] I, Q;

output signed [17:0] yI, yQ;

integer L;

initial begin

yI = I;

yQ=Q; L=0;

end

always @(posedge clk) begin

yI <= yI + yQ;

yQ <= yI - yQ;

L <= L + 1;

end

endmodule

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Initial block is normally used to initialize the register.

    You are trying to initialize output port in the initial blobk, thix does not make sense.

    U can change the output port name and use assignment to assign yL and yQ to these output port. Anyway, initial block is only for simulation purpose only. I think u should have a reset, to initialize during reset.