Forum Discussion
Altera_Forum
Honored Contributor
17 years ago$readmemb
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?3 Replies
- Altera_Forum
Honored Contributor
So it looks as if the simulator has a problem with the drive e:. Is this a network drive? What OS do you use?
- Altera_Forum
Honored Contributor
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. - Altera_Forum
Honored Contributor
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.