Layup is a lightweight, browser-based viewer for LEF, DEF, and GDSII layout files.
It helps you quickly inspect MACRO geometry, pins, layers, and obstructions (OBS) for library / layout understanding and early verification—without installing heavy EDA tools.
https://adachi6k.github.io/Layup/
- Drag & drop, file picker, or sample URL loading
- LEF, DEF, and GDSII file loading
- Layer visibility toggling (Metal / Via / PIN / OBS)
- Zoom & pan (mouse & touch)
- Macro switching with size / origin display
- Pin list with direction, use, and geometry preview
- Obstruction (OBS) visualization
- File statistics (macro count, pin count, etc.)
- Responsive layout (desktop / mobile)
| Category | Supported Items |
|---|---|
| Version | 5.6+ core constructs (progressively expanding) |
| MACRO | NAME, CLASS, SIZE, ORIGIN, SYMMETRY (when present) |
| PIN | DIRECTION, USE, PORT (LAYER / RECT) |
| LAYER | Common metal layers (M1–M8) and via layers (V1–V5) |
| OBS | LAYER / RECT |
| Not yet | ANTENNAMODEL, advanced SPACINGTABLE forms, complex SITE usage, POLYGON, etc. |
Open an issue if you need unsupported constructs.
- Provide a
.lef,.def,.gds, or.gdsiifile (drag & drop, choose file, or load a sample). - Use the left panel to:
- View file summary
- Toggle layer visibility
- Select macros
- Explore the central Canvas view:
- Zoom with mouse wheel / pinch
- Pan by dragging
- Inspect pins in the right panel:
- Direction / use / layer rectangles
- Iterate across macros as needed.
All parsing happens locally inside the browser (no server upload).
- Node.js 18+
- npm / yarn / pnpm
git clone https://github.com/adachi6k/Layup.git
cd Layup
npm install
npm run dev
# Open http://localhost:5173npm run build
npm run preview # Optional local previewBuild artifacts are emitted to dist/ and can be hosted on any static hosting (GitHub Pages, Vercel, Netlify, etc.).
| Path | Purpose |
|---|---|
src/App.tsx |
Application shell that chooses the active LEF / DEF / GDS viewer |
src/hooks/useLayoutFiles.ts |
File loading, URL loading, parser dispatch, and view-mode state |
src/components/AppNavbar.tsx |
Loaded-file summary and LEF / DEF / GDS view-mode switcher |
src/components/FileDropZone.tsx |
Initial drag-and-drop, file picker, and sample-file loading UI |
src/types/lef.ts |
TypeScript interfaces for LEF entities |
src/utils/lefParser.ts |
Text → normalized in‑memory model |
src/components/LEFViewerCanvas.tsx |
Main LEF Canvas visualization with macro, layer, and pin panels |
src/types/def.ts |
TypeScript interfaces for DEF entities |
src/utils/defParser.ts |
DEF text parser for die area, components, pins, and net connectivity |
src/components/DEFLayoutViewer.tsx |
DEF Canvas visualization for die, components, pins, and LEF-assisted macro sizes |
src/types/gds.ts |
TypeScript interfaces for GDSII entities |
src/utils/gdsParser.ts |
Binary GDSII → normalized in-memory model |
src/components/GDSViewer.tsx |
GDSII canvas visualization |
Raw LEF / DEF text or GDSII binary data
↓ (tokenization / parsing)
Normalized layout model (macros / pins / layers / rects / polygons / references)
↓
React state
↓
Canvas rendering (grouped per layer -> geometry -> styled)
- LEF, DEF, and GDS coordinates are mapped into Canvas world coordinates.
- Each viewer owns format-specific drawing while sharing common interaction concepts: wheel zoom, drag pan, reset / fit, cursor coordinates, and layer visibility.
- LEF uses a Canvas renderer as the active production viewer; the older SVG and debug viewer variants have been removed to keep the codebase focused.
- Colors are deterministic per layer or orientation, with format-specific palettes.
npm install
npm run lint
npm run buildThere is no dedicated npm test script yet; parser and coordinate-transform tests are planned future work.
- Very large LEF files (tens of thousands of rects) may impact performance.
- DEF support parses DIEAREA, COMPONENTS, PINS, and NET connectivity, but routed net geometry is not yet rendered.
- GDS support focuses on BOUNDARY, PATH, SREF, and AREF geometry. Full text/property rendering is not yet supported.
- VIA compound definitions simplified to rectangles.
- Error handling for malformed LEF is basic.
- No POLYGON support (currently RECT only).
- 3D layer extrusion / stacked preview
- Richer DEF rendering for routed nets and pin shapes
- Export (PNG / SVG / PDF)
- Advanced filtering (pin name / layer / direction)
- Performance optimizations (tiling / virtualization)
- WebGL / Canvas backend for heavy geometry
- Ruler & coordinate probe
- Dark theme
- Internationalization (i18n)
- POLYGON & complex VIA support
Contributions / suggestions welcome.
You can load public LEF samples (subject to CORS):
- ASAP7 SRAM LEF: https://github.com/The-OpenROAD-Project/asap7_sram_0p0
Paste raw file URLs into the URL input field.
- Fork the repository
- Create a feature branch:
git checkout -b feat/your-feature - Implement & test:
npm run dev - (Optional) Lint / types:
npm run lint && npm run typecheck(add script if missing) - Commit:
git commit -m "feat: add your feature" - Push & open a Pull Request
// eslint.config.js (example)
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
import tseslint from 'typescript-eslint'
export default tseslint.config([
{
files: ['**/*.{ts,tsx}'],
extends: [
reactX.configs['recommended-typescript'],
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
},
},
])Q: Does the file ever leave my machine?
A: No. Parsing and rendering happen entirely in the browser.
Q: What units are shown?
A: LEF units (micron scale) are scaled proportionally into Canvas world coordinates.
Q: Are non-rectangular shapes supported?
A: Not yet—RECT only. File an issue if you require POLYGON.
Q: How are colors chosen?
A: Deterministic hash of layer names (planned customizable palette).
MIT License – see LICENSE for details.
Layup is an in-browser layout viewer: drop a file, toggle layers, inspect pins and geometry, and explore layouts without backend dependencies. Roadmap includes richer DEF/GDS support, exports, performance tuning, and a WebGL backend.
Bug reports & feature requests: please include reproduction steps and (if possible) a minimal LEF snippet.
Happy hacking!