A Rust-based LEF (Library Exchange Format) and DEF (Design Exchange Format) file viewer with a modern GUI built using egui.
- LEF File Support: Parse and visualize LEF files containing macro definitions, pins, and layout information
- DEF File Support: Parse and visualize DEF files with die area, components, nets, and routing information
- Interactive GUI: Modern interface with file browsing, zoom/pan controls, and detailed data inspection
- Real-time Visualization: Dynamic rendering of layout elements with proper scaling and positioning
- Cross-platform: Built with Rust and egui for Windows, macOS, and Linux support
- Static Binary: Linux version available with musl static linking for portable deployment
- Rust 1.70+ (install from rustup.rs)
git clone <repository-url>
cd lefdef-viewer
cargo build --release
For a fully static binary on Linux that doesn't depend on system libraries:
# Install musl target
rustup target add x86_64-unknown-linux-musl
# Install musl tools (on Debian/Ubuntu)
sudo apt-get install musl-tools
# Build with musl target
cargo build --release --target x86_64-unknown-linux-musl
The resulting binary will be at target/x86_64-unknown-linux-musl/release/lefdef-viewer
.
cargo run --release
- Open Files: Use File -> Open LEF File or Open DEF File to load your files
- Navigate: Use mouse drag to pan around the visualization
- Zoom: Use the zoom slider in the left panel or mouse wheel
- View Details: Enable "Show LEF Details" or "Show DEF Details" from the View menu for detailed information
- Reset View: Click "Reset View" to return to the original zoom and pan settings
The project is structured into several modules:
lef/
: LEF file parsing and data structuresmod.rs
: Core LEF data structures (LefMacro, LefPin, LefRect, etc.)parser.rs
: Nom-based parser for LEF filesreader.rs
: High-level reader interface
def/
: DEF file parsing and data structuresmod.rs
: Core DEF data structures (DefComponent, DefNet, DefPin, etc.)parser.rs
: Nom-based parser for DEF filesreader.rs
: High-level reader interface
gui.rs
: egui-based graphical user interfacemain.rs
: Application entry point
- MACRO definitions with class, source, and site information
- PIN definitions with direction, use, and shape
- PORT definitions with layer rectangles
- OBS (obstruction) definitions
- Size and origin information
- DIEAREA definitions
- GCELLGRID definitions (X and Y)
- Component placement information
- Pin definitions and locations
- Net connectivity (basic parsing)
- Row and track definitions
egui
: Immediate mode GUI frameworkeframe
: Application framework for eguinom
: Parser combinator library for file parsingserde
: Serialization frameworkrfd
: Native file dialoglog
&env_logger
: Logging support
Licensed under either of
- MIT License (LICENSE-MIT)
Contributions are welcome! Please feel free to submit a Pull Request.
- Enhanced DEF parsing (complete COMPONENTS, NETS sections)
- Layer management and visualization
- Export functionality (PNG, SVG)
- Advanced measurement tools
- Design rule checking visualization
- Technology file support
- Performance optimizations for large files