Hello everyone, I'm learning how to use PySpice to simulate circuits using the PDK sky130, but first...
n

Nelson Rodriguez

about 3 years ago
Hello everyone, I'm learning how to use PySpice to simulate circuits using the PDK sky130, but first I'm just starting with this doc example. The issue is that I'm getting following errors and I don't know why.
Traceback (most recent call last):
  File "/home/nelson/myreps/obsidian-vault/PRACTICE/PYSPICE/pyspice-engineeringthings/tutorial/tutorial2.py", line 28, in <module>
    analysis = simulator.operating_point()
  File "/home/nelson/myreps/obsidian-vault/PRACTICE/PYSPICE/pyspice-engineeringthings/tutorial/lib/python3.10/site-packages/PySpice/Spice/Simulation.py", line 1194, in operating_point
    return self._run('operating_point', *args, **kwargs)
  File "/home/nelson/myreps/obsidian-vault/PRACTICE/PYSPICE/pyspice-engineeringthings/tutorial/lib/python3.10/site-packages/PySpice/Spice/NgSpice/Simulation.py", line 76, in _run
    raw_file = self._spice_server(spice_input=str(self))
  File "/home/nelson/myreps/obsidian-vault/PRACTICE/PYSPICE/pyspice-engineeringthings/tutorial/lib/python3.10/site-packages/PySpice/Spice/NgSpice/Server.py", line 162, in __call__
    return RawFile(stdout, number_of_points)
  File "/home/nelson/myreps/obsidian-vault/PRACTICE/PYSPICE/pyspice-engineeringthings/tutorial/lib/python3.10/site-packages/PySpice/Spice/NgSpice/RawFile.py", line 170, in __init__
    raw_data = self._read_header(stdout)
  File "/home/nelson/myreps/obsidian-vault/PRACTICE/PYSPICE/pyspice-engineeringthings/tutorial/lib/python3.10/site-packages/PySpice/Spice/NgSpice/RawFile.py", line 192, in _read_header
    self.circuit_name = self._read_header_field_line(header_line_iterator, 'Circuit')
  File "/home/nelson/myreps/obsidian-vault/PRACTICE/PYSPICE/pyspice-engineeringthings/tutorial/lib/python3.10/site-packages/PySpice/Spice/RawFile.py", line 243, in _read_header_field_line
    raise NameError("Expected label %s instead of %s" % (expected_label, label))
NameError: Expected label Circuit instead of Note
The error may come because my executable path of ngspice is
/home/nelson/cad/bin/ngspice
and I tried to modify it according to this doc part but nothing:
simulator = circuit.simulator(temperature=25, nominal_temperature=25, spice_command='/home/nelson/cad/bin/ngspice')
Could anyone help me with that? @proppy maybe could you give me some ideas about it?
🌍 1
Hi all, newbie here! I want to simulate a transistor using PySpice. Can anyone tell me the proper wa...
w

Wonjae Ji

about 3 years ago
Hi all, newbie here! I want to simulate a transistor using PySpice. Can anyone tell me the proper way of including "sky130_fd_pr__nfet_01v8_lvt" in my simple python code here? I use PySpice 1.5 / ngspice-32. Including a simple PTM model file and defining a MOSFET just works fine.
circuit.include("./ptm_90nm.model")
circuit.M('1', 'node_drain', 'node_gate',  circuit.gnd, circuit.gnd, model='nmos', width=1e-6, length=1e-6)
However, including
sky130_fd_pr__nfet_01v8_lvt.pm3.spice
and defining a subcircuit does not work.
circuit.include("../share/pdk/sky130A/libs.ref/sky130_fd_pr/spice/sky130_fd_pr__nfet_01v8_lvt.pm3.spice")
circuit.X('M1', d='node_drain', g='node_gate', s=circuit.gnd, b=circuit.gnd, model='sky130_fd_pr__nfet_01v8', w=1, l=1, subcircuit_name='nfet')
---
Error: unknown subckt: xm1 nfet b=0 d={node_drain} g={node_gate} l=1 model={sky130_fd_pr__nfet_01v8} s=0 w=1
    Simulation interrupted due to error!
