I’m dealing with some legacy code which is using an interface as a reset bfm. Rst is valid inside the interface when I view the waves but the output at the top level dut is X. reset_bfm is the only driver at the top level dut. I normally don’t use interface to model reset. What would cause rst to be valid inside of the interface but ‘X’ on the wire connections in the dut? Is it a problem with rst being logic?
Interface reset_bfm (input bit clk, output logic rst);
int cntr;
initial
begin
rst = 0;
cntr = 0;
end
always @(posedge clk) begin
if(cntr == 10)
begin
rst <= 1;
end
else if(cntr == 20)
begin
rst <= 0
end
if(cntr <= 20)
begin
cntr <= cntr + 1;
end
end
endinterface: reset_bfm