Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Selecting generic at simulation time.

 
Thread Tools Search this Thread
Old 10-31-2009, 09:37 AM   #1
Default Selecting generic at simulation time.


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)
  Reply With Quote
Old 10-31-2009, 05:51 PM   #2
Pontus
 
Posts: n/a
Default Re: Selecting generic at simulation time.
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
  Reply With Quote
Old 11-02-2009, 04:21 PM   #3
Andy
 
Posts: n/a
Default Re: Selecting generic at simulation time.
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
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

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




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46