M
mag
Guest
We model our async resets like this:
module AsyncResetFlop(flopout, flopin, clr_bar, clock);
output [WIDTH-1:0] flopout;
input [WIDTH-1:0] flopin;
input clr_bar;
input clock;
reg [WIDTH-1:0] temp;
// synopsys async_set_reset "clr_bar"
// cadence async_set_reset "clr_bar"
assign flopout = temp;
always @(posedge clock or negedge clr_bar) begin
if (!clr_bar) temp <= #1 {WIDTH{1'b0}};
else temp <= #1 flopin;
end
endmodule
The thing that bugs me is that we qualify reset with 'if (!clr_bar)'
and not 'if (clr_bar == 1'b0)' which I have observed results in this
flop reseting when clr_bar == 1'bx and the clock is running.
Can someone tell me what are some of the dangers besides gate-to-RTL
modeling mismatches? Has anyone ever observed bugs escaping to silicon
or other problems from modeling flops like this? I know it's a widely
proffered modeling pattern.
module AsyncResetFlop(flopout, flopin, clr_bar, clock);
output [WIDTH-1:0] flopout;
input [WIDTH-1:0] flopin;
input clr_bar;
input clock;
reg [WIDTH-1:0] temp;
// synopsys async_set_reset "clr_bar"
// cadence async_set_reset "clr_bar"
assign flopout = temp;
always @(posedge clock or negedge clr_bar) begin
if (!clr_bar) temp <= #1 {WIDTH{1'b0}};
else temp <= #1 flopin;
end
endmodule
The thing that bugs me is that we qualify reset with 'if (!clr_bar)'
and not 'if (clr_bar == 1'b0)' which I have observed results in this
flop reseting when clr_bar == 1'bx and the clock is running.
Can someone tell me what are some of the dangers besides gate-to-RTL
modeling mismatches? Has anyone ever observed bugs escaping to silicon
or other problems from modeling flops like this? I know it's a widely
proffered modeling pattern.