- Updated the LVS script to make it better.
diff --git a/gds/bandgap/bandgap_2.gds.gz b/gds/bandgap/bandgap_2.gds.gz
deleted file mode 100644
index e4cf84d..0000000
--- a/gds/bandgap/bandgap_2.gds.gz
+++ /dev/null
Binary files differ
diff --git a/mag/extracted.spi b/mag/extracted.spi
deleted file mode 100644
index 7e4c850..0000000
--- a/mag/extracted.spi
+++ /dev/null
@@ -1,7 +0,0 @@
-* NGSPICE file created from ldo_flattened_f.ext - technology: sky130A
-
-
-* Top level circuit ldo_flattened_f
-
-.end
-
diff --git a/mag/ldo_flattened_f.ext b/mag/ldo_flattened_f.ext
deleted file mode 100644
index 71cf72c..0000000
--- a/mag/ldo_flattened_f.ext
+++ /dev/null
@@ -1,7 +0,0 @@
-timestamp 0
-version 8.3
-tech sky130A
-style ngspice()
-scale 1000 1 500000
-resistclasses 4400000 2200000 1700000 3050000 120000 197000 114000 191000 120000 197000 114000 191000 48200 319800 2000000 48200 48200 12200 125 125 47 47 29 5
-substrate "VSUBS" 0 0 -1073741817 -1073741817 space 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
diff --git a/mag/run_magic_lvs.tcl b/mag/run_magic_lvs.tcl
deleted file mode 100644
index ecf47e6..0000000
--- a/mag/run_magic_lvs.tcl
+++ /dev/null
@@ -1,17 +0,0 @@
-# run_magic_drc.tcl ---
-# batch script for running DRC
-
-crashbackups stop
-drc euclidean on
-drc style drc(full)
-drc on
-snap internal
-gds flatglob *__example_*
-gds flatten true
-gds read /home/mustafa/mabrains/caravel_user_project_ldo/gds/ldo_v1/ldo_flattened_f.gds
-load ldo_flattened_f
-select top cell
-expand
-extract all
-ext2spice lvs
-ext2spice -M -o extracted.spi
diff --git a/scripts/run_standard_lvs.py b/scripts/run_standard_lvs.py
index 9aa2600..83e81d9 100644
--- a/scripts/run_standard_lvs.py
+++ b/scripts/run_standard_lvs.py
@@ -24,12 +24,15 @@
# Work in progress
-def run_full_lvs(layout_name, output_file,compare_netlist,report_file,cell_name="default"):
+def run_full_lvs(layout_file, layout_netlist_file, sch_netlist_file, report_file, layout_top_cell, sch_top_cell):
+ # un_full_lvs(layout_file=arguments[0], layout_netlist_file=arguments[1], sch_netlist=arguments[2], report_file=arguments[3],
+ # layout_top_cell=arguments[4], sch_top_cell=arguments[5])
+
+ sch_netlist_file = os.path.abspath(sch_netlist_file)
+
is_gds = False
- if cell_name == "default":
- cell_name = layout_name
# Remove any extension from layout_name
- layout_root = layout_name
+ layout_root = layout_file
layout_name = os.path.splitext(layout_root)[0]
layout_ext = os.path.splitext(layout_root)[1]
@@ -77,8 +80,6 @@
else:
magpath = os.getcwd()
- if output_file == '':
- output_file = layout_name + '_drc.txt'
# Check for presence of a .magicrc file, or else check for environment
# variable PDKPATH, or PDK_PATH
@@ -122,14 +123,14 @@
print('gds flatglob *__example_*', file=ofile)
print('gds flatten true', file=ofile)
print('gds read ' + gdspath + '/' + layout_name, file=ofile)
- print('load ' + cell_name, file=ofile)
+ print('load ' + layout_top_cell, file=ofile)
else:
print('load ' + layout_name + ' -dereference', file=ofile)
print('select top cell', file=ofile)
print('expand', file=ofile)
print('extract all', file=ofile)
print('ext2spice lvs', file=ofile)
- print('ext2spice -M -o ' + output_file, file=ofile)
+ print('ext2spice -M -o ' + layout_netlist_file, file=ofile)
# print('set ofile [open ' + output_file + ' w]', file=ofile)
# print('puts $ofile "DRC errors for cell ' + cell_name + '"', file=ofile)
# print('puts $ofile "--------------------------------------------"', file=ofile)
@@ -171,9 +172,9 @@
print('Done! magic extraction')
##netgen part
- netgen_run = subprocess.run(['netgen', '-batch', 'lvs',output_file,compare_netlist,
- netgenset, report_file],
- env = myenv, cwd = magpath,
+ netgen_run = subprocess.run(['netgen','-batch lvs "{} {}" "{} {}" {} {}'.format(layout_netlist_file, layout_top_cell,
+ sch_netlist_file, sch_top_cell, netgenset, report_file)],
+ env = myenv, cwd = magpath,
stdin = subprocess.DEVNULL, stdout = subprocess.PIPE,
stderr = subprocess.PIPE, universal_newlines = True)
@@ -212,11 +213,12 @@
elif len(arguments) > 2:
out_filename = arguments[1]
-
- if len(arguments) > 0 and len(arguments) < 6:
- run_full_lvs(layout_name=arguments[0], output_file=arguments[1],compare_netlist=arguments[2],report_file=arguments[3],cell_name=arguments[4])
+ # python scripts/run_standard_lvs.py gds/ldo_v1/ldo_flattened_f.gds extracted.spi xschem/ldo_v1/ldo_v1_lvs.spice report.lvs ldo_flattened_f ldo_v1_lvs
+ if len(arguments) > 0 and len(arguments) < 7:
+ run_full_lvs(layout_file=arguments[0], layout_netlist_file=arguments[1], sch_netlist_file=arguments[2], report_file=arguments[3],
+ layout_top_cell=arguments[4], sch_top_cell=arguments[5])
else:
- print("Usage: run_standard_drc.py <layout_name> [<output_file>] [options]")
+ print("Usage: run_standard_lvs.py <layout_file> [<output_file>] [options]")
print("Options:")
print(" (none)")
diff --git a/xschem/ldo_v1/ldo_v1_lvs.spice b/xschem/ldo_v1/ldo_v1_lvs.spice
index 175ddc0..95ab045 100644
--- a/xschem/ldo_v1/ldo_v1_lvs.spice
+++ b/xschem/ldo_v1/ldo_v1_lvs.spice
@@ -1,4 +1,6 @@
-**.subckt ldo_v1_lvs in en ldo_out
+** ldo_v1_lvs
+
+.subckt ldo_v1_lvs in en ldo_out
*.ipin in
*.ipin en
*.opin ldo_out
@@ -11,7 +13,7 @@
XR3 net3 ldo_out GND sky130_fd_pr__res_xhigh_po_0p69 L=24 mult=8 m=8
XR1 net4 pos GND sky130_fd_pr__res_xhigh_po_0p69 L=24 mult=2 m=2
XR4 GND net4 GND sky130_fd_pr__res_xhigh_po_0p69 L=24 mult=4 m=4
-**.ends
+.ends
* expanding symbol: bgr_sym.sym # of pins=5
* sym_path: /home/mustafa/mabrains/caravel_user_project_ldo/xschem/ldo_v1/bgr_sym.sym