I have a module that writes two hexadecimal values to a text file say “abc.txt”. I am using the $fdisplay(edit 1: tried $fwrite as well) construct in SV and have two print statements for debugging above and below the $fdisplay.
Upon running, the log has debug prints, however, the file abc.txt is empty
Sharing the code snippet
always @ (posedge clk)
begin
$display("file write debug outside if");
if(dut_wvalid)
begin
$display("file write debug inside if");
$fwrite(fd1,"%h %h",awaddr,wdata);
$display("write executed above this");
end
end