![]() |
|
|
|||||||
![]() |
VHDL - Selecting generic at simulation time. |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
I have a testbench which reads data from a memory, which is
initialised with data from a file, the file name is a generic in the memory model. Is there some way to start the simulation which then asks which file I'd like to use to initialise the memory before the sim progresses? TIA, Niv. Niv (KP) |
|
|
|
|
#2 |
|
Posts: n/a
|
You can also use environment variables when opening a file.
I've succeded both with aldecs and mentors vhdl simulators, use $$MY_ENV_VAR for riviera, use $MY_ENV_VAR for modelsim. So something similar to this should work (can' test my self right now) file_open(status, "$$MY_PATH/my_file.ext", L.all, READ_MODE); HTH -- Pontus Pontus |
|
|
|
#3 |
|
Posts: n/a
|
If the file is opened/read dynamically in a process, then you cannot
initialize the memory array via its declaration. With a generic, you can initialize the array declaration with a function call that uses the generic, opens the file, reads the data and returns an initialized array. This initialization is done during the VHDL elaboration phase, which is "hidden" at the beginning of many simulators (before the actual simulation starts), but is an explicit step on others (e.g. Cadence). Andy Andy |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Post-Route Simulation does not give output for the first clock cycle Options | velocityreviews | Software | 0 | 04-17-2007 05:47 PM |
| USB ports reporting all installs as Generic USB Hubs | jmcgovern | Computer Support | 3 | 03-05-2007 12:30 AM |
| DVD super multi drive cd write problem.. | ashjas | Computer Support | 0 | 07-16-2006 06:14 AM |
| Serial to usb generic driver? | =?Utf-8?B?aWFuc2lja282NjY=?= | Windows 64bit | 3 | 03-07-2006 05:21 PM |
| Free Money!!! This Really Works!!! | Free Money Guy! | Computer Information | 14 | 04-27-2004 06:52 AM |