Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

single foreach_in_collection loop to traverse through two sets of collections

Status
Not open for further replies.

snehal.saini

Newbie level 6
Newbie level 6
Joined
Oct 3, 2011
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,357
[Design Compiler] single foreach_in_collection loop for 2 sets of collections

I wanted to traverse through two sets of collections with a single foreach_in_collection. i wanted something like:

for (i=0;i<10;i++)
{
A = B;
}


A & B are the 2 collections i have.
Can anyone please help me to write a tcl script for this in Design Compiler?
 

Re: [Design Compiler] single foreach_in_collection loop for 2 sets of collections

I wanted to traverse through two sets of collections with a single foreach_in_collection. i wanted something like:

for (i=0;i<10;i++)
{
A = B;
}


A & B are the 2 collections i have.
Can anyone please help me to write a tcl script for this in Design Compiler?


Hai snehal.saini,
By changing the starting initialization and condition check in for use can get what u need from that list..

set a {}
set b { 1 2 3 4}
for { set i 0} {$i < [llength $b]} {incr i} {
lappend a [lindex $b $i]
}
puts $a

This may help u.....:p

- - - Updated - - -

By changing the starting initialization and condition check in for loop.... use can get the list value what u need from that list..
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top