• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Allegro X PCB Editor
  3. Recommended project directories structure

Stats

  • State Verified Answer
  • Replies 8
  • Answers 2
  • Subscribers 162
  • Views 1568
  • Members are here 0
More Content

Recommended project directories structure

bdc66a938f164d
bdc66a938f164d 21 days ago

I am new to Cadence software. Before starting working on a large project, I would like to know if there is a recommended or most common structure for the directories and files.

One option is to a single directory and all the files in there, but it does not look very convenient for large project. Another option is to have global directories for footprints, symbols, etc. This works fine for a single project, but with multiple projects then everything gets mixed.

In other EDA software tools I usually set up things like this:

```
.
├── libs
│   ├── lib_1
│   │   ├── 3D
│   │   │   └── a.step
│   │   ├── a.footprint
│   │   ├── a.symbol
│   │   ├── b.footprint
│   │   └── b.symbol
│   └── lib_2
│       ├── 3D
│       │   └── a.step
│       ├── a.footprint
│       ├── a.symbol
│       ├── b.footprint
│       └── b.symbol
└── main.project
```

which is very convenient because 

  1. It remain local to the project,
  2. if I reuse say `lib_1` in another project, I can simply symlink to it and use it without duplicating information or having to update any path, and
  3. the working directories stay clean.

I tried to setup something similar for Allegro X but ended up having a lot of issues with the paths. Right now I have everything in a single directory, but I see an inconvenience when the project starts to grow.

  • Cancel
  • Sign in to reply
