Skill Problem - Change properties of instances on schematic

Guest
I've got a task to put on all the instance and change the properties.
Though I use the function schCreateInst() to place instance on
schematic.


Some part of the codes like this:

myId = dbOpenCellViewByType(libId cellName "symbol" "" "a")
instId = schCreateInst(schId myId cellNum 1:1 "R0")
/** from the input string: spec1 = w spec2 = l **/
instId ~>spec1 = 0u /**actually this line dosen' work**/
instId ~>w = 0u /** but this line works! why????? **/

anyone could tell me how to alter it ???
 
nhalex@gmail.com wrote, on 09/22/08 08:25:
I've got a task to put on all the instance and change the properties.
Though I use the function schCreateInst() to place instance on
schematic.


Some part of the codes like this:

myId = dbOpenCellViewByType(libId cellName "symbol" "" "a")
instId = schCreateInst(schId myId cellNum 1:1 "R0")
/** from the input string: spec1 = w spec2 = l **/
instId ~>spec1 = 0u /**actually this line dosen' work**/
instId ~>w = 0u /** but this line works! why????? **/

anyone could tell me how to alter it ???
I'm guessing that you have a variable called "spec1" which has the value "w"?

If so, you can do:

dbSet(instId 0u spec1)

Effectively the ~> operator is equivalent to the dbSetq() function (when used as
an assignment; note, this isn't strictly true, but it's close enough for the
purposes of this explanation). This "q" function means that the argument is
implicitly quoted. So:

instId->w=0u

is equivalent to:

dbSetq(instId 0u w)

which is in turn equivalent to

dbSet(instId 0u 'w)

Thus, if you want the property name to be a variable, you have to prevent it
from being quoted - you have to allow it to be evaluated. So using dbSet() (and
dbGet() if you want to read the value rather than set it) is the answer
here. Assuming I've understood your question!

Regards,

Andrew.
 
On 9$B7n(B22$BF|(B, $B2<8a(B10$B;~(B22$BJ,(B, Andrew Beckett <andr...@DcEaLdEeTnEcTe.HcIoSm>
wrote:
nha...@gmail.com wrote, on 09/22/08 08:25:

I've got a task to put on all the instance and change the properties.
Though I use the function schCreateInst() to place instance on
schematic.

Some part of the codes like this:

myId = dbOpenCellViewByType(libId cellName "symbol" "" "a")
instId = schCreateInst(schId myId cellNum 1:1 "R0")
/** from the input string: spec1 = w spec2 = l **/
instId ~>spec1 = 0u /**actually this line dosen' work**/
instId ~>w = 0u /** but this line works! why????? **/

anyone could tell me how to alter it ???

I'm guessing that you have a variable called "spec1" which has the value "w"?

If so, you can do:

dbSet(instId 0u spec1)

Effectively the ~> operator is equivalent to the dbSetq() function (when used as
an assignment; note, this isn't strictly true, but it's close enough for the
purposes of this explanation). This "q" function means that the argument is
implicitly quoted. So:

instId->w=0u

is equivalent to:

dbSetq(instId 0u w)

which is in turn equivalent to

dbSet(instId 0u 'w)

Thus, if you want the property name to be a variable, you have to prevent it
from being quoted - you have to allow it to be evaluated. So using dbSet() (and
dbGet() if you want to read the value rather than set it) is the answer
here. Assuming I've understood your question!

Regards,

Andrew.
Thanks anyway~
I've got new knowledge of the functions :)
 

Welcome to EDABoard.com

Sponsor

Back
Top