Add 1T1R example

This PR contains open-source schematic files for a 1T1R example based
off the reram documentation which uses closed source tools.

Jesse Cirimelli-Low <jcirimel@ucsc.edu>
diff --git a/examples/1T1R/1T1R.sch b/examples/1T1R/1T1R.sch
new file mode 100644
index 0000000..bf56699
--- /dev/null
+++ b/examples/1T1R/1T1R.sch
@@ -0,0 +1,134 @@
+v 20201211 2
+C 40000 40000 0 0 0 title-B.sym
+C 46800 49900 1 0 0 spice-model-1.sym
+{
+T 46900 50600 5 10 0 1 0 0 1
+device=model
+T 46800 49900 5 10 1 0 0 0 2
+value=rram2_model rram2 rram2_params.scs
+
+T 46800 49900 5 10 1 0 0 0 1
+refdes=.model
+}
+C 40200 41450 1 0 0 spice-directive-1.sym
+{
+T 40300 41750 5 10 0 1 0 0 1
+device=directive
+T 40300 41850 5 10 1 1 0 0 1
+refdes=.print
+T 40300 41450 5 10 1 1 0 0 1
+value=TRAN FORMAT=RAW V(VDD) V(0) I(Vsl) V(BL - BE) V(BL) V(WL) V(sl) V(BE)
+}
+C 40200 40700 1 0 0 spice-directive-1.sym
+{
+T 40300 41000 5 10 0 1 0 0 1
+device=directive
+T 40300 41100 5 10 1 1 0 0 1
+refdes=.tran
+T 40300 40800 5 10 1 1 0 0 1
+value=0.01ns 50ns
+}
+C 46750 48900 1 0 0 spice-include-1.sym
+{
+T 46850 49200 5 10 0 1 0 0 1
+device=include
+T 46750 48900 5 10 1 0 0 0 1
+refdes=.lib
+T 46750 48700 5 10 1 0 0 0 1
+value="$PDK_ROOT/sky130A/libs.tech/ngspice/sky130.lib.spice" tt
+}
+C 41700 44500 1 0 0 vpwl-1.sym
+{
+T 41900 44650 5 10 1 1 0 0 1
+refdes=Vbl
+T 42400 45350 5 10 0 0 0 0 1
+device=vpwl
+T 42400 45550 5 10 0 0 0 0 1
+footprint=none
+T 50400 44950 5 10 1 1 0 0 1
+value=pwl 1ns 0V 10ns 0V 15ns 3V 20ns 0V
+}
+C 40200 40000 1 0 0 spice-directive-1.sym
+{
+T 40300 40300 5 10 0 1 0 0 1
+device=directive
+T 40300 40400 5 10 1 1 0 0 1
+refdes=VVDD
+T 40300 40100 5 10 1 1 0 0 1
+value=VDD 0 1.8V
+}
+C 46600 44600 1 0 0 asic-nmos-1.sym
+{
+T 47400 45400 5 10 0 1 0 0 1
+refdes=Xwl
+T 47400 44900 5 8 1 0 0 0 1
+w=7.0
+T 47400 44700 5 8 1 0 0 0 1
+l=0.15
+T 46600 44600 5 10 0 0 0 0 1
+value=sky130_fd_pr__nfet_01v8
+}
+C 44100 43900 1 0 0 vpwl-1.sym
+{
+T 43700 44450 5 10 1 1 0 0 1
+refdes=Vwl
+T 44800 44750 5 10 0 0 0 0 1
+device=vpwl
+T 44800 44950 5 10 0 0 0 0 1
+footprint=none
+T 50400 44550 5 10 1 1 0 0 1
+value=pwl 0ns 0V 8ns 0V 9ns 1V 21ns 1V 22ns 0V 28ns 0V 29ns 3V 41ns 3V 42ns 0V 50ns 0V
+}
+N 44400 45100 46600 45100 4
+{
+T 45100 45250 5 10 1 1 0 6 1
+netname=wl
+}
+N 42000 45700 42000 46700 4
+C 46900 43200 1 0 0 vpwl-1.sym
+{
+T 47100 43350 5 10 1 1 0 0 1
+refdes=Vsl
+T 47600 44050 5 10 0 0 0 0 1
+device=vpwl
+T 47600 44250 5 10 0 0 0 0 1
+footprint=none
+T 50400 44150 5 10 1 1 0 0 1
+value=pwl 0ns 0V 30ns 0V 35ns 3V 40ns 0V 50ns 0V
+}
+N 47200 44400 47200 44600 4
+{
+T 47300 44450 5 10 1 1 0 0 1
+netname=sl
+}
+C 46300 46050 1 0 0 sym-memristor.sym
+{
+T 46600 46450 5 10 0 0 0 0 1
+device=RESISTOR
+T 47400 46450 5 10 0 1 270 0 1
+refdes=Yrram2 res0
+T 46900 46850 5 10 0 1 270 0 1
+value=rram2_model
+}
+N 42000 46700 47200 46700 4
+{
+T 42000 46600 5 10 1 1 0 0 1
+netname=bl
+}
+N 44400 43900 44400 43200 4
+N 42000 43200 48500 43200 4
+N 42000 44500 42000 43200 4
+C 48300 42900 1 0 0 ground.sym
+N 47300 45100 48500 45100 4
+N 48500 45100 48500 43200 4
+N 47200 45700 47200 45600 4
+{
+T 47300 45550 5 10 1 1 180 6 1
+netname=BE
+}
+T 50100 44500 9 10 1 0 0 0 1
+wl: 
+T 50100 44900 9 10 1 0 0 0 1
+bl:
+T 50100 44100 9 10 1 0 0 0 1
+sl:
diff --git a/examples/1T1R/1T1R.spice b/examples/1T1R/1T1R.spice
new file mode 100644
index 0000000..cd42028
--- /dev/null
+++ b/examples/1T1R/1T1R.spice
@@ -0,0 +1,13 @@
+* SPICE Lepton EDA netlister backend
+.lib "$PDK_ROOT/sky130A/libs.tech/ngspice/sky130.lib.spice" tt
+.model rram2_model rram2 rram2_params.scs
+
+.print TRAN FORMAT=RAW V(VDD) V(0) I(Vsl) V(BL - BE) V(BL) V(WL) V(sl) V(BE)
+.tran 0.01ns 50ns
+VVDD VDD 0 1.8V
+Vbl bl 0 pwl 1ns 0V 10ns 0V 15ns 3V 20ns 0V
+Vsl sl 0 pwl 0ns 0V 30ns 0V 35ns 3V 40ns 0V 50ns 0V
+Vwl wl 0 pwl 0ns 0V 8ns 0V 9ns 1V 21ns 1V 22ns 0V 28ns 0V 29ns 3V 41ns 3V 42ns 0V 50ns 0V
+Xwl BE wl sl 0 sky130_fd_pr__nfet_01v8 l=0.15 w=7.0
+Yrram2 res0 bl BE rram2_model
+.END
diff --git a/examples/1T1R/README b/examples/1T1R/README
new file mode 100644
index 0000000..f273e4d
--- /dev/null
+++ b/examples/1T1R/README
@@ -0,0 +1,9 @@
+Build Xyce Plugin
+buildxyceplugin -o rram2 ../../cells/reram_cell/sky130_fd_pr_reram__reram_cell.va .
+
+extract netlist with lepton:
+lepton-netlist -g spice -o 1T1R.spice 1T1R.sch
+
+Run simluation with Xyze
+Xyce -plugin rram2.so 1T1R.spice
+
diff --git a/examples/1T1R/gafrc b/examples/1T1R/gafrc
new file mode 100644
index 0000000..16ac400
--- /dev/null
+++ b/examples/1T1R/gafrc
@@ -0,0 +1,2 @@
+( component-library "symbols" "sch-hier" )
+( source-library (getcwd) )
diff --git a/examples/1T1R/lepton.conf b/examples/1T1R/lepton.conf
new file mode 100644
index 0000000..0858ef1
--- /dev/null
+++ b/examples/1T1R/lepton.conf
@@ -0,0 +1,4 @@
+[netlist.hierarchy]
+refdes-attribute-order=true
+refdes-attribute-separator=_
+mangle-net-attribute=false
diff --git a/examples/1T1R/schematic.png b/examples/1T1R/schematic.png
new file mode 100644
index 0000000..aeea0c9
--- /dev/null
+++ b/examples/1T1R/schematic.png
Binary files differ
diff --git a/examples/1T1R/symbols/sym-gnd.sym b/examples/1T1R/symbols/sym-gnd.sym
new file mode 100644
index 0000000..bf1a500
--- /dev/null
+++ b/examples/1T1R/symbols/sym-gnd.sym
@@ -0,0 +1,17 @@
+v 20031231 1
+P 100 100 100 300 1 0 1
+{
+T 158 161 5 4 0 1 0 0 1
+pinnumber=1
+T 158 161 5 4 0 0 0 0 1
+pinseq=1
+T 158 161 5 4 0 1 0 0 1 
+pinlabel=1
+T 158 161 5 4 0 1 0 0 1 
+pintype=pwr
+}
+L 0 100 200 100 3 0 0 0 -1 -1
+L 55 50 145 50 3 0 0 0 -1 -1
+L 80 10 120 10 3 0 0 0 -1 -1
+T 300 50 8 10 0 0 0 0 1
+net=GND:1
diff --git a/examples/1T1R/symbols/sym-in.sym b/examples/1T1R/symbols/sym-in.sym
new file mode 100644
index 0000000..fd5782b
--- /dev/null
+++ b/examples/1T1R/symbols/sym-in.sym
@@ -0,0 +1,15 @@
+v 20031231 1
+P 400 100 600 100 1 0 1
+{
+T 450 150 5 6 0 1 0 0 1
+pinnumber=1
+T 450 150 5 6 0 0 0 0 1
+pinseq=1
+}
+L 100 100 0 200 6 0 0 0 -1 -1
+L 100 100 0 0 6 0 0 0 -1 -1
+L 400 100 100 100 6 0 0 0 -1 -1
+T 0 300 5 10 0 0 0 0 1
+device=INPUT
+T 0 300 8 10 1 1 0 0 1
+refdes=pinlabel
diff --git a/examples/1T1R/symbols/sym-memristor.sym b/examples/1T1R/symbols/sym-memristor.sym
new file mode 100644
index 0000000..aae2072
--- /dev/null
+++ b/examples/1T1R/symbols/sym-memristor.sym
@@ -0,0 +1,40 @@
+v 20201211 2
+L 1000 0 800 100 3 0 0 0 -1 -1
+L 800 100 1000 200 3 0 0 0 -1 -1
+L 1000 200 800 300 3 0 0 0 -1 -1
+L 800 300 1000 400 3 0 0 0 -1 -1
+T 300 400 5 10 0 0 0 0 1
+device=RESISTOR
+L 1000 0 800 -100 3 0 0 0 -1 -1
+L 800 -100 900 -150 3 0 0 0 -1 -1
+L 1000 399 900 450 3 0 0 0 -1 -1
+T 1100 400 8 10 1 1 270 0 1
+refdes=Y?
+T 0 0 8 10 0 1 0 0 1
+pins=2
+T 0 0 8 10 0 1 0 0 1
+class=DISCRETE
+T 600 800 8 10 1 1 270 0 1
+value=rram2_model
+P 900 650 900 450 1 0 0
+{
+T 950 550 5 8 0 1 270 0 1
+pinnumber=1
+T 950 550 5 8 0 0 270 0 1
+pinseq=1
+T 1000 700 5 10 1 1 270 0 1
+pinlabel=TE
+T 900 650 5 10 0 1 270 0 1
+pintype=io
+}
+P 900 -350 900 -150 1 0 0
+{
+T 850 -250 5 8 0 1 90 0 1
+pinnumber=2
+T 850 -250 5 8 0 0 90 0 1
+pinseq=2
+T 1000 -150 5 10 1 1 270 0 1
+pinlabel=BE
+T 900 -350 5 10 0 1 90 0 1
+pintype=io
+}
diff --git a/examples/1T1R/symbols/sym-resistor.sym b/examples/1T1R/symbols/sym-resistor.sym
new file mode 100644
index 0000000..64bff55
--- /dev/null
+++ b/examples/1T1R/symbols/sym-resistor.sym
@@ -0,0 +1,28 @@
+v 20201211 2
+L 1000 0 800 100 3 0 0 0 -1 -1
+L 800 100 1000 200 3 0 0 0 -1 -1
+L 1000 200 800 300 3 0 0 0 -1 -1
+L 800 300 1000 400 3 0 0 0 -1 -1
+T 300 400 5 10 0 0 0 0 1
+device=RESISTOR
+L 1000 0 800 -100 3 0 0 0 -1 -1
+L 800 -100 900 -150 3 0 0 0 -1 -1
+P 900 600 900 448 1 0 0
+{
+T 1000 700 5 8 1 1 270 0 1
+pinlabel=TE
+}
+L 1000 399 900 450 3 0 0 0 -1 -1
+T 1100 400 8 10 1 1 270 0 1
+refdes=Y?
+T 0 0 8 10 0 1 0 0 1
+pins=2
+T 0 0 8 10 0 1 0 0 1
+class=DISCRETE
+P 900 -300 900 -148 1 0 0
+{
+T 1000 -200 5 8 1 1 270 0 1
+pinlabel=BE
+}
+T 600 600 9 10 1 0 270 0 1
+memristor
diff --git a/examples/1T1R/symbols/sym-subcircuit.sym b/examples/1T1R/symbols/sym-subcircuit.sym
new file mode 100644
index 0000000..b5746ab
--- /dev/null
+++ b/examples/1T1R/symbols/sym-subcircuit.sym
@@ -0,0 +1,32 @@
+v 20191003 2
+T 300 400 5 10 0 0 0 0 1
+device=SUB
+P 900 100 800 100 1 0 0
+{
+T 800 150 5 8 0 1 0 0 1
+pinnumber=2
+T 800 150 5 8 0 0 0 0 1
+pinseq=2
+T 850 200 9 6 1 0 90 2 1
+pinlabel=2
+T 800 150 5 8 0 1 0 0 1
+pintype=pas
+}
+P 0 100 100 100 1 0 0
+{
+T 100 150 5 8 0 1 0 0 1
+pinnumber=1
+T 100 150 5 8 0 0 0 0 1
+pinseq=1
+T 50 200 9 6 1 0 90 0 1
+pinlabel=1
+T 100 150 5 8 0 1 0 0 1
+pintype=pas
+}
+T 200 200 8 10 1 1 0 0 1
+refdes=U?
+T 0 0 8 10 0 1 0 0 1
+pins=2
+T 0 0 8 10 0 1 0 0 1
+class=DISCRETE
+B 100 -200 700 600 3 10 1 0 -1 -1 0 -1 -1 -1 -1 -1
diff --git a/examples/1T1R/symbols/sym-vdc.sym b/examples/1T1R/symbols/sym-vdc.sym
new file mode 100644
index 0000000..636a083
--- /dev/null
+++ b/examples/1T1R/symbols/sym-vdc.sym
@@ -0,0 +1,38 @@
+v 20031231 1
+T 700 650 8 10 1 1 0 0 1
+refdes=V?
+T 700 850 5 10 0 0 0 0 1
+device=VOLTAGE_SOURCE
+T 700 1050 5 10 0 0 0 0 1
+footprint=none
+T 700 1250 5 10 0 0 0 0 1
+numslots=0
+T 700 1450 5 10 0 0 0 0 1
+description=dc power source
+P 300 1200 300 900 1 0 0
+{
+T 350 1000 5 8 1 1 0 0 1
+pinnumber=1
+T 350 1000 5 8 0 1 0 2 1
+pinseq=1
+T 300 850 9 8 1 1 0 5 1
+pinlabel=+
+T 300 700 5 8 0 1 0 5 1
+pintype=pwr
+}
+P 300 0 300 300 1 0 0
+{
+T 350 100 5 8 1 1 0 0 1
+pinnumber=2
+T 350 100 5 8 0 1 0 2 1
+pinseq=2
+T 300 350 9 8 1 1 0 3 1
+pinlabel=-
+T 300 500 5 8 0 1 0 3 1
+pintype=pwr
+}
+V 300 600 300 3 0 0 0 -1 -1 0 -1 -1 -1 -1 -1
+L 175 625 425 625 3 0 0 0 -1 -1
+L 175 575 425 575 3 0 0 0 -1 -1
+T 700 450 5 10 1 1 0 0 1
+value=DC 1V
diff --git a/examples/1T1R/symbols/sym_senseamp.sym b/examples/1T1R/symbols/sym_senseamp.sym
new file mode 100644
index 0000000..13991fe
--- /dev/null
+++ b/examples/1T1R/symbols/sym_senseamp.sym
@@ -0,0 +1,89 @@
+v 20201211 2
+T 300 400 5 10 0 0 0 0 1
+device=SUB
+P 900 100 800 100 1 0 0
+{
+T 800 150 5 8 0 1 0 0 1
+pinnumber=2
+T 800 150 5 8 0 0 0 0 1
+pinseq=2
+T 1042 203 9 6 1 1 180 2 1
+pinlabel=sout
+T 800 150 5 8 0 1 0 0 1
+pintype=pas
+}
+P 0 100 100 100 1 0 0
+{
+T 100 150 5 8 0 1 0 0 1
+pinnumber=1
+T 100 150 5 8 0 0 0 0 1
+pinseq=1
+T 92 310 9 6 1 1 180 0 1
+pinlabel=precharge
+T 100 150 5 8 0 1 0 0 1
+pintype=pas
+}
+T 200 200 8 10 1 1 0 0 1
+refdes=U?
+T 0 0 8 10 0 1 0 0 1
+pins=2
+T 0 0 8 10 0 1 0 0 1
+class=DISCRETE
+B 100 -1300 700 1700 3 10 1 0 -1 -1 0 -1 -1 -1 -1 -1
+P 900 -200 800 -200 1 0 0
+{
+T 800 -150 5 8 0 1 0 0 1
+pinnumber=2
+T 800 -150 5 8 0 0 0 0 1
+pinseq=2
+T 1042 -97 9 6 1 1 180 2 1
+pinlabel=sa0
+T 800 -150 5 8 0 1 0 0 1
+pintype=pas
+}
+P 900 -500 800 -500 1 0 0
+{
+T 800 -450 5 8 0 1 0 0 1
+pinnumber=2
+T 800 -450 5 8 0 0 0 0 1
+pinseq=2
+T 1042 -397 9 6 1 1 180 2 1
+pinlabel=sa1
+T 800 -450 5 8 0 1 0 0 1
+pintype=pas
+}
+P 0 -300 100 -300 1 0 0
+{
+T 100 -250 5 8 0 1 0 0 1
+pinnumber=1
+T 100 -250 5 8 0 0 0 0 1
+pinseq=1
+T 92 -90 9 6 1 1 180 0 1
+pinlabel=en
+T 100 -250 5 8 0 1 0 0 1
+pintype=pas
+}
+P 0 -700 100 -700 1 0 0
+{
+T 100 -650 5 8 0 1 0 0 1
+pinnumber=1
+T 100 -650 5 8 0 0 0 0 1
+pinseq=1
+T 92 -490 9 6 1 1 180 0 1
+pinlabel=bl
+T 100 -650 5 8 0 1 0 0 1
+pintype=pas
+}
+P 0 -1100 100 -1100 1 0 0
+{
+T 100 -1050 5 8 0 1 0 0 1
+pinnumber=1
+T 100 -1050 5 8 0 0 0 0 1
+pinseq=1
+T 92 -890 9 6 1 1 180 0 1
+pinlabel=dbl
+T 100 -1050 5 8 0 1 0 0 1
+pintype=pas
+}
+T 0 -1500 9 10 1 0 0 0 1
+sense_amp
diff --git a/examples/1T1R/wave.png b/examples/1T1R/wave.png
new file mode 100644
index 0000000..5cdbc9e
--- /dev/null
+++ b/examples/1T1R/wave.png
Binary files differ