R
Robert Willy
Guest
Hi,
I have the following code which is generated by Simulink HDL coder. It has
two same if clause:
if (dout_re_rdenb == 1)
In verilog simulation, it is correct. I just feel the two same if clause
weird. Could you explain its meaning in the test bench?
Thanks,
always @ (posedge clk or posedge reset) // checker_dout_re
begin
if (reset == 1) begin
dout_re_timeout <= 0;
dout_re_testFailure <= 0;
dout_re_errCnt <= 0;
end
else begin
if (dout_re_rdenb == 1 ) begin
dout_re_timeout <= 0;
if (dout_re !== dout_re_repected[dout_re_addr]) begin
end
end
else if (dout_re_timeout > MAX_TIMEOUT && dout_re_rdenb == 1 ) begin
dout_re_errCnt <= dout_re_errCnt + 1;
dout_re_testFailure <= 1;
$display ("Error: Timeout not received for dout_re.");
$stop;
end
else if (dout_re_rdenb == 1) begin
dout_re_timeout <= dout_re_timeout + 1 ;
end
end
end // checker_dout_re
I have the following code which is generated by Simulink HDL coder. It has
two same if clause:
if (dout_re_rdenb == 1)
In verilog simulation, it is correct. I just feel the two same if clause
weird. Could you explain its meaning in the test bench?
Thanks,
always @ (posedge clk or posedge reset) // checker_dout_re
begin
if (reset == 1) begin
dout_re_timeout <= 0;
dout_re_testFailure <= 0;
dout_re_errCnt <= 0;
end
else begin
if (dout_re_rdenb == 1 ) begin
dout_re_timeout <= 0;
if (dout_re !== dout_re_repected[dout_re_addr]) begin
end
end
else if (dout_re_timeout > MAX_TIMEOUT && dout_re_rdenb == 1 ) begin
dout_re_errCnt <= dout_re_errCnt + 1;
dout_re_testFailure <= 1;
$display ("Error: Timeout not received for dout_re.");
$stop;
end
else if (dout_re_rdenb == 1) begin
dout_re_timeout <= dout_re_timeout + 1 ;
end
end
end // checker_dout_re