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

Reply

VHDL - Modelsim command line: How to pass a generic parameter for my testbench ?

 
Thread Tools Search this Thread
Old 03-09-2009, 06:10 AM   #1
Default Modelsim command line: How to pass a generic parameter for my testbench ?


Hello all,

That's my first post ..

I have a testbench.vhd having the following entity:
Code:
Entity TestBench is Generic(Mode :integer:=64); -- valid values are 64/128 End TestBench;

Additionally, I wrote a file.do that compiles everything and run the testbench from the command line <linux>:
Code:
vsim -c -do file.do

The file.do looks like:
Code:
onerror { exit } exec rm -fr Project/; exec mkdir Project cd Project; vlib work; vcom ./../*.vhd; vsim -novopt -quiet work.testbench; run -all; quit -sim; exit;

Is there a way to pass the generic parameter "Mode" from the command line?

Thanks in advance,
Tarek


tarekeldeeb

Last edited by tarekeldeeb : 03-09-2009 at 06:22 AM.
tarekeldeeb is offline   Reply With Quote
Old 03-09-2009, 08:03 AM   #2
cheevu
Junior Member
 
Join Date: Jan 2008
Location: BAngalore
Posts: 5
Default
Vsim command use -g<genericname>=<value>

vsim -gMode=64 -c -do file.do


cheevu
cheevu is offline   Reply With Quote
Old 03-10-2009, 09:18 AM   #3
tarekeldeeb
Junior Member
 
Join Date: Mar 2009
Posts: 4
Default
Quote:
Originally Posted by cheevu
Vsim command use -g<genericname>=<value>

vsim -gMode=64 -c -do file.do

Furthermore, can I specify more options to check for it in the file.do
as:
vsim -gMode=64 -c -<more options> showme -do file.do

and in the file.do:

if [showme]
{add signals to wave, and view it}

Or I'm just daydreaming ?

Thanks in advance,
Tarek


tarekeldeeb

Last edited by tarekeldeeb : 03-10-2009 at 02:04 PM.
tarekeldeeb is offline   Reply With Quote
Old 03-10-2009, 10:59 AM   #4
tarekeldeeb
Junior Member
 
Join Date: Mar 2009
Posts: 4
Default
Quote:
Originally Posted by cheevu
Vsim command use -g<genericname>=<value>

vsim -gMode=64 -c -do file.do

OOps ! Sorry, but it did not work!!

Adding the "-GMode=128" to the command line call did not work.

But it worked when added to the file.do

ie: The file.do looks now like:
Code:
onerror { exit } exec rm -fr Project/; exec mkdir Project cd Project; vlib work; vcom ./../*.vhd; vsim -novopt -quiet -GMode=128 work.testbench; run -all; quit -sim; exit;


but I want to pass the generic from the command terminal, not by editing the file.do itself.

Can this be done ?


tarekeldeeb

Last edited by tarekeldeeb : 03-10-2009 at 02:08 PM.
tarekeldeeb is offline   Reply With Quote
Old 03-10-2009, 02:53 PM   #5
tarekeldeeb
Junior Member
 
Join Date: Mar 2009
Posts: 4
Default
For Allah's sake and the community,

I found the solution

in the linux terminal:
Code:
vsim -c -GMode=128 -do file.do

and in the file.do, you have to check the $argv

Code:
set x [lsearch $argv -GMode=128 ]; if "$x != -1" { set Mode 128; } if "$x == -1" { ## Default Mode set Mode 64; } .. .. vsim -novopt -quiet -GMode=$Mode work.testbench;

salam


tarekeldeeb
tarekeldeeb is offline   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




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