Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to Read a file into verilog test bench and pass it to the verilog code

Status
Not open for further replies.

gadagkar.rohit

Junior Member level 2
Joined
Apr 7, 2010
Messages
23
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
San Jose
Activity points
1,439
Hi,

I need to generate a signal from MATLAB and store the data into a file and then use that file as an input to verilog code.

i just need to know how to read a file in verilog. and in what format should the file be to be able to be read in verilog.

can someone please help me with that.
 

$readmemh() is very usful for such tasks.
Need to define an array, the file should hold hex values (in text, not a binary file), readmemh loads the values into the array.
google readmemh and you'll find a few examples.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top