i am writing one verilog code
my number is 128 bit number and it will generate different number in every clock cycle
so i need to write each and every number in a file
can u please help me how can i do that?
Hi Vinod,
First open file using $fopen task in an initial block.
Then you can use $fdisplay task. Let's assume your number changes on rising edge of the clock, then I would read its value on falling edge
always @(negedge clk)
$fdisplay(fid1,"%d", theNumber);
Before ending simulation you'll need to close the file ID.
Start doing, debugging errors you will learn better, then using ready code.
Other than my increased level of confusion, seriously, try using google sometimes. This one is no worse than some other complacent posts on this forum, but sometimes ... Just for the fun of it I just did a cut & paste of "how to write output in file (in veriliog)" into google, and even that turns up pretty relevant answers.