I have a testbench and a verilog modules. I want to write ouput of the testbench to a file anmed as output.txt. While doing this job, I want to use $monitor.
Is it possible ? If yes, can you give me pseudo code of that segment ?
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It only takes a minute to sign up.
Sign up to join this communityuse $fmonitor:
integer f;
initial begin
f = $fopen("output.txt");
$fmonitor(f, "time=%5d, v=%h\n", $time, vv);
#1000
$fclose(f);
$finish;
end
I have wrote Makefile to meet that desire ;
default :
iverilog -o verilog_testbench lab_work.v test_bench.v
odt :
./verilog_testbench > simulation.odt
txt :
./verilog_testbench > simulation.txt
I have tried Taniwha 's answer before, but It did not work. So, I have wrote Makefile.