{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Discussion_02

Discussion_02 - How to read an i/p file `timescale 1ns/10ps...

Info icon This preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
How to read an i/p file? `timescale 1ns/10ps module tb; //declare input //declare output integer index reg [w-1:0] ippattern [0:L-1]; //instantiate DUT initial begin $readmemh("pattern.data", ippattern); for(index=0;index<L;index=index+1) begin @(posedge clk); in =ippattern[index]; ....... ....... end end …. ….. ….. endmodule
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
How to write an o/p file? `timescale 1ns/10ps module tb; //declare input //declare output integer ofile; //instantiate DUT initial begin ofile = $fopen("design.out"); $timeformat (-9, 0, " ns ", 5); //input stimuli $ fclose(ofile);
Image of page 2