- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So it looks as if the simulator has a problem with the drive e:. Is this a network drive? What OS do you use?

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page