|
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. | |
| void | SetKiway (KIWAY *aKiway) |
| bool | WriteNetlist (const wxString &aOutFileName, unsigned aNetlistOptions, REPORTER &aReporter) |
| 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 | |
| void | rebuildConnectivity () |
| std::optional< wxString > | itemNetName (const SCH_ITEM &aItem, const SCH_SHEET_PATH &aPath) const |
| std::vector< PIN_INFO > | CreatePinList (SCH_SYMBOL *aSymbol, const SCH_SHEET_PATH &aSheetPath) |
| 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 | appendResolvedPins (std::vector< PIN_INFO > &aPins, const SCH_PIN *aPin, const SCH_SHEET_PATH &aSheetPath, const wxString &aNetName) |
| Resolve aPin to its pad number(s) and append a PIN_INFO for each (issue #2282). | |
| std::vector< wxString > | resolvePadNumbers (const SCH_PIN *aPin, const SCH_SHEET_PATH &aSheetPath) const |
| Resolve aPin to its effective pad number(s) for every netlist path (issue #2282). | |
| const std::set< wxString > & | footprintPads (const wxString &aFootprintId) const |
| void | findAllUnitsOfSymbol (SCH_SYMBOL *aSchSymbol, const SCH_SHEET_PATH &aSheetPath, std::vector< PIN_INFO > &aPins) |
| Find all units for symbols with multiple symbols per package. | |
Protected Attributes | |
| SCH_SHEET_LIST | m_exportSheets |
| std::vector< EXPORT_NET > | m_exportNets |
| std::map< SCH_SHEET_PATH, std::unordered_map< KIID, wxString > > | m_exportItemNets |
| unsigned | m_connectivityDepth = 0 |
| 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 * | m_schematic |
| The schematic we're generating a netlist for. | |
| KIWAY * | m_kiway = nullptr |
| std::map< wxString, std::set< wxString > > | m_footprintPadCache |
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 31 of file netlist_exporter_cadstar.h.
|
inline |
Definition at line 34 of file netlist_exporter_cadstar.h.
References NETLIST_EXPORTER_BASE::NETLIST_EXPORTER_BASE().
|
protectedinherited |
Resolve aPin to its pad number(s) and append a PIN_INFO for each (issue #2282).
Definition at line 339 of file netlist_exporter_base.cpp.
References SCH_PIN::GetNumber(), SCH_PIN::GetShownName(), and resolvePadNumbers().
Referenced by CreatePinList(), and findAllUnitsOfSymbol().
|
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.
Definition at line 223 of file netlist_exporter_base.cpp.
References appendResolvedPins(), eraseDuplicatePins(), findAllUnitsOfSymbol(), SCH_SYMBOL::GetLibSymbolRef(), SCH_SYMBOL::GetPins(), SCH_SYMBOL::GetRef(), LIB_SYMBOL::GetUnitCount(), SCH_SYMBOL::IsPower(), itemNetName(), m_libParts, 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 352 of file netlist_exporter_base.cpp.
References IsAutoGeneratedNetName().
Referenced by 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.
Definition at line 405 of file netlist_exporter_base.cpp.
References appendResolvedPins(), SCH_SYMBOL::GetRef(), itemNetName(), m_exportSheets, pin, and SCH_SYMBOL_T.
Referenced by 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 177 of file netlist_exporter_base.cpp.
References SCH_SCREEN::GetLibSymbols(), SCH_SYMBOL::GetRef(), SCH_SYMBOL::GetSchSymbolLibraryName(), LIB_SYMBOL::GetUnitCount(), SCH_SHEET_PATH::LastScreen(), m_libParts, m_referencesAlreadyFound, SCH_SYMBOL_T, and EDA_ITEM::Type().
Referenced by NETLIST_EXPORTER_ALLEGRO::extractComponentsInfo(), NETLIST_EXPORTER_XML::makeSymbols(), NETLIST_EXPORTER_SPICE::ReadSchematicAndLibraries(), NETLIST_EXPORTER_CADSTAR::writeNetlist(), NETLIST_EXPORTER_ORCADPCB2::writeNetlist(), and NETLIST_EXPORTER_PADS::writeNetlist().
|
protectedinherited |
Definition at line 315 of file netlist_exporter_base.cpp.
References KIWAY::FACE_CVPCB, KIFACE_FOOTPRINT_PAD_NUMBERS, m_footprintPadCache, m_kiway, and m_schematic.
Referenced by resolvePadNumbers().
|
protectedinherited |
Definition at line 119 of file netlist_exporter_base.cpp.
References m_exportItemNets, and EDA_ITEM::m_Uuid.
Referenced by CreatePinList(), findAllUnitsOfSymbol(), and NETLIST_EXPORTER_SPICE_MODEL::readPorts().
|
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 141 of file netlist_exporter_base.cpp.
Referenced by SCH_EDIT_FRAME::WriteNetListFile().
|
protectedinherited |
Definition at line 75 of file netlist_exporter_base.cpp.
References m_exportItemNets, m_exportNets, m_exportSheets, m_schematic, NO_RECURSE, path, result, SCH_NO_CONNECT_T, and SCH_PIN_T.
|
protectedinherited |
Resolve aPin to its effective pad number(s) for every netlist path (issue #2282).
Definition at line 280 of file netlist_exporter_base.cpp.
References ExpandStackedPinNotation(), footprintPads(), SCH_PIN::GetEffectivePadNumber(), SCH_ITEM::GetParentSymbol(), LIB_ID::GetUniStringLibId(), m_kiway, m_schematic, pad, LIB_ID::Parse(), and RESOLVED.
Referenced by appendResolvedPins(), and NETLIST_EXPORTER_XML::makeListOfNets().
|
inlineinherited |
Definition at line 106 of file netlist_exporter_base.h.
References m_kiway.
Referenced by SCH_EDIT_FRAME::KiwayMailIn().
|
private |
Write a net list (ranked by Netcode), and pins connected to it.
Format:
Definition at line 140 of file netlist_exporter_cadstar.cpp.
References NETLIST_EXPORTER_BASE::m_exportNets, pin, StartLine(), and TO_UTF8.
Referenced by writeNetlist().
|
inherited |
Write to specified output file.
Definition at line 54 of file netlist_exporter_base.cpp.
References _, REPORTER::Report(), RPT_SEVERITY_ERROR, IO_ERROR::What(), IO_ERROR::what(), and writeNetlist().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and SCH_EDIT_FRAME::WriteNetListFile().
|
overridevirtual |
Write to specified output file.
Reimplemented from NETLIST_EXPORTER_BASE.
Definition at line 36 of file netlist_exporter_cadstar.cpp.
References _, NETLIST_EXPORTER_BASE::findNextSymbol(), GetBuildVersion(), SCH_SYMBOL::GetExcludedFromBoard(), SCH_SYMBOL::GetFootprintFieldText(), GetISO8601CurrentDateTime(), SCH_SYMBOL::GetRef(), SCH_SYMBOL::GetValue(), NETLIST_EXPORTER_BASE::m_exportSheets, NETLIST_EXPORTER_BASE::m_referencesAlreadyFound, EDA_ITEM::m_Uuid, REPORTER::Report(), RESOLVED, RPT_SEVERITY_ERROR, SCH_SYMBOL_T, StartLine(), TO_UTF8, and writeListOfNets().
|
protectedinherited |
Definition at line 174 of file netlist_exporter_base.h.
|
protectedinherited |
Definition at line 173 of file netlist_exporter_base.h.
Referenced by itemNetName(), and rebuildConnectivity().
|
protectedinherited |
Definition at line 172 of file netlist_exporter_base.h.
Referenced by NETLIST_EXPORTER_ALLEGRO::extractComponentsInfo(), NETLIST_EXPORTER_XML::makeListOfNets(), rebuildConnectivity(), NETLIST_EXPORTER_CADSTAR::writeListOfNets(), and NETLIST_EXPORTER_PADS::writeListOfNets().
|
protectedinherited |
Definition at line 171 of file netlist_exporter_base.h.
Referenced by NETLIST_EXPORTER_SPICE::BuildSheetList(), NETLIST_EXPORTER_ALLEGRO::extractComponentsInfo(), findAllUnitsOfSymbol(), NETLIST_EXPORTER_XML::getSheetComponentClasses(), NETLIST_EXPORTER_XML::makeDesignHeader(), NETLIST_EXPORTER_XML::makeGroups(), NETLIST_EXPORTER_XML::makeSymbols(), rebuildConnectivity(), NETLIST_EXPORTER_CADSTAR::writeNetlist(), NETLIST_EXPORTER_ORCADPCB2::writeNetlist(), and NETLIST_EXPORTER_PADS::writeNetlist().
|
mutableprotectedinherited |
Definition at line 238 of file netlist_exporter_base.h.
Referenced by footprintPads().
|
protectedinherited |
Definition at line 236 of file netlist_exporter_base.h.
Referenced by footprintPads(), resolvePadNumbers(), and SetKiway().
|
protectedinherited |
unique library symbols used. LIB_SYMBOL items are sorted by names
Definition at line 231 of file netlist_exporter_base.h.
Referenced by CreatePinList(), NETLIST_EXPORTER_ALLEGRO::extractComponentsInfo(), 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 228 of file netlist_exporter_base.h.
Referenced by NETLIST_EXPORTER_ALLEGRO::extractComponentsInfo(), findNextSymbol(), NETLIST_EXPORTER_XML::makeGroups(), NETLIST_EXPORTER_XML::makeSymbols(), NETLIST_EXPORTER_SPICE::ReadSchematicAndLibraries(), NETLIST_EXPORTER_CADSTAR::writeNetlist(), NETLIST_EXPORTER_ORCADPCB2::writeNetlist(), and NETLIST_EXPORTER_PADS::writeNetlist().
|
protectedinherited |
The schematic we're generating a netlist for.
Definition at line 234 of file netlist_exporter_base.h.
Referenced by NETLIST_EXPORTER_SPICE::BuildSheetList(), NETLIST_EXPORTER_SPICE::collectMergedSimPins(), NETLIST_EXPORTER_SPICE::collectUnitPinMaps(), NETLIST_EXPORTER_ALLEGRO::extractComponentsInfo(), footprintPads(), NETLIST_EXPORTER_SPICE::getDecomposition(), NETLIST_EXPORTER_XML::makeDesignHeader(), NETLIST_EXPORTER_XML::makeGroups(), NETLIST_EXPORTER_XML::makeListOfNets(), NETLIST_EXPORTER_XML::makeNetChains(), NETLIST_EXPORTER_XML::makeSymbols(), NETLIST_EXPORTER_XML::makeVariants(), NETLIST_EXPORTER_BASE(), NETLIST_EXPORTER_SPICE::readModel(), NETLIST_EXPORTER_SPICE::ReadSchematicAndLibraries(), rebuildConnectivity(), resolvePadNumbers(), NETLIST_EXPORTER_SPICE_MODEL::WriteHead(), NETLIST_EXPORTER_SPICE::writeInclude(), and NETLIST_EXPORTER_ALLEGRO::writeNetlist().