Is it possible to create pin for each inst terminal using SK

  • Thread starter Reotaro Hashemoto
  • Start date
R

Reotaro Hashemoto

Guest
Hi,

I have one instance of a cell from certain library. How can I convert
it to block? In other words, add pin corresponding to each terminal of
this instance having the same name.

For example, if i have an nmos, I need to create a block (symbol) for
this nmos, or place 4 pins named: D, G, S, B.

If anyother instance is placed, i need to determine that
automatically.

Thanks,
Ahmad
 
Is create->cellview->from cellview what you are looking for?

I'm having some trouble understanding the question..


Cheers,
Stéphane


Reotaro Hashemoto wrote:
Hi,

I have one instance of a cell from certain library. How can I convert
it to block? In other words, add pin corresponding to each terminal of
this instance having the same name.

For example, if i have an nmos, I need to create a block (symbol) for
this nmos, or place 4 pins named: D, G, S, B.

If anyother instance is placed, i need to determine that
automatically.

Thanks,
Ahmad
 
Ahmad, if you want to create a layout from a schematic, cadence has a
tool to do that called vxl......
now to answer your question, there are skill command you can use to do
what you want
dbCreateTerm
dbCreatePin
dbCreateNet

you can also build a rod rectangle and use the pin option to make it a
pin


hope this helps
David


On Jun 7, 2:37 pm, Reotaro Hashemoto <ahmad.abdulgh...@gmail.com>
wrote:
Hi,

I have one instance of a cell from certain library. How can I convert
it to block? In other words, add pin corresponding to each terminal of
this instance having the same name.

For example, if i have an nmos, I need to create a block (symbol) for
this nmos, or place 4 pins named:  D, G, S, B.

If anyother instance is placed, i need to determine that
automatically.

Thanks,
Ahmad
 
Stephane,

No. I have tried using it, but it cannot create pin assosiated to
terminals unless I create pins manually and connect to terminals of
instance.

My case is, I've single instance per sheet, and I need to
automatically and correctly connect an i/o pin to each terminal of its
terminals with the same name.

David, thanks for the hint, yes it helps..

Cheers,
Ahmad

On Jun 8, 1:32 pm, "S. Badel" <stephane.ba...@REMOVETHISepfl.ch>
wrote:
Is create->cellview->from cellview what you are looking for?

I'm having some trouble understanding the question..

Cheers,
Stéphane

Reotaro Hashemoto wrote:
Hi,

I have one instance of a cell from certain library. How can I convert
it to block? In other words, add pin corresponding to each terminal of
this instance having the same name.

For example, if i have an nmos, I need to create a block (symbol) for
this nmos, or place 4 pins named:  D, G, S, B.

If anyother instance is placed, i need to determine that
automatically.

Thanks,
Ahmad
 
Ahmad, I think I understand better.

Below's a quick, easy way to create the symbol. The idea is to look for unconnected terminals in all
the instances, then use schPinListToSymbol to generate the symbol.

Note that it does not create the pins on the schematic. If you want that, you will have to use
schCreatePin() and dbCreateInstTerm() to create and connect the pin ; however, though the result has
correct connectivity and is netlistable, it is not human editable since the graphical objects are
not present (wires, wire labels) so the connectivity will be lost after a manual check & save. To go
one step further is a little tricky, since by creating wires without caution you can create shorts ;
in that case a simple way is to create a very small (shorter than the snap spacing) piece of wire
connecting each pin, to avoid touching an existing wire - even so, it is not bullet proof.

One possibly bullet-proof way of achieving that is to create the connectivity and then invoke
Import->Netlist View, the schematic place & route ; I'm pretty sure there's a way of calling it from
SKILL though it escapes my memory at the moment.

Cheers,
Stéphane

cv = geGetEditCellView()

;; find floating instance terminals and build pin list
termList = nil
foreach( inst cv~>instances
foreach( instTerm inst~>instTerms
when( length( instTerm~>net~>instTerms ) == 1
printf("found floating term %s of inst %s\n" instTerm~>term~>name instTerm~>inst~>name )
termList = cons( list(nil 'name instTerm~>term~>name 'direction instTerm~>term~>direction)
termList )
) ;when
) ; foreach
) ; foreach

