Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers

$readmemb

Altera_Forum
Honored Contributor II
1,910 Views

t=[0:0.02*10^-3:0.01];a=cos(2*pi*5*10^3*t);plot(t,a) 

b=a*2^11 

fid=fopen('e:\resourse.txt','wt');fprintf(fid,'%12.0f\n',b);fclose(fid) 

 

//// 

reg [IDATA_WIDTH-1:0] fir_in[9:0]; 

reg [IDATA_WIDTH-1:0] temp; 

initial  

begin  

temp=0; 

$readmemb("e:\resourse.txt",fir_in); 

 

end 

 

I generated data with MATLAB,and then read them by $readmemb,but when simulating on modelsim,it failed,can you help me?
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
562 Views

Depending on the simulator there might be a need to use a slash instead of a back slash in the filename. It that does not help tell us more about the error.

0 Kudos
Altera_Forum
Honored Contributor II
562 Views

I not think it's this reason, because when i put the resourse on c:\ like this: 

$readmemb("c:\resourse.txt",fir_in); 

IT WORKS.
0 Kudos
Altera_Forum
Honored Contributor II
562 Views

So it looks as if the simulator has a problem with the drive e:. Is this a network drive? What OS do you use?

0 Kudos
Reply