Parents
  • bdc66a938f164d
    +1 bdc66a938f164d 15 days ago

    For future reference, this is how I achieved what I wanted:

    1. Within Allegro, go to "Setup/User preferences/Paths/Library" and add `$PROJECT_LIBS` to `padpath`, `psmpath` and `steppath`.
    2. Create a folder next to your project called `libs`.
    3. Create local project libraries with folders inside `libs`, e.g. `libs/connectors`, `libs/vias`, etc.
    4. Create `open_project.bat` and paste the contents below into it, save it and close it.
    4. Run `open_project.bat` (double click it) to open your project from now on. It will automatically and temporarily add all your libraries paths and start Allegro.

    Important: The changes made by the script are temporary, meaning that it will not interfere with any other existing configuration and also next time you open your project, you have to do it through the script.

    Script `open_project.bat`:

    ```
    REM Manual configuration below:
    set PATH_TO_ALLEGRO_EXE=C:\Cadence\SPB_24.1\tools\bin\allegro.exe
    set NAME_OF_PROJECT_FILE=main.mcm

    ::::::::::::::::::::::::::::::::::::::

    REM Get the directory of this batch file, we assume the `NAME_OF_PROJECT_FILE` sits right next to this script:
    set PROJECT_DIR=%~dp0
    REM Initialize PROJECT_LIBS variable:
    set PROJECT_LIBS=
    REM Enable delayed variable expansion so the `for` loop does not fail:
    setlocal enabledelayedexpansion


    REM Recursively loop through all subdirectories in ./libs:
    for /R "%PROJECT_DIR%libs" %%L in (.) do (
        if exist "%%L\" (
            set PROJECT_LIBS=!PROJECT_LIBS! %%L;
        )
    )
    ::echo %PROJECT_LIBS%
    ::pause

    REM Launch Allegro with the project file:
    set PATH_TO_PROJECT_FILE=%PROJECT_DIR%%NAME_OF_PROJECT_FILE%
    start "" "%PATH_TO_ALLEGRO_EXE%" "%PATH_TO_PROJECT_FILE%"

    ```

    Note that the script works recursively, so you can have an arbitrary directory structure within `libs`, e.g.:

    .
    ├── libs
    │   ├── lib_1
    │   │   ├── component_a
    │   │   │   ├── 3D_model.step
    │   │   │   ├── a.dra
    │   │   │   ├── a.psm
    │   │   │   ├── pad_1.pad
    │   │   │   └── pad_2.pad
    │   │   └── component_b
    │   │       ├── 1.pad
    │   │       ├── 2.pad
    │   │       ├── 3D_model.step
    │   │       ├── 3.pad
    │   │       ├── 4.pad
    │   │       ├── b.dra
    │   │       └── b.psm
    │   └── lib_2
    │       └── component_c
    │           ├── 3D_model.step
    │           ├── c.dra
    │           └── c.psm
    ├── main.mcm
    └── open_project.bat

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
  • excellon1
    0 excellon1 15 days ago in reply to bdc66a938f164d

    This looks kind of interesting, I am curious. In a corporate environment typically there are tight controls to prevent exploits creeping onto the network.
    How will the script work in particular if Domain Policy blocks the execution of batch files ?.

    On the structure under libs that has various folders. Where does the contents that fill these folders come from ?. Like you have a sub folder lib_1\a.dra
    so if you have a physical dra somewhere within say a corporate library how does it get copied into the a.dra sub-folder ?

    Within your batch file would it make any sense to use the batch file to physically create the folders, basically sort of a pre canned structure so it would not have to be done manually ?. The part that I see as a road block is while folders are created and paths are set there does not appear to be a method to fill those folders with content. Maybe i'm missing something ?

    Best regards.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • excellon1
    0 excellon1 15 days ago in reply to bdc66a938f164d

    This looks kind of interesting, I am curious. In a corporate environment typically there are tight controls to prevent exploits creeping onto the network.
    How will the script work in particular if Domain Policy blocks the execution of batch files ?.

    On the structure under libs that has various folders. Where does the contents that fill these folders come from ?. Like you have a sub folder lib_1\a.dra
    so if you have a physical dra somewhere within say a corporate library how does it get copied into the a.dra sub-folder ?

    Within your batch file would it make any sense to use the batch file to physically create the folders, basically sort of a pre canned structure so it would not have to be done manually ?. The part that I see as a road block is while folders are created and paths are set there does not appear to be a method to fill those folders with content. Maybe i'm missing something ?

    Best regards.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • bdc66a938f164d
    0 bdc66a938f164d 15 days ago in reply to excellon1
    excellon1 said:
    In a corporate environment typically there are tight controls to prevent exploits creeping onto the network.
    How will the script work in particular if Domain Policy blocks the execution of batch files ?.

    There are probably plenty of ways of doing this rather simple task, e.g. Python can also do it. However, if you are in a corporate jail where they cut your wings and tie you with chains, then yes this can be a problem.

    excellon1 said:
    On the structure under libs that has various folders. Where does the contents that fill these folders come from ?. Like you have a sub folder lib_1\a.dra
    so if you have a physical dra somewhere within say a corporate library how does it get copied into the a.dra sub-folder ?

    All the content under `lib` is hand made. If the component is already in a corporate library, take it from there and don't create it again. Having `lib` right next to `main.mcm` is intended for project-specific components that you know you will never use again or for some other reason they must remain with the project. In this way there is no noise in the already huge corporate library and nobody else than the people working on the project knows about it.

    excellon1 said:
    Within your batch file would it make any sense to use the batch file to physically create the folders, basically sort of a pre canned structure so it would not have to be done manually ?

    Yes, but it is not my goal to automate the creation of `lib`. 

    I think such a structure is also nice for global libraries. In fact, I would make this structure the standard in my company right from the beginning, if I had one. To me, it makes much more sense to split the files in a per-component basis rather than putting everything in a single folder or splitting on a per-file-format basis (`pads`, `symbols`, `step`). Consider this example:

    global_corporate_library
    └── connectors
        └── BNC
            └── Amphenol_RF_031-5329-51RFX
                ├── allegro
                ├── altium
                ├── datasheet.pdf
                ├── eagle
                ├── kicad
                └── readme.md

    Inside the folder `allegro` you have all the `.dra`, `.pad`, etc. Optionally you also have a `readme.md` file with some info, the datasheet, etc etc. In the folder of that component, you can also have the implementation for other software.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • excellon1
    0 excellon1 13 days ago in reply to bdc66a938f164d

    Hi

    For clarity & in relation to your specific question of  "Recommended project directories structure" there are a number of parts to this and certainly the Allegro Configuration & Libraries are a part of this but it is not the whole part by a long shot. The Orcad/Allegro tool set is basically a "Siloed" type of system. That is each part Schematic Capture, Board editor, Pcb footprint & padstack creation all operate independently of each other. This is unlike similar products like say Alt that are based around a database where by everything gets combined into a database file type of project. If you are used to this type of thing, Its not going to help you in the Allegro world.

    You have to kind of think about the system as a whole & not just the PCB end of things.

    In the Orcad/Allegro flow what drives the PCB editor is Orcad Capture, Or the Cadence schematic tool. Orcad is fairly popular as a schematic tool goes so my assumption is this is what you are using.

    If you load up Orcad Capture and draw your schematic the physical output on disk will basically be a 2 folder system

    The root folder say c:\Orcad_Design will contain your project & the .dsn  schematic file. When you create a netlist and then run the packager to create a board there will typically be a sub folder under the root folder and by default it is named Allegro. That folder is where the board would be.

    So since Capture is basically driving everything then the actual "Recommended project directories structure" is one Root folder and one sub folder for the board. That's it. Just two folders on disk !.

    In this flow the libraries are totally seperate from both Capture & Allegro. If your just learning the tool & if I'm not mistaken Cadence does offer some pre canned designs so as to kind of kick the tires and learn the system.

    Best Regards.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information