Thanks!
It helped alot! =)
That code above let me have a clearer understanding of $fopen and $fwrite.
The counter result, hmm, actually what i meant was that i was intending to use a counter, and display the outcome of the counter into a .txt file. But i dont really know what should i call it. =/
I realise there is another approach by using a clock, reset, row counter and column counter. The number of rows and column i may need to do comes in hundreds and thousands, and needed a reset function.
I am not very sure with this. I thought the program should be something like this shown below.
always@(posedge clk)
begin
if(col_cnt>5)
begin
col_cnt<=col_cnt+1;
$fwrite(file_out,"%d %d %d %d %d ",din);
end
else
col_cnt<=0;
end
always @(posedge clk1)
begin
clk<=~clk;
end
always@(posedge clk1)
begin
if(row>5)
row_cnt<=row_cnt+1;
$fwrite(file_out,"\n");
else
begin
row_cnt<=0;
end
end
endmodule
But i am not very sure about the clock thingy, but its pretty much required in my project. Hope somebody can kindly help me and guide me thru. Thanks!