Add Viper compatibility and via import #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of fixes
1) Config file: accept
-c <chipsmith_config.toml>and improve errorsFiles:
src/main.cpp(or wherevermainlives),src/chipsmith/chipFill.cppwelcomeScreen()).config.tomlremoved. We now parse an optional-c/--configCLI flag and pass that filename through the tool flow. If the flag is omitted we fall back toconfig.tomlfor backwards compatibility.Why: The ViPeR flow provides a
chipsmith_config.tomlseparate from the top‑levelconfig.toml. The original chipSmith always tried to readconfig.toml, producing confusing errors.2) Read ViPeR’s new TOML keys and translate to chipSmith’s internal structures
File:
src/chipsmith/chipFill.cppWe still read the original chipSmith tables:
[GDS_CELL_LOCATIONS][GDS_MAIN_STR_NAME][GDS_LOCATIONS]New: we now parse
[Biasing_Coordinate.*](ViPeR style) and translate it into the legacyGateBiasCorXmap thatplaceBias()uses.[Biasing_Coordinate.AND2T]), we take the first element oftop = [<x>]as the bias x‑offset (in microns).AND2T) to the actual GDS main structure name via[GDS_MAIN_STR_NAME](e.g.LSmitll_AND2T_v2p1).Layer name normalization for routing: DEFs may emit
metal1,metal2, etc. ViPeR’s[Parameters]containsWe now route:
metal1→ GDS layer 10 (M1)metal2→ GDS layer 30 (M3)The PTL width comes from
Parameters.PTLwidth(µm) and is converted to GDS units.Why: Without these translations, no top‑level routing appeared (DEF layer names didn’t match the original hard‑coded mapping), and
placeBias()couldn’t find x‑offsets for modern config files.3) Via import decoupled from fill enable (critical bug fix)
Files:
src/chipsmith/chipFill.cppPreviously, the via cell
ViaM1M3lived in[GDS_LOCATIONS](with the fill cells) and was only imported whenfill = true.But we always place via SREFs regardless of
fill. Result: GDS had references toViaM1M3but no cell definition → vias appeared as “(ViaM1M3)” (empty) in KLayout.Fix: We always call
importFill()(which imports everything in[GDS_LOCATIONS]) and guard only the placement step (placeFill()) withfillEnable.This guarantees the via cell definition is present even when fill is disabled.
Why: Ensures via geometry is visible in the final GDS without forcing users to enable metal fill.
4) Build fixes for MSYS2/MinGW‑w64
Files:
include/gdscpp/gdsParser.hpp,src/gdscpp/gdsCpp.cpp(and any file using fixed‑width integer types)'uint32_t'/'uint64_t' was not declarederrors.Why: Current GCC requires
<cstdint>when using fixed‑width integer types.5) Quality‑of‑life
importData().configFileUnitsandgdsUnitsparameters fromchipsmith_config.tomlto replace hardcoded geometry scaling parameters inchipFill.cpp.