Example: GDS → ROOM → text dump
The gds_to_room program — layout import workflow
Schematic import from Qucs: Qucs example.
1. Build (VS Code)
Ctrl+Shift+B → choose a task:
| Task | Output |
|---|---|
| Build: Static Libraries (.a) | build/libroom.a, build/libroom_utils.a |
| Build: All Targets | Libraries + gds_to_room.exe, make_sample_gds.exe |
| Install: Libraries + Headers | install/ prefix for other projects |
| Example: Build & Run Full Demo | Sample GDS → output/sample.room |
2. Build (command line)
cmake -S . -B build -G "MinGW Makefiles"
cmake --build build --target room room_utils
On first cmake configure, Cap'n Proto is built into third_party/capnp-install/ automatically. Sample layout GDS can come from the IHP Open Source PDK (sg13g2) or make_sample_gds.
3. Link from another project
# after: VS Code task "Install: Libraries + Headers"
list(APPEND CMAKE_PREFIX_PATH "C:/path/to/Room/install")
find_package(ROOM REQUIRED)
add_executable(my_app main.cpp)
target_link_libraries(my_app PRIVATE ROOM::room_utils)
target_include_directories(my_app PRIVATE ${ROOM_INCLUDE_DIRS})
# also link capnp + kj from third_party/capnp-install/lib
4. Sample GDS
.\build\make_sample_gds.exe testdata\sample.gds
Creates a minimal GDS with cells INV and TOP.
5. Import
.\build\gds_to_room.exe testdata\sample.gds output\sample.room output\sample.txt
| Argument | Description |
|---|---|
input.gds | Input GDSII file |
output.room | Binary ROOM file (Cap'n Proto) |
dump.txt | Text dump (optional; defaults to output.room.txt) |
6. Example source
Source file: examples/gds_to_room/main.cpp
#include "database.h"
#include "gds_importer.h"
#include "text_dump.h"
room::GdsImporter importer;
room::Database db = importer.importFile("testdata/sample.gds");
db.saveToFile("output/sample.room");
room::TextDumper dumper;
dumper.dumpToFile(db, "output/sample.txt");
// round-trip check
room::Database reloaded = room::Database::loadFromFile("output/sample.room");
Core headers are under src/ (database.h, …).
Utility headers are under utils/ (gds_importer.h, text_dump.h).
CMake adds both directories to the include path for linked targets.
7. Data flow
GDS file
│
▼
GdsImporter::importFile()
│ STRNAME, BOUNDARY, PATH, SREF, TEXT, UNITS …
▼
Database → Lib → Cell → CellContent(layout).payload.layout.block
│
├─► Database::saveToFile() → sample.room
└─► TextDumper::dumpToFile() → sample.txt
8. GDS → ROOM mapping
| GDS record | ROOM |
|---|---|
| STRNAME | Cell |
| LAYER + DATATYPE | LayerSpec in Lib::layers() |
| BOUNDARY / BOX | Shape::Polygon |
| PATH | Shape::Path |
| TEXT | Shape::Text |
| SREF | Instance |
| UNITS | CellContent::dbuPerMicron() |
9. Sample dump output
=== ROOM text dump ===
version: 1.0
generator: ROOM GdsImporter
lib: gds_import
layers: 3
cells: 2
cell "TOP"
type layout dbuPerMicron=1000.000
bbox=(0,0)-(5000,5000)
shapes=2 instances=1 nets=0
shape path layer=L2/D0 width=200 points=2
shape text layer=L3/D0 "TOPCELL" at (100,100)
instance -> "INV" at (2000,2000)
Limitations
- AREF is not expanded into geometry
- Only
ViewType::Layoutis imported from GDS - GDS user properties (PROPATTR/PROPVALUE) map to
gds.prop.<attr>on cells, shapes, and instances