openMemristorPDK Guide
Guide · Section 4 · about 10 min · 24 steps

Your first simulation

From a closed laptop to a real simulated memristor curve on your screen, and a look at the chip itself, in 24 steps. You only ever need to click whatever is inside the red box, or type exactly what is in a black box.

First time on this computer? Do Install from scratch first.

click here Click any screenshot to see it full size Keys in the player: ← → Space Esc
Part 1 · about 2 minutes

Switch everything on

All the chip-design programs live inside a "container", which is like a separate computer running inside this one. You start it with one command and then look at its screen through your web browser.

1

Open a terminal

On the laptop, press Ctrl + Alt + T together. A window with a blinking cursor opens. That's the terminal, where you type commands.

2

Start the container and the program

Type these two lines into the terminal, pressing Enter after each one. Copy-paste is fine: in a terminal, paste with Ctrl + Shift + V.

$ cd ~/Documentos/rodrigo/openPDKcreator
$ ./start_eda_container.sh --gui-memristor
You should seeA few lines like these. The long number at the end is different every time, which is normal.
[INFO] iic-osic-tools_openpdkcreator_uid_1001 is already running.
[INFO] VNC session: http://127.0.0.1:8081/?password=abc123&autoconnect=true&resize=scale  (NOT the 'localhost' form -- see header comment)
[INFO] Launching the openMemristorPDK GUI inside the container ...
c54598e723c7af51640f993fd393d7c0ae1cb0b3375ecd7fd972c940bb0a9557
Good to knowIf the container wasn't running yet, the first line says does not exist -- creating it or exists but is stopped -- starting it instead. The very first time it can take a few minutes. Just wait for the terminal to finish.
3

Open the container's screen in the browser

Open Firefox (or Chrome) and go to this address. Type it exactly, with 127.0.0.1 and not localhost:

http://127.0.0.1:8081/?password=abc123&autoconnect=true&resize=scale
You should seeA dark desktop with the IIC-OSIC-TOOLS logo, like this. This is the container's own screen. Everything from now on happens inside this browser tab.
If it says "unable to connect"Check you typed 127.0.0.1 and 8081, then go back to step 2 and make sure the command finished without an error.
4

Make the program window big

After a few seconds the openPDKcreator window appears. It's too small to show all its buttons, so click the square button at its top-right corner to make it fill the screen.

TipDouble-clicking the window's title bar does the same thing.
5

The program is ready

Nothing to click here, just a look around. The program opens on the Wizard tab: a map of everything the PDK contains. Green boxes are parts that are already finished. You don't need this map today.

While it starts, openPDKcreator also compiles the memristor recipes (step 10 shows one) into files the simulator can load. That happens by itself, there's nothing to click. The first time, the bar at the very bottom of the window says Compilation performed correctly.

What's a PDK?A Process Design Kit is the instruction manual a chip factory gives to chip designers: which materials exist, how small things can be, and how each device behaves electrically. This one describes a made-up factory that builds memristors, resistors whose resistance depends on how much current has gone through them before. They "remember".
Part 2 · about 2 minutes

Find the memristor

The Library Manager is like a parts catalogue. We'll open the gold/titanium-dioxide/gold memristor and read the little program that describes how it behaves.

6

Open the Library Manager

Click the Library Manager tab, near the top-left.

7

Pick the library

In the Libraries list on the left, click openmemristorpdk_pr (real). It's the only one there.

8

Pick the memristor

The middle list (Cells) fills up with parts. Click memristor_tio2_au (9 view(s)).

What the name meanstio2 is titanium dioxide, the material in the middle that actually switches. au is gold (from the Latin aurum), used for the electrodes on top and bottom. So this part is a gold / TiO₂ / gold sandwich.
9

Open the memristor's behaviour file

The right side now lists every "view" of this part: its drawing, its layout, its models... Find the Verilog-A row and click its View button.

10

Read the behaviour file, then close it

A window shows the file. This is the "recipe" the simulator uses to work out how much current flows through the memristor. When you've had a look, click Close. Nothing else happens: the recipe was already compiled when the program started (step 5).