Am I missing something? Please refer to the code below. It's just I-V plotting, but I'm lost. Haha
import matplotlib.pyplot as plt
import numpy as np

import PySpice
from PySpice.Spice.Netlist import Circuit, SubCircuit, SubCircuitFactory
from PySpice.Unit import u_V, u_mA

import sys, os
if sys.platform =="linux" or sys.platform =="linux2":
    PySpice.Spice.Simulation.CircuitSimulator.DEFAULT_SIMULATOR = 'ngspice-subprocess'
circuit = Circuit('IVtest')

Vdrain = circuit.V('drain', 'node_drain', circuit.gnd, 1@u_V)
Vgate = circuit.V('gate', 'node_gate', circuit.gnd, 1@u_V)
# circuit.include("./ptm_90nm.model")
# circuit.M('1', 'node_drain', 'node_gate',  circuit.gnd, circuit.gnd, model='nmos', width=1e-6, length=1e-6) # this just works fine

# circuit.lib('../share/pdk/sky130A/libs.tech/ngspice/sky130.lib.spice', 'tt')
# circuit.include("../share/pdk/sky130A/libs.tech/ngspice/corners/tt.spice")

circuit.include("../share/pdk/sky130A/libs.ref/sky130_fd_pr/spice/sky130_fd_pr__nfet_01v8_lvt.pm3.spice")
circuit.X('M1', d='node_drain', g='node_gate', s=circuit.gnd, b=circuit.gnd, model='sky130_fd_pr__nfet_01v8', w=1, l=1, subcircuit_name='nfet')
print(circuit)

simulator = circuit.simulator(temperature=27)
print(simulator)

analysis = simulator.dc(Vgate=slice(0, 2, 0.1))

