Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored 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's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored 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.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored 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?