openMemristorPDK Guide
Guide · Section 1 · Introduction to FOSS · Part 2 · about 4 min to read

Drawing and simulating

The PDK window, the schematic editor, the circuit simulator and the compiler that turns a memristor model into something the simulator can run.

One tab per program

Pick a program

Each tab says what the program does, where this guide uses it, who makes it, and how to check and install it.

openPDKcreator

Build and explore a PDK in one window.

A window for looking inside a PDK and for building a new one: its layers, design rules, devices, symbols, models and layouts. Its Library Manager lists every cell and opens each view in the right program (a schematic in xschem, a layout in KLayout). It compiles Verilog-A models by itself when it starts, and its Tools tab checks the programs on this page (see openPDKcreator's Tools tab). openMemristorPDK was built with it.

Runs on
Inside the container
Used in this guide
Every section.
Made by
R. Picos (University of the Balearic Islands), within the MemFRAME research project.
License
Apache 2.0
Website
github.com/rpicos-uib/openpdkcreator-toolkit

Is it there?

Type this in a container terminal:

$ cd /foss/designs && python3 main.py --help

Install it outside the container

Download it with Git (Install from scratch, step B); the container already has everything it needs. To run it outside the container you need Python 3 with Tk and two Python libraries:

$ sudo apt install -y python3-tk python3-yaml

plus ./install_deps.sh in the openPDKcreator folder for KLayout's Python module.

xschem

Draw circuits as schematics.

A schematic editor: you place symbols (a memristor, a voltage source, a transistor) and connect them with wires. Press Netlist and it writes the circuit as text for the simulator; press Simulate and it runs ngspice and shows the result.

Runs on
Inside the container
Used in this guide
Your first simulation onwards, every testbench.
Made by
Stefan Schippers, since 1998.
License
GNU GPL
Website
xschem.sourceforge.io/stefan/index.html

Is it there?

Type this in a container terminal:

$ xschem --version

Install it outside the container

Inside the container it is already installed: nothing to do. These commands are only for using it on your own Ubuntu, without the container.

$ sudo apt install -y xschem

Ubuntu's version is older than the container's. For the newest one, build it from its GitHub page.

ngspice

The circuit simulator: works out every voltage and current.

Give it a circuit (a netlist) and it computes how the voltages and currents change over time: the pinched hysteresis loop, the write and read currents of a bit. It grew out of SPICE, written at the University of California, Berkeley, in the 1970s, the program every circuit simulator since is based on. It can load models compiled by OpenVAF, which is how it simulates our memristors.

Runs on
Inside the container
Used in this guide
Your first simulation onwards: every analog simulation.
Made by
The ngspice team, on top of Berkeley SPICE.
License
BSD (modified)
Website
ngspice.sourceforge.io

Is it there?

Type this in a container terminal:

$ ngspice --version

Install it outside the container

Inside the container it is already installed: nothing to do. These commands are only for using it on your own Ubuntu, without the container.

$ sudo apt install -y ngspice

Check that ngspice --version says ngspice-39 or newer: older versions cannot load Verilog-A models.

OpenVAF

Turns a Verilog-A model into something ngspice can run.

Our memristor models are written in Verilog-A, a language for writing a device's equations (the .va files). OpenVAF compiles a .va file into an .osdi file that ngspice loads. openPDKcreator runs it for you every time it starts. The container has OpenVAF-Reloaded, the version the community keeps up to date.

Runs on
Inside the container
Used in this guide
Add a model and Add a new device.
Made by
Pascal Kuthe, continued by the OpenVAF-Reloaded community.
License
GNU GPL
Website
github.com/pascalkuthe/OpenVAF

Is it there?

Type this in a container terminal:

$ openvaf --version

Install it outside the container

Inside the container it is already installed: nothing to do. These commands are only for using it on your own Ubuntu, without the container.

No Ubuntu package. Download the ready-made program for Linux from its GitHub page, and copy it into ~/.local/bin.