Using Extracta in Allegro PCB Editor Product Version 17.4 July, 2021 Using Extracta in Allegro PCB Editor Copyright Statement © 2018 Cadence Design Systems, Inc. All rights reserved worldwide. Cadence and the Cadence logo are registered trademarks of Cadence Design Systems, Inc. All others are the property of their respective holders. Learn more at Cadence Support Portal - https://support.cadence.com © 2018 Cadence Design Systems, Inc. All rights reserved worldwide. Page 2 Using Extracta in Allegro PCB Editor Contents Purpose........................................................................................................................ 4 Audience ...................................................................................................................... 4 Extracta ........................................................................................................................ 4 Extracta Command File ............................................................................................ 5 Extracta Output ......................................................................................................... 6 Ways to Run Extracta .................................................................................................. 7 Extracta Command ................................................................................................... 7 Extracta UI .............................................................................................................. 14 Custom Reports ......................................................................................................... 15 Examples ................................................................................................................... 19 Summary.................................................................................................................... 26 Support ...................................................................................................................... 26 Feedback ................................................................................................................... 26 Learn more at Cadence Support Portal - https://support.cadence.com © 2018 Cadence Design Systems, Inc. All rights reserved worldwide. Page 3 Using Extracta in Allegro PCB Editor Purpose Extracta is an Allegro PCB Editor/ Allegro Package Designer (APD) command to generate reports that show the extracted data from a design. Extracta uses a “view” file or “cmdfile”, which is a plain text file (*.txt) and contains data fields to generate a report for specific database views. This application note will help users understand how to extract the desired data from a design using the view file. Audience This document is intended for Allegro (*.brd) /APD (*.mcm and *.sip) users who want to generate customized reports using an Extracta command file within Allegro / APD or from Windows command line, apart from those available in the software under the Reports section (Tools > Reports). This document may be helpful for users who would like to generate reports for various layout analyses as per their requirements. Extracta The Extracta command reads the binary representations of the layout designs, and then translates that data into ASCII text files. These files contain database information that can be used for reporting and analysis. By using this command, you obtain flattened information from a design as per the information contained in the view. The three files of Extracta are: Extracta View File, Layout File (*.brd, *.mcm and *.sip), and Extracta Output. Learn more at Cadence Support Portal - https://support.cadence.com © 2018 Cadence Design Systems, Inc. All rights reserved worldwide. Page 4 Using Extracta in Allegro PCB Editor Extracta Command File To control the Extracta output, create an extracta command file that Extracta uses as input. In the Extracta command file, list the data fields to extract from the layout database and establish the selection criteria for certain data values. Data fields may change as per the database view being extracted. The information provided as data fields is called a view, and the file is thus named as a view file or cmdfile (*.txt). This command file must exist before you can run Extracta. Base-View files are predefined views for which reports are already present in the tool and can be customized as per your requirement. Available view files can be referred from %CDSROOT%\share\pcb\text\views. Learn more at Cadence Support Portal - https://support.cadence.com © 2018 Cadence Design Systems, Inc. All rights reserved worldwide. Page 5 Using Extracta in Allegro PCB Editor Extracta Output The Extracta command output (*.txt, *.rpt, or *.htm file) contains the extracted information from the design specified in cmdfile. The output file is composed of many text record representations of the database. In addition to the output file, Extracta creates extracta.log, which contains a copy of cmdfile and error messages, if any. Learn more at Cadence Support Portal - https://support.cadence.com © 2018 Cadence Design Systems, Inc. All rights reserved worldwide. Page 6 Using Extracta in Allegro PCB Editor Ways to Run Extracta There are two ways to use Extracta: • • Extracta Command Extracta UI Extracta Command To run the command using the Windows command prompt, use the following: extracta <board_file_name.brd> <extracta_cmdFile.txt> <extract_outfile.txt> extracta: It references a command file (cmdfile) to extract data from the database (run it from the command prompt). board_file_name.brd: This is the layout file name to extract the design database for reporting and analysis. Extracta_cmdFile: This is the view file name with data fields to be extracted from the database. Extracta_outfile: This is the name of the Extracta output file. Learn more at Cadence Support Portal - https://support.cadence.com © 2018 Cadence Design Systems, Inc. All rights reserved worldwide. Page 7 Using Extracta in Allegro PCB Editor There are several options available to control the extract process. The arguments are listed below: extracta [ args] [<drawing>] [<cmdfile>] [<outfile>...] -c Dumps interior of cross hatch shapes as individual lines -k extracta -d [<boardfile>] Precludes generation of errors if cmdfile has illegal field names -d -m -q -r -s -w Dumps all field names. The file names are unused, and the output goes to the log (extract.log) file. Overrides the default behavior of the command of renaming the outermost etch layers to TOP / BOTTOM. This only works for APD and SIP designs. Prevents Extracta from displaying status messages during processing (quiet mode) Reuses the log file (delete before execution) Provides the output file in a short output format; the output contains only records. Excludes the extra date in output file -l <logfile> Name of the log file. It overrides the default log file name (extracta.log) and location; defined by the ads_sdlog environment variable (The subdirectory to which the log file is written). -z Generates a unique net name for items on dummy net in non-net views -A -a <name> <drawing> Lists all database attachments in the design. This option does not require any other option. Extracta -A [<boardfile] Extracts the attachment as given by -A arg above to a file <name>.dat. To extract more than one attachments, use this option multiple times on the command line. This option does not require any other option. Extracta -a CVLayerSettings [<boardfile>] Name of the design database <cmdfile> Name of the Extracta command file. It uses TEXTPATH to locate the file if the relative path is given. Name of the output file. If multiple views are given in cmdfile, one output file <outfile>... is needed for each file. If no outfile file is given, the output is dumped to stdout. Learn more at Cadence Support Portal - https://support.cadence.com © 2018 Cadence Design Systems, Inc. All rights reserved worldwide. Page 8 Using Extracta in Allegro PCB Editor Command File To initialize the view file or command file, the record contains the name of the database view (like BOARD, COMPONENT…). Using “END” as a keyword in the Extracta cmdFile file helps to extract multiple views from a single command file. Here is an example of a sample view file: Use the Allegro / APD Reports menu to create the custom view file. You can also use any text editor to write the Extracta commands. To open the Extracta UI, in Allegro, use Tools > Reports > New/Edit, a dialog box with name Extract UI is opened. Now, you can choose the database views type and other fields per your requirement. As you go on adding these items, you can see them being added on the left side. When you save this and write the report, you will find an extracta.log file in your current working directory. Open it in any text editor, and you can see the Extracta commands inside it. You can save it as *.txt to use it as the Extracta command file if you are using the commandbased method. Learn more at Cadence Support Portal - https://support.cadence.com © 2018 Cadence Design Systems, Inc. All rights reserved worldwide. Page 9 Using Extracta in Allegro PCB Editor Learn more at Cadence Support Portal - https://support.cadence.com © 2018 Cadence Design Systems, Inc. All rights reserved worldwide. Page 10 Using Extracta in Allegro PCB Editor These commands are generated by extracta_ui and are written in the extracta.log file. You need to copy them in a *.txt file to use as the command file while using Extracta in command mode. Types of Database Views Typically, one type of data is extracted from the design. The following is a list of predefined data views available with their prefix name: Database View Type BOARD COMPONENT COMPONENT_PIN COMPOSITE_PAD CONNECTIVITY FULL_GEOMETRY FUNCTION GEOMETRY LAYER LOGICAL_PIN NET SYMBOL Prefix Name BOARD_ COMP_ PIN_ PAD_ ; PIN_ ; DRILL_ ; VIA_ NET_ ; NODE_ ; PIN_ ; SEG_ ; GRAPHIC_ GRAPHIC_ ; SEG_ ; PAD_ FUNC_ GRAPHIC_ ; SEG_ LAYER_ PIN_ NET_ SYM_ Data Fields and Description Available data fields and their descriptions can be referred from “Extracta Data Dictionary” available at %CDSROOT%\doc\algrodescmp. Now, you can generate the command files both by writing them yourself in the text editor or by generating the custom view files from the Extract UI. Learn more at Cadence Support Portal - https://support.cadence.com © 2018 Cadence Design Systems, Inc. All rights reserved worldwide. Page 11 Using Extracta in Allegro PCB Editor Output File Extracta output can be stored in the *.txt file format. If you do not specify any output file on the command line, Extracta will print the output on the command line. To store the output in a file, you need to give the name of the output file with the extension you want to save the file as (for example, *.txt). If you just give the file name, Extracta will create *.txt for it. Your output file will store all the information extracted from the database as per the fields mentioned in the command file. With this output file format (.txt), data fields in the output file are separated by “!” marks and “!!!” to separate subsequent data element records. To generate a report from a Linux/UNIX or DOS command line, you can use the following syntax: extracta ./test.brd ./test.txt ./out.txt The output report will look something like below: Learn more at Cadence Support Portal - https://support.cadence.com © 2018 Cadence Design Systems, Inc. All rights reserved worldwide. Page 12 Using Extracta in Allegro PCB Editor The output text file contains two header records followed by one data record per extracted element. Each data record starts with a record-type character: • The first record starts with the letter A. This record contains labels for each data field that Extracta writes. Label names are same as the one present in the Extracta command file. • The second letter of the record is J. This record contains global data about the Allegro / APD design serially (Design name, Extracta execution date, drawing extents left X, drawing extents lower Y, drawing extents right X, drawing extents upper Y, database accuracy, database units, value of BOARD_SCHEMATIC_NAME property, value of BOARD_THICKNESS property, number of conductor layers in the design, BOARD_DRC_STATUS_FIELD). • Subsequent records start with the letter S. This signifies values for data field names in record A in the same order. Learn more at Cadence Support Portal - https://support.cadence.com © 2018 Cadence Design Systems, Inc. All rights reserved worldwide. Page 13 Using Extracta in Allegro PCB Editor Extracta UI The Extracta UI assists in creating custom view files. The UI returns a list of data fields available as per the selected database view type. Earlier in this document, you ran Extracta from the command line, creating the command files and then passing those as arguments for the command. Here, you can do all of that through the UI inside Allegro PCB Editor or APD. The Extracta UI can be opened in the following two ways: 1. In PCB Editor, select Tools > Reports or in Allegro Package Design, go to the Reports menu and then select Reports. Select the New/Edit button to open a dialog box with name Extract UI. For Allegro PCB Editor For APD 2. You can also open the Extract UI directly from the Allegro command line by Learn more at Cadence Support Portal - https://support.cadence.com © 2018 Cadence Design Systems, Inc. All rights reserved worldwide. Page 14 Using Extracta in Allegro PCB Editor typing extract_ui. Custom Reports By using the Extract UI, you can generate custom reports by selecting database views and configurations. You can also generate command files directly from this UI and load your custom command files directly in it. Load: The Load button is used to load the command file (*.txt) already present in your directory. Save: The Save button is used to save the current configuration as a command file (*.txt). Learn more at Cadence Support Portal - https://support.cadence.com © 2018 Cadence Design Systems, Inc. All rights reserved worldwide. Page 15 Using Extracta in Allegro PCB Editor Data Fields: This tab helps choose the database view and the type of elements desired as data fields in the custom report. • Select database view: This is used to choose a predefined view, which contains data fields defining the type of element to extract from the design database and include in the custom report. • Available Fields: This is used to choose data fields to include in the report. Data fields that display are those associated with the view chosen in the Select database view field. Double-click on a data field to include it in the custom report. Your choices appear in the right pane. Click the arrow buttons next to the right pane to rearrange the order in which the data fields appear in the generated report, if necessary. • Current Configuration Database View: This displays the view chosen in the Select database view field. Properties: You can use this tab to select properties as per the object for which the view file is being created. Miscellaneous: This tab contains the following: • Group Names: This is used to choose the group names to include the membership of that group in the report. • Sort Commands: This is used to choose data fields by which to sort the extracted data fields in the report. Learn more at Cadence Support Portal - https://support.cadence.com © 2018 Cadence Design Systems, Inc. All rights reserved worldwide. Page 16 Using Extracta in Allegro PCB Editor .rpt This format generates comma-separated output from Allegro / APD. Go to Tools > Reports. In the Reports dialog box, enter the Output File (optional) name, enable the Write Report option, and click Report. As seen in the following screenshot, if you generate a predefined Cadence-provided report, you also automatically generate the output filename consisting of the keyword associated with the chosen report with a .rpt extension appended. You can save the report to a file and display it on the screen by enabling both Write Report and Display Report fields. For example, the output filename for the Bill of Materials report is bom_rep.rpt. If you generate a custom report configuration such as myreport.txt, and the written output file is myreport.rpt, you can give the name in the Output File (optional) box. Learn more at Cadence Support Portal - https://support.cadence.com © 2018 Cadence Design Systems, Inc. All rights reserved worldwide. Page 17 Using Extracta in Allegro PCB Editor With the .rpt file format, the first line records the name of the report. The second line gives the design name. The third line contains the timestamp of the execution of the report, and the fourth line contains comma-separated values for the mentioned data field in subsequent lines. If you do not save the command file from the Extract UI, and just select your fields and generate a report, the Extracta commands are stored in the extracta.log file generated in your current working directory. Learn more at Cadence Support Portal - https://support.cadence.com © 2018 Cadence Design Systems, Inc. All rights reserved worldwide. Page 18 Using Extracta in Allegro PCB Editor Examples Download and save the attached database. 1. Run the Extracta command to generate the report from the command line: Use the attached examples of the command file test.txt. Go to Start > Run and type “cmd”. This will open a command prompt. Browse to a location where your command file is saved using the “cd” command. Type the following to generate a report on using the attached sample design saved at the same location as the view file. You can also use your board file to generate the report. > extracta ./test.brd ./test.txt ./out.txt This will generate the out.txt file in the working directory. 2. Run Custom Report from Allegro/APD: In Allegro PCB Editor, open a design, like the test.brd file, on which a report needs to be generated. Select Tools > Reports. Learn more at Cadence Support Portal - https://support.cadence.com © 2018 Cadence Design Systems, Inc. All rights reserved worldwide. Page 19 Using Extracta in Allegro PCB Editor Scroll down the available reports, and you can see the command file, test.txt, already present there. Add the Output File (optional) name, and enable the Write Report option. Click Report to generate the report in comma-separated *.rpt format. To generate a report on an APD design, open the design with Package Designer and select Reports > Reports, and you can perform the above-mentioned steps there also. You can also open extracta_ui and try generating different custom reports by clicking on the New/Edit button as per your needs. Learn more at Cadence Support Portal - https://support.cadence.com © 2018 Cadence Design Systems, Inc. All rights reserved worldwide. Page 20 Using Extracta in Allegro PCB Editor • Generating a custom report with Pin number, RefDes, and Padstack Name The following example helps understand the usage of logical NOT (!=) operator: ----- pin_details.txt----COMPOSITE_PAD REFDES REFDES_SORT PIN_NUMBER != '' ### PIN_NUMBER != '' is to avoid pins with no pin number like mechanical ## pins. Comment this to include mechanical pins in the report. PIN_NUMBER PIN_X PIN_Y PAD_STACK_NAME END ----------------------------------- Learn more at Cadence Support Portal - https://support.cadence.com © 2018 Cadence Design Systems, Inc. All rights reserved worldwide. Page 21 Using Extracta in Allegro PCB Editor • Generating a custom report to see text present on SILKSCREEN layer, avoiding blank layers The following example helps explain the usage of the logical OR (OR) and logical NOT (!=) operators: -----silkscreen_text.txt----FULL_GEOMETRY GRAPHIC_DATA_7 != '' CLASS='REF DES' SUBCLASS='SILKSCREEN_TOP' OR GRAPHIC_DATA_7 != '' CLASS='REF DES' SUBCLASS='SILKSCREEN_BOTTOM' GRAPHIC_DATA_NAME = 'TEXT' GRAPHIC_DATA_7 CLASS SUBCLASS ### GRAPHIC_DATA_7 is the text string. END ---------------------------------------- Learn more at Cadence Support Portal - https://support.cadence.com © 2018 Cadence Design Systems, Inc. All rights reserved worldwide. Page 22 Using Extracta in Allegro PCB Editor • Generating a report to list symbols as SMD or Thru hole placed on the top or bottom layer This same list can be generated as a component to list only components, ignoring format and mechanical symbols in the design. -----sym_layer_type.txt----SYMBOL REFDES REFDES_SORT COMP_CLASS SYM_CENTER_X SYM_CENTER_Y SYM_PIN_COUNT SYM_MIRROR COMMENT END ### Modify report as COMMENT = SMD or COMMENT = TH, to create pick and ## place report for SMD components or Thru hole specific. ### SYM_MIRROR value = NO, symbol placed on TOP ### SYM_MIRROR = YES, symbol placed on the BOTTOM layer ---------------------------------- • Creating a report that provides information on silk outlines and shapes of a footprint The following example illustrates the usage of the logical OR (OR) function with Extracta. Similarly, logical AND (AND) can be used to restrict sorting when both data fields (logically ANDed) are available. ----- pkg_silkscreen.txt----FULL_GEOMETRY CLASS = "MANUFACTURING" SUBCLASS = "AUTOSILK_TOP" OR CLASS = "MANUFACTURING" SUBCLASS = "AUTOSILK_BOTTOM" OR CLASS = "REF DES" Learn more at Cadence Support Portal - https://support.cadence.com © 2018 Cadence Design Systems, Inc. All rights reserved worldwide. Page 23 Using Extracta in Allegro PCB Editor SUBCLASS = "SILKSCREEN_BOTTOM" OR CLASS = "REF DES" SUBCLASS = "SILKSCREEN_TOP" OR CLASS = "DEVICE TYPE" SUBCLASS = "SILKSCREEN_BOTTOM" OR CLASS = "DEVICE TYPE" SUBCLASS = "SILKSCREEN_TOP" OR CLASS = "TOLERANCE" SUBCLASS = "SILKSCREEN_BOTTOM" OR CLASS = "TOLERANCE" SUBCLASS = "SILKSCREEN_TOP" OR CLASS = "PACKAGE GEOMETRY" SUBCLASS = "SILKSCREEN_BOTTOM" OR CLASS = "PACKAGE GEOMETRY" SUBCLASS = "SILKSCREEN_TOP" OR CLASS = "USER PART NUMBER" SUBCLASS = "SILKSCREEN_BOTTOM" OR CLASS = "USER PART NUMBER" SUBCLASS = "SILKSCREEN_TOP" CLASS SUBCLASS GRAPHIC_DATA_NAME GRAPHIC_DATA_NUMBER GRAPHIC_DATA_1 GRAPHIC_DATA_2 GRAPHIC_DATA_3 GRAPHIC_DATA_4 GRAPHIC_DATA_5 GRAPHIC_DATA_6 GRAPHIC_DATA_7 END ### GRAPHIC_DATA_NAME: This is the Allegro PCB Editor figure name. Learn more at Cadence Support Portal - https://support.cadence.com © 2018 Cadence Design Systems, Inc. All rights reserved worldwide. Page 24 Using Extracta in Allegro PCB Editor ### GRAPHIC_DATA_NUMBER: This field may be used instead of ## GRAPHIC_DATA_NAME to save disk space and to make the ## post processor’s job easier. ### GRAPHIC_DATA_N: The GRAPHIC_DATA_N (where N is 1 to 10) fields ## are used differently depending on the graphic element as defined. ### GRAPHIC_DATA_NAME (and GRAPHIC_DATA_NUMBER) field ### Refer to the Extracta Data Dictionary in the ## <install_dir>/doc/algrodescmp folder. ---------------------------------• Picking and placing the report specific to mechanical symbols ----- pick_n_place.txt----SYMBOL SYM_TYPE = MECHANICAL #OR #SYM_TYPE = PACKAGE #OR #SYM_TYPE = FORMAT SYM_TYPE SYM_NAME REFDES SYM_BOX_X1 SYM_BOX_X2 SYM_BOX_Y1 SYM_BOX_Y2 SYM_CENTER_X SYM_CENTER_Y SYM_EXTENTS_X1 SYM_EXTENTS_X2 SYM_EXTENTS_Y1 SYM_EXTENTS_Y2 SYM_HAS_PIN_ED IT SYM_MIRROR SYM_ROTATE SYM_X SYM_Y SYM_LIBRARY_PATH END Learn more at Cadence Support Portal - https://support.cadence.com © 2018 Cadence Design Systems, Inc. All rights reserved worldwide. Page 25 Using Extracta in Allegro PCB Editor ### Remove “#” (comment) to modify this report for the package ## or format symbol. ### Similarly, the report can be modified to generate the report ## specific to SYM_NAME. ---------------------------------- Summary This document covered different methods to generate custom reports to extract design data for various analyses. Support Cadence Support Portal provides access to support resources, including an extensive knowledge base, access to software updates for Cadence products, and the ability to interact with Cadence Customer Support. Visit https://support.cadence.com. Feedback Email comments, questions, and suggestions to content_feedback@cadence.com. Learn more at Cadence Support Portal - https://support.cadence.com © 2018 Cadence Design Systems, Inc. All rights reserved worldwide. Page 26