figure, ax = plt.subplots(figsize=(6,3))
ax.plot(u_V(analysis.node_gate), u_mA(-analysis.Vdrain))
ax.grid()
ax.set_xlabel('Vgs [V]')
ax.set_ylabel('Id [mA]')
ax.set_yscale('log')
plt.tight_layout()
plt.show()
Including the library resulted in ~2000 lines of parsing error and >20min of running time, so I aborted it. Thanks in advance
Has anyone encountered this error message when running the openlane notebook on google colab? [STEP...
t

Taylor P

over 1 year ago
Has anyone encountered this error message when running the openlane notebook on google colab? [STEP 7] [INFO]: Performing Random Global Placement (log: runs/RUN_2024.04.10_23.11.55/logs/placement/7-global.log)... [ERROR]: during executing: "openroad -exit -no_init -python /content/conda-env/share/openlane/scripts/odbpy/random_place.py --input-lef /content/runs/RUN_2024.04.10_23.11.55/tmp/merged.nom.lef --output-def /content/runs/RUN_2024.04.10_23.11.55/tmp/placement/7-global.def --output /content/runs/RUN_2024.04.10_23.11.55/tmp/placement/7-global.odb /content/runs/RUN_2024.04.10_23.11.55/results/floorplan/inverter.odb |& tee /dev/null /content/runs/RUN_2024.04.10_23.11.55/logs/placement/7-global.log" [ERROR]: Exit code: 1 [ERROR]: Last 10 lines: OpenROAD 2.0-12381-g01bba3695 This program is licensed under the BSD-3 license. See the LICENSE file for details. Components of this program may be licensed under more restrictive licenses which must be honored. [CRITICAL ODB-0001] No logger is installed in odb. child process exited abnormally [ERROR]: Step 7 (placement) failed with error: -code 1 -level 0 -errorstack {INNER {invokeStk1 throw_error} CALL {try_exec openroad -exit -no_init -python /content/conda-env/share/openlane/scripts/odbpy/random_place.py --input-lef /content/runs/RUN_2024.04.10_23.11.55/tmp/merged.nom.lef --output-def /content/runs/RUN_2024.04.10_23.11.55/tmp/placement/7-global.def --output /content/runs/RUN_2024.04.10_23.11.55/tmp/placement/7-global.odb /content/runs/RUN_2024.04.10_23.11.55/results/floorplan/inverter.odb |& tee /dev/null /content/runs/RUN_2024.04.10_23.11.55/logs/placement/7-global.log} CALL {manipulate_layout /content/conda-env/share/openlane/scripts/odbpy/random_place.py -indexed_log /content/runs/RUN_2024.04.10_23.11.55/logs/placement/7-global.log -output_def /content/runs/RUN_2024.04.10_23.11.55/tmp/placement/7-global.def -output /content/runs/RUN_2024.04.10_23.11.55/tmp/placement/7-global.odb -input /content/runs/RUN_2024.04.10_23.11.55/results/floorplan/inverter.odb} CALL random_global_placement CALL run_placement CALL run_placement_step CALL {run_non_interactive_mode -design .}} -errorcode NONE -errorinfo { while executing "throw_error" (procedure "try_exec" line 15) invoked from within "try_exec $::env(OPENROAD_BIN) -exit -no_init -python {*}$args --input-lef $::env(MERGED_LEF) --output-def $arg_values(-output_def) --output $arg_va..." (procedure "manipulate_layout" line 19) invoked from within "manipulate_layout $::env(SCRIPTS_DIR)/odbpy/random_place.py -indexed_log [index_file $::env(placement_logs)/global.log] -output_def $save_def -output ..." (procedure "random_global_placement" line 10) invoked from within "random_global_placement" (procedure "run_placement" line 12) invoked from within "run_placement" (procedure "run_placement_step" line 8) invoked from within "run_placement_step"} -errorline 1 [INFO]: Saving current set of views in 'runs/RUN_2024.04.10_23.11.55/results/final'... [INFO]: Generating final set of reports... [INFO]: Created manufacturability report at 'runs/RUN_2024.04.10_23.11.55/reports/manufacturability.rpt'. [INFO]: Created metrics report at 'runs/RUN_2024.04.10_23.11.55/reports/metrics.csv'. [INFO]: Saving runtime environment... [ERROR]: Flow failed. [INFO]: The failure may have been because of the following warnings: [WARNING]: PNR_SDC_FILE is not set. It is recommended to write a custom SDC file for the design. Defaulting to BASE_SDC_FILE [WARNING]: SIGNOFF_SDC_FILE is not set. It is recommended to write a custom SDC file for the design. Defaulting to BASE_SDC_FILE Similarly I am facing an error when attempting to run the openlane2 example notebook as well
──────────────────────────────────────── Static Timing Analysis (Post-PnR) ────────────────────────────────────────
[21:41:28] VERBOSE  Running 'OpenROAD.STAPostPNR'… (Log:                                               step.py:1085
                    ./openlane_run/21-openroad-stapostpnr/openroad-stapostpnr.log)                                 
[21:41:31] ERROR    Subprocess had a non-zero exit.                                                    step.py:1310
[21:41:31] ERROR    Last 10 line(s):                                                                   step.py:1315
                    AssertionError: SRE module mismatch                                                            
                    Traceback (most recent call last):                                                             
                      File "/content/openlane_ipynb/openlane/scripts/odbpy/filter_unannotated.py",                 
                    line 15, in <module>                                                                           
                        import re                                                                                  
                      File "/usr/lib/python3.10/re.py", line 125, in <module>                                      
                        import sre_compile                                                                         
                      File "/usr/lib/python3.10/sre_compile.py", line 17, in <module>                              
                        assert _sre.MAGIC == MAGIC, "SRE module mismatch"                                          
                               ^^^^^^^^^^^^^^^^^^^                                                                 
                    AssertionError: SRE module mismatch                                                            
                                                                                                                   
[21:41:31] ERROR    Full log file:                                                                     step.py:1318
                    'openlane_run/21-openroad-stapostpnr/nom_tt_025C_1v80/filter_unannotated.log'                  
[21:41:31] ERROR    Failed STA for the nom_tt_025C_1v80 timing corner:                              openroad.py:699
---------------------------------------------------------------------------
StepError                                 Traceback (most recent call last)
<ipython-input-40-011cbee31ed3> in <cell line: 4>()
      2 
      3 sta_post_pnr = STAPostPNR(state_in=rcx.state_out)
----> 4 sta_post_pnr.start()

/content/openlane_ipynb/openlane/steps/step.py in start(self, toolbox, step_dir, _no_rule, **kwargs)
   1117                 ) from None
   1118             else:
