Skip to content

Conversation

@supertjhok
Copy link

Summary of fixes

1) Config file: accept -c <chipsmith_config.toml> and improve errors

Files: src/main.cpp (or wherever main lives), src/chipsmith/chipFill.cpp

  • Enabled the banner (welcomeScreen()).
  • Hard‑coded config.toml removed. We now parse an optional -c/--config CLI flag and pass that filename through the tool flow. If the flag is omitted we fall back to config.toml for backwards compatibility.
  • Added strict/clear error messages when required top‑level tables are missing from the config, printing the available keys before exiting.

Why: The ViPeR flow provides a chipsmith_config.toml separate from the top‑level config.toml. The original chipSmith always tried to read config.toml, producing confusing errors.


2) Read ViPeR’s new TOML keys and translate to chipSmith’s internal structures

File: src/chipsmith/chipFill.cpp

  • We 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 legacy GateBiasCorX map that placeBias() uses.

    • For each block (e.g. [Biasing_Coordinate.AND2T]), we take the first element of top = [<x>] as the bias x‑offset (in microns).
    • We map the logical gate name (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] contains

    routingLayers = ["M1", "M3"]

    We 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.cpp

  • Previously, the via cell ViaM1M3 lived in [GDS_LOCATIONS] (with the fill cells) and was only imported when fill = true.
    But we always place via SREFs regardless of fill. Result: GDS had references to ViaM1M3 but 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()) with fillEnable.
    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)

  • Added the missing header:
    #include <cstdint>
    to fix 'uint32_t'/'uint64_t' was not declared errors.
  • (Optional) You can statically link libstdc++/libgcc if you need a standalone EXE (larger file). The dynamic build is smaller and loads the runtime DLLs from the toolchain.

Why: Current GCC requires <cstdint> when using fixed‑width integer types.


5) Quality‑of‑life

  • Printed the units and grid summary during importData().
  • Parsed the configFileUnits and gdsUnits parameters from chipsmith_config.toml to replace hardcoded geometry scaling parameters in chipFill.cpp.
  • Improved consistency of console logging (clearly separates import, routing, biasing, write stages).
  • Kept the original via placement logic (SREFs at DEF via sites) but ensured the via cell is always available (see §3).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants