# Output internal reg to a .txt in Verilog

I would like to write an internal reg to a txt file.

I have tried something like:

    f = $fopen("conv2_tb_output.txt","w");$fmonitor(f, value=%d\n", mat_out);