spman
Advanced Member level 4
- Joined
- Aug 15, 2010
- Messages
- 113
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,296
- Activity points
- 2,061
Hi,
I have a problem with simulation.
I want to write the value of a signal into a file at positive edge of another signal. How should I use file commands to achieve it?
I wrote this code
But it doesn't work!
I have a problem with simulation.
I want to write the value of a signal into a file at positive edge of another signal. How should I use file commands to achieve it?
I wrote this code
Code:
initial begin
FileW = $fopen("dataout.txt", "w");
forever begin
if (Enable) begin
#10; //prevent writing frequently. clk is 10 ns
$fwrite(FileW, "A=%d B=%d C=%d\n", A, B, C);
end
end
end