Hi, I'm new with SKILL, I try to do some code and it works, but as I trying to go deeper I found some issues. I start to work with the database and as a exercise I want to extract all reference designators (or net names) from a board.
However, I was looking trough Allegro® User Guide: SKILL Reference but can not find nothing. I don't want from you to give me the code, I just need some advice in some methodology how to extract such things from database.
I found only this axlExtractMap (there is an example how to extract all net names) but if I understand it correctly it use already existing report files and I looking fore something without external files.\
use the following:
for net dbids
allNets = axlDBGetDesign()->nets
for net names
allNetsname = axlDBGetDesign()->nets~>name
for symbol dbids
allSymbols = axlDBGetDesign()->symbols
for symbol refdes
allSymbols = axlDBGetDesign()->symbols~>refdes
In reply to D912349:
Thanks a lot, it works. I was trying this:
allNets = axlGetParam("design")->nets
but returns nil.
One more question, regarding the example you give to me. It looks like it takes only placed symbols. For nets it works for all of them.
In reply to serpens:
In the Allegro Skill Reference Manual see section 2 (Allegrp PCB Editor Database User Model). You want to look at the Design Attribute table. The symbol attribute reports the list of placed symbols while the component attribute reports all components whether its symbol is placed or not. Components match all of the parts referenced in the netlist and sport a REFDES. If you place addtitional symbols (such as mechanical or format) that are not netlist they will show up on the symbol attribute but not in the component attribute.
In reply to fxffxf:
Thanks, I was looking on the database user models and alway jumps into Design instead of Design Files.
Now I trying to get more info from the database, but I'm stuck again. I decided to write a small skill routine which will look at each net in the design and check if the net is connected to symbol with specific refdes eg. Rxxx
I want to use this;
to find if a dbid is a pin and if yes I will go deeper and try to find the parent of the pin and his ref des and compare it with some patern. Is this good way? Or is there something less complicated?
This would be eaier to do if you started from the component (e.g. the one with the RefDes). If you have a component dbid, it has an attribute containing a list of pins.You can then look at the at the net dbid attribute of each pin add create a list of nets that are connected to the symbol.
If that is your goal, you can start with nets and use net parameters to check if it is from a testpoint. net object covers or contains objects such as vias, clines and shapes. Using the net parameters, you can get almost all of the informations from this objects connected to the net.
I must say, the symbol what I'm looking for is not a regular TP. In our company we use TP in schematic, and as I was informed from Casdence Support, there is no way how to have TP in scm and auto place them in PCB, or vice versa. So because we use TP as symbols in scm (represented in pcb like a single SMT pad) I want to check all nets if they are connected to partst with TPxxx refdes and make some kind of report.
If somebody knows some skill routine where I can look for something similar I will be glad to look at it.
If all TP that is used as symbol names starts with "TP" then you can use string manipulations to filter and check if it is connected to the net.. try to follow this routine.
lets say you store the symbol names to variable symbolName and symbolIsTP determines if it is a TP component(given that all TP components in your design starts with TP)
symbolIsTP = substring(symbolName 1 2) == "TP"
If symbolIsTP = t then it is a TP symbol
If symbolIsTP = nil then it is not..
Hope this helps.
Did you mean something like this?
moRef = axlDBGetDesign()->symbols~>refdes
foreach( moVar moRef moX = substring( moVar 1 2) if( moX == "TP" printf("%s - TP \n" moVar) printf("%s - not TP \n" moVar) );end if);end foreach
But this just filter out TPs from a list of reference designators. What I want to achieve is:
- obtain a list_1 of nets used in current design (done)- list_2 of redfdes of symbols for each net which are connected to this net (strugling)- check in list_2 if some of the refdes are TP, if yes net have a TP, if no net dont have a TP (done)
Mod can delete...
Mod can delete...
Is there some way how to input formated text in this forum or attach some file, or i need to use external space?
However, I want to thank you both, with your help I was able to create this:
foreach( moAllNets axlDBGetDesign()->nets moTP = 0 printf( "\n %s - " moAllNets->name) foreach( moNetBranch moAllNets->branches foreach( moBranchType moNetBranch->children if( moBranchType->objType == "pin" then moIsTP = substring( moBranchType->component->name 1 2) if( moIsTP == "TP" then printf( "%s " moBranchType->component->name) moTP = 1 );end if );end if );foreach );end foreach if( moTP == 0 print("Missing Test Point") ));end for each
Now I can continue and finetune it, but this is the core which I need. If you have any ideas how to make it shorter I glad to hear you.
there is a way to read a text from a file..
try using gets function. also take a look at infile function to open ports to read a file..
- list_2 of redfdes of symbols for each net which are connected to this net (strugling)
you can use axlDBGetConnect to find all the elements you want.. please refer to the Cadence documentation