Hierarchial Design

Hierarchical design is essential for any cad tool. Kicad screwed up when they added theirs. They added top down hierarchy but did not support bottoms up. We must have both.

Here is a use case for how we can add hierarchy to librePCB with minimal disruption.

We start by adding a new menu pick for a “create Symbol” command in the schematic editor. When called it opens a window that asks for:

Name
Library Name
Description
Keywords
Author
Version
component category

It then collects a list of all pins from all instances under the component_category of “Connectors”. Each one consists of the instance_name “_” pin_name. If J5 is a DB-9 uart connector then you have J5_1,J5_2…J5_9.

These are then used to create a rectangular symbol. Each pin retains the same orientation that it had from the schematic.

You then create a component for that symbol. The component will have a new field to identify it as a Hierarchical component as opposed to a Leaf cell. It will also have a source uuid that points back to the uuid of the schematic.

You now have bottoms up design in schematic capture.

Top down will require the addition of all the symbol editor tools to the schematic editor. You create a symbol in the schematic, select all of it and then hit “Make Symbol”. This time it will only create the symbol/component that you selected. It will mark it as a hierarchical component and link the source uuid to a newly created schematic sheet.

Then it deletes everything that was selected and instantiates the new component exactly where the old one was created.

You now have top down design in schematic capture.

When adding footprints to the board the hierarchical components are marked and cannot be placed. You can double click on them to list all of the child components and they can be placed.

The netlister will have to follow the hierarchy to build a flattened netlist