In reply to chr_sue:
In reply to rupeshblr:
The solution would look like this:
int fd;
logic [31:0] addr;
logic [31:0] data;
logic [31:0] wmask;
logic [31:0] rmask;
fd = $fopen ("data.txt" , "r");
// $fscanf returns the number of matches, i.e. 4 in your case
while ($fscanf (fd, "%0h %0h %0h %0h", addr, data, wmask, rmask) == 4) begin
// do something
end
$fclose(fd);
But using this file solution is not really smart. There is a solution without using the file.
May i know the solution without using the file ?
is it the same which you have given in the the last post
"But you are wasting your resources in terms of memory space by writing data to queues. This will slowdown your simulation. You should do a on-the-fly checking of your packet data.
You could store your write data in an associative array in the sequence. This allows data to be stored in a non-contigious way. When reading your data you can pass back the read data as a response to your sequence and compare with the data in the assoc. array. "