Home > Community > Forums > PCB SKILL > Extract all symbols/nets from a design

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Extract all symbols/nets from a design 

Last post Sun, Jan 13 2013 10:59 PM by serpens. 16 replies.
Started by serpens 09 Jan 2013 12:31 AM. Topic has 16 replies and 2340 views
Page 1 of 2 (17 items) 1 2 Next >
Sort Posts:
  • Wed, Jan 9 2013 12:31 AM

    • serpens
    • Top 500 Contributor
    • Joined on Thu, Feb 4 2010
    • Dubnica nad Vahom, Slovakia
    • Posts 23
    • Points 310
    Extract all symbols/nets from a design Reply

    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.\

    Regards,

    Miro

    • Post Points: 20
  • Wed, Jan 9 2013 1:56 AM

    • D912349
    • Top 150 Contributor
    • Joined on Sat, Nov 24 2012
    • Posts 47
    • Points 800
    Re: Extract all symbols/nets from a design Reply

    Hi Serpens,

    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

    Regards,

    • Post Points: 20
  • Wed, Jan 9 2013 2:22 AM

    • serpens
    • Top 500 Contributor
    • Joined on Thu, Feb 4 2010
    • Dubnica nad Vahom, Slovakia
    • Posts 23
    • Points 310
    Re: Extract all symbols/nets from a design Reply

    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.

    • Post Points: 20
  • Wed, Jan 9 2013 5:14 AM

    • fxffxf
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • ., AK
    • Posts 291
    • Points 4,640
    Re: Extract all symbols/nets from a design Reply

    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.

    • Post Points: 20
  • Wed, Jan 9 2013 6:49 AM

    • serpens
    • Top 500 Contributor
    • Joined on Thu, Feb 4 2010
    • Dubnica nad Vahom, Slovakia
    • Posts 23
    • Points 310
    Re: Extract all symbols/nets from a design Reply

    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;

    axlDBGetDesign()->nets~>branches~>children~>objType

    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?

    • Post Points: 20
  • Wed, Jan 9 2013 9:23 AM

    • fxffxf
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • ., AK
    • Posts 291
    • Points 4,640
    Re: Extract all symbols/nets from a design Reply

    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.

    • Post Points: 20
  • Wed, Jan 9 2013 10:05 PM

    • serpens
    • Top 500 Contributor
    • Joined on Thu, Feb 4 2010
    • Dubnica nad Vahom, Slovakia
    • Posts 23
    • Points 310
    Re: Extract all symbols/nets from a design Reply
    Thank, but maybe I don't write it good. I need to go through all nets and check which of them have the component. It will be something like testpoint report. This is why I want to start from top (design), get the list of all nets, in here check for all pins connected to each net and decide if the pin is or isn't from a testpoint.
    • Post Points: 20
  • Wed, Jan 9 2013 11:11 PM

    • D912349
    • Top 150 Contributor
    • Joined on Sat, Nov 24 2012
    • Posts 47
    • Points 800
    Re: Extract all symbols/nets from a design Reply

    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.

    • Post Points: 20
  • Wed, Jan 9 2013 11:37 PM

    • serpens
    • Top 500 Contributor
    • Joined on Thu, Feb 4 2010
    • Dubnica nad Vahom, Slovakia
    • Posts 23
    • Points 310
    Re: Extract all symbols/nets from a design Reply

    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.

    Regards,
    Miro

    • Post Points: 20
  • Thu, Jan 10 2013 12:20 AM

    • D912349
    • Top 150 Contributor
    • Joined on Sat, Nov 24 2012
    • Posts 47
    • Points 800
    Re: Extract all symbols/nets from a design Reply

    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.

    • Post Points: 20
  • Thu, Jan 10 2013 3:09 AM

    • serpens
    • Top 500 Contributor
    • Joined on Thu, Feb 4 2010
    • Dubnica nad Vahom, Slovakia
    • Posts 23
    • Points 310
    Re: Extract all symbols/nets from a design Reply

    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)

    • Post Points: 20
  • Thu, Jan 10 2013 3:29 AM

    • serpens
    • Top 500 Contributor
    • Joined on Thu, Feb 4 2010
    • Dubnica nad Vahom, Slovakia
    • Posts 23
    • Points 310
    Re: Extract all symbols/nets from a design Reply

    Mod can delete...

    • Post Points: 5
  • Thu, Jan 10 2013 6:33 AM

    • serpens
    • Top 500 Contributor
    • Joined on Thu, Feb 4 2010
    • Dubnica nad Vahom, Slovakia
    • Posts 23
    • Points 310
    Re: Extract all symbols/nets from a design Reply

    Mod can delete...

    • Post Points: 5
  • Fri, Jan 11 2013 12:00 AM

    • serpens
    • Top 500 Contributor
    • Joined on Thu, Feb 4 2010
    • Dubnica nad Vahom, Slovakia
    • Posts 23
    • Points 310
    Re: Extract all symbols/nets from a design Reply

    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.

    Regards,
    Miro

    • Post Points: 20
  • Fri, Jan 11 2013 12:18 AM

    • D912349
    • Top 150 Contributor
    • Joined on Sat, Nov 24 2012
    • Posts 47
    • Points 800
    Re: Extract all symbols/nets from a design Reply

    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..

    • Post Points: 5
Page 1 of 2 (17 items) 1 2 Next >
Sort Posts:
Started by serpens at 09 Jan 2013 12:31 AM. Topic has 16 replies.