View Single Post
  #3 (permalink)  
Old 06-09-2005, 03:21 PM
Chris Briggs
Guest
 
Posts: n/a
Default Re: Reading files in multiple instances of a ROM model

If you have to pass it in to the ROM model as a parameter, I don't
think there's a way to change it at simulation time since parameters
are processed during compile/elaboration.

One solution is to use fixed filenames and link them to your target
files in your run script.

e.g.,
rm -f file_1.dat file_2.dat
ln -s rom_file_1a.dat file_1.dat
ln -s rom_file_2a.dat file_2.dat
vcs|ncverilog|vsim|whatever ...

And the choice of rom_file_1a.dat or rom_file_1b.dat or
whatever_rom_file.dat would be made earlier in your script, probably
based on the test you're running, or command line options, or whatever.

-cb


[email protected] wrote:
> Hi there!
>
> I have a ROM model, and I use $readmemh to read its memory file.
>
> I have multiple instances of this ROM, and I want each to read in a
> different memory file.
>
> I know I can do this statically (at compile time) using parameters as
> follows:
>
> parameter FILE_1 = "file_1.dat";
> parameter FILE_2 = "file_2.dat";
>
> rom #(FILE_1) rom_1( ... );
> rom #(FILE_2) rom_2( ... );
>
> Is there a standard way to do this dynamically (ie, at run time),
> without having to re-compile/elaborate? I've tried a few things, but
> none has been satifactory...
>
> thanks in advance!
> marcas


Reply With Quote