Simulation says your SoC behaves correctly. Synthesis says whether it can be built: it turns the RTL into a netlist of real logic cells from a cell library and reports what that costs in area and which cells it needed. This article synthesizes cvsoc block by block on the open SkyWater 130 nm library, shows where the logic area goes, explains why the memories are left out as black boxes and what they would cost as real macros, and describes the two checks of exercise S17: no latches, and enough flip-flops to show that nothing was optimized away.
9 min read | Intermediate
What You'll Learn
- Explain what synthesis reports about an SoC and why memories are treated as black boxes
- Read the area and flip-flop count of each block and explain the differences
- Compare the logic of an SoC with the area of its memories
- Find the RTL patterns that make synthesis infer latches or remove logic
Before You Start
This section needs Verilog: see the Verilog Tutorial. Pass S16 first (The Complete SoC): S17 synthesizes the same modules. Memories in a System explains memory macros, and Single-Cycle vs Pipelined: Cycles and Clock Period shows the synthesis of the core itself. In the RTL Synthesis tutorial, Synthesis Fundamentals covers synthesis in depth and Common Synthesis Issues covers latches.
What Synthesis Tells You
Synthesis translates RTL into a netlist: a list of standard cells (gates, multiplexers, flip-flops) from a cell library, and the wires between them. Every cell has a known area, so the netlist gives the logic area of the design. It also reveals what the RTL really describes: a case without a default becomes a latch, a register whose output drives nothing disappears, a 64-bit comparison becomes a chain of gates. The lab synthesizes with Yosys on sky130_fd_sc_hd, the high-density cell library of SkyWater's open 130 nm process.
Black Boxes for the Core and the Memories
Not everything in cvsoc should be synthesized here:
- The TCM and the SRAM are 64 KB and 16 KB: 655,360 bits. Synthesized as flip-flops they would take hundreds of thousands of cells and a very long run, and no real chip builds them that way. They are made as memory macros, dense blocks generated by a memory compiler and placed whole.
- The core was synthesized on its own in the Computer Architecture tutorial (exercise E17) and is the same here.
- Simulation control exists only in simulation.
A black box tells the synthesis tool that a module exists, with these ports, but that its inside is not to be synthesized. The S17 starter declares the four as black boxes: a module with its port list, an empty body and the attribute (* blackbox *). Yosys keeps their ports connected and synthesizes everything else, with cvsoc_top as the top module: the manager port, the interconnect, the bridge and the three peripherals, plus the small logic inside the CPU subsystem. That is everything you wrote except the TCM and the SRAM.
Area by Block
Synthesized one by one on sky130_fd_sc_hd at the typical corner, the blocks of the reference design come out as:
The order is not what a block diagram suggests. The timer is the largest block: two 64-bit registers (128 flip-flops), a 64-bit incrementer and a 64-bit comparator. The UART follows, mostly its FIFO: 8 bytes are 64 flip-flops before any control. The bridge registers a whole transaction (address, data, byte enables, read data), which costs 89 flip-flops. The interconnect, which routes every transaction in the system, is the smallest: with one manager and two subordinates it is mostly multiplexers and a few bits of state. Together, in cvsoc_top, the blocks take 19,630 µm² with 410 flip-flops, a little less than their sum because synthesis simplifies across block boundaries. The 3-stage core alone is 64,059 µm², three times as much, mostly its register file.
Quick Check
Q: The timer has 128 flip-flops and the GPIO 32. Where do they come from, and why is a peripheral that just counts so much larger than one that drives 32 pins?
Show Answer
The timer stores MTIME and CMP, 64 bits each: 128 flip-flops. The GPIO stores only OUT, 32 bits; IN is read straight from the pins. The timer also needs a 64-bit adder to count and a 64-bit comparator for irq, while the GPIO needs only a read multiplexer. Width costs area, whatever the block's job sounds like.
Logic Against Memory
The open SkyWater memory compiler produces a 2 KB SRAM macro of 284,539 µm². Built from those, the 64 KB TCM would take 32 macros, about 9.11 mm², and the 16 KB SRAM 8 macros, about 2.28 mm². Next to that, all the logic, core included, is about 0.084 mm²:
The logic is less than 1 percent of the estimate. The estimate is rough: it counts cell area only, without placement and wiring, and a real chip would use larger macros that store more bits per square micrometre. But the conclusion holds in real microcontrollers too: their area is mostly memory, and how much memory to put on the chip is one of the first and most expensive decisions an architect makes. Memories in a System compares the macro sizes in detail.
The Two Checks of S17
No latches. A latch appears when combinational logic does not give an output a value on every path: an always block whose case has no default, or an if without an else. In simulation the output simply keeps its old value; in hardware that memory is a latch, which the rest of the design does not expect and timing tools handle badly. The test fails if the netlist contains any sky130_fd_sc_hd__dl* cell. The usual cause in this SoC is a peripheral's read multiplexer: prdata in a case on paddr without a default.
Registers present. The reference netlist has 346 plain flip-flops (the grader counts cells such as dfxtp and dfrtp, not the flip-flops with an enable pin, which is why this number is lower than the 410 above). The test requires at least 300. A much lower count means synthesis removed logic, and synthesis removes logic only when its outputs drive nothing. A wrong solution that disconnects the CPU subsystem from the interconnect, for example, keeps only 100 flip-flops: with no transaction able to reach them, the bridge and the peripherals' registers can never change, and synthesis deletes them. The check is a cheap way to catch a connection that simulation of a few programs might miss.
Where Does This Matter?
On real projects, synthesis of the integrated SoC runs every night, long before tape-out, and its reports are watched for exactly these signs: new latches, flip-flop counts that drop suddenly (a connection lost somewhere), and area that grows faster than the features. Memories are handled as macros from the start, with their own timing and area models from the memory compiler. Tapeout Readiness and SoC Sign-Off lists the checks that follow.
Common Mistakes
Mistake #1: Pasting the TCM and SRAM too
The starter's black boxes already define cvsoc_tcm and cvsoc_axil_sram. Pasting your own modules with the same names is a duplicate definition; leave them out, and leave out your own core if you used one.
Mistake #2: A case without a default in a read multiplexer
It simulates correctly, because the tests only read valid offsets, and it synthesizes into latches. Give every combinational output a value on every path, for example a default of 0.
Mistake #3: Reading a low flip-flop count as "small and efficient"
If your count is far below the reference, something was removed, not optimized. Look for an output or a VALID that is not connected in cvsoc_top.
Your Turn in the Lab
Exercise S17: paste your S16 modules below the black boxes in the starter, without the TCM, the SRAM and your own core, and submit. The lab synthesizes them and reports the flip-flop count and any latch cells it finds.
Open exercise S17 in ChipVerify LabSummary
- Synthesis turns the RTL into a netlist of library cells and shows its area; S17 synthesizes
cvsoc_toponsky130_fd_sc_hdwith the core, the two memories and simulation control as black boxes. - The timer is the largest block (two 64-bit registers, an adder and a comparator), the interconnect the smallest; together the blocks take 19,630 µm², a third of the core's 64,059 µm².
- As 2 KB macros the TCM and SRAM would take about 11.4 mm², against about 0.084 mm² of logic: the chip is mostly memory.
- S17 fails on any latch cell and on fewer than 300 plain flip-flops (the reference has 346); the first points to incomplete combinational logic, the second to a lost connection.