I have to read binary file to testbench

Status
Not open for further replies.

kinjarapudushyanth

Newbie level 1
Joined
Nov 12, 2010
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,287
Hello sir,

I am using ISE 13.1 simulator for my project. I need to input the values from tesh bench. these input values are to be read from binary file. I used $readmemb("C:\my documents\data.bin",my_data); I am unable to receive binary values from file. I even tried read() comman it is also not working. Can anyone please help me with a example.

Thanks,
Dus
 

present a model for you:

//------------------Load file(Binary/Hex)----------------------------------------
reg [11:0] data_mem[0:16384]; //define a 12bit*16384 array
initial
begin
$readmemh("adc.txt",data_mem); //load data to data_mem
end
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…