I know that if I am outputting a binary file in verilog, then I can use the following verilog IO standard function:
$fwrite(fd,"%u",32'hABCDE124);
But the above command writes 4-byte data into the file. What if the binary data that I want to write is only one-byte, two-bytes or three-bytes? How can I do this?
For example, I know the following won't do what I want:
$fwrite(fd,"%u",8'h24);
$fwrite(fd,"%u",16'hE124);
$fwrite(fd,"%u",24'hCDE124);
Is there any way that I can write a non 4-byte multiple data into a file?
Thanks,
--Rudy