-> 1119                 raise StepError(
   1120                     f"{self.name}: subprocess {e.args} failed", underlying_error=e
   1121                 ) from None
StepError: STA (Post-PnR): subprocess (1, ['openroad', '-exit', '-no_splash', '-metrics', '/content/openlane_run/21-openroad-stapostpnr/nom_tt_025C_1v80/filter_unannotated_metrics.json', '-python', '/content/openlane_ipynb/openlane/scripts/odbpy/filter_unannotated.py', '--corner', 'nom_tt_025C_1v80', '--checks-report', '/content/openlane_run/21-openroad-stapostpnr/nom_tt_025C_1v80/checks.rpt', '/content/openlane_run/11-openroad-fillinsertion/spm.odb', '--input-lef', '/root/.volare/sky130A/libs.ref/sky130_fd_sc_hd/techlef/sky130_fd_sc_hd__nom.tlef', '--input-lef', '/root/.volare/sky130A/libs.ref/sky130_fd_sc_hd/lef/sky130_fd_sc_hd.lef', '--input-lef', '/root/.volare/sky130A/libs.ref/sky130_fd_sc_hd/lef/sky130_ef_sc_hd.lef']) failed
[21:41:31] ERROR    Subprocess had a non-zero exit.
Hi, everyone. I am trying to install OpenROAD on CentOS 7. I referred to the readme file on github a...
t

Tianyu Wei

over 4 years ago
Hi, everyone. I am trying to install OpenROAD on CentOS 7. I referred to the readme file on github and ran`./etc/DependencyInstaller.sh -dev` (there seems to be a "[elopment]" at the end of the command, but I don't know what it means so I just have it removed) for the dependencies. When I tried to compile the project with
cmake3 ..
, an error occurred: -- The CXX compiler identification is GNU 4.8.5 -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ - works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- OpenROAD version: 1 -- OpenROAD git sha: 527cd5d8e82308baa1a46265c1338e6c1757858f -- System name: Linux -- Compiler: GNU 4.8.5 -- Build type: RELEASE -- Install prefix: /usr/local -- TCL library: /usr/lib64/libtcl.so -- TCL header: /usr/include/tcl.h -- Found SWIG: /usr/bin/swig (found suitable version "3.0.12", minimum required is "3.0") -- Found Boost: /usr/include (found version "1.53.0") -- Found Python3: /usr/lib64/libpython3.6m.so (found version "3.6.8") found components: Development -- Found ZLIB: /usr/lib64/libz.so (found version "1.2.7") CMake Error at src/CMakeLists.txt:107 (find_package): By not providing "Findspdlog.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "spdlog", but CMake did not find one. Could not find a package configuration file provided by "spdlog" with any of the following names: spdlogConfig.cmake spdlog-config.cmake Add the installation prefix of "spdlog" to CMAKE_PREFIX_PATH or set "spdlog_DIR" to a directory containing one of the above files. If "spdlog" provides a separate development package or SDK, be sure it has been installed. -- Configuring incomplete, errors occurred! See also "/home/weitianyu/OpenROAD/build/CMakeFiles/CMakeOutput.log". I tried to fix it with
sudo yum install spdlog
but it didn't help. Does anyone know how to fix it? Please excuse me if this is something very simple. I am quite new to openroad and Linux.