Hello, I'd like to write a value in a file. This is the code I have
implemented:
1 | task speed;
|
2 | input [23:0] v;
|
3 | input [23:0] s;
|
4 | integer f;
|
5 | begin
|
6 | f = $fopen("test.txt","w");
|
7 | if (!f) begin
|
8 | $display("Could not open \"test.txt\"");
|
9 | end else begin
|
10 | #70000;
|
11 |
|
12 | for(int i=0; i<24; i++) begin
|
13 | $fwrite(f,"%b", s[i]);
|
14 | end
|
15 | end
|
16 | #10000
|
17 | $fclose(f);
|
18 | end
|
19 | endtask
|
Unfortunately, what I read is "xxxxxxxxxxxxxxxxxxxxxxxx". I was thinking
that this happens since the date is not available when I try to write
it, so I put a delay, but it's not still working. Can anyone help me
please?