Complete ASIC Implementation using Verilog HDL, OpenLane & Sky130 PDK
A Multiply–Accumulate (MAC) unit is a digital hardware block widely used in Digital Signal Processing (DSP) and computer architectures.
This repository demonstrates the complete RTL → GDSII ASIC implementation flow of a custom 4-bit MAC Unit using Ubuntu, OpenLane, and the Sky130 Process Design Kit (PDK).
The overall ASIC implementation flow remains the same across platforms (Ubuntu, Azure VM, etc.); only the installation and terminal commands vary slightly.
Figure 1. MAC Unit Block Diagram
Navigate to the OpenLane directory and follow the steps below.
| Step | Description |
|---|---|
| Step 1 |
Create a new project directory. |
| Step 2 |
Move into the project directory. |
| Step 3 |
Create the |
| Step 4 |
Move into the source directory and create the CLA module. Paste the CLA Verilog code, save the file, and close the editor. |
| Step 5 |
Repeat the same process for:
After creating each file, verify using |
| Step 6 |
Return to the project directory. |
| Step 7 |
Create the OpenLane configuration file. Paste the configuration code and save it. |
Figure 2. Terminal View
---Move into the src directory and compile the design.
iverilog -o mac_sim acc.v cla.v multiplier.v mac.v mac_tb.vRun the simulation.
vvp mac_simAfter successful execution, the terminal should display the simulation output.
Figure 3. RTL Simulation Output
Open the waveform.
gtkwave dump.vcdInside GTKWave:
- Select tb_mac_unit
- Add the required signals
- Adjust the zoom level to inspect the waveform
Figure 4. GTKWave Verification
Return to the OpenLane directory.
cd ~/OpenLaneLaunch the Docker container.
make mountRun the complete OpenLane flow.
./flow.tcl -design MAC_unitOpenLane will automatically perform:
- RTL Elaboration
- Logic Synthesis
- Floorplanning
- Placement
- Clock Tree Synthesis
- Routing
- DRC
- LVS
- GDSII Generation
|
|
|
|
|
|
Ignore minor warnings if present. The important message is:
SUCCESS : Flow Complete
Locate the generated GDSII file.
find . -name "*.gds"Open the generated layout.
klayout <path_to_gds_file>Figure 5. Generated GDSII File
Figure 6. KLayout View
Copy the generated .gds file and upload it to
Tiny Tapeout GDS Viewer
https://gds-viewer.tinytapeout.com/
Figure 7. 3D Visualization of the Final GDSII Layout
The project consists of the following Verilog modules.
| File | Description |
|---|---|
multiplier.v |
Sequential Shift-and-Add Multiplier |
cla.v |
17-bit Carry Lookahead Adder |
acc.v |
17-bit Accumulator |
mac.v |
Top-level MAC Module |
mac_tb.v |
Functional Testbench |
config.json |
OpenLane Configuration |
The complete RTL → GDSII implementation of the MAC Unit has been successfully demonstrated.
This design can be further extended into:
- Multi-MAC Arrays
- Pipelined Architectures
- Systolic Arrays
- Matrix Multiplication Engines
- CNN / AI Accelerators
- FPGA Implementations