;; create symbol
schPinListToSymbol( cv~>libName cv~>cellName "symbol" list(nil 'ports termList) )

Ahmad wrote:
Stephane,

No. I have tried using it, but it cannot create pin assosiated to
terminals unless I create pins manually and connect to terminals of
instance.

My case is, I've single instance per sheet, and I need to
automatically and correctly connect an i/o pin to each terminal of its
terminals with the same name.

David, thanks for the hint, yes it helps..

Cheers,
Ahmad

On Jun 8, 1:32 pm, "S. Badel" <stephane.ba...@REMOVETHISepfl.ch
wrote:
Is create->cellview->from cellview what you are looking for?

I'm having some trouble understanding the question..

Cheers,
Stéphane

Reotaro Hashemoto wrote:
Hi,
I have one instance of a cell from certain library. How can I convert
it to block? In other words, add pin corresponding to each terminal of
this instance having the same name.
For example, if i have an nmos, I need to create a block (symbol) for
this nmos, or place 4 pins named: D, G, S, B.
If anyother instance is placed, i need to determine that
automatically.
Thanks,
Ahmad
 
Thanks again Stephane for the great help...

I could use your code to create a symbol out of the schematic view.
But when I try to netlist this symbol (after being instantiated in a
new sheet) it gives me error for each of its terminals like this:

ERROR: Netlister : terminal 'B' found in cell 'testSym', view 'symbol'
does not exist in cell 'testSym' view 'schematic'.

I think this is because I don't have 'pins' in the schematic view
corresponding to those on symbol.

Is it possible, as you mentioned, to create very short net on each
terminal in schematic view, then go to an empty place in the sheet,
draw floating wires with labels having same names as those on
terminals, then connect to pins? I think this would solve it, but
don't know exactly how to do that.

Best regards,
Ahmad

On Jun 9, 1:00 am, "S. Badel" <stephane.ba...@REMOVETHISepfl.ch>
wrote:
Ahmad, I think I understand better.

Below's a quick, easy way to create the symbol. The idea is to look for unconnected terminals in all
the instances, then use schPinListToSymbol to generate the symbol.

Note that it does not create the pins on the schematic. If you want that, you will have to use
schCreatePin() and dbCreateInstTerm() to create and connect the pin ; however, though the result has
correct connectivity and is netlistable, it is not human editable since the graphical objects are
not present (wires, wire labels) so the connectivity will be lost after a manual check & save. To go
one step further is a little tricky, since by creating wires without caution you can create shorts ;
in that case a simple way is to create a very small (shorter than the snap spacing) piece of wire
connecting each pin, to avoid touching an existing wire - even so, it is not bullet proof.

One possibly bullet-proof way of achieving that is to create the connectivity and then invoke
Import->Netlist View, the schematic place & route ; I'm pretty sure there's a way of calling it from
SKILL though it escapes my memory at the moment.

Cheers,
Stéphane

cv = geGetEditCellView()

;; find floating instance terminals and build pin list
termList = nil
foreach( inst cv~>instances
  foreach( instTerm inst~>instTerms
   when( length( instTerm~>net~>instTerms ) == 1
    printf("found floating term %s of inst %s\n" instTerm~>term~>name instTerm~>inst~>name )
    termList = cons( list(nil 'name instTerm~>term~>name 'direction instTerm~>term~>direction)
termList )
   ) ;when
  ) ; foreach
) ; foreach

;; create symbol
schPinListToSymbol( cv~>libName cv~>cellName "symbol" list(nil 'ports termList) )

Ahmad wrote:
Stephane,

No. I have tried using it, but it cannot create pin assosiated to
terminals unless I create pins manually and connect to terminals of
instance.

My case is, I've single instance per sheet, and I need to
automatically and correctly connect an i/o pin to each terminal of its
terminals with the same name.

David, thanks for the hint, yes it helps..

Cheers,
Ahmad

On Jun 8, 1:32 pm, "S. Badel" <stephane.ba...@REMOVETHISepfl.ch
wrote:
Is create->cellview->from cellview what you are looking for?

I'm having some trouble understanding the question..

Cheers,
Stéphane

Reotaro Hashemoto wrote:
Hi,
I have one instance of a cell from certain library. How can I convert
it to block? In other words, add pin corresponding to each terminal of
this instance having the same name.
For example, if i have an nmos, I need to create a block (symbol) for
this nmos, or place 4 pins named:  D, G, S, B.
If anyother instance is placed, i need to determine that
automatically.
Thanks,
Ahmad
 
Hi Ahmad,

I had some spare time so I put together the following code. Hope this solves your problem...

Cheers,
Stéphane


procedure( SBCreateSymbol( @optional (cv geGetEditCellView()) )
let( (termList)
termList = nil

foreach( inst cv~>instances
foreach( instTerm inst~>instTerms
when( length( instTerm~>net~>instTerms ) == 1 && null(instTerm~>net~>pins)
printf("found floating term %s of inst %s\n" instTerm~>term~>name instTerm~>inst~>name )
termList = cons( list(nil 'name instTerm~>term~>name 'direction instTerm~>term~>direction)
termList )
SBConnectPin( instTerm instTerm~>term~>name )
) ;when
) ; foreach
) ; foreach

;; create pins
SBCreatePins( cv termList )

;; save
dbSave( cv )

;; create symbol
schPinListToSymbol( cv~>libName cv~>cellName "symbol" schSchemToPinList(cv~>libName cv~>cellName
cv~>viewName) )

;; check
schCheck( cv )

) ; let
) ; procedure


procedure( SBCreatePins( cv termList )
let( (x y ipin opin iopin)
x = int((caar(cv~>bBox) - 4*0.0625)/0.0625)*0.0625
y = int(cadar(cv~>bBox)/0.0625)*0.0625
ipin = dbOpenCellViewByType("basic" "ipin" "symbol" nil "r")
opin = dbOpenCellViewByType("basic" "opin" "symbol" nil "r")
iopin = dbOpenCellViewByType("basic" "iopin" "symboll" nil "r")
foreach( term termList
unless(dbFindTermByName(cv term->name)
printf("Creating pin %s\n" term->name)
schCreatePin(
cv
case(term->direction ("input" ipin) ("output" opin) ("inputOutput" iopin) (t ipin))
term->name
term->direction
nil
list(x y)
"R180"
)
y = y + 4*0.0625
) ; unless
) ; foreach
mapcar('dbClose list(ipin opin iopin))
) ; let
) ; procedure

procedure( SBConnectPin( instTerm netName @optional (wireLen 0.0625) (textSize 0.0625) )
let( (instBox pinBox xa xb ya yb x1 y1 x2 y2 mywire mylabel orient (cv instTerm~>cellView))

;; instance and pin coordinates
pinBox = dbTransformBBox( car(instTerm~>term~>pins~>fig~>bBox) instTerm~>inst~>transform )
instBox = dbTransformBBox( or(car(exists(x instTerm~>inst~>master~>shapes x~>lpp=='("instance"
"drawing")))~>bBox instTerm~>inst~>bBox) instTerm~>inst~>transform )

;; calculate the center of instTerm
xa = caar(pinBox)
xb = caadr(pinBox)
ya = cadar(pinBox)
yb = cadadr(pinBox)
x1 = (xa + xb)/2
y1 = (ya + yb)/2

;; try to figure direction of wire from position of terminal
cond(
(caar(pinBox)<caar(instBox) x2=x1-wireLen y2=y1 orient="R0" ) ;; leftwards
(caadr(pinBox)>caadr(instBox) x2=x1+wireLen y2=y1 orient="R0" ) ;; rightwards
(cadar(pinBox)<cadar(instBox) x2=x1 y2=y1-wireLen orient="R90") ;; downwards
(cadadr(pinBox)>cadadr(instBox) x2=x1 y2=y1+wireLen orient="R90") ;; upwards
(t x2=x1 y2=y1+wireLen orient="R90") ;; upwards by default
) ; cond

;; delete existing wires
;; mapcar( 'dbDeleteObject setof(x cv~>shapes x~>objType=="line" && member(instTerm
x~>net~>instTerms) && member(list(x1 y1) x~>points)) )

mywire = schCreateWire(
cv
"draw"
"direct"
list( list(x1 y1) list(x2 y2) )
0.0625
0.0625
0.0
)

mylabel = schCreateWireLabel(
cv
car(mywire)
list( x2 y2 )
netName
"lowerCenter"
orient
"stick"
textSize
nil
)

) ; let
) ; procedure



Ahmad wrote:
Thanks again Stephane for the great help...

I could use your code to create a symbol out of the schematic view.
But when I try to netlist this symbol (after being instantiated in a
new sheet) it gives me error for each of its terminals like this:

ERROR: Netlister : terminal 'B' found in cell 'testSym', view 'symbol'
does not exist in cell 'testSym' view 'schematic'.

I think this is because I don't have 'pins' in the schematic view
corresponding to those on symbol.

Is it possible, as you mentioned, to create very short net on each
terminal in schematic view, then go to an empty place in the sheet,
draw floating wires with labels having same names as those on
terminals, then connect to pins? I think this would solve it, but
don't know exactly how to do that.

Best regards,
Ahmad

On Jun 9, 1:00 am, "S. Badel" <stephane.ba...@REMOVETHISepfl.ch
wrote:
Ahmad, I think I understand better.

Below's a quick, easy way to create the symbol. The idea is to look for unconnected terminals in all
the instances, then use schPinListToSymbol to generate the symbol.

Note that it does not create the pins on the schematic. If you want that, you will have to use
schCreatePin() and dbCreateInstTerm() to create and connect the pin ; however, though the result has
correct connectivity and is netlistable, it is not human editable since the graphical objects are
not present (wires, wire labels) so the connectivity will be lost after a manual check & save. To go
one step further is a little tricky, since by creating wires without caution you can create shorts ;
in that case a simple way is to create a very small (shorter than the snap spacing) piece of wire
connecting each pin, to avoid touching an existing wire - even so, it is not bullet proof.

One possibly bullet-proof way of achieving that is to create the connectivity and then invoke
Import->Netlist View, the schematic place & route ; I'm pretty sure there's a way of calling it from
SKILL though it escapes my memory at the moment.

Cheers,
Stéphane

cv = geGetEditCellView()

;; find floating instance terminals and build pin list
termList = nil
foreach( inst cv~>instances
foreach( instTerm inst~>instTerms
when( length( instTerm~>net~>instTerms ) == 1
printf("found floating term %s of inst %s\n" instTerm~>term~>name instTerm~>inst~>name )
termList = cons( list(nil 'name instTerm~>term~>name 'direction instTerm~>term~>direction)
termList )
) ;when
) ; foreach
) ; foreach

;; create symbol
schPinListToSymbol( cv~>libName cv~>cellName "symbol" list(nil 'ports termList) )

Ahmad wrote:
Stephane,
No. I have tried using it, but it cannot create pin assosiated to
terminals unless I create pins manually and connect to terminals of
instance.
My case is, I've single instance per sheet, and I need to
automatically and correctly connect an i/o pin to each terminal of its
terminals with the same name.
David, thanks for the hint, yes it helps..
Cheers,
Ahmad
On Jun 8, 1:32 pm, "S. Badel" <stephane.ba...@REMOVETHISepfl.ch
wrote:
Is create->cellview->from cellview what you are looking for?
I'm having some trouble understanding the question..
Cheers,
Stéphane
Reotaro Hashemoto wrote:
Hi,
I have one instance of a cell from certain library. How can I convert
it to block? In other words, add pin corresponding to each terminal of
this instance having the same name.
For example, if i have an nmos, I need to create a block (symbol) for
this nmos, or place 4 pins named: D, G, S, B.
If anyother instance is placed, i need to determine that
automatically.
Thanks,
Ahmad
 
Hello Stephane,

Thanks a lot for the wonderful script, it's really excellent.

Sorry for the late reply, since I've been in a vacation with no email
no internet access trying to have some relaxation away of work
environment :-D

Could you please tell me how can I make similar thing in layout side?
I.e create symbol (or even place pins on instance)

I tried to get the location of all "terminals" for instances placed in
layout view (how do they named?) using the same way u used, but it
seems the the ~> operator params differes between layout and
schematic..

Can anybody help?

Best regards,
Ahmad

On Jun 10, 7:05 pm, "S. Badel" <stephane.ba...@REMOVETHISepfl.ch>
wrote:
Hi Ahmad,

I had some spare time so I put together the following code. Hope this solves your problem...

Cheers,
Stéphane

procedure( SBCreateSymbol( @optional (cv geGetEditCellView()) )
  let( (termList)
   termList = nil

   foreach( inst cv~>instances
    foreach( instTerm inst~>instTerms
     when( length( instTerm~>net~>instTerms ) == 1 && null(instTerm~>net~>pins)
      printf("found floating term %s of inst %s\n" instTerm~>term~>name instTerm~>inst~>name )
      termList = cons( list(nil 'name instTerm~>term~>name 'direction instTerm~>term~>direction)
termList )
      SBConnectPin( instTerm instTerm~>term~>name )
     ) ;when
    ) ; foreach
   ) ; foreach

   ;; create pins
   SBCreatePins( cv termList )

   ;; save
   dbSave( cv )

   ;; create symbol
   schPinListToSymbol( cv~>libName cv~>cellName "symbol" schSchemToPinList(cv~>libName cv~>cellName
cv~>viewName) )

   ;; check
   schCheck( cv )

  ) ; let
) ; procedure

procedure( SBCreatePins( cv termList )
  let( (x y ipin opin iopin)
   x = int((caar(cv~>bBox) - 4*0.0625)/0.0625)*0.0625
   y = int(cadar(cv~>bBox)/0.0625)*0.0625
   ipin = dbOpenCellViewByType("basic" "ipin" "symbol" nil "r")
   opin = dbOpenCellViewByType("basic" "opin" "symbol" nil "r")
   iopin = dbOpenCellViewByType("basic" "iopin" "symboll" nil "r")
   foreach( term termList
    unless(dbFindTermByName(cv term->name)
     printf("Creating pin %s\n" term->name)
     schCreatePin(
      cv
        case(term->direction ("input" ipin) ("output" opin) ("inputOutput" iopin) (t ipin))
        term->name
        term->direction
        nil
        list(x y)
        "R180"
     )
     y = y + 4*0.0625
    ) ; unless
   ) ; foreach
   mapcar('dbClose list(ipin opin iopin))
  ) ; let
) ; procedure

procedure( SBConnectPin( instTerm netName @optional (wireLen 0.0625) (textSize 0.0625) )
  let( (instBox pinBox xa xb ya yb x1 y1 x2 y2 mywire mylabel orient (cv instTerm~>cellView))

   ;; instance and pin coordinates
   pinBox = dbTransformBBox( car(instTerm~>term~>pins~>fig~>bBox) instTerm~>inst~>transform )
   instBox = dbTransformBBox( or(car(exists(x instTerm~>inst~>master~>shapes x~>lpp=='("instance"
"drawing")))~>bBox instTerm~>inst~>bBox) instTerm~>inst~>transform )

   ;; calculate the center of instTerm
   xa = caar(pinBox)
   xb = caadr(pinBox)
   ya = cadar(pinBox)
   yb = cadadr(pinBox)
   x1 = (xa + xb)/2
   y1 = (ya + yb)/2

   ;; try to figure direction of wire from position of terminal
   cond(
    (caar(pinBox)<caar(instBox)      x2=x1-wireLen y2=y1 orient="R0" )     ;; leftwards
    (caadr(pinBox)>caadr(instBox)    x2=x1+wireLen y2=y1 orient="R0" )     ;; rightwards
    (cadar(pinBox)<cadar(instBox)    x2=x1 y2=y1-wireLen orient="R90")     ;; downwards
    (cadadr(pinBox)>cadadr(instBox)  x2=x1 y2=y1+wireLen orient="R90")     ;; upwards
    (t                               x2=x1 y2=y1+wireLen orient="R90")        ;; upwards by default
   ) ; cond

   ;; delete existing wires
   ;; mapcar( 'dbDeleteObject setof(x cv~>shapes x~>objType=="line" && member(instTerm
x~>net~>instTerms) && member(list(x1 y1) x~>points)) )

   mywire = schCreateWire(
    cv
    "draw"
    "direct"
    list( list(x1 y1) list(x2 y2) )
    0.0625
    0.0625
    0.0
   )

   mylabel = schCreateWireLabel(
    cv
    car(mywire)
    list( x2 y2 )
    netName
    "lowerCenter"
    orient
    "stick"
    textSize
    nil
   )

  ) ; let
) ; procedure

Ahmad wrote:
Thanks again Stephane for the great help...

I could use your code to create a symbol out of the schematic view.
But when I try to netlist this symbol (after being instantiated in a
new sheet) it gives me error for each of its terminals like this:

ERROR: Netlister : terminal 'B' found in cell 'testSym', view 'symbol'
does not exist in cell 'testSym' view 'schematic'.

I think this is because I don't have 'pins' in the schematic view
corresponding to those on symbol.

Is it possible, as you mentioned, to create very short net on each
terminal in schematic view, then go to an empty place in the sheet,
draw floating wires with labels having same names as those on
terminals, then connect to pins? I think this would solve it, but
don't know exactly how to do that.

Best regards,
Ahmad

On Jun 9, 1:00 am, "S. Badel" <stephane.ba...@REMOVETHISepfl.ch
wrote:
Ahmad, I think I understand better.

Below's a quick, easy way to create the symbol. The idea is to look for unconnected terminals in all
the instances, then use schPinListToSymbol to generate the symbol.

Note that it does not create the pins on the schematic. If you want that, you will have to use
schCreatePin() and dbCreateInstTerm() to create and connect the pin ; however, though the result has
correct connectivity and is netlistable, it is not human editable since the graphical objects are
not present (wires, wire labels) so the connectivity will be lost after a manual check & save. To go
one step further is a little tricky, since by creating wires without caution you can create shorts ;
in that case a simple way is to create a very small (shorter than the snap spacing) piece of wire
connecting each pin, to avoid touching an existing wire - even so, it is not bullet proof.

One possibly bullet-proof way of achieving that is to create the connectivity and then invoke
Import->Netlist View, the schematic place & route ; I'm pretty sure there's a way of calling it from
SKILL though it escapes my memory at the moment.

Cheers,
Stéphane

cv = geGetEditCellView()

;; find floating instance terminals and build pin list
termList = nil
foreach( inst cv~>instances
  foreach( instTerm inst~>instTerms
   when( length( instTerm~>net~>instTerms ) == 1
    printf("found floating term %s of inst %s\n" instTerm~>term~>name instTerm~>inst~>name )
    termList = cons( list(nil 'name instTerm~>term~>name 'direction instTerm~>term~>direction)
termList )
   ) ;when
  ) ; foreach
) ; foreach

;; create symbol
schPinListToSymbol( cv~>libName cv~>cellName "symbol" list(nil 'ports termList) )

Ahmad wrote:
Stephane,
No. I have tried using it, but it cannot create pin assosiated to
terminals unless I create pins manually and connect to terminals of
instance.
My case is, I've single instance per sheet, and I need to
automatically and correctly connect an i/o pin to each terminal of its
terminals with the same name.
David, thanks for the hint, yes it helps..
Cheers,
Ahmad
On Jun 8, 1:32 pm, "S. Badel" <stephane.ba...@REMOVETHISepfl.ch
wrote:
Is create->cellview->from cellview what you are looking for?
I'm having some trouble understanding the question..
Cheers,
Stéphane
Reotaro Hashemoto wrote:
Hi,
I have one instance of a cell from certain library. How can I convert
it to block? In other words, add pin corresponding to each terminal of
this instance having the same name.
For example, if i have an nmos, I need to create a block (symbol) for
this nmos, or place 4 pins named:  D, G, S, B.
If anyother instance is placed, i need to determine that
automatically.
Thanks,
Ahmad
 

Welcome to EDABoard.com

Sponsor

Back
Top