Download, install and configure SLiCAP¶
Download and Install SLiCAP¶
SLiCAP is available under the following license:
SLiCAP is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. Based on a work at: http://www.analog-electronics.eu/slicap/slicap.html
Requirements¶
Before installing SLiCAP you need to install maxima CAS and Python 3 packages listed in https://github.com/Lenty/SLiCAP_python/requirements.txt.
MSWindows installation of maxima¶
The preferred install path for maxima under MSWindows is on the system drive. If the program is installed on another drive, SLiCAP will only work after the MAXIMA command in the SLiCAPsettings.py has been set to the correct value. The file SLiCAPsettings.py is located in the SLiCAP installation directory (use file search).
MSWindows installation of LTspice¶
The preferred install path for LTspice under MSWindows is on the system drive. If the program is installed on another drive, makeNetlist(<netlistFile>.asc) will only work after the LTspice command in the SLiCAPsettings.py has been set to the correct value. The file SLiCAPsettings.py is located in the SLiCAP installation directory (use file search).
Download SLiCAP¶
Open a command window or terminal in a folder where you want to store the downloaded files and clone https://github.com/Lenty/SLiCAP_python into that folder:
git clone https://github.com/Lenty/SLiCAP_python
or
Download the zip file from: https://github.com/Lenty/SLiCAP_python and extract it in some folder.
Install SLiCAP¶
If you work with Anaconca open the Anaconda Prompt
If you have python installed under Windows, open a terminal by running the command cmd
If you have python installed under Linux or mac Open a terminal
Go to the folder with the file setup.py (usually: <where_you_downloaded_or_cloned>/SLiCAP_python-master/) and enter the command:
python setup.py install --user
If you install SLiCAP under MSWindows (Anaconda), the installation searches for the maxima command and the LTspice command.
In cases in which maxima cannot be found, SLiCAP will only work after maxima has been installed and the MAXIMA command in the SLiCAPsettings.py has been set to the correct value. The file SLiCAPsettings.py is located in the SLiCAP installation directory (use file search).
In cases in which the LTspice command is not found, the instruction makeNetlist(<cirFileName>.asc) will only run after LTspice has been installed and the LTSPICE command in the SLiCAPsettings.py has been set to the correct value. The file SLiCAPsettings.py is located in the SLiCAP installation directory (use file search).
Configure SLiCAP options¶
You can configure SLiCAP options after you have created a project. To this end you create a python file in some project directory. The minimum content of this (python) file is:
# import the SLiCAP modules
from SLiCAP import *
# Create a SLiCAP project, this creates the folder structure
# and compiles the libraries.
my_project = initProject('my_firstSLiCAP_project')
You can modify the directory structure and update the paths for circuit files, library files, etc in the
SLiCAPconfig.py
file, which is created in the project directory.
MathJax¶
SLiCAP uses MathJax to render LaTeX embedded in html. LaTeX is used for expressions. MathJax rendering of equations requires an Internet connection. The scripts of the MathJax CDN will then be used for this purpose. For proper rendering of equations you need to be connected to the Internet and have JavaScript enabled in your browser.
Global parameters¶
Global parameters are parameters that are defined in a library outside a subcircuit environment. SLiCAP has a number of built-in global parameters. These parameters are defined in the SLiCAPmodels.lib
library file in the lib/
folder
You can define other global parameters by adding SPICE .param declarations in this file.
1"SLiCAPmodels"
2
3* Physical constants
4********************
5
6.param
7+ q = 1.60217662e-19 ; Electron charge in [C]
8+ c = 2.99792458e+08 ; Speed of light in [m/s]
9+ mu_0 = {4*pi*1e-7} ; Permeability of vacuum in [H/m]
10+ epsilon_SiO2 = 3.9 ; Relative permittivity of SiO2 [-]
11+ k = 1.38064852e-23 ; Boltzmann constant in [J/K]
12+ epsilon_0 = {1/mu_0/c^2} ; permittivity of vacuum in [F/m]
13
14* Temperature and thermal voltage
15*********************************
16
17.param
18+ T = 300 ; Default value of the absolute temperature in [K]
19+ U_T = {k*T/q} ; Thermal voltage [V]
20
21* CMOS18 technology parameters for EKV models (SI units)
22********************************************************
23
24.param
25+ TOX_N18 = 4.1n ; oxide thickness [m]
26+ Vth_N18 = 0.36 ; threshold voltage [V]
27+ N_s_N18 = 1.35 ; substrate factor [-]
28+ Theta_N18 = 0.28 ; vertical field mobility reduction coefficient [1/V]
29+ E_CRIT_N18 = 5.6M ; lateral field strength for velocity saturation [V/m]
30+ u_0_N18 = 42m ; zero field carrier mobility [m^2/V/s]
31+ CGBO_N18 = 1p ; gate-bulk overlap capacitance [F/m]
32+ CGSO_N18 = 300p ; gate-source and gate-drain overlap capacitance [F/m]
33+ CJB0_N18 = 1m ; source/bulk drain/bulk capacitance [F/m^2]
34+ LDS_N18 = 180n ; length of drain and source [m]
35+ VAL_N18 = 40M ; Early voltage per unit of length [V/m]
36+ KF_N18 = 2e-27 ; flicker noise (1/f noise) coefficient, zero for f_ell=0 [C/m^2]
37+ AF_N18 = 1 ; flicker noise exponent [-]
38+ C_OX_N18 = {epsilon_0 * epsilon_SiO2 / TOX_N18}; oxide capacitance per unit of area [F/m^2]
39+ I_0_N18 = {2*N_s_N18*u_0_N18*C_OX_N18*U_T^2} ; technology current [A]
40+ V_KF_N18 = 2 ; flicker noise voltage coefficient [V]
41
42.param
43+ TOX_P18 = 4.1n ; oxide thickness [m]
44+ Vth_P18 = -0.36 ; threshold voltage [V]
45+ N_s_P18 = 1.35 ; substrate factor [-]
46+ Theta_P18 = 0.35 ; vertical field mobility reduction factor [1/V]
47+ E_CRIT_P18 = 14M ; lateral field strength for velocity saturation [V/m]
48+ u_0_P18 = 8.92m ; zero field carrier mobility [m^2/V/s]
49+ CGBO_P18 = 1p ; gate-bulk overlap capacitance [F/m]
50+ CGSO_P18 = 300p ; gate-source and gate-drain overlap capacitance [F/m]
51+ CJB0_P18 = 1m ; source/bulk drain/bulk capacitance [F/m^2]
52+ LDS_P18 = 180n ; length of drain and source [m]
53+ VAL_P18 = 40M ; Early voltage per unit of length [V/m]
54+ KF_P18 = 1e-27 ; flicker noise (1/f noise) coefficient, zero for f_ell=0 [C/m^2]
55+ AF_P18 = 1 ; flicker noise exponent [-]
56+ C_OX_P18 = {epsilon_0 * epsilon_SiO2 / TOX_P18}; oxide capacitance per unit of area [F/m^2]
Path settings¶
The project path settings are defined in SLiCAPconflig.py. This file is created in the project directory the by initProject(). Once created, it can be edited to modify the path settings. initProject() will not overwrite the existing SLiCAPconflig.py. If you want it to be regenerated, simply delete it before running initProject().
The default values are:
1#!/usr/bin/env python3
2# -*- coding: utf-8 -*-
3"""
4SLiCAP module with user-defined path settings.
5
6Default values:
7
8>>> PROJECTPATH = None # Leave it for automatic detection
9>>> # PATHS: relative to the project path
10>>> HTMLPATH = 'html/' # path for html output
11>>> CIRCUITPATH = 'cir/' # path for .asc, .net, .cir, .sch files
12>>> LIBRARYPATH = 'lib/' # path for include and library files
13>>> TXTPATH = 'txt/' # path for text files
14>>> CSVPATH = 'csv/' # path for CSV files
15>>> LATEXPATH = 'tex/' # path for LaTeX output
16>>> MATHMLPATH = 'mathml/' # path for mathML output
17>>> IMGPATH = 'img/' # path for image files
18>>> SPHINXPATH = 'sphinx/' # path for Sphinx output
19"""
20PROJECTPATH = None # Leave it for automatic detection
21# PATHS: relative to the project path
22HTMLPATH = 'html/' # path for html output
23CIRCUITPATH = 'cir/' # path for .asc, .net, .cir, .sch files
24LIBRARYPATH = 'lib/' # path for include and library files
25TXTPATH = 'txt/' # path for text files
26CSVPATH = 'csv/' # path for CSV files
27LATEXPATH = 'tex/' # path for LaTeX output
28MATHMLPATH = 'mathml/' # path for mathML output
29IMGPATH = 'img/' # path for image files
30SPHINXPATH = 'sphinx/' # path for Sphinx output
SLiCAP configuration parameters¶
The configuration parameters for SLiCAP are defined in SLiCAP.SLiCAPini.py.
To list the values of the SLiCAP configuration parameters enter:
>>> ini.dump()
Getting Help¶
For help open the index.html
in the doc/
folder in the SLiCAP main library path that you have selected during installation.
If you are working in a python IDE or in a jupyter notebook, use the Help() function (with capital H).
>>> Help() # This will open the HTML documentation in your default web browser.