Chapter 13 of 14 · about 10 min
Reference: menus and commands
Workspace layout
~/fosslab/
fosslab.lib library definitions (like Cadence's cds.lib)
libs/<library>/<cell>/ one folder per cell, one file per view
<cell>.sch .sym .gds .va .v .spice .md
<tb>.ade.json a testbench's Simulation Environment setup
sim/<library>/<cell>/ simulations: netlist, .raw waveforms, logs
corners/ montecarlo/ Simulation Environment runs: one folder per run,
results.csv, histograms, bar charts
verif/<library>/<cell>/ drc/ lvs/ pex/ with their reports and status
fosslab.lib accepts DEFINE <library> <folder> and INCLUDE <another fosslab.lib> (for instance a library your teacher shares, which you see read only).
Commands
Every action of the Library Manager is also a command (in a terminal on the server):
| Command | Does |
|---|---|
fosslab | the Library Manager |
fosslab libs, fosslab cells LIB | list libraries; cells with their views and status |
fosslab new-lib NAME | new library |
fosslab new-cell LIB CELL --views schematic,symbol | new cell with views |
fosslab open LIB CELL --view layout | open a view in its program |
fosslab hier LIB CELL | print the design hierarchy (--gui for the browser) |
fosslab symbol LIB CELL | symbol from the schematic’s pins |
fosslab testbench LIB CELL | new testbench cell tb_CELL |
fosslab sim LIB CELL | netlist and simulate (--extracted c1,c2: use PEX views) |
fosslab drc|lvs|pex LIB CELL | verification (--show: in a window) |
fosslab va LIB CELL | compile the Verilog-A view |
fosslab copy SRCLIB CELL DSTLIB [NEW] | copy a cell (also from the PDK examples) |
fosslab rename LIB CELL NEW | rename, updating the instances in your schematics |
fosslab ade LIB TB | the Simulation Environment of a testbench |
fosslab corners LIB TB | run its corners (saved setup), print the table |
fosslab mc LIB TB [-n 200] [--variation mismatch|process] [--seed 1] | run its Monte Carlo, print the statistics |
fosslab example opamp [--lib NAME] | the tutorial’s reference library, generated in your workspace |
fosslab status | last results of every cell |
fosslab selftest | check every tool and flow |
The programs themselves are available too: xschem, klayout, ngspice, magic, netgen, openvaf, iverilog, gtkwave, yosys… and fosslab-shell opens a shell with the whole environment.
Keys worth knowing
| xschem | KLayout | ||
|---|---|---|---|
| Insert | place a symbol | F2 | zoom to fit |
| w | draw a wire | * | show all hierarchy levels |
| q | edit properties | b / p | box / path |
| e / Ctrl+e | descend / go up | i | instance (PCells: library SG13_dev) |
| i | descend into symbol | k | ruler |
| Ctrl+s | save | Ctrl+s | save |
The Simulation Environment’s setup file
Everything the Simulation Environment window shows is saved in <testbench>.ade.json next to the testbench’s schematic. You never need to edit it by hand, but it is plain text, and it is sometimes quicker (e.g. to copy a corner table from one testbench to another):
{
"variables": {"vdd": "1.2", "vcm": "0.8", "ibias": "10u", "cl": "1p"},
"outputs": [
{"name": "a0", "label": "DC gain", "min": 55, "max": null, "scale": 1.0, "unit": "dB", "expr": ""},
{"name": "g1m", "label": "Gain at 1 MHz", "min": 20, "max": null, "scale": 1.0, "unit": "dB",
"expr": "meas ac g1m find vdb(out) at=1e6"}
],
"corners": [
{"name": "ss_125C", "enabled": true, "mos": "mos_ss", "cap": "cap_wcs", "res": "res_typ",
"temp": 125, "vars": {"vdd": "1.08"}}
],
"montecarlo": {"runs": 200, "variation": "mismatch", "seed": 1, "jobs": 8},
"wave": "vdb(out)", "wave_logx": true
}
What a run does with it: the testbench is netlisted once; for each corner or Monte Carlo sample FOSSLab copies the netlist and changes the IHP .lib sections (mos_tt → the corner’s, or → mos_tt_mismatch/mos_tt_stat for Monte Carlo), every .param of a variable, the temperature and the random seed; adds the outputs’ expressions and the waveform at the end of the control block; runs ngspice; and collects every name = value ngspice prints.
