Example: Xschem schematic → ROOM → round-trip
The xschem_to_room program — import, save with view suffix, sniff, export
1. Run (command line)
.\build\xschem_to_room.exe examples\xschem_to_room\data\test.sch examples\xschem_to_room\output\test.schematic.room
| Argument | Description |
|---|---|
input.sch|sym | Xschem file (default: examples/xschem_to_room/data/test.sch) |
output.room | ROOM file — prefer <cell>.schematic.room |
roundtrip.out | Optional export for verification |
2. Sniff without loading geometry
#include "file_summary.h"
room::RoomFileInfo info = room::sniffRoomFile("test.schematic.room");
See file summary API and docs/SNIFF.md.
3. Data flow
Xschem .sch / .sym → XschemImporter (xschem_io) → Database::saveToFile
├─► sniffRoomFile() for LibMan routing
└─► XschemExporter → payload/*.sch
4. Coordinate scale
Xschem stores fractional schematic coordinates; ROOM uses dbuPerEditorUnit = 1000
(1000 DBU = 1.0 Xschem unit). Qucs views use 1.
Exporters call effectiveDbuPerEditorUnit() from utils/coord_scale.h.
See Coordinate scale.
5. Qucs ROOM in Xschem
When SourceInfo::format() is qucs, xschem_io maps Qucs component types to
Xschem symbols (GND → gnd.sym, Lib → qucs_blackbox.sym, etc.)
while applying the view's DBU scale.
6. In-process (Xschem + Tcl)
Build roomtcl.so and use xschem_bridge from Tcl.
See also: Qucs example · ROOM file naming