sureshrawal
Newbie level 1
- Joined
- Oct 28, 2012
- Messages
- 1
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,290
Hello,
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.
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.
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 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