diff --git a/modules/module_0_foundations/foundations.md b/modules/module_0_foundations/foundations.md index 2ddc1006..3f6db13d 100644 --- a/modules/module_0_foundations/foundations.md +++ b/modules/module_0_foundations/foundations.md @@ -81,7 +81,7 @@ The scripts that was made for generating the LUTs can be found as: ### 🔧 Setup Procedure 1. **Clone the Metwatts GMID repository** - Follow the installation instructions provided in the repo. + Follow the installation instructions provided in the repo ([`gmid`](https://github.com/medwatt/gmid)) > 💡 It is recommended to use a virtual environment. 2. **Generate Lookup Tables** @@ -101,7 +101,7 @@ The scripts that was made for generating the LUTs can be found as: ```bash jupyter lab _gmid_test.ipynb ``` - This notebook will open a GUI for exploring the GMID lookup tables, which should look like the following: + This notebook will open a GUI for exploring the GMID lookup tables, which should look like the following (make sure the paths match yours accordingly):

diff --git a/modules/module_0_foundations/sg13_nmos_lv.py b/modules/module_0_foundations/sg13_nmos_lv.py index 68d49f5f..2f7b8571 100644 --- a/modules/module_0_foundations/sg13_nmos_lv.py +++ b/modules/module_0_foundations/sg13_nmos_lv.py @@ -1,8 +1,15 @@ +import os from mosplot.lookup_table_generator.simulators import NgspiceSimulator, HspiceSimulator from mosplot.lookup_table_generator import LookupTableGenerator, TransistorSweep # One of `include_paths` or `lib_mappings` must be specified. # The rest are optional. +# Read environment variables to build model path +PDK_ROOT = os.environ["PDK_ROOT"] +PDK = os.environ["PDK"] + +model_path = os.path.join(PDK_ROOT, PDK, "libs.tech/ngspice/models/cornerMOSlv.lib") + ngspice = NgspiceSimulator( # Provide path to simulator if simulator is not in system path. simulator_path="ngspice", @@ -15,8 +22,8 @@ ngspice = NgspiceSimulator( # Files to include with `.LIB`. - lib_mappings = [ - ("/home/pedersen/IHP-Open-PDK/ihp-sg13g2/libs.tech/ngspice/models/cornerMOSlv.lib", " mos_tt") # Put your own path to the corner lib + lib_mappings = [ + (model_path, "mos_tt") ], # If the transistor is defined inside a subcircuit in diff --git a/modules/module_0_foundations/sg13_pmos_lv.py b/modules/module_0_foundations/sg13_pmos_lv.py index 74847464..5524d434 100644 --- a/modules/module_0_foundations/sg13_pmos_lv.py +++ b/modules/module_0_foundations/sg13_pmos_lv.py @@ -1,8 +1,15 @@ +import os from mosplot.lookup_table_generator.simulators import NgspiceSimulator, HspiceSimulator from mosplot.lookup_table_generator import LookupTableGenerator, TransistorSweep # One of `include_paths` or `lib_mappings` must be specified. # The rest are optional. +# Read environment variables to build model path +PDK_ROOT = os.environ["PDK_ROOT"] +PDK = os.environ["PDK"] + +model_path = os.path.join(PDK_ROOT, PDK, "libs.tech/ngspice/models/cornerMOSlv.lib") + ngspice = NgspiceSimulator( # Provide path to simulator if simulator is not in system path. simulator_path="ngspice", @@ -15,8 +22,8 @@ ngspice = NgspiceSimulator( # Files to include with `.LIB`. - lib_mappings = [ - ("/home/pedersen/IHP-Open-PDK/ihp-sg13g2/libs.tech/ngspice/models/cornerMOSlv.lib", " mos_tt") # Put your own path to the corner lib + lib_mappings = [ + (model_path, "mos_tt") ], # If the transistor is defined inside a subcircuit in