Macros: reusing a hardened block
A macro is a block you have already taken through LibreLane, placed in a bigger design as one finished piece. Harden the block in its own project, save the run to My macros, then add it to the top-level project from the file list. You do not upload or paste anything.
New to this?
Follow the tutorial first: it builds a small adder and places it in a chip, step by step with screenshots. This page is the reference.What a macro is#
A finished LibreLane run produces a layout (.gds), an abstract of its pins and outline (.lef), a gate-level netlist, timing libraries (.lib) and parasitics (.spef). Together they let another design place the block without building it again.
These files cannot be uploaded through the file picker. A layout runs to megabytes, so Vulkos keeps them outside the project's file list and hands them to each run for you.
Use a block in a bigger design#
- 1
Harden the block
Run LibreLane on the block in its own project until the run completes. - 2
Save the run to My macros
Open the finished run's Analysis page and choose Save to My macros. The block is now in your library, named after its top module. - 3
Add it to the top-level project
Open the project that will use the block. Above the file list, choose Add macro, then Add beside the block. - 4
Place it and run
Vulkos writes the block intoconfig.json, places each instance it finds in your top module, connects its power and puts its Verilog in the file list. Run LibreLane as usual.
What goes in config.json#
Adding a block writes an entry like this. The paths are filled in for you, and so is an instance for each one found directly inside your top module, placed where there is room. Move a block by editing its location.
1"MACROS": {
2 "counter": {
3 "gds": ["dir::macros/counter/counter.gds"],
4 "lef": ["dir::macros/counter/counter.lef"],
5 "nl": ["dir::macros/counter/counter.nl.v"],
6 "lib": { "nom_tt_025C_1v80": ["dir::macros/counter/lib/nom_tt_025C_1v80.lib"] },
7 "spef": { "nom_*": ["dir::macros/counter/spef/nom.spef"] },
8 "instances": {
9 "u_counter": { "location": [100, 100], "orientation": "N" }
10 }
11 }
12}- The instance name (
u_counter) is the name in your top-level Verilog. The location is the block's lower left corner in microns. - Leave the block's own Verilog out of
VERILOG_FILESin the top level, so it is placed as a block and not synthesised again. - The die has to be big enough for the blocks. Set
FP_SIZINGtoabsolutewith aDIE_AREA. - If you instantiate the block after adding it, open Add macro and choose Update. It places the new instance and connects its power, and keeps everything you already set.
The file list shows one small file per block, macros/<name>/macro.json. It records which run the block came from, its size and its power pins. If you delete it, later runs no longer get the block's files, so take its entry out of MACROS as well.
Where to put a block#
LibreLane clears the standard-cell rows for 10 microns around a block. If a block sits a little further than that from the die edge, a strip of rows a few microns wide is left beside it. No power strap fits in a strip that narrow, so the cells in it are unpowered and the run fails sign-off.
- Put a block 10 microns from the left or right die edge, so no rows are left on that side. Add macro puts the first block at
[10, 10]. - Put two blocks side by side 20 microns apart, so the cleared areas meet.
- Otherwise leave a wide gap: more than
FP_PDN_VPITCHplus about 20 microns, so a strap lands in it.
Hundreds of DRC errors after adding a block
If the run finishes but reports hundreds of Magic DRC errors, allnwell.4, LU.2 and LU.3, and LVS does not match, a block is leaving a narrow strip. Open Add macro and choose Update: it names the block to move.Power#
Add macro also writes the power settings a top level needs. You should not have to touch them, but this is what they are for.
PDN_MACRO_CONNECTIONShas one line per instance, tying the block's power and ground pins to the top-level power nets.FP_PDN_MULTILAYERis switched on. A block has its power pins as vertical stripes on one layer, and they join the top level through horizontal straps, which are only drawn with this on.FP_PDN_HPITCHis kept to half the block's height or less, so a horizontal strap always crosses the block, andFP_PDN_VPITCHto half its width or less.
PDN-0232 and PDN-0233
A run that stops with "the grid macro has no shapes" and "failed to generate full power grid" has a top level with no horizontal straps for the block to join. Open Add macro and choose Update, which sets the two values above. Changing the strap layers does not fix it.The block's Verilog#
Adding a block also brings its Verilog, in macros/<name>/rtl/. These are the files the block's own config.json listed under VERILOG_FILES, plus its headers, as they were when the run was started. Its testbench is not included.
- Open them to read the module's ports before you instantiate it in the top level.
- A simulation of the top level compiles them, so a testbench that drives the whole chip works.
- They open read-only. They record what was hardened, so to change the block, change it in its own project and harden it again.
- LibreLane does not build them and Vulkos never adds them to
VERILOG_FILES. Do not add them yourself: the module would be defined twice. - If the project already has a module of the same name in its own files, the Verilog is not copied in, because two copies of a module stop every simulation.
A block saved before this was added has no Verilog with it. Save its run to My macros again, then choose Update.
Updating a block#
A macro is a copy of one run. After you harden the block again, save the new run to My macros, then open Add macro in the top-level project and choose Update. The file paths are refreshed and the instances you placed are kept.
Things to know#
- The block and the top level must be built for the same PDK. A run with a mismatch stops before it starts.
- A copied or forked project keeps the
macro.jsonfile but not the block's files. Add the block again from My macros. - Removing a block from My macros does not affect projects that already added it.
- One macro can be up to 150 MB across all its files.