Question on using DC command "foreach"

Status
Not open for further replies.

aaronhe

Junior Member level 2
Joined
Jul 10, 2007
Messages
23
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Shenzhen in China
Activity points
1,466
I've written a module "transquantop" which includes four sub_modules,"trans_sram,trans4x4,quanti and transctl". All these four submodules are synthesised and get the "*.db" files.

Then I written a top script as follow:
*************
set sub_modules {trans_sram quanti trans4x4 transctl}
foreach module $submodules{set syn_db $module.db read_db syn_db}
*************

The displayed error is:
Error:wrong #args:shoule be "foreach varlist ?varlist..? command"

Can anyone helpme debug my script. thanks in advance.
 

there is some problem with second line ""foreach"
did u check for syntax?
 

Hi
there are several problems with your 'code'
Here is the corrected one
Code:
set sub_modules {trans_sram quanti trans4x4 transctl} 
foreach module $sub_modules {set syn_db $module.db}

These were your porblems:
1. you haven't given a space between $sumbodules and {
2. you have used $submodules instead of $sub_modules
3. syn_db I gues cannot have multiple options. you can only one as I have given in the example above
Kr,
Avi
http://www.vlsiip.com
 

The working code after debug is
foreach module $sub_modules { set syn_db $module.db
read_db $syn_db}

I found that the expression must be written in two lines, when I written it in one line, DC reports error.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…