Project 1, Part 1: Setting Up and Configuring the ALU Flow
This is the first capstone project of Module 10. We begin with a purely combinational 8-bit arithmetic logic unit (ALU). The design contains no sequential clock pins, storage elements, or memory macros. This simple block allows us to execute the complete RTL-to-GDSII flow cleanly before introducing complex clock tree synthesis and macro floorplanning.
A simple design establishes baseline flow expectations. The configuration parameters, timing constraints, and verification procedures established here apply directly to more complex sequential designs.
Design Architecture: 8-Bit Combinational ALU
This block widens the 4-bit ALU from Module 2.2 of the Verilog course to an 8-bit data path. The ALU implements eight distinct operations selected by a 3-bit opcode S[2:0], outputting an 8-bit result and four status flags (Z, N, C, V):
Opcode S[2:0] |
Operation | Result Expression |
|---|---|---|
000 |
ADD | A + B |
001 |
SUB | A - B |
010 |
AND | A & B |
011 |
OR | A | B |
100 |
XOR | A ^ B |
101 |
NOT | ~A |
110 |
PASSA | A |
111 |
PASSB | B |
module alu8 (
input [7:0] A, B,
input [2:0] S,
output reg [7:0] Result,
output Z, N, C, V
);
// Combinational logic only; see Module 2.2 of the Verilog course
// for arithmetic/logic partitioning and status flag equations.
endmodule
The module contains no flip-flops and no clock port. This architecture dictates all configuration and constraint decisions.
Configuring OpenLane for Clockless Blocks
Default OpenLane settings assume sequential designs requiring clock tree synthesis. For alu8, configure the flow explicitly to disable clock tree generation:
{
"DESIGN_NAME": "alu8",
"VERILOG_FILES": "dir::src/alu8.v",
"CLOCK_PORT": null,
"CLOCK_PERIOD": 10,
"PNR_SDC_FILE": "dir::alu8.sdc",
"SIGNOFF_SDC_FILE": "dir::alu8.sdc",
"FP_SIZING": "relative",
"FP_CORE_UTIL": 35,
"PL_TARGET_DENSITY": 0.45,
"SYNTH_STRATEGY": "AREA 0",
"RUN_CTS": false
}
Setting CLOCK_PORT: null declares that the design lacks a physical clock net. Setting RUN_CTS: false instructs the flow to bypass clock tree synthesis cleanly. The PDK defaults to sky130A and standard cell library sky130_fd_sc_hd.
Setting CLOCK_PERIOD: 10 is necessary despite the absence of a physical clock pin. A combinational circuit requires input arrival and output delay constraints to calculate path delays during static timing analysis. Without a reference clock, commands set_input_delay and set_output_delay cannot calculate arrival times. We establish a virtual clock in the SDC file as an idealized timing reference.
SDC Timing Constraints
# alu8.sdc: This design has no clock pin; create a virtual clock reference.
create_clock -name vclk -period 10
set_input_delay 2.0 -clock vclk [get_ports {A[*] B[*] S[*]}]
set_output_delay 2.0 -clock vclk [get_ports {Result[*] Z N C V}]
set_driving_cell -lib_cell sky130_fd_sc_hd__buf_2 -pin X [all_inputs]
set_load 0.02 [all_outputs]
The command create_clock -name vclk -period 10 defines an internal virtual clock without attaching to an input pin. Allocating 2.0 ns for input delay and 2.0 ns for output delay leaves a maximum combinational propagation budget of $10.0 - (2.0 + 2.0) = 6.0\text{ ns}$ through the ALU.
Executing Logic Synthesis
Execute logic synthesis using OpenLane:
openlane --flow Classic --run-tag alu8_run1 --to Yosys.Synthesis designs/alu8/config.json
Yosys and ABC map the RTL into SkyWater 130 nm standard cells. Inspect the resulting synthesis summary report:
=== alu8 ===
Number of wires: 96
Number of wire bits: 212
Number of cells: 163
sky130_fd_sc_hd__a21oi_1 16
sky130_fd_sc_hd__and2_1 18
sky130_fd_sc_hd__buf_1 6
sky130_fd_sc_hd__clkinv_1 4
sky130_fd_sc_hd__mux2_1 32
sky130_fd_sc_hd__nand2_1 12
sky130_fd_sc_hd__o21ai_0 2
sky130_fd_sc_hd__or2_1 14
sky130_fd_sc_hd__xnor2_1 9
sky130_fd_sc_hd__xor2_1 24
...
Chip area for module '\alu8': 1958.1
The synthesized netlist contains 163 standard cells and zero sequential storage elements (dfxtp or latches). This confirms that Yosys inferred no accidental transparent latches from incomplete sensitivity lists. Total standard cell area is approximately 1,958 µm².
Never omit CLOCK_PERIOD on a combinational block. Omitting the parameter forces the tool to adopt an arbitrary default period, rendering STA slack metrics meaningless.
Practice Exercise
The synthesis report lists 32 mux2_1 multiplexer cells, representing 20% of total gate count. Using the opcode table, explain why an 8-operation ALU requires this multiplexer structure, and estimate how gate count changes if a ninth operation is added.
Solution
Selecting among eight operations per output bit requires a 3-level binary multiplexer tree ($2^3 = 8$). A complete multiplexer tree requires 7 two-input multiplexers per output bit, totaling $8 \times 7 = 56$ multiplexers for 8 data bits. Synthesis optimization reduces this count to 32 by sharing common sub-expressions between operations (such as deriving NOT and PASSA from input A).
Adding a ninth operation expands the multiplexer tree depth to 4 levels ($2^4 = 16$). Every output bit requires an additional multiplexer stage. Opcode selection architectures directly determine physical gate area.
In the next article, we advance this synthesized netlist through floorplanning, placement, and routing.