How 0xharry/rtl2gds works
The RTL2GDS project is an automated flow that converts RTL (Verilog) designs into GDSII layout files. Based on both the file tree and the README content, this is a specialized EDA tool that integrates synthesis and layout generation using external tools (iEDA and Yosys) along with a custom Python-based flow management system.
Main Components to Highlight
• User Input & Design Examples:
• RTL input files (Verilog) and configuration YAML files.
• Design example directory (design_zoo) where several sample designs like “gcd”, “aes”, and “picorv32a” are provided.
• Core Flow Engine (Python-based):
• “src/rtl2gds” directory that contains the main modules:
• The main entrypoint (__main__.py) for launching the flow.
• Chip management (chip.py), design constraints (design_constrain.py), and design path computation (design_path.py).
• The flow orchestration inside “src/rtl2gds/flow” which contains the actual flow logic (rtl2gds_flow.py, cloud_flow.py, step_runner.py).
• “metrics.py” and “global_configs.py” for monitoring and configuring the flow.
• Modular Steps:
• Under “src/rtl2gds/step”, break down different processing steps such as synthesis, floorplanning, placement, and routing.
• These modules (e.g., synthesis.py, floorplan.py, dump_layout_gds.py) represent discrete stages in the RTL to GDSII conversion.
• External Tools Integration:
• iEDA: There is both a prebuilt binary under “bin/iEDA” and several tools/scripts under “tools/iEDA”. This integration is responsible for layout generation aspects.
• Yosys: A prebuilt Yosys binary is provided in “bin/yosys”, including its own support files, which are used for synthesis and Verilog processing.
• Additional conversion/integration tools like sv2v (for SystemVerilog-to-Verilog conversion) appear in “bin/sv2v-Linux”.
• Foundry and Tech Libraries:
• The “foundry/sky130” directory includes LEF, LIB, and verilog files needed to define technology-specific cells and constraints.
• Cloud & Docker Integration:
• The project is designed to run in a containerized environment (with Docker support) as outlined in the README.
• Components such as “cloud_flow.py” in the flow directory indicate that the flow can incorporate cloud execution aspects, probably for scaling or remote processing.
Relationships and Interactions
• Flow starting with user-provided RTL and configuration files. These are read by the Python entrypoint.
• The orchestrator then sequences through several steps (synthesis, constraint generation, floorplanning, placement/routing, and finally GDSII generation). Each step is encapsulated in its own module.
• At key points, the orchestrator calls out to external tools (iEDA and Yosys) using prebuilt binaries or scripts found in “bin/” and “tools/iEDA” and “tools/yosys”.
• The foundry files (LEF/Lib/Verilog) feed into the steps to bring technology-specific details into the design.
Architectural Patterns and Design Principles
• The project follows a modular, step-based design, essentially an orchestration pattern where the flow is broken into distinct stages that can be developed, tested, and extended independently.
• It uses a clear separation of concerns:
• Input handling and configuration (design_zoo, YAML config files).
• Flow coordination (src/rtl2gds, flow, and step directories).
• Integration with external executables and EDA tools (iEDA, Yosys, and associated scripts).
• The use of Docker and cloud flow modules indicates attention to reproducibility and scalability.
Technologies, Frameworks, and Libraries
• Python for flow orchestration and control logic.
• Yosys (open-source synthesis tool) and iEDA (for physical design).
• Docker for environment reproducibility and containerized execution.
• Standard EDA file formats and libraries (LEF, LIB, GDSII).
• Additional utility tools such as klayout (for layout viewing) and third-party Python packages (pyyaml, orjson).