Hi,
I am facing issues while dumping the packets into the file in the sequence class.
Actually, I am creating a packet in the sequence class and then randomizing it
and dumping their fields in the file and finally i am sending those packets to the driver class.
But no data get dumped into the file.
So, my question is it allowed to dump the data in the file in the sequence class?
Code is:
class seq extends uvm_sequence#(uvm_sequence_item)
integer fd;
virtual task body();
//---------------------------------------------------------------------------------
packet pkt;
pkt = packet::type_id::create("pkt");
//---------------------------------------------------------------------------------
assert(pkt.randomize());
//////////////////////////////////////////////////////////////////////////////////
if(fd == 0) begin
fd = $fopen("data_write.txt", "w");
end
$fwrite(fd, "%h %h", pkt.type, pkt.value);
//////////////////////////////////////////////////////////////////////////////////
pkt.print();
start_item(ordered_set_pkt);
finish_item(ordered_set_pkt);
endfunction