I have three variables, x,y,z which acts as an input to my SV model. Each of the input are of 16bit length binary data and I have 500 values of them. I need to supply them as input to my module at every posedge of the clock and each after #20ns delay. This is via the TB and also I need to write the output values into a text file. Can someone help me with code. Here is what I have written.
logic [15:0] X,Y,Z;
logic clk, vectornum;
logic [15:0] testvectors [499:0];
or or1(.*);
initial begin
clk =0;
forever #5ns clk #~clk;
end
initial $readmemb("xyz.txt",testvectors);
always@(posedge clk)
begin
#20 {X,Y,Z};
testvectors[vectornum];
vectornum=vectornum+1;
end