|
发表于 2021-12-29 11:03:42
|
显示全部楼层
How to make a pin from net (or wire)?
shyoon23 days ago
Hello Guys,
I want to automatically make pins from Net name or symbols. (Cadence version : 6.1.8) And I do not know the SKill well. Can I get some help?
Thank you!
-
Kevin Buck23 days ago
This should get you started. The first line creates a net in the object newSchView, the second line creates a terminal and the third line generates a pin on the schematic canvas. The last line also draws a wire but that part is not explicitly necessary. You should be able to find these functions in the documentation to figure out exactly what you're trying to do as it's not totally clear from your post.
newInputNet = dbCreateNet(newSchView nth(0 nth(0 term~>pins~>figs~>net~>name)))
newInputTerm = dbCreateTerm(newInputNet nil "input")
schCreatePin(newSchView inputCVId nth(0 nth(0 term~>pins~>figs~>net~>name)) "input" nil 0:ypin_ofs "R0")
schCreateWire(newSchView "draw" "full" list(0:ypin_ofs xpin_ofs:ypin_ofs) 0.0625 0.0625 0.0 )
-
shyoon23 days agoin reply to Kevin Buck
Hi Kevin,
Thank you for your quick reply. I want to print to be created automatically according to the net applied to the symbol.
For example, if it is an input, the pin wants an input pin to be created, and if it is an input output, I want an input output pin to be created automatically. Is it possible this?
Thank you!
-
Kevin Buck23 days agoin reply to shyoon
As far as I'm aware nets themselves are not directional. If you have some way of determining which direction you want then of course you can set the direction, the example I gave you shows a pin/terminal configured as "input" but you can just as easily specify "output" or "inputOutput".
-
shyoon23 days agoin reply to Kevin Buck
How can I use this? Please help me.
-
Kevin Buck23 days agoin reply to shyoon
I'm not sure what you are asking for. You can change the direction of the pin/terminal if you wish. In the code I provided you simply replace "input" with whatever pin direction you want. The documentation also has information explaining the different inputs to the functions. There is one part I forgot to add. You need to create an object to specify the type of pin you are using and they live in the basic library. The two lines below will create objects for input and output pin types. You can see where this is used in the third line of my first reply. inputCVId = dbOpenCellViewByType( "basic" "ipin" "symbol" "" "r" )
outputCVId = dbOpenCellViewByType( "basic" "opin" "symbol" "" "r" )
-
shyoon23 days agoin reply to Kevin Buck
Ah, something seems to have gone wrong with the story. I draw one schematic, where I call symbol as instance, and make net name and wire on it. And then I have to put a pin, which means that I want it to be created automatically by judging the input or output or inoutput of the symbol. I wonder if there is a script that makes it.
Thank you!
-
Kevin Buck23 days agoin reply to shyoon
If you open the symbol view for reading you can iterate over the terminals and then make your schematic pins based on what is found. Something like this would do it: libName=ddGetObj("shyoons_library") ;this is the name of the library that your schematic is in
symView = dbOpenCellViewByType(yourLibName yourCellName "symbol" "" "r") foreach(term symView~>terminals ;Input pin case
if(term~>direction == "input" then
;do something here
);if
;Output pin case
if(term~>direction == "output" then
;do something here
);if
);foreach You could also use a case statement instead of if statements. Note that you need to determine which cell you are trying to execute this function for and it should be a string.
-
Andrew Beckett23 days agoin reply to Kevin Buck
Kevin Buck said:
newInputNet = dbCreateNet(newSchView nth(0 nth(0 term~>pins~>figs~>net~>name)))
newInputTerm = dbCreateTerm(newInputNet nil "input")
schCreatePin(newSchView inputCVId nth(0 nth(0 term~>pins~>figs~>net~>name)) "input" nil 0:ypin_ofs "R0")
schCreateWire(newSchView "draw" "full" list(0:ypin_ofs xpin_ofs:ypin_ofs) 0.0625 0.0625 0.0 )
Kevin, Note that the first two lines are redundant - if you call schCreatePin and tell it the terminal name and direction, it will automatically create the net and terminal objects in the database. It's also a bit odd that you are starting from a terminal on the first line, creating a net with the same name (which must already exist, unless the variable term is in a different cellView?). This code can also be used to conveniently get the pin master used for creating the pin based on the same choices that appear in the schematic editor when creating pins: ; the variable "direction" needs to be set to the terminal direction; you want;; assume that pinUsage is the type of pin to use pinUsage="schematic";----------------------------------------------------------------; Determine the pin master to use given the direction; and pinUsage (normally schematic);----------------------------------------------------------------offsheet=cadr(assoc(pinUsage car(schPinMasters)))pinOptions=foreach(mapcar (usageInfo pinInfo) car(schPinMasters) cddr(assoc(direction schPinMasters)) cons(car(usageInfo) pinInfo))pinMasterInfo=cdr(assoc(pinUsage pinOptions))if(pinMasterInfo then pinMaster=dbOpenCellViewByType( car(pinMasterInfo) cadr(pinMasterInfo) caddr(pinMasterInfo) ) unless(pinMaster error("Could not open pin master %L\n" pinMasterInfo) )else error("Could not find pin master for direction %L usage %L\n" direction pinUsage))
|
|