FOSSlab

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):

CommandDoes
fosslabthe Library Manager
fosslab libs, fosslab cells LIBlist libraries; cells with their views and status
fosslab new-lib NAMEnew library
fosslab new-cell LIB CELL --views schematic,symbolnew cell with views
fosslab open LIB CELL --view layoutopen a view in its program
fosslab hier LIB CELLprint the design hierarchy (--gui for the browser)
fosslab symbol LIB CELLsymbol from the schematic’s pins
fosslab testbench LIB CELLnew testbench cell tb_CELL
fosslab sim LIB CELLnetlist and simulate (--extracted c1,c2: use PEX views)
fosslab drc|lvs|pex LIB CELLverification (--show: in a window)
fosslab va LIB CELLcompile the Verilog-A view
fosslab copy SRCLIB CELL DSTLIB [NEW]copy a cell (also from the PDK examples)
fosslab rename LIB CELL NEWrename, updating the instances in your schematics
fosslab ade LIB TBthe Simulation Environment of a testbench
fosslab corners LIB TBrun 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 statuslast results of every cell
fosslab selftestcheck 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

xschemKLayout
Insertplace a symbolF2zoom to fit
wdraw a wire*show all hierarchy levels
qedit propertiesb / pbox / path
e / Ctrl+edescend / go upiinstance (PCells: library SG13_dev)
idescend into symbolkruler
Ctrl+ssaveCtrl+ssave

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.