openMemristorPDK/user_models/veriloga/memristor_tio2_au.vaVerilog-A (the comment lines at the top are left out)
`include "disciplines.vams"

module memristor_tio2_au(BE, TE);
inout BE, TE;
electrical BE, TE;
electrical dx;   // hidden node: how far x has moved from x0

parameter real Ron = 100 from (0:inf);
parameter real Roff = 16e3 from (0:inf);
parameter real D = 10n from (0:inf);
parameter real uv = 1e-14 from (0:inf);
parameter real x0 = 0.1 from [0:1];

real x, Rmem, dxdt;

analog begin
  x = min(max(x0 + V(dx), 0.0), 1.0);   // the memory, kept between 0 and 1
  Rmem = Ron * x + Roff * (1.0 - x);
  I(BE, TE) <+ V(BE, TE) / Rmem;
  dxdt = (uv * Ron / (D * D)) * V(BE, TE) / Rmem;   // the boundary moves with the current
  if ((x >= 1.0 && dxdt > 0.0) || (x <= 0.0 && dxdt < 0.0))
    dxdt = 0.0;                         // at an end: stop there
  I(dx) <+ ddt(V(dx)) - dxdt;           // x moves at dxdt
  I(dx) <+ 1e-12 * V(dx);               // keeps dx defined at rest
end
endmodule
BE, TE
The two wires of the memristor: Bottom Electrode and Top Electrode.
Ron, Roff
Its lowest and highest resistance: 100 Ω when fully "on", 16 000 Ω when fully "off".
D
How thick the TiO₂ layer is: 10 nanometres, about 1/10 000 of a hair.
x
The memory. A number between 0 and 1 saying how much of the layer has been switched on. It starts at x0, and stops at 0 and at 1.
dxdt
How fast the memory moves: in step with the current. x grows while current flows one way and shrinks when it flows back.
dx, ddt
The trick that stores the memory: a hidden extra wire, dx, whose voltage is how far x has moved. ddt(...) means "how fast it changes", so that line says: make dx change at speed dxdt.
Rmem
Today's resistance, a mix between Roff and Ron depending on x.
I <+ V / Rmem
Ohm's law: current = voltage ÷ resistance. The only twist is that the resistance keeps changing.
Only if you change the recipeIf you click Edit, change something and Save, closing the window compiles it again and tells you how it went: Compilation performed correctly, or the line with the mistake. Today you don't need to change anything.
Part 3 · about 1 minute

Open the test circuit

To see what a memristor does, we connect it to a battery that keeps flipping between +1 V and −1 V (a sine wave), and measure the current.

11

Pick the test circuit

In the Cells list, click memristor_tio2_au_tb (1 view(s)). The tb stands for testbench, a circuit made for testing a part.

12

Open it in xschem

On the Schematic row, click Open in xschem. xschem is the program for drawing circuits.

13

Meet the test circuit

A black xschem window opens on top. Wait until you can see the drawing: the very first time it can take up to half a minute, so don't click anything else meanwhile. The small box on the left is the memristor n1. The circle on the right is the sine-wave source V1. They're joined by a wire called te. The text below the circuit tells the simulator what to do.

If you can't see itIt may have opened behind the openPDKcreator window. Click xschem in the bar at the very bottom of the screen to bring it to the front.
openMemristorPDK/libraries/openmemristorpdk_pr/memristor_tio2_au_tb.schthe whole file
v {xschem version=3.4.8RC file_version=1.3}
G {}
K {}
V {}
S {}
F {}
E {}
T {Memristor testbench} -60 -300 0 0 0.6 0.6 {}
T {Press "Netlist", then "Simulate" (top-right of the menu bar).} -60 -240 0 0 0.3 0.3 {}
T {The sine-wave source V1 pushes current back and forth through the memristor n1.} -60 -210 0 0 0.3 0.3 {}
N 40 -100 400 -100 {lab=te}
N 400 -40 400 -20 {lab=0}
C {/foss/designs/openMemristorPDK/export/openmemristorpdk/libs.tech/xschem/openmemristorpdk_pr/memristor_tio2_au.sym} 0 -100 0 1 {name=n1 model=mm}
C {gnd.sym} -40 -100 0 0 {name=l1 lab=0}
C {lab_wire.sym} 220 -100 0 0 {name=p1 sig_type=std_logic lab=te}
C {vsource.sym} 400 -70 0 0 {name=V1 value="dc 0 sin(0 1.0 0.6)" savecurrent=false}
C {gnd.sym} 400 -20 0 0 {name=l2 lab=0}
C {code_shown.sym} -60 40 0 0 {name=s1 only_toplevel=false value="
.model mm memristor_tio2_au ron=100 roff=16k d=10n uv=1e-14 x0=0
.control
pre_osdi /foss/designs/openMemristorPDK/user_models/veriloga/memristor_tio2_au.osdi
tran 300u 3.34
plot -i(V1) vs v(te) retraceplot title 'Memristor I-V loop' xlabel 'Voltage (V)' ylabel 'Current (A)'
.endc
"}
T {...}
Text written on the drawing (the title and the two hint lines).
N ...
A wire, from one point to another. lab=te names it "te"; lab=0 means ground (0 volts).
C {...}
A component placed on the drawing: the memristor, two ground symbols, the wire label, the source V1, and the code block.
sin(0 1.0 0.6)
The source makes a sine wave around 0 V, going up to 1 V and down to −1 V, 0.6 times per second.
.model mm ...
Which behaviour file to use for n1, and its numbers (the same ones from step 10). x0=0 means the memory starts fully off: 16 000 Ω.
pre_osdi ...
Loads the compiled version of the behaviour file (memristor_tio2_au.osdi, made automatically when openPDKcreator started) into the simulator before anything else.
tran 300u 3.34
Simulate 3.34 seconds of time (two full waves), taking a snapshot every 0.3 milliseconds.
plot ...
When it's done, draw the current (up/down) against the voltage (left/right).
Part 4 · about 1 minute

Run the simulation

Two clicks: first turn the drawing into a list the simulator understands (the netlist), then run the simulator (ngspice).

14

Click Netlist

In xschem's top menu bar, on the right, click Netlist. It turns green when it's done (it takes about a second).

~/.xschem/simulations/memristor_tio2_au_tb.spice (inside the container)what Netlist writes
** sch_path: /foss/designs/openMemristorPDK/libraries/openmemristorpdk_pr/memristor_tio2_au_tb.sch
**.subckt memristor_tio2_au_tb
n1 te 0 mm
V1 te 0 dc 0 sin(0 1.0 0.6)
**** begin user architecture code


.model mm memristor_tio2_au ron=100 roff=16k d=10n uv=1e-14 x0=0
.control
pre_osdi /foss/designs/openMemristorPDK/user_models/veriloga/memristor_tio2_au.osdi
tran 300u 3.34
plot -i(V1) vs v(te) retraceplot title 'Memristor I-V loop' xlabel 'Voltage (V)' ylabel 'Current (A)'
.endc


**** end user architecture code
**.ends
.end

The two highlighted lines are the whole circuit: "memristor n1 sits between wire te and ground (0)" and "source V1 sits between te and ground". Lines starting with * are comments.

15

Click Simulate

Now click Simulate, right next to Netlist. Wait about 10 seconds.

If nothing happensClick Netlist again, wait until it's green, then click Simulate once more.
16

The result: a memristor's fingerprint

Two new windows appear. The small white one in the middle is the simulator (ngspice) reporting what it did. The black one on the right is the result.

How to read it Left/right is the voltage (−1 V to +1 V). Up/down is the current, in millionths of an amp (µA). A normal resistor would draw one straight line: the same current every time you're at the same voltage. The memristor draws two different paths, one going up and one coming back. At the same voltage it lets more or less current through depending on its history. That's its memory. Both paths cross exactly at zero. Scientists call this a pinched hysteresis loop, and it's the official fingerprint of a memristor.
Part 5 · 1 minute

Close the simulation

Close things in this order so nothing is left running.

17

Close the plot

In the plot window, click the small orange Quit button at the top-right.

18

Close the simulator

Click once inside the white ngspice window, where it says ngspice 1 ->. Then type quit and press Enter. The window closes by itself.

19

Close xschem

Click the X at the top-right of the black xschem window. You're back in the Library Manager, with the test circuit still selected.

Part 6 · about 2 minutes

See what the chip looks like

The simulation showed how the memristor behaves. The layout shows how it is built: the shapes the factory would actually print onto the chip, seen from above.

20

Pick the memristor again

In the Cells list, click memristor_tio2_au (9 view(s)), the same part as in step 8.

21

Open the layout in KLayout

On the GDS/Layout row, click Open in KLayout. KLayout is the program for looking at chip layouts. It takes a few seconds to appear, at the top-left of the screen.

22

Look at the chip from above

Nothing to click. The big hatched square is the memristor seen from above. It's 1 µm on each side, a thousandth of a millimetre, so about 80 of them would fit across one human hair. The little ruler at the bottom-left shows 0.2 µm.

How to read it The memristor is a sandwich of three squares stacked exactly on top of each other, so from above they look like one square. The Layers list (red box) names them. The bold ones are used by this part: BE_Au is the gold bottom electrode, MEM_TiO2 the 10 nm titanium-dioxide layer in the middle, and TE_Au the gold top electrode. The grey names are layers the other memristors in this PDK use: hafnium dioxide, titanium and aluminium. VIA1 (solid red) is the via layer: a hole that joins a bottom-electrode wire straight to a top-electrode wire elsewhere on the chip, only where someone draws one. A memristor has none: its current has to go through the oxide. Each layer has its own colour and hatch pattern, which is why you can see the lines of all three layers crossing.
openMemristorPDK/data/openmemristorpdk/libs.tech/klayout/tech/openmemristorpdk.lypthe whole file: one <properties> block per layer
<?xml version="1.0" encoding="utf-8"?>
<layer-properties>
  <properties>
    <frame-color>#8a6a00</frame-color>
    <fill-color>#d4a017</fill-color>
    <frame-brightness>0</frame-brightness>
    <fill-brightness>0</fill-brightness>
    <dither-pattern>I9</dither-pattern>
    <line-style>C0</line-style>
    <valid>true</valid>
    <visible>true</visible>
    <transparent>false</transparent>
    <width>1</width>
    <marked>false</marked>
    <animation>0</animation>
    <name>BE_Au.drawing</name>
    <source>10/0</source>
  </properties>
  <properties>
    <frame-color>#3a8fa8</frame-color>
    <fill-color>#9fd3e6</fill-color>
    <frame-brightness>0</frame-brightness>
    <fill-brightness>0</fill-brightness>
    <dither-pattern>I5</dither-pattern>
    <line-style>C0</line-style>
    <valid>true</valid>
    <visible>true</visible>
    <transparent>false</transparent>
    <width>1</width>
    <marked>false</marked>
    <animation>0</animation>
    <name>MEM_TiO2.drawing</name>
    <source>11/0</source>
  </properties>
  <properties>
    <frame-color>#5a3f99</frame-color>
    <fill-color>#8e6cc9</fill-color>
    <frame-brightness>0</frame-brightness>
    <fill-brightness>0</fill-brightness>
    <dither-pattern>I3</dither-pattern>
    <line-style>C0</line-style>
    <valid>true</valid>
    <visible>true</visible>
    <transparent>false</transparent>
    <width>1</width>
    <marked>false</marked>
    <animation>0</animation>
    <name>MEM_HfO2.drawing</name>
    <source>12/0</source>
  </properties>
  <properties>
    <frame-color>#b0221a</frame-color>
    <fill-color>#e2483d</fill-color>
    <frame-brightness>0</frame-brightness>
    <fill-brightness>0</fill-brightness>
    <dither-pattern>I0</dither-pattern>
    <line-style>C0</line-style>
    <valid>true</valid>
    <visible>true</visible>
    <transparent>false</transparent>
    <width>1</width>
    <marked>false</marked>
    <animation>0</animation>
    <name>VIA1.drawing</name>
    <source>15/0</source>
  </properties>
  <properties>
    <frame-color>#a07800</frame-color>
    <fill-color>#f0c419</fill-color>
    <frame-brightness>0</frame-brightness>
    <fill-brightness>0</fill-brightness>
    <dither-pattern>I13</dither-pattern>
    <line-style>C0</line-style>
    <valid>true</valid>
    <visible>true</visible>
    <transparent>false</transparent>
    <width>1</width>
    <marked>false</marked>
    <animation>0</animation>
    <name>TE_Au.drawing</name>
    <source>20/0</source>
  </properties>
  <properties>
    <frame-color>#4f5b66</frame-color>
    <fill-color>#8c99a6</fill-color>
    <frame-brightness>0</frame-brightness>
    <fill-brightness>0</fill-brightness>
    <dither-pattern>I8</dither-pattern>
    <line-style>C0</line-style>
    <valid>true</valid>
    <visible>true</visible>
    <transparent>false</transparent>
    <width>1</width>
    <marked>false</marked>
    <animation>0</animation>
    <name>TE_Ti.drawing</name>
    <source>21/0</source>
  </properties>
  <properties>
    <frame-color>#7d858c</frame-color>
    <fill-color>#c0c6cc</fill-color>
    <frame-brightness>0</frame-brightness>
    <fill-brightness>0</fill-brightness>
    <dither-pattern>I4</dither-pattern>
    <line-style>C0</line-style>
    <valid>true</valid>
    <visible>true</visible>
    <transparent>false</transparent>
    <width>1</width>
    <marked>false</marked>
    <animation>0</animation>
    <name>TE_Al.drawing</name>
    <source>22/0</source>
  </properties>
</layer-properties>
<name>
The layer's name shown in the Layers list.
<source>
Which numbered layer in the chip file (the GDS file) it belongs to: 10/0 is layer 10, type 0. The factory only sees these numbers. The names are for humans.
<fill-color>, <frame-color>
The colours, as hex codes: gold #d4a017 for the bottom electrode, light blue #9fd3e6 for TiO₂, and so on.
<dither-pattern>
The hatch pattern, one of KLayout's built-in ones (I9, I5, I3...). A different pattern per layer is what lets you see through the stack.
<visible>
Whether the layer is drawn at all.
23

Close KLayout

Click the X at the top-right of the KLayout window. It closes straight away. Nothing was changed, so there's nothing to save.

Part 7 · 1 minute

Switch it all off

When you're done for the day.

24

Switch it all off

When you're done for the day, close the openPDKcreator window with its X and close the browser tab. Then, back in the laptop's terminal from step 1, type:

$ podman stop iic-osic-tools_openpdkcreator_uid_$(id -u)
Next timeStart again from step 1. Nothing you looked at today was changed, so you'll get exactly the same result.