R
Remco Poelstra
Guest
Hi all,
I've a problem with describing a special counter.
The counter is incremented by a clock but needs to be reset by an
external trigger (and by a reset signal).
I want to implement it as follows:
----------------
module shift_inhibit( clk,fsclk,reset,out );
input clk;
input fsclk;
input reset;
output out;
reg [4:0] counter;
wire out;
assign out = (counter<=23);
always @(fsclk)
begin
if(reset) //reset is active low
counter = 5'b11111;
end
always @(negedge reset)
begin
counter = 5'b11000;
end
always @(negedge clk)
begin
if(reset)
counter = counter + 1;
end
endmodule
---------------------------
The simulator thinks this is OK, but the synthesizer complains about the
assignment from multiple always blocks. How can I solve that?
Thanks in advance.
Kind regards,
Remco Poelstra
I've a problem with describing a special counter.
The counter is incremented by a clock but needs to be reset by an
external trigger (and by a reset signal).
I want to implement it as follows:
----------------
module shift_inhibit( clk,fsclk,reset,out );
input clk;
input fsclk;
input reset;
output out;
reg [4:0] counter;
wire out;
assign out = (counter<=23);
always @(fsclk)
begin
if(reset) //reset is active low
counter = 5'b11111;
end
always @(negedge reset)
begin
counter = 5'b11000;
end
always @(negedge clk)
begin
if(reset)
counter = counter + 1;
end
endmodule
---------------------------
The simulator thinks this is OK, but the synthesizer complains about the
assignment from multiple always blocks. How can I solve that?
Thanks in advance.
Kind regards,
Remco Poelstra