/spice-mode/spice-mode.el
Emacs Lisp | 8679 lines | 7223 code | 774 blank | 682 comment | 271 complexity | 89b5512e5c5904e034ebe8a4bff124e0 MD5 | raw file
Large files are truncated, but you can click here to view the full file
- ;;; spice-mode.el --- major mode providing a spice mode hook for fontification
- ;;; $Id: spice-mode.el,v 1.100 2007/01/03 16:46:46 vdplasg Exp $
- ;; Emacs Lisp Archive Entry
- ;; Author: Geert A. M. Van der Plas <geert_vanderplas@email.com> 1999-
- ;; Emmanuel Rouat <emmanuel.rouat@wanadoo.fr> 1997-
- ;; Carlin J. Vieri, MIT AI Lab <cvieri@ai.mit.edu> 1994
- ;; Keywords: ngspice, gnucap, spice, spice2g6, spice3, eldo, hspice, layla, mondriaan, fasthenry, CDL, spectre compatibility, netlist editing
- ;; Filename: spice-mode.el
- ;; Version: 1.2.25
- ;; Maintainer: Geert A. M. Van der Plas <geert_vanderplas@email.com>
- ;; Last-Updated: 01 November 2004
- ;; Description: spice file editing
- ;; URL: http://spice-mode.4t.com/
- ;; old-URL: http://www.esat.kuleuven.ac.be/~vdplas/emacs/
- ;; Compatibility: Emacs2[01], (partly tested)XEmacs21
- ;; Please send suggestions and bug reports to
- ;; mailto:Geert_VanderPlas@email.com
- ;; Copyright (C) 1994, MIT Artificial Intelligence Lab
- ;; Copyright (C) 1997- Emmanuel Rouat
- ;; Copyright (C) 1999- Geert A. M. Van der Plas
- ;; This file is free software; you can redistribute it and/or modify
- ;; it under the terms of the GNU General Public License as published by
- ;; the Free Software Foundation; either version 2, or (at your option)
- ;; any later version.
- ;; This file is distributed in the hope that it will be useful,
- ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
- ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ;; GNU General Public License for more details.
- ;; You should have received a copy of the GNU General Public License
- ;; along with GNU Emacs; see the file COPYING. If not, write to
- ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- ;; INSTALL:
- ;; ========
- ;; byte compile spice-mode.el to spice-mode.elc (see `byte-compile-file')
- ;; put these two files in an arbitrary, but accesible directory
- ;; for example: $HOME/emacs, /usr/lib/emacs/site-lisp/ or
- ;; /usr/local/lib/emacs/site-lisp/
- ;; If you chose a non-standard place to put the files add the following
- ;; line to your Emacs start-up file (`.emacs') or custom `site-start.el'
- ;; file (replace <directory-name> by the directory where you placed
- ;; spice-mode.el and spice-mode.elc):
- ;; (setq load-path (cons (expand-file-name "<directory-name>") load-path))
- ;; To use spice-mode, add either the following to your `.emacs' file. This
- ;; assumes that you will use the .sp, .cir, .ckt, .mod, ... extensions for
- ;; your spice source decks and output files:
- ;; (autoload 'spice-mode "spice-mode" "Spice/Layla Editing Mode" t)
- ;; (setq auto-mode-alist (append (list (cons "\\.sp$" 'spice-mode)
- ;; (cons "\\.cir$" 'spice-mode)
- ;; (cons "\\.ckt$" 'spice-mode)
- ;; (cons "\\.spc$" 'spice-mode) ; xcircuit output
- ;; (cons "\\.spice$" 'spice-mode) ; magic output
- ;; (cons "\\.mod$" 'spice-mode)
- ;; (cons "\\.cdl$" 'spice-mode)
- ;; (cons "\\.chi$" 'spice-mode) ;eldo outpt
- ;; (cons "\\.inp$" 'spice-mode))
- ;; auto-mode-alist))
- ;; Other way to load spice mode (by Andrew Scott):
- ;; ;;; Testing for spice-mode (Another spice mode, also works on Spice,
- ;; ;;; Eldo, Layla; this one works on GNU Emacs-20.6 issues).
- ;; (autoload 'spice-mode "spice-mode" "Spice/Layla Editing Mode" t)
- ;; (add-to-list 'auto-mode-alist '("\\.cir$" . spice-mode))
- ;; (add-to-list 'auto-mode-alist '("\\.ckt$" . spice-mode))
- ;; (add-to-list 'auto-mode-alist '("\\.inp$" . spice-mode))
- ;; (add-to-list 'auto-mode-alist '("\\.spout$" . spice-mode));hspice out
- ;; (add-to-list 'auto-mode-alist '("\\.pdir$" . spice-mode))
- ;; ;;; Intel formats
- ;; (add-to-list 'auto-mode-alist '("\\.[sS][pP]$" . spice-mode))
- ;; (add-to-list 'auto-mode-alist '("\\.[sm]?t0$" . spice-mode))
- ;; (add-to-list 'auto-mode-alist '("\\.[h]?spice$" . spice-mode))
- ;; CUSTOMIZATION:
- ;; ==============
- ;; use customization to modify the behaviour of spice-mode; add
- ;; custom-set-variables to your `.emacs' file, for example:
- ;; (custom-set-variables
- ;; ; '(spice-initialize-file-function (quote geert-spice-file-header)) ;; use geert-spice-file-header function (not included in this file !)
- ;; '(spice-initialize-empty-file t) ;; initialize empty/new spice file
- ;; ; '(spice-standard '(spice2g6 (hspice eldo eldorf eldovloga layla))) ;; all 4 modes
- ;; '(spice-standard (quote (spice2g6 (hspice eldo)))) ;; hspice and eldo
- ;; '(spice-standard (quote (spice2g6 ()))) ;; spice2g6/3 only
- ;; '(spice-simulator "Spice3") ;; default simulator
- ;; '(spice-waveform-viewer "ngnutmeg") ;; default waveform
- ;; '(spice-highlight-keywords nil) ;; less highlighting
- ;; '(spice-section-alist ;; add own sections
- ;; ;; this is ugly, I know ;)
- ;; (append (nth 1 (nth 0 (get 'spice-section-alist 'standard-value)))
- ;; (list
- ;; (list "My Header" "MY HEADER" nil)
- ;; )))
- ;; '(spice-use-func-menu t) ;; use func-menu (XEmacs)
- ;; '(spice-show-describe-mode nil) ;; don't describe mode at startup
- ;; )
- ;; This can also be achieved interactively through customizations !
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; Commentary:
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; The original spice-mode.el created by C. Vieri has been modified
- ;; extensively. These changes have been heavily influenced by the eldo-mode.el
- ;; of Emmanuel Rouat (the tempo-templates for one) and the vhdl-mode.el of
- ;; Reto Zimmermann and Rodney J. Whitby (the font-locking, the
- ;; customization, the menus, ...) Help in understanding 'advanced' lisp
- ;; was provided by G. Debyser <geert.debyser@advalvas.be>, our (common) lisp
- ;; expert. Since version 0.97 a lot of input/ideas have been provided by
- ;; Emmanuel Rouat. Just take a look and search for eldo-mode ;)
- ;; This package provides an Emacs major mode for editing SPICE decks.
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; TODO:
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; - customization group spice- needs to be improved
- ;; activate customizations needs to be looked at (potentially removed)
- ;; - fix problem imenu sometimes truncating filenames of include files
- ;; by replacing the functionality with own function
- ;; - improve Y instance handling. use builtin macromodels, and own development;; models
- ;; - ...
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; BUGS:
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; - searching for .subckt could be buggy because of user's file structure
- ;; - xinstance highlighting is buggy, and probably always will ?
- ;; - font-lock expressions are incredibly complicated, and multiple spice
- ;; formats are not handled correctly at the same time...
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; If you have any questions about this mode, feel free to contact me
- ;; at the following address: geert_vanderplas@email.com. If I find the
- ;; time, I can take a look at the problem
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; free variables
- (defvar fume-function-name-regexp-alist)
- (defvar fume-function-name-regexp)
- (defvar compilation-file-regexp-alist)
- (defvar fume-find-function-name-method-alist)
- (defvar fume-menubar-menu-name)
- (defvar fume-buffer-menu)
- (defvar fume-buffer-name)
- (defvar fume-index-method)
- (defvar msb-menu-cond)
- (defconst spice-version "1.2.26 (12 Dec 2009)"
- "Current version of spice mode (spice2g6/spice3/hspice/eldo(rf&verilog-a)/fasthenry/layla/mondriaan/draccdl/spectre).")
- (defconst spice-developer
- "Geert Van der Plas & Emmanuel Rouat (<geert_vanderplas@email.com>, <emmanuel.rouat@wanadoo.fr>)"
- "Current developers/maintainers of spice-mode.")
- (defvar spice-running-xemacs (string-match "XEmacs" emacs-version)
- "A variable that tells us whether we're in Xemacs or not")
- (defvar spice-tempo-tags nil
- "List of templates used in spice mode.")
- ;; help function
- (defun spice-custom-set (variable value &rest functions)
- "Set variables as in `custom-set-default' and call FUNCTIONS (if
- bound) afterwards."
- (if (fboundp 'custom-set-default)
- (custom-set-default variable value)
- (set-default variable value))
- (while functions
- (when (fboundp (car functions)) (funcall (car functions)))
- (setq functions (cdr functions))))
- (defgroup spice nil
- "Customizations for Spice mode."
- :prefix "spice-"
- :link '(url-link "http://spice-mode.4t.com/")
- :group 'languages
- )
- ;;;###autoload
- (defcustom spice-mode-hook nil
- "*List of hook functions run by `spice-mode' (see `run-hooks')."
- :type 'hook
- :group 'spice)
- ;;;###autoload
- (defcustom spice-standard '(spice2g6 (hspice eldo eldorf eldovloga fasthenry)) ; "layla" has been removed
- "*Spice standards used.
- Basic standard:
- Spice2g6 : Original Berkeley Spice (leave this always on!)
- Additional standards:
- Gnucap : The Gnu Circuit Analysis Package
- Hspice (TM) : Commercial Spice, formerly Meta Software, now owned by Synopsys
- Eldo (TM) : Commercial Spice, formerly Anacad, now owned by Mentor Graphics
- EldoRf (TM) : RF Steady State analyses of Eldo (also turn on Eldo!)
- EldoVlogA : Verilog-A extensions to Eldo netlist language (also turn on Eldo!)
- FastHenry : Multipole-accelerated inductance analysis program from MIT
- Layla : KULeuven LAYLA (layout synthesis) extensions to Spice format
- Mondriaan : KULeuven MONDRIAAN (layout synthesis) extensions (also turn on Layla!)
- DracCDL (TM): Dracula CDL extensions (Cadence LOGLVS netlists)
- Spectre (TM): Spice compatibility of Spectre language (simulator language=spice decks)
- "
- :type '(list (choice :tag "Basic standard"
- (const :tag "Spice2g6" spice2g6))
- (set :tag "Additional standards" :indent 2
- (const :tag "Hspice" hspice)
- (const :tag "Eldo" eldo)
- (const :tag "Eldo RF" eldorf)
- (const :tag "Eldo Verilog-A" eldovloga)
- (const :tag "FastHenry" fasthenry)
- (const :tag "Layla" layla)
- (const :tag "Mondriaan" mondriaan)
- (const :tag "DracCDL" draccdl)
- (const :tag "Spectre Spice Compatibility" spectre)))
- :set (lambda (variable value)
- (spice-custom-set variable value
- 'spice-check-spice-standard
- 'spice-mode-syntax-table-init
- 'spice-keywords-init
- 'spice-font-lock-init
- 'spice-imenu-init
- 'spice-update-existing-buffers))
- :group 'spice)
- ;;;###autoload
- (defcustom spice-imenu-add-to-menubar t
- "*Spice mode adds imenu (Index) item to menubar"
- :group 'spice
- :set (lambda (variable value)
- (spice-custom-set variable value
- 'spice-update-existing-buffers))
- :type 'boolean)
- ;;;###autoload
- (defcustom spice-use-func-menu nil
- "*Spice func menu setting (untested), comparable to imenu"
- :group 'spice
- :set (lambda (variable value)
- (spice-custom-set variable value
- 'spice-update-existing-buffers))
- :type 'boolean)
- ;;;###autoload
- (defcustom spice-show-describe-mode nil ; was t
- "*Spice mode runs `describe-mode' once at start of spice-mode"
- :group 'spice
- :type 'boolean)
- ;;;###autoload
- (defcustom spice-echo-intro t
- "*Spice mode echos introductory message on entry to spice-mode"
- :group 'spice
- :type 'boolean)
- (defgroup spice-initialize-file nil
- "Customizations for initialization of empty/new spice files."
- :group 'spice)
- ;;;###autoload
- (defcustom spice-initialize-empty-file nil
- "*Spice initialize empty/new file setting"
- :group 'spice-initialize-file
- :type 'boolean)
- ;;;###autoload
- (defcustom spice-initialize-template-file "~/.spice-default"
- "*File containing the default header that is inserted when opening
- an empty file (ie. a new file), see also `spice-initialize-empty-file'"
- :group 'spice-initialize-file
- :type 'file)
- ;;;###autoload
- (defcustom spice-default-header nil
- "*Default header for new Spice netlists, see also `spice-initialize-empty-file'"
- :group 'spice-initialize-file
- :type 'string)
- ;;;###autoload
- (defcustom spice-initialize-file-function 'spice-initialize-empty-file
- "*Optional initialize function for empty/new files, see also
- `spice-initialize-empty-file'. If a different function is specified it
- should insert a default header/template in the current buffer. This
- function should check which submode is in use with `spice-standard-p'
- and adapt its output accordingly. It may also use the `spice-default-header'
- variable and insert its contents into the buffer."
- :group 'spice-initialize-file
- :type 'function)
- (defgroup spice-simulate nil
- "Customizations for simulation."
- :group 'spice)
- (defcustom spice-simulator-alist
- '(
- ;; Spice3; spice3 -b <file.cir>
- ;;
- ("Gnucap" "gnucap -b" ""
- ("\\s-*Error[\t ]+on[ \t]+line[\t ]+\\([0-9]+\\) +:.+"
- 0 1 nil (buffer-file-name))
- ("Circuit: \\(.*\\)$" 1)) ; spice3 hack, is not the filename, but that's no prob
- ;; Hspice; hspice <file.cir>
- ;; **error**: only 1 connection at node 0:2
- ("Hspice" "hspice" ""
- ("\\s-*\\(..?error..?[: ]\\).+" 0 spice-linenum 1 (buffer-file-name))
- ("[* ]* [iI]nput [fF]ile: +\\([^ \t]+\\).*$" 1))
- ;; Eldo; eldo -i <file.cir>
- ;; ERROR 503: MODEL "NMOS": Undeclared model reference.
- ("Eldo" "eldo -i" ""
- ("\\s-*\\(E[rR][rR][oO][rR] +[0-9]+:\\).*"
- 0 spice-linenum 1 (buffer-file-name))
- ("Running \\(eldo\\).*$" 1)) ; eldo hack, true filename can not be found
- ;; Spectre; spectre <file.cir>
- ;; "viblok2.cir" 7: Unknown dot word `.param'.
- ("Spectre" "spectre" ""
- ("\\s-*\"\\([^ \t\n]+\\)\" +\\([0-9]+\\):.*"
- 1 2)
- ("" 0)) ; filename is in regexp of error
- ;;; Add your local simulators here:
- ;;
- )
- "*List of available Spice simulators and their properties.
- Each list entry specifies the following items for a simulator:
- Simulator:
- Simulator Name : name used in variable `spice-simulator' to choose
- simulator
- Simulate Command : command including options used for simulation program
- Extra switches : extra switches for simulator, after filename
- Error Message:
- Regexp : regular expression to match error messages
- File Subexp Index: index of subexpression that matches the file name
- Line Subexp Index: index of subexpression that matches the line number.
- use function `spice-linenum' when the line number
- is not available
- Col Subexp Index : index of subexpression that matches the column number
- if not available but `spice-linenum' has been
- supplied in the previous field, use 1
- File Message:
- Regexp : regular expression to match a file name message
- File Subexp Index: index of subexpression that matches the file name
- See also variable `spice-simulator-switches' to add options to the
- simulate command.
- Most simulators do not include the file name in the error message, but print
- out a file name message in advance. In this case, set \"File Subexp Index\"
- to 0 and fill out the \"File Message\" entries.
- "
- :type '(repeat (list :tag "Simulator" :indent 2
- (string :tag "Simulator Name ")
- (string :tag "Simulate Command ")
- ;(string :tag "From Directory " "./")
- (string :tag "Extra Switches ")
- (list :tag "Error Message" :indent 4
- (regexp :tag "Regexp ")
- (integer :tag "File Subexp Index")
- (integer :tag "Line Subexp Index"))
- (list :tag "File Message" :indent 4
- (regexp :tag "Regexp ")
- (integer :tag "File Subexp Index"))))
- :set (lambda (variable value)
- (spice-custom-set variable value
- 'spice-menu-init
- 'spice-compile-variables-init
- 'spice-update-existing-buffers))
- :group 'spice-simulate)
- ;;;###autoload
- (defcustom spice-simulator nil ; example: "Hspice"
- "*Spice command, used when compiling buffer with `compile-mode',
- see also `spice-simulator-switches'."
- :group 'spice-simulate
- :type 'string)
- ;;;###autoload
- (defcustom spice-simulator-switches "" ; example "-noconf"
- "*Spice command switches, used when compiling buffer with `compile-mode',
- see also `spice-simulator'."
- :group 'spice-simulate
- :type 'string)
- (defcustom spice-waveform-viewer-alist
- '(
- ;; Nutmeg; nutmeg <waveformdata.dat>
- ;;
- ("Gwave" "gwave" "" spice-run-silent
- (".raw" ".braw" ".ac0" ".tr0" ".sw0" ".W" ".N" ".acs")) ; gwave viewer
- ("ngnutmeg" "ngnutmeg" "" spice-run-interactive (".dat" ".ac0" ".tr0")) ; spice3 nutmeg viewer
- ("Xelga" "xelga" "" spice-run-silent ".cou") ; xelga eldo viewer
- ("Awaves" "awaves_emacs" "" spice-run-silent (".ac0" ".tr0")) ; awaves hspice viewer, this doesn't work yet and will it ever ? Explanation: awaves is a script that starts an executable/binary in the background. This means the shell starting awaves ends immediately after the forking of the executable; after which all backgrounded programs get killed by emacs since their parent's parent shell (/bin/sh) ends. awaves shouldn't return immediately and then this will work; that's why I called the program awaves_emacs...
- ;; ("Awaves2" "echo_awaves" "" spice-run-silent nil) ; awaves hspice viewer
- ;;; Add your local waveform viewers here:
- ;;
- )
- "*List of available Waveform viewers and their properties.
- Each list entry specifies the following items for a waveform viewer:
- Waveform Viewer:
- Wave Viewer Name : name used in variable `spice-waveform-viewer' to choose
- a waveform viewer
- Wave Viewer Command : command including options used for waveform viewer
- Extra switches : extra switches for waveform viewer, after filename
- See also variable `spice-waveform-viewer-switches' to add options to the
- waveform viewer command.
- "
- :type '(repeat (list :tag "Waveform Viewer" :indent 2
- (string :tag "Waveform Viewer Name ")
- (string :tag "Waveform Viewing Command ")
- (string :tag "Extra Switches ")
- (choice :tag "How"
- :value spice-run-silent
- (function-item spice-run-silent)
- (function-item spice-run-interactive)
- (function :tag "Other"))
- (choice (string :tag "Filename Suffix ")
- (function :tag "Function Deriving Filename")
- (repeat (list :tag "List of Filename Suffixes")))))
- :set (lambda (variable value)
- (spice-custom-set variable value
- 'spice-menu-init
- 'spice-update-existing-buffers))
- :group 'spice-simulate)
- ;;;###autoload
- (defcustom spice-waveform-viewer nil ; example: "ngnutmeg"
- "*Spice command, used when starting waveform viewer,
- see also `spice-waveform-viewer-switches'."
- :group 'spice-simulate
- :type 'string)
- ;;;###autoload
- (defcustom spice-waveform-viewer-switches "" ; example "-b"
- "*Spice waveform viewer command switches,
- see also `spice-waveform-viewer'."
- :group 'spice-simulate
- :type 'string)
- (defgroup spice-commands nil
- "Customizations for commands."
- :group 'spice)
- ;;;###autoload
- (defcustom spice-shell
- (if (memq system-type '(ms-dos emx windows-nt))
- shell-file-name
- "/bin/sh")
- "*Name of shell used to parse spice commands."
- :group 'spice-commands
- :type 'file)
- ;;;###autoload
- (defcustom spice-shell-command-option
- (cond ((memq system-type '(ms-dos emx windows-nt) )
- (cond ((boundp 'shell-command-option)
- shell-command-option)
- ((boundp 'shell-command-switch)
- shell-command-switch)
- (t
- "/c")))
- (t ;Unix & EMX (Emacs 19 port to OS/2)
- "-c"))
- "*Shell argument indicating that next argument is the command."
- :group 'spice-commands
- :type 'string)
- (defgroup spice-hide nil
- "Customizations for hiding of comments."
- :group 'spice)
- ;;;###autoload
- (custom-declare-variable 'spice-hide-line-prefix
- '(concat
- (regexp-quote
- (concat comment-start
- (if (boundp 'comment-padding)
- (if (integerp comment-padding)
- (make-string comment-padding ? )
- comment-padding)
- " ")))
- "[a-z\\*!$0-9+\\.]")
- "*Regexp string describing lines that are commented out and will be
- hidden. The regexp is matched to the beginning of a line, the ^ is
- added automatically. The initialization of this variable is handled
- in `spice-hide-init', which is after the setting of `comment-start'
- and `comment-padding' variables."
- :initialize (lambda (variable value)
- (message "Deferring initialization of %s with %s to spice-hide-init" variable value)) ; avoid init now, comment-start and padding aren't set yet.
- :group 'spice-hide
- :type 'string)
- ;;;###autoload
- (defcustom spice-auto-hide-comments nil
- "*Boolean indicating automatic hiding of all commented regions at load time."
- :group 'spice-hide
- :type 'boolean)
- (defgroup spice-section nil
- "Customizations for sections."
- :group 'spice)
- ;; sections (entirely different implementation but sections idea has
- ;; been taken from eldo-mode.el)
- ;;;###autoload
- (defcustom spice-section-alist
- '(
- ;; Libraries
- ("Libraries" "LIBRARIES" nil) ;
- ;; Netlist
- ("Netlist" "NETLIST" nil) ;
- ;; Main Circuit
- ("Main Circuit" "MAIN CIRCUIT" nil) ;
- ;; Options
- ("Options" "SIMULATION OPTIONS" nil) ;
- ;; Supplies
- ("Supplies" "SUPPLIES/REFERENCES" nil) ;
- ;; Input Signals
- ("Input Signals" "INPUT SIGNALS" nil) ;
- ;; DC Analysis
- ("DC Analysis" "DC ANALYSIS" nil) ;
- ;; AC Analysis
- ("AC Analysis" "AC ANALYSIS" nil) ;
- ;; Transient Analysis
- ("Transient Analysis" "TRANSIENT ANALYSIS" nil) ;
- ;;; Add your site-local spice sections here:
- ;;
- )
- "*List of valid sections in a Spice file and their options.
- Each list entry specifies the following items for a section:
- Section:
- Section Name : name used in to select/create find section, make this
- name short and descriptive.
- Section String : string used in file to start section (usually all
- uppercase variant of name).
- Extra switches : extra switches for a section, unspecified for now."
- :type '(repeat (list :tag "Section" :indent 2
- (string :tag "Section Name ")
- (string :tag "Section String ")
- (sexp :tag "Extra Switches (nil)")))
- :set (lambda (variable value)
- (spice-custom-set variable value
- 'spice-keywords-init
- 'spice-font-lock-init
- 'spice-menu-init
- 'spice-imenu-init
- 'spice-update-existing-buffers))
- :group 'spice-section)
- (defgroup spice-faces nil
- "Customizations for highlighting."
- :group 'spice)
- ;;;###autoload
- (defcustom spice-highlight-keywords t
- "*Non-nil means highlight SPICE keywords and other standardized words.
- The following faces are used:
- `spice-title-face' : title (first line in a spice file)
- `spice-doc-face' : doc strings
- `spice-analysis-face' : analyses
- `spice-instance-name-face' : instance/element names
- `spice-model-name-face' : subckt model names
- `spice-layla-function-name-face': layla function names
- `spice-include-file-face' : include files and libraries
- `font-lock-keyword-face' : keywords
- `font-lock-warning-face' : warnings
- `font-lock-comment-face' : comment
- `font-lock-function-name-face': subcircuit references / names of objects
- `font-lock-type-face' : types
- `font-lock-string-face' : strings & include files
- `font-lock-constant-face' : simulator's options
- `font-lock-variable-name-face': names of .param's & variables
- NOTE: Activate the new setting in a spice buffer by re-fontifying it (menu
- entry \"Fontify Buffer\"). XEmacs: turn off and on font locking."
- :type 'boolean
- :group 'spice-faces)
- ;; We try to use usual/standard font-lock faces, plus a few specific ones:
- (custom-add-to-group
- 'spice-faces 'font-lock-comment-face 'custom-face)
- (custom-add-to-group
- 'spice-faces 'font-lock-keyword-face 'custom-face)
- (custom-add-to-group
- 'spice-faces 'font-lock-type-face 'custom-face)
- (custom-add-to-group
- 'spice-faces 'font-lock-function-name-face 'custom-face)
- (custom-add-to-group
- 'spice-faces 'font-lock-variable-name-face 'custom-face)
- (custom-add-to-group
- 'spice-faces 'font-lock-warning-face 'custom-face)
- (custom-add-to-group
- 'spice-faces 'font-lock-string-face 'custom-face)
- (defgroup spice-output nil
- "Customizations for spice output file handling."
- :group 'spice)
- ;;;###autoload
- (defcustom spice-output-filename-alist
- '(
- ;; Libraries
- (eldo (concat (file-name-sans-extension (buffer-file-name)) ".chi")) ;
- (hspice (concat (file-name-sans-extension (buffer-file-name)) ".lis")) ;
- (hspice (concat (file-name-sans-extension (buffer-file-name)) ".spout")) ;
- (hspice (concat (file-name-sans-extension (buffer-file-name)) ".hspout")) ;
- (spice2g6 (concat (file-name-sans-extension (buffer-file-name)) ".out")) ;
- )
- "*List of valid output names depending on selected spice standard:
- Spice Standard : one of spice2g6, hspice, eldo or layla
- Expression : expression calculating the output filename
- "
- :type '(repeat (list :tag "Output Filenames" :indent 2
- (symbol :tag "Spice Standard ")
- (sexp :tag "Expression ")))
- :group 'spice-output)
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; buffer local vars for spice-mode
- ;;(defvar spice-standard-local nil
- ;; "buffer local version of spice-standard.")
- (defvar spice-output-local nil
- "buffer local version of spice-output.")
- (defun spice-standard-p (standard)
- "Check if STANDARD is specified as used standard on local variable."
- (or (eq standard (car spice-standard))
- (memq standard (cadr spice-standard))))
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; regexps for spice mode
- (defconst spice-continuation-prefix "+"
- "Continuation prefix for normal spice line")
- (defconst spice-line-break "\\(\n\\s-*\\+\\s-*\\)*"
- "Regexp that matches a (possible) line break (\n+)")
- (defconst spice-model-name "\\([a-z][^ \t\n=]*\\)" ; "\\([a-z]\\sw*[^ \t\n=]*\\)"
- "Regexp that describes a syntactically correct model or subckt name")
- (defconst spice-library-regexp-start
- "^\\.\\(inc\\|include\\|verilog\\|use_veriloga\\|lib\\(\\s-+key=\\w+\\)?\\|libfas\\|subckt\\s-+lib\\|model\\s-+lib\\)\\s-+[\"']?"
- "Regexp that matches the beginning of library or include filename")
- (defconst spice-library-regexp-end
- "\\([^ \t\n\"']*\\)"
- "Regexp that matches the end of library or include filename") ; doesn't catch end of buffer
- (defconst spice-section-regexp-start "\\(^[*!$]\\s-*\\)"
- "spice mode section header start regexp.")
- (defconst spice-spice2g6-keywords
- '(
- "subckt"
- "print" "plot"
- "opt" ; opt is actually a spice3 keyword, not 2g6
- "nodeset"
- "model" "macro" "include" ; include is actually a spice3 keyword, not 2g6
- "ends" "end"
- )
- "List of Spice2g6 keywords")
- (defconst spice-spice2g6-analyses
- '(
- "tran" "op" "noise" "four" "disto" "dc" "ac"
- )
- "List of Spice2g6 analysis keywords")
- (defconst spice-spice2g6-analysis-modifiers
- '(
- "dec" "lin" "oct" ;; the ubiquitous spice2g6 ac modifiers
- "pol" "zer" "pz" "cur" "vol" ;; pz analysis spice3
- "ac" ;; .sens analysis spice3
- )
- "List of Spice2g6 analysis modifier keywords")
- (defconst spice-eldo-keywords
- '(
- "width" "use" "unprotect" "tvinclude" "topcell"
- "table" "subdup" "solve" "sinus" "sigbus"
- "setsoa" "setbus" "save" "restart" "ramp"
- "protect" "probe" "plotbus"
- "param" "overwrite_input" "optwind" "optpwl" "optnoise" "options"
- "option" "optfour"
- "notrc" "nocom" "modlogic"
- "moddup" "meas" "mcmod" "lotgroup" "loop" "load"
- "libfas" "lib" "init" "include" "ic" "hier" "guess" "global"
- "extract" "endl" "enddata" "dspf_include" "distrib" "del"
- "defwave" "defplotdig" "defmac" "data" "d2a" "comchar" "conso" "connect"
- "chrsim" "chrent" "chrand" "checksoa" "checkbus" "alter" "addlib" "a2d"
- )
- "List of Eldo keywords")
- (defconst spice-eldo-colon-keywords
- '(
- "param" "pin" "model"
- )
- "List of Eldo colon keywords")
- (defconst spice-eldo-macromodel-keywords
- '(
- "opamp0" "opamp0d" "opamp1" "opamp1d" "opamp2" "opamp2d"
- "satr" "satv" "vswitch" "cswitch"
- "tri2sin" "stairgen" "sawgen" "trigen"
- "amm" "pam"
- "sa_ho" "tr_ho"
- "pwm" "vco"
- "peak_d" "lev_d"
- "logamp" "expamp"
- "diff" "integ"
- "add" "sub" "mult" "div"
- "sc_ideal" "sc_i" "sc_n" "sc_p" "sc_s1" "sc_s2"
- "sc_sp1" "sc_sp2" "sc_b" "sc_u"
- )
- "List of Eldo macromodels")
- (defconst spice-eldo-analyses
- '(
- "wcase" "tf" "temp"
- "step" "snf" "sens" "pz"
- "noisetran" "mc"
- )
- "List of Eldo analysis keywords")
- (defconst spice-eldo-analysis-modifiers
- '(
- )
- "List of Eldo analysis modifier keywords")
- (defconst spice-eldorf-keywords
- '(
- "sst"
- )
- "List of Eldo RF keywords")
- (defconst spice-eldovloga-keywords
- '(
- "verilog" "use_veriloga"
- )
- "List of Eldo Verilog-A keywords")
- (defconst spice-eldovloga-colon-keywords
- '(
- "port" "generic"
- )
- "List of Eldo Verilog-A colon keywords")
- (defconst spice-eldorf-analyses
- '(
- "sstac" "sstxf" "sstnoise"
- )
- "List of Eldo RF keywords")
- (defconst spice-hspice-keywords
- '(
- "width" "unprot" "unprotect" "uic"
- "title" "sys" "system" "save"
- "sample" "prot" "protect"
- "probe" "pc" "parameter"
- "param" "options" "option"
- "nomod"
- "measure" "meas" "macro"
- "load" "lib" "include" "inc" "ic" "graph" "global"
- "eom" "enddata" "dellib" "delete"
- "del" "dcvolt" "data" "control" "comment"
- "alter"
- "fsoptions" "layerstack" "material" "shape" ; FEM solver for W elements
- )
- "List of Hspice keywords")
- (defconst spice-hspice-analyses
- '(
- "disto"
- "fft"
- "tf" "temp"
- "net" ;; S, Z, Y and H parameters
- "sample"
- "sens"
- "pz"
- "noise"
- )
- "List of Hspice analysis keywords")
- (defconst spice-hspice-analysis-modifiers
- '(
- "sweep" "poi"
- )
- "List of Hspice analysis modifier keywords")
- (defconst spice-fasthenry-keywords
- '(
- "units" "default" "external" "equiv"
- )
- "List of FastHenry keywords")
- (defconst spice-fasthenry-analyses
- '(
- "freq"
- )
- "List of FastHenry analysis keywords")
- (defconst spice-fasthenry-analysis-modifiers
- '(
- )
- "List of FastHenry analysis modifier keywords")
- (defconst spice-layla-keywords
- '(
- "stop" "start"
- "port" "performance" "parameter"
- "param" "options" "option"
- "net"
- "model" "matching"
- "include" "inc"
- "bus"
- )
- "List of Layla keywords")
- (defconst spice-mondriaan-keywords
- '(
- "master" "routingarea" "routingchannel" "ports" "portgrid" "net"
- )
- "List of Mondriaan keywords")
- (defconst spice-draccdl-keywords
- '(
- "bipolar" "busdelimiter" "capa" "caparea" "capval" "default" "dioarea"
- "dioperi" "diode" "edifdelimiter" "busdelimiter" "equation" "equiv"
- "gnonswap" "ldd" "mega" "nonswap" "nopin" "nosub" "pin" "pininfo"
- "resi" "ressize" "resval" "reverse" "scale" "spice" "unspec"
- "eom" "global" "param" "macro" "swap"
- )
- "List of Dracula CDL keywords")
- (defconst spice-spice2g6-types
- '(
- "ac" "dc" "exp" "pulse" "pwl" "sffm" "sin"
- )
- "List of types in spice2g6")
- (defconst spice-hspice-types
- '(
- "metal" "dielectric" "pec" "rectangle" "circle" "strip" "polygon" ;; ""
- )
- "List of types in hspice")
- (defconst spice-eldo-types
- '(
- "pattern"
- )
- "List of source types in eldo")
- (defconst spice-eldorf-types
- '(
- "fpulse" "four" "probe"
- )
- "List of source types in eldorf")
- (defconst spice-fasthenry-types
- '(
- "point" "rect" "circle"
- "user1" "user2" "user3" "user4" "user5" "user6" "user7"
- )
- "List of source types in fasthenry")
- (defconst spice-special-model-type-names
- '(
- "d" "npn" "pnp" "nmos" "pmos"
- )
- "List of model type names which are excluded for imenu")
- (defconst spice-spice2g6-model-type-names
- '(
- "r" "c" "urc" "ltra"
- "njf" "pjf"
- "nmf" "pmf"
- "sw" "csw"
- )
- "List of model type names in spice2g6")
- (defconst spice-eldo-model-type-names
- '(
- "res" "cap" "ind"
- "rn" "rp" "lpnp"
- )
- "List of model type names extra in eldo")
- (defconst spice-eldo-vloga-model-type-names
- '(
- "macro"
- )
- "List of model type names extra in Eldo Verilog-A")
- (defconst spice-hspice-model-type-names
- '(
- "l" "core" "w" "plot"
- )
- "List of model type names extra in hspice")
- (defconst spice-spice2g6-output-keywords
- '("print" "plot")
- "List of output keywords in spice2g6")
- (defconst spice-spice2g6-output-types
- '("ac" "dc" "tran")
- "List of output types in spice2g6")
- (defconst spice-eldo-output-keywords
- '("extract" "meas")
- "List of output keywords in eldo")
- (defconst spice-eldo-output-types
- '("dcac" "dcsweep" "dctran" "noise" "four" "sweep")
- "List of output types in eldo")
- (defconst spice-eldorf-output-types
- '("fsst" "tsst" "sstac" "sstxf" "ssnoise" )
- "List of output types in eldo")
- (defconst spice-hspice-output-keywords
- '("probe" "graph" "measure")
- "List of output keywords in hspice")
-
- (defconst spice-hspice-output-types
- '("noise" "disto")
- "List of output types in hspice")
-
- (defconst spice-spice2g6-options-keywords
- '("trytocompact")
- "List of spice2g6/3 options keywords.")
- (defconst spice-eldo-options-keywords
- '("wsf" "wsfascii" "sda"
- "precise" "spi3asc" "spi3bin" "spicedc" "spiout" "libfas" "nolib"
- "ammeter" "msgbias" "nowarn" "ulogic" "aspec" "mod4pins" "modwl" "wl"
- "captab" "coustep" "input" "lcapop" "list" "noascii" "ascii"
- "autostop" "nobound_phase" "nocou" "node" "nomod" "nopage" "nosizechk"
- "notrc" "trap" "smooth" "be" "gear" "newton" "iem" "analog" "digital"
- "osr" "mixed" "pstran" "dptran" "itl6" "itl7" "itl8" "nmaxsize"
- "noconvassist" "nolat" "pivrel" "pivtol" "qtrunc" "noconvassist"
- "nolat" "pivrel" "pivtol" "qtrunc" "relvar" "splitc" "noswitch"
- "unbound" "randmc" "usedefap" "engnot" "nodcpart" "probeop"
- "noprobeop" "histlim" "wbulk" "noinit" "nonoise" "tempcouk" "nofnsiem"
- "icdc" "icdev" "carlo_gauss" "cteprec" "d2dmvl9bit" "defconvmsg"
- "maxnodeord" "notrclib" "motorola" "aex")
- "List of eldo options keywords.")
- (defconst spice-eldorf-options-keywords
- '("sst_freqdiv")
- "List of Eldo RF options keywords.")
- (defconst spice-hspice-options-keywords
- '("acct" "converge"
- "absh" "acout" "cds" "scale" "cshdc" "alt999" "alt9999" "csdf"
- "accurate" "dvdt" "measout" "acout" "brief" "cshunt" "gshunt" "probe"
- "kcltest" "dctran" "di" "itl5" "list" "sda" "gshunt" "cshunt" "post"
- "node" "noelck" "gshunt" "maxamp" "nomod" "aspec" "icsweep" "relh"
- "nopage" "newtol" "reli" "notop" "parhier" "off" "spice" "wl"
- "dvtr" "nxx" "seed" "risetime" "imax" "nopiv" "imin" "opts" "cscal"
- "vntol" "absv" "pathnum" "badchr" "fmax" "plim" "diagnostic" "pivref"
- "fscal" "autostop" "nowarn" "gscal" "search" "lscal" "bypass" "verify"
- "sparse" "pivot" "pzabs" "cpu" "pztol" "fast" "interp" "h9007" "expli"
- "ritol" "itlpz" "itrprt" "unwrap" "captab" "newtol" "dccap")
- "List of hspice options keywords.")
- (defconst spice-spice2g6-options-parameters
- '("gmin" "reltol" "abstol" "vntol" "trtol" "chgtol" "pivtol" "pivrel"
- "tnom" "temp" "lvlcod" "itl1" "itl2" "itl3" "itl4" "itl5" "defl"
- "defw" "defad" "defas" "method")
- "List of spice2g6/3 options parameters.")
- (defconst spice-eldo-options-parameters
- '("cptime" "msgnode" "zoomtime" "bsim3ver" "defnrd" "defnrs" "defpd" "defps"
- "gramp" "scale" "scalebsim" "scalm" "soiback" "flicker_noise"
- "thermal_noise" "cousmp" "limprobe" "ascii" "savetime" "simudiv"
- "stat" "timediv" "maxord" "bloc" "epsdig" "absvar" "capanw" "chgtol"
- "dvdt" "eps" "fluxtol" "freqsmp" "ft" "hmin" "hmax" "itol" "lvltim"
- "maxnodes" "maxtran" "maxv" "netsize" "ngtol" "ratprint" "reltrunc"
- "sample" "startsmp" "step" "trtol" "tuning" "vmin" "vntol" "xa"
- "numdgt" "dcpart" "couresol" "defa2d" "defd2a" "vbcsat" "dclog" "epso"
- "optype")
- "List of eldo options parameters.")
- (defconst spice-eldorf-options-parameters
- '("sst_start" "sst_stop" "sst_nper"
- "sst_npt" "sst_ovrsmp" "sst_spectrum" "sst_uic"
- "sst_max_liniter" "sst_verbose")
- "List of Eldo RF options parameters.")
- (defconst spice-hspice-options-parameters
- '("artist" "dcap" "absh" "absvar" "absi" "absv" "delmax" "absmos"
- "dcfor" "dchold" "fs" "mentor" "absvdc" "dcon" "ft" "co" "reltol" ; "post"
- "cvtol" "di" "dcstep" "imin" "ingold" "imax" "lennam" "psf" "maxamp"
- "dv" "defl" "relh" "gmax" "relvar" "measdgt" "zuken" "defnrd" "reli"
- "gmindc" "rmax" "defnrs" "relmos" "gramp" "rmin" "defpd" "relv"
- "slopetol" "defps" "relvdc" "timeres" "limpts" "scalm" "relq" "numdgt"
- "resmin" "optlst" "trtol" "genk" "pivot" "sparse" "lvltim" "klim"
- "maxord" "post_version" "bkpsiz" "mu" "xmu" "warnlimit" "expli"
- "bytol" "cptime" "epsmin" "mbypass" "expmax" "limtim" "vfloor")
- "List of hspice options parameters.")
- (defconst spice-layla-options-parameters
- '("begin_temp_iterations" "begin_acc_prob" "min_temp_scale_factor"
- "max_temp_scale_factor" "max_inner_loop_delta" "max_cost_delta"
- "min_range_scale_factor" "nr_temp_steps"
- "min_stable_inner_loops" "min_local_iterations" "max_local_iterations"
- "max_iterations" "bank_min_ar" "bank_max_ar" "bank_orientations"
- "bank_routing_space" "bus_sides" "bus_layer" "bus_port_width"
- "bus_port_height" "bus_port_distance" "bus_routing_space" "cap_min_ar"
- "cap_max_ar" "cap_orientations" "cap_routing_space" "cap_ar_step"
- "coil_orientations" "coil_routing_space" "alfa_area"
- "alfa_performance" "alfa_aspect_ratio" "alfa_overlap" "alfa_overlap_min"
- "alfa_overlap_max" "kappa_overlap" "device_min_ar" "device_max_ar"
- "device_orientations" "device_routing_space" "device_current"
- "diode_min_ar" "diode_max_ar" "diode_orientations"
- "diode_routing_space" "diode_current" "matching_compute_method"
- "dummy_min_ar" "dummy_max_ar" "dummy_orientations"
- "dummy_routing_space" "dummy_ar_step"
- "mos_min_ar" "mos_max_ar" "mos_orientations" "mos_routing_space"
- "mos_current" "prob_reshape" "prob_reorientation"
- "prob_symmetric_translation" "prob_symmetric_swap"
- "prob_symmetric_flip" "prob_symmetric_flip" "prob_symmetric_shift"
- "prob_independent_translation" "prob_independent_swap"
- "prob_independent_flip" "min_move_range" "net_compute_method"
- "write_init" "write_int" "int_write_interval" "write_fin" "write_final"
- "mentor_write_ipc" "gds2_write_ipc" "construct_net_performance"
- "construct_matching_performance" "aspect_ratio" "field_grow_factor"
- "field_aspect_ratio" "disable_symmetry" "disable_matching"
- "do_kul_routing" "kul_router_program" "kul_router_directives_file"
- "number_of_randomize_loops" "port_inherit_terminals" "bus_priority"
- "port_sides" "port_layer" "port_width" "port_height" "port_distance"
- "port_abutment" "port_routing_space" "port_no_routing" "port_current"
- "res_ar_step" "res_min_ar" "res_max_ar" "res_orientations"
- "res_routing_space" "res_width" "res_current" "disable_couple_flipping"
- "symmetry_max_offset_factor" "print_cost" "placement_name"
- "write_final_ample" "write_final_skill" "write_final_gds2_bin"
- "write_final_gds2_cells" "write_final_tud"
- "write_final_ample_generators" "write_final_ample_cells"
- "write_final_cif" "write_final_rose" "write_final_kul"
- "write_final_text"
- "write_int_ample" "write_int_skill" "write_int_gds2_bin"
- "write_int_gds2_cells" "write_int_tud" "write_int_ample_generators"
- "write_int_ample_cells" "write_int_cif" "write_int_rose"
- "write_int_kul" "write_int_text"
- "write_init_ample" "write_init_skill" "write_init_gds2_bin"
- "write_init_gds2_cells" "write_init_tud" "write_init_ample_generators"
- "write_init_ample_cells" "write_init_cif" "write_init_rose"
- "write_init_kul" "write_init_text" "time_out"
- "random_seed" "anneal_rs" )
- "List of LAYLA options parameters.")
- (defconst spice-layla-functions
- '(
- "bus_double_param" "bus_integer_param" "bus_string_param"
- "device_double_param" "device_integer_param" "device_string_param"
- "net_double_param" "net_integer_param" "net_string_param"
- "placement_double_param" "placement_integer_param" "placement_string_param"
- "port_double_param" "port_integer_param" "port_string_param"
- "symmetry_double_param" "symmetry_integer_param" "symmetry_string_param"
- )
- "List of functions in Layla mode")
- (defconst spice-draccdl-device-keywords
- '("nonswap" )
- "List of Dracula CDL device keywords.")
- (defconst spice-draccdl-device-parameters
- '("w" "l" "sub" "ea" ;; CDL parameters
- "x" "y") ;; added X&Y, dracula extracts them (not CDL!)
- "List of Dracula & CDL device parameters.")
- (defconst spice-spice2g6-entity-start-keywords
- '(
- "ends" "macro" "subckt"
- )
- "List of spice2g6 entity start keywords")
- (defconst spice-eldo-entity-start-keywords
- '(
- "endl"
- )
- "List of eldo entity start keywords")
- (defconst spice-hspice-entity-start-keywords
- '(
- "endl" "eom"
- "fsoptions" "layerstack" "material" "shape" ; FEM solver for W elements
- )
- "List of hspice entity start keywords")
- (defconst spice-layla-entity-start-keywords
- '(
- "bus" "net" "symmetry" "performance" "port"
- )
- "List of layla entity start keywords")
- (defconst spice-mondriaan-entity-start-keywords
- '(
- "routingarea" "routingchannel" ;; "net" ; already in layla
- )
- "List of mondriaan entity start keywords")
- (defconst spice-draccdl-entity-start-keywords
- '(
- "eom"
- )
- "List of DracCDL entity start keywords")
- (defvar spice-keywords nil
- "List of spice mode keywords.")
- (defvar spice-colon-keywords nil
- "List of spice mode colon keywords.")
- (defvar spice-analyses nil
- "List of spice mode analyses.")
- (defvar spice-analysis-modifiers nil
- "List of spice mode analysis modifiers.")
- (defvar spice-types nil
- "List of spice mode standardized types.")
- (defvar spice-functions nil
- "List of spice mode functions.")
- (defvar spice-section-headings nil
- "List of spice mode section headings.")
- (defvar spice-misc-model-type-names nil
- "List of miscellaneous model type name.")
- (defvar spice-model-type-names nil
- "List of all model type name.")
- (defvar spice-output-keywords nil
- "List of all output keywords.")
- (defvar spice-output-types nil
- "List of all output types.")
- (defvar spice-options-keywords nil
- "List of all output options keywords.")
- (defvar spice-options-parameters nil
- "List of all output options parameters.")
- (defvar spice-entity-start-keywords nil
- "List of entity definition keywords.")
- (defvar spice-keywords-regexp nil
- "Regexp for keywords.")
- (defvar spice-colon-keywords-regexp nil
- "Regexp for colon keywords.")
- (defvar spice-analyses-regexp nil
- "Regexp for analyses.")
- (defvar spice-analysis-modifiers-regexp nil
- "Regexp for analysis modifiers.")
- (defvar spice-layla-keywords-regexp nil
- "Regexp for layla keywords.")
- (defvar spice-mondriaan-keywords-regexp nil
- "Regexp for mondriaan keywords.")
- (defvar spice-draccdl-keywords-regexp nil
- "Regexp for dracula CDL keywords.")
- (defvar spice-types-regexp nil
- "Regexp for spice mode types.")
- (defvar spice-functions-regexp nil
- "Regexp for spice mode functions (Layla).")
- (defvar spice-section-headings-regexp nil
- "Regexp for spice mode section headings.")
- (defvar spice-xinstance-regexp nil
- "Regexp for x instances.")
- (defvar spice-model-name-regexp nil
- "Regexp model names of elements.")
- (defvar spice-entity-start-regexp nil
- "Regexp for start of entity definition.")
- (require 'font-lock)
- (defvar spice-instance-name-face 'spice-instance-name-face
- "Face name to use spice instances.")
- (defface spice-instance-name-face
- '((((class grayscale) (background light)) (:foreground "LightGray" :bold t))
- (((class grayscale) (background dark)) (:foreground "DimGray" :bold t))
- (((class color) (background light)) (:foreground "ForestGreen" :bold t))
- (((class color) (background dark)) (:foreground "Yellow" :bold t))
- (t (:bold t)))
- "Spice mode face used to highlight instances."
- :group 'spice-faces)
- (defvar spice-model-name-face 'spice-model-name-face
- "Face name to use spice instances.")
- (defface spice-model-name-face
- '((((class grayscale) (background light)) (:foreground "LightGray"))
- (((class grayscale) (background dark)) (:foreground "DimGray"))
- (((class color) (background light)) (:foreground "Red3"))
- (((class color) (background dark)) (:foreground "LightSteelBlue"))
- (t (:bold t)))
- "Spice mode face used to highlight models."
- :group 'spice-faces)
- (defvar spice-title-face 'spice-title-face
- "Face name for title string.")
- (defface spice-title-face
- '((((class grayscale) (background light)) (:foreground "LightGray" :bold t))
- (((class grayscale) (background dark)) (:foreground "DimGray" :bold t))
- (((class color) (background light))
- (:foreground "Yellow" :background "black" :bold t))
- (((class color) (background dark))
- (:foreground "green3":background "lightyellow" :bold t))
- (t (:bold t)))
- "Spice mode face used for title string."
- :group 'spice-faces)
- (defvar spice-layla-function-name-face 'spice-layla-function-name-face
- "Face name to use for layla function names.")
- (defface spice-layla-function-name-face
- '((((class grayscale) (background light)) (:foreground "LightGray" :bold t))
- (((class grayscale) (background dark)) (:foreground "DimGray" :bold t))
- (((class color) (background light))
- (:foreground "Darkgreen"))
- (((class color) (background dark)) (:foreground "green"))
- (t (:bold t)))
- "Spice mode face used to higlight layla functions."
- :group 'spice-faces)
- (defvar spice-analysis-face 'spice-analysis-face
- "Face name to highlight spice mode analysis commands.")
- (defface spice-analysis-face
- '((((class color) (background light)) (:foreground "Magenta" :bold t :underline t))
- (((class color) (background dark)) (:foreground "Lightgreen" :bold t :underline t))
- (t (:bold t)))
- "Spice mode face used to highlight analysis commands."
- :group 'spice-faces)
- (defvar spice-doc-face (if spice-running-xemacs
- 'font-lock-doc-string-face
- 'font-lock-string-face)
- "Face name to use for doc strings.")
- (custom-add-to-group
- 'spice-faces (if spice-running-xemacs
- 'font-lock-doc-string-face
- 'font-lock-string-face)
- 'custom-face)
- (defvar spice-constant-face (if spice-running-xemacs
- 'font-lock-reference-face
- (if (facep 'font-lock-constant-face)
- 'font-lock-constant-face
- 'font-lock-reference-face)) ; old emacs20.1
- "Face name to use for constants.")
- (custom-add-to-group
- 'spice-faces (if spice-running-xemacs
- 'font-lock-reference-face
- (if (facep 'font-lock-constant-face)
- 'font-lock-constant-face
- 'font-lock-reference-face))
- 'custom-face)
- (defvar spice-include-file-face (if spice-running-xemacs
- 'font-lock-preprocessor-face
- 'font-lock-string-face)
- "Face name to use for include files and libraries.")
- (custom-add-to-group
- 'spice-faces (if spice-running-xemacs
- 'font-lock-preprocessor-face
- 'font-lock-string-face)
- 'custom-face)
- (if (not spice-running-xemacs)
- (custom-add-to-group
- 'spice-faces 'font-lock-builtin-face 'custom-face)
-
- (defface spice-builtin-face
- '((((class grayscale) (background light)) (:foreground "LightGray"))
- (((class grayscale) (background dark)) (:foreground "DimGray"))
- (((class color) (background light)) (:foreground "Orchid" :bold t))
- (((class color) (background dark)) (:foreground "LightBlue" :bold t))
- (t (:bold t)))
- "Spice mode face used for builtin types."
- :group 'spice-faces))
- (defvar spice-builtin-face (if spice-running-xemacs
- 'spice-builtin-face
- 'font-lock-builtin-face)
- "Face name for builtin types.")
- (defun spice-keywords-init ()
- "Initialize reserved words."
- (setq spice-keywords
- (append spice-spice2g6-keywords
- (when (spice-standard-p 'hspice)
- spice-hspice-keywords)
- (when (spice-standard-p 'eldo)
- spice-eldo-keywords)
- (when (spice-standard-p 'eldorf)
- spice-eldorf-keywords)
- (when (spice-standard-p 'fasthenry)
- spice-fasthenry-keywords)))
- (setq spice-colon-keywords
- (append (when (spice-standard-p 'eldo)
- spice-eldo-colon-keywords)
- (when (spice-standard-p 'eldovloga)
- spice-eldovloga-colon-keywords)))
- (setq spice-analyses
- (append spice-spice2g6-analyses
- (when (spice-standard-p 'hspice)
- spice-hspice-analyses)
- (when (spice-standard-p 'eldo)
- spice-eldo-analyses)
- (when (spice-standard-p 'eldorf)
- spice-eldorf-analyses)
- (when (spice-standard-p 'fasthenry)
- spice-fasthenry-analyses)))
- (setq spice-analysis-modifiers
- (append spice-spice2g6-analysis-modifiers
- (when (spice-standard-p 'hspice)
- spice-hspice-analysis-modifiers)
- (when (spice-standard-p 'eldo)
- spice-eldo-analysis-modifiers)
- (when (spice-standard-p 'fasthenry)
- spice-fasthenry-analysis-modifiers)))
- (setq spice-misc-model-type-names
- (append spice-spice2g6-model-type-names
- (when (spice-standard-p 'hspice)
- spice-hspice-model-type-names)
- (when (spice-standard-p 'eldovloga)
- spice-eldo-vloga-model-type-names)
- (when (s…
Large files are truncated, but you can click here to view the full file