KiCad PCB EDA Suite
|
Generate a netlist compatible with CADSTAR. More...
#include <netlist_exporter_cadstar.h>
Public Member Functions | |
NETLIST_EXPORTER_CADSTAR (SCHEMATIC *aSchematic) | |
bool | WriteNetlist (const wxString &aOutFileName, unsigned aNetlistOptions, REPORTER &aReporter) override |
Write to specified output file. | |
Static Public Member Functions | |
static wxString | MakeCommandLine (const wxString &aFormatString, const wxString &aNetlistFile, const wxString &aFinalFile, const wxString &aProjectDirectory) |
Build up a string that describes a command line for executing a child process. | |
Protected Member Functions | |
std::vector< PIN_INFO > | CreatePinList (SCH_SYMBOL *aSymbol, const SCH_SHEET_PATH &aSheetPath, bool aKeepUnconnectedPins) |
Find a symbol from the DrawList and builds its pin list. | |
SCH_SYMBOL * | findNextSymbol (EDA_ITEM *aItem, const SCH_SHEET_PATH &aSheetPath) |
Check if the given symbol should be processed for netlisting. | |
void | eraseDuplicatePins (std::vector< PIN_INFO > &pins) |
Erase duplicate pins. | |
void | findAllUnitsOfSymbol (SCH_SYMBOL *aSchSymbol, const SCH_SHEET_PATH &aSheetPath, std::vector< PIN_INFO > &aPins, bool aKeepUnconnectedPins) |
Find all units for symbols with multiple symbols per package. | |
Protected Attributes | |
UNIQUE_STRINGS | m_referencesAlreadyFound |
Used for "multiple symbols per package" symbols to avoid processing a lib symbol more than once. | |
std::set< LIB_SYMBOL *, LIB_SYMBOL_LESS_THAN > | m_libParts |
unique library symbols used. LIB_SYMBOL items are sorted by names | |
SCHEMATIC_IFACE * | m_schematic |
The schematic we're generating a netlist for. | |
Private Member Functions | |
bool | writeListOfNets (FILE *f) |
Write a net list (ranked by Netcode), and pins connected to it. | |
Generate a netlist compatible with CADSTAR.
Definition at line 35 of file netlist_exporter_cadstar.h.
|
inline |
Definition at line 38 of file netlist_exporter_cadstar.h.
|
protectedinherited |
Find a symbol from the DrawList and builds its pin list.
This list is sorted by pin number. The symbol is the next actual symbol after aSymbol. Power symbols and virtual symbols that have their reference designators starting with '#' are skipped. if aKeepUnconnectedPins = false, unconnected pins will be removed from list but usually we need all pins in netlists.
Definition at line 128 of file netlist_exporter_base.cpp.
References SCHEMATIC_IFACE::ConnectionGraph(), NETLIST_EXPORTER_BASE::eraseDuplicatePins(), NETLIST_EXPORTER_BASE::findAllUnitsOfSymbol(), CONNECTION_GRAPH::FindSubgraphByName(), CONNECTION_SUBGRAPH::GetItems(), SCH_SYMBOL::GetLibSymbolRef(), CONNECTION_SUBGRAPH::GetNoConnect(), SCH_SYMBOL::GetPins(), SCH_SYMBOL::GetRef(), SCH_SYMBOL::IsPower(), NETLIST_EXPORTER_BASE::m_libParts, NETLIST_EXPORTER_BASE::m_schematic, and pin.
Referenced by NETLIST_EXPORTER_SPICE::ReadSchematicAndLibraries(), and NETLIST_EXPORTER_ORCADPCB2::WriteNetlist().
|
protectedinherited |
Erase duplicate pins.
(This is a list of pins found in the whole schematic, for a single symbol.) These duplicate pins were put in list because some pins (power pins...) are found more than once when in "multiple symbols per package" symbols. For instance, a 74ls00 has 4 symbols, and therefore the VCC pin and GND pin appears 4 times in the list. Note: this list MUST be sorted by pin number (.m_PinNum member value) Also set the m_Flag member of "removed" NETLIST_OBJECT pin item to 1
Definition at line 201 of file netlist_exporter_base.cpp.
Referenced by NETLIST_EXPORTER_BASE::CreatePinList().
|
protectedinherited |
Find all units for symbols with multiple symbols per package.
Search the entire design for all units of aSymbol based on matching reference designator, and for each unit, add all its pins to the sorted pin list. if aKeepUnconnectedPins = false, unconnected pins will be removed from list but usually we need all pins in netlists.
Definition at line 234 of file netlist_exporter_base.cpp.
References SCHEMATIC_IFACE::ConnectionGraph(), CONNECTION_GRAPH::FindSubgraphByName(), CONNECTION_SUBGRAPH::GetItems(), CONNECTION_SUBGRAPH::GetNoConnect(), SCH_SYMBOL::GetPins(), SCH_SYMBOL::GetRef(), SCHEMATIC_IFACE::Hierarchy(), NETLIST_EXPORTER_BASE::m_schematic, pin, and SCH_SYMBOL_T.
Referenced by NETLIST_EXPORTER_BASE::CreatePinList().
|
protectedinherited |
Check if the given symbol should be processed for netlisting.
Prevent processing multi-unit symbols more than once, etc.
aItem | is a symbol to check |
aSheetPath | is the sheet to check the symbol for |
Definition at line 82 of file netlist_exporter_base.cpp.
References SCH_SCREEN::GetLibSymbols(), SCH_SYMBOL::GetRef(), SCH_SYMBOL::GetSchSymbolLibraryName(), LIB_SYMBOL::GetUnitCount(), SCH_SHEET_PATH::LastScreen(), UNIQUE_STRINGS::Lookup(), NETLIST_EXPORTER_BASE::m_libParts, NETLIST_EXPORTER_BASE::m_referencesAlreadyFound, SCH_SYMBOL_T, and EDA_ITEM::Type().
Referenced by NETLIST_EXPORTER_ALLEGRO::extractComponentsInfo(), NETLIST_EXPORTER_XML::makeSymbols(), NETLIST_EXPORTER_SPICE::ReadSchematicAndLibraries(), WriteNetlist(), NETLIST_EXPORTER_ORCADPCB2::WriteNetlist(), and NETLIST_EXPORTER_PADS::WriteNetlist().
|
staticinherited |
Build up a string that describes a command line for executing a child process.
The input and output file names along with any options to the executable are all possibly in the returned string.
aFormatString | holds:
|
aNetlistFile | is the name of the input file for the external program, that is a intermediate netlist file in xml format. |
aFinalFile | is the name of the output file that the user expects. |
aProjectDirectory | is used for P replacement, it should omit the trailing '/'. |
Supported formatting sequences and their meaning:
Definition at line 46 of file netlist_exporter_base.cpp.
Referenced by SCH_EDIT_FRAME::WriteNetListFile().
|
private |
Write a net list (ranked by Netcode), and pins connected to it.
Format:
Definition at line 110 of file netlist_exporter_cadstar.cpp.
References SCHEMATIC_IFACE::ConnectionGraph(), CONNECTION_GRAPH::GetNetMap(), SCH_SHEET_PATH::GetSheet(), NETLIST_EXPORTER_BASE::m_schematic, pin, SCH_PIN_T, StartLine(), and TO_UTF8.
Referenced by WriteNetlist().
|
overridevirtual |
Write to specified output file.
Reimplemented from NETLIST_EXPORTER_BASE.
Definition at line 39 of file netlist_exporter_cadstar.cpp.
References _, UNIQUE_STRINGS::Clear(), NETLIST_EXPORTER_BASE::findNextSymbol(), GetBuildVersion(), SYMBOL::GetExcludedFromBoard(), SCH_SYMBOL::GetFootprintFieldText(), GetISO8601CurrentDateTime(), SCH_SYMBOL::GetRef(), SCH_SYMBOL::GetValue(), SCHEMATIC_IFACE::Hierarchy(), NETLIST_EXPORTER_BASE::m_referencesAlreadyFound, NETLIST_EXPORTER_BASE::m_schematic, REPORTER::Report(), RPT_SEVERITY_ERROR, SCH_SYMBOL_T, StartLine(), TO_UTF8, and writeListOfNets().
|
protectedinherited |
unique library symbols used. LIB_SYMBOL items are sorted by names
Definition at line 192 of file netlist_exporter_base.h.
Referenced by NETLIST_EXPORTER_BASE::CreatePinList(), NETLIST_EXPORTER_ALLEGRO::extractComponentsInfo(), NETLIST_EXPORTER_BASE::findNextSymbol(), NETLIST_EXPORTER_XML::makeLibParts(), NETLIST_EXPORTER_XML::makeSymbols(), and NETLIST_EXPORTER_SPICE::ReadSchematicAndLibraries().
|
protectedinherited |
Used for "multiple symbols per package" symbols to avoid processing a lib symbol more than once.
Definition at line 189 of file netlist_exporter_base.h.
Referenced by NETLIST_EXPORTER_ALLEGRO::extractComponentsInfo(), NETLIST_EXPORTER_BASE::findNextSymbol(), NETLIST_EXPORTER_XML::makeSymbols(), NETLIST_EXPORTER_SPICE::ReadSchematicAndLibraries(), WriteNetlist(), NETLIST_EXPORTER_ORCADPCB2::WriteNetlist(), and NETLIST_EXPORTER_PADS::WriteNetlist().
|
protectedinherited |
The schematic we're generating a netlist for.
Definition at line 195 of file netlist_exporter_base.h.
Referenced by NETLIST_EXPORTER_SPICE::BuildSheetList(), NETLIST_EXPORTER_BASE::CreatePinList(), NETLIST_EXPORTER_ALLEGRO::extractComponentsInfo(), NETLIST_EXPORTER_BASE::findAllUnitsOfSymbol(), NETLIST_EXPORTER_XML::makeDesignHeader(), NETLIST_EXPORTER_XML::makeLibraries(), NETLIST_EXPORTER_XML::makeListOfNets(), NETLIST_EXPORTER_XML::makeSymbols(), NETLIST_EXPORTER_SPICE::readModel(), NETLIST_EXPORTER_SPICE_MODEL::WriteHead(), NETLIST_EXPORTER_SPICE::writeInclude(), writeListOfNets(), NETLIST_EXPORTER_PADS::writeListOfNets(), NETLIST_EXPORTER_ALLEGRO::WriteNetlist(), WriteNetlist(), NETLIST_EXPORTER_ORCADPCB2::WriteNetlist(), and NETLIST_EXPORTER_PADS::WriteNetlist().