build: split core/ from frontends/; prepare for multiple GUI/TUI targets
Reorganise the tree into business vs frontend as separate directories:
src/core/{domain,imports,app} (was system/, imports/, app/)
src/frontends/tui/ (was tui/ + main.cpp)
tests/tui/ (the FTXUI-coupled helper test)
All cross-dir #include paths rewritten; same-dir includes untouched.
CMake: essim_core is the frontend-agnostic business library — links libzip,
pugixml and bsdl, NO GUI toolkit. Each frontend is a self-contained
src/frontends/<name>/ (own CMakeLists, toolkit, main.cpp) that links
essim_core, selected with -DESSIM_FRONTEND=<name> (default tui; 'none' = core +
tests only, no toolkit fetched). FTXUI moved into the tui frontend. Tests are
split: essim_tests links essim_core (no FTXUI), essim_tui_tests links essim_tui.
Verified: default tui build green (ctest 2/2); ESSIM_FRONTEND=none builds the
core + tests with FTXUI never fetched and no `essim` binary.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
36
src/core/domain/pin_role.hpp
Normal file
36
src/core/domain/pin_role.hpp
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef _PIN_ROLE_HPP_
|
||||
#define _PIN_ROLE_HPP_
|
||||
|
||||
#include "pin_spec.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class Part;
|
||||
|
||||
// For a given connector type and pin position, return the expected PinSpec
|
||||
// (function/direction/pad + source). Used at `set-connector-type` to populate
|
||||
// each pin's `spec`, then later by `verify` to flag mismatches between the
|
||||
// connector's expectation and the actual signal's inferred/declared type.
|
||||
//
|
||||
// Returns a default PinSpec (function Unknown, source None) for unknown
|
||||
// connector types or unmatched pins — i.e. "no expectation, no constraint".
|
||||
PinSpec pin_role(const std::string &connector_type,
|
||||
const std::string &pin_name);
|
||||
|
||||
// Canonical full pin-name list for the connector type (e.g. for VPX 3U,
|
||||
// every (col, row) position the connector physically has). Returns an empty
|
||||
// vector for connector types that don't have a registered layout — callers
|
||||
// must treat that as "unknown, do not auto-fill".
|
||||
//
|
||||
// Used at `set-connector-type` to materialise NC pins for positions absent from the
|
||||
// imported netlist (Altium drops NC, Mentor doesn't). Stub today: every
|
||||
// known kind returns {} — populate alongside `vpx_3u_role`.
|
||||
std::vector<std::string> pin_layout(const std::string &connector_type);
|
||||
|
||||
// For each canonical pin in `pin_layout(kind)` not already present on `p`,
|
||||
// add a NC pin using the canonical name. Returns the number created.
|
||||
// No-op when the layout is empty (unknown kind).
|
||||
int FillPartFromLayout(Part *p, const std::string &connector_type);
|
||||
|
||||
#endif // _PIN_ROLE_HPP_
|
||||
Reference in New Issue
Block a user