In a previous post titled Knowm Memristor Modeling and Simulation, I presented the implementation of a Verilog-A version of the Knowm MSS model within industry standard commercial EDA tools. Today I’ll be discussing the Knowm Open-Source EDA Stack that includes Knowm contributed extensions to popular open-source EDA tools to be used for the design, layout, and simulation of memristor devices and neuro-memristive circuits. This post will cover the installation and use of Schematic Capture and Circuit Simulation tools. I will provide a brief tutorial of Qucs – Quite Universal Circuit Simulator which is an open-source circuit simulator being developed by The Qucs Development Team – a multi-disciplinary group of talented engineers, scientists and mathematicians. This software is available on Sourceforge or Github for download under the GNU General Public License (GPL) v2+. The Qucs Team has developed a specific branch of the open-source project Qucs-S Spice4qucs to support several popular SPICE compatible simulators. This branch is being used to develop Knowm’s extensions to allow using the Xyce Electronic Simulator developed by the Xyce Team at Sandia National Labs. A new behavioral memristor model, the Knowm M-MSS ( Mean Metastable Switch Memristor Model ) was recently added to Xyce by Tim Molter and Alex Nugent. The Knowm M-MSS model is included in the Xyce OpenModels library and the model and Knowm’s release of Xyce-6.6 are both available under the GPL v3 open-source license. See the details of the implementation of the model in the recent post titled The Mean Metastable Switch Memristor Model in Xyce. Selection of this model is included from the new Xyce Memristor Technology library within Qucs-S along with the Known proposed new memristor symbol in the Qucs-S non-linear component library.

Prerequisites

The current release candidate for the Knowm OSS EDA Stack is available for macOS Sierra 10.12 and Ubuntu 16.04 LTS (Xenial Xerus) . This post covers installation on MacOS and Linux but usage only on the macOS platform. The installation process is different, but the use of the software is more or less the same. There is currently support for Xyce (Serial) simulations. The included versions of Qucs-S (0.0.19S) and Xyce 6.6 include libraries for amd64 (intel) 64-bit architectures. Support for other architectures and operating systems are under development and will be released when available.

Software Installation

First, download the pre-built bundles for the Qucs-S and Xyce for your operating system. These binary packages are available here:

MacOS Sierra

Install Qucs-0.0.19S bundle

Double click on the bundle qucs_knowm_oss_eda-0.0.19s-rc1.dmg to mount the bundle. Copy or drag-n-drop the qucs folder to /Applications folder. Open the qucs folder that you just copied and open the ./bin folder. Drag the Qucs.app to the Launcher Bar. Right click on the Qucs-S bundle and select Eject Qucs-S from the context menu.

Install Xyce-6.6-Open_Source bundle

Double click on the bundle xyce_knowm_oss_eda-6.6-rc1.dmg to mount the bundle. Copy or drag-n-drop the xyce folder to /Applications folder. Right click on the Xyce-6.6 bundle and select Eject Xyce-6.6 from the context menu.

Linux

NOTE: The release candidate Debian packages are currently being installed in the /usr/local under their own package directories to allow for side-by-side comparison of release candidates. The final release versions will be provided under a package manager and will use standard directories in /usr .

Install Qucs-0.0.19S .deb package

Download the package qucs-knowm-oss-eda-0.0.19s-rc1.deb to the $HOME/Downloads directory. Install using dpkg the following command $ sudo dpkg -i qucs-knowm-oss-eda-0.0.19s-rc1.deb Set the PATH variable export PATH=/usr/local/qucs/bin:$PATH Test the install by typing qucs --version . Execution should return Qucs 0.0.19 (7526999) .

Install Xyce-6.6-Open_Source bundle

Download the package xyce-knowm-oss-eda-6.6-rc1.deb to the $HOME/Downloads directory. Install using dpkg the following command $ sudo dpkg -i xyce-knowm-oss-eda-6.6-rc1.deb Set the LD_LIBRARY_PATH variable export LD_LIBRARY_PATH=/usr/local/xyce-6.6/serial/lib Set the PATH variable export PATH=/usr/local/xyce-6.6/serial/bin:$PATH Test the install by typing runxyce -v .

Launch Qucs-S

Click on the Qucs app icon on the Launcher Bar. NOTE: the first time Qucs is started is will inform you that no default simulator has been selected. Click Ok and then select Xyce (Serial) as the default. Click the Select button to the right of the Xyce executable location edit field. Select runxyce from the file browser and then click Open Click Apply changes

Qucs Application Settings

The Qucs Settings file qucs.conf is stored in your $HOME directory in the .config directory. If you experience any issues with persistence of your settings in this section you can manually edit this file with a compatible editor.

Select File -> Application Settings... from the menu. Click the Locations tab.

NOTE: The Qucs Home will a folder named .qucs in your home directory. This is where all projects will be stored for your installation. Each project will be stored in a separate sub-directory with the _prj suffix appended to the name you specify. Other directories such as the spice4qucs directory will also be created which will store the data and netlist information for your Xyce simulations.

ADMS – Automatic Device Model Synthesizer

ADMS is a code generator that converts electrical compact device models specified in high-level description language into ready-to-compile C code for the API of SPICE simulators. Based on transformations specified in XML language, ADMS transforms Verilog-AMS code into other target languages.

Verify AdmsXml Path: is to /Applications/qucs/adms/bin . If not, set it.

ASCO – A SPICE Circuit Optimizer

ASCO project aims to bring circuit optimization capabilities to existing SPICE simulators using a high-performance parallel differential evolution (DE) optimization algorithm. Currently out-of-the-box support for Eldo (TM), HSPICE (R), LTspice (TM), Spectre (R), Qucs and Ngspice exist.

Verify ASCO Path: to /Applications/qucs/asco/bin . If not, set it.

GNU Octave – Scientific Programming Language

Powerful mathematics-oriented syntax with built-in plotting and visualization tools. The Octave syntax is largely compatible with Matlab. The Octave interpreter can be run in GUI mode, as a console, or invoked as part of a shell script. It is accessed in Qucs by selecting View -> Octave Window .

Set Octave Path: to /Applications/qucs/octave/bin . If not, set it.

NOTE: Octave is not currently provided with this release. You can install Octave 4.2.0 from Homebrew tap homebrew/science

Save Application Settings

Click Apply to save the settings. Click OK to exit the settings dialog.

Create a Project File

Select the Projects tab on the left of the Main Dock. Click New to create a new project. Enter Ymemristor for the project name. Click the Create button to create the project. NOTE: The project Ymemristor_prj is displayed in the Project tab. Double click the Ymemristor_prj to automatically open the Content tab.

Create the Schematic diagram

Select the Components tab in the Main Dock. Open the sources from the drop-down list. Select the ac Voltage Source and then left click on the schematic to place the symbol. Press the Esc key to exit place mode. Open the non-linear components from the drop-down list. Select the MR Memristor and then left click on the schematic to place the symbol. Press the Esc key to exit place mode. Open the probes from the drop-down list. Select the Current Probe and then left click on the schematic to place the symbol. Press the Esc key to exit place mode. SUGGESTION: Try to place each component’s nodes on the grid. You can either manually position the component using you mouse or right click on the component symbol and select Set on Grid . Select the Gnd symbol on the toolbar then left click on the schematic to place the symbol.

Click on the minus terminal of the ac Voltage Source to place another Gnd symbol on the schematic. Press the Esc key to exit place mode.

Set AC Voltage Source properties

Double click on the ac Voltage Source symbol to open the parameters for the source. Select the U row in the properties table. Change the voltage from 1 V to 500 mV . Click Apply to set the voltage value. Select the f row in the properties table. Change the frequency from 1 GHz to 10 Hz . Select the display in schematic checkbox. Click Apply to set the frequency value. Click OK to exit the properties dialog.

Wire the Schematic Components

Select the Wire tool button on the toolbar.

Select the free Gnd node and then left click the negative node of the memristor symbol. Press the Esc key to exit place mode. Select the positive node of the ac Voltage Source and then left click the input node of the Current Probe . Select the out node of the Current Probe and and drag to the positive node of the MR Memristor .

Add a Named Node (Vmr) to MR1 Component Positive Port

Click the Name button on the toolbar.

Left click on the positive node of the MR1 Memristor symbol. Enter the Vmr for the label. Click OK to save the changes. Press the Esc key to exit place mode. Click on the Vmr label and drag it to a position below the memristor symbol. Left click on the schematic to exit move mode.

Clean up component and set MR Memristor parameters

Right click on the MR Memristor symbol and select the Move Component Text from the context menu. Left click on the MR1 MEMERISTOR label and drag it to a position below the memristor symbol. Left click anywhere on the schematic to exit move mode.

Configure the Transient Simulation of the MR1 Memristor Model

Select the Components tab from the Main Dock. Open the simulations from the drop-down list. Click and drag the Transient Simulation and drop it on the schematic and left click to place the symbol. Press the Esc key to exit place mode. Double click on the transient simulation symbol to open the setup parameters dialog. Enter 500 ms in the stop param field. Enter 101 in the number value field to set a 10 ms step size. Click Apply to save the changes. Click OK to exit the properties dialog.

Select the .Model Directive for the MR Memristor Component

The MR Memeristor model is accompanied by several model directives that can be independently

applied to each memristor symbol instance in the schematic diagram. These are selected from the

Libraries tab. The MR Memristor component is used for multiple model definitions in Xyce. These

are selected by the level parameter of the model. The following levels are available for the

MR Memristor model in Xyce.

The parameters sets are stored in the .Model card format for SPICE compatible simulators.

level=2 : TEAM memristor model

level=3 : Yakopcic memristor model

level=4 : Joglekar memristor model

level=5 : Knowm M-MSS memristor model

NOTE: Each of these correspond to the model parameter sets above can be selected by choosing from the available models in the Xyce Memristor Technology Library. The selection .Model and assignment to the MR1 Memristor component in the schematic determines the the model being simulated.

Select the Libraries tab from the Main Dock. Left click on the Xyce_Memristor_Technology to expand the list. Notice: there are 4 different levels for the Memristor Model in Xyce. Each of these correspond to the model parameter sets above. Select the appropriate MRM(X) file for the model you want to use. In this case MRM5 Left click to place the .Model directive on the schematic. Press the Esc key to exit place mode.

Select the model for the MR1 Memeristor component

Double click on the MR1 symbol to open the setup parameters dialog. Select MEMRISTOR line 1. Enter MRM5 in the param list and model spec field. Click Apply to save the changes. Click OK to exit the properties dialog.

Configure the Rinit .PARAM for the MR Memristor Model

Select the Components tab from the Main Dock. Open the SPICE specific sections from the drop-down list. Click and drag the .PARAM Section and drop it on the schematic and left click to place the symbol. Press the Esc key to exit place mode. Double click on the .PARAM symbol to open the setup parameters dialog. Enter Rinit in the param field. Enter 500 in the value field to set Rinit=500 ohms. Click Apply to save the changes. Click OK to exit the properties dialog.

Set Document Settings (Optional)

For smaller sized schematics it is often desirable to add the data tables and plots to the schematic

diagram. The default behavior is for the data to displayed in a separate tab after the simulation is

complete. You can change this behavior by changing the settings for the schematic diagram.

Right click on the schematic and select Document Settings... Select Simulations tab. Uncheck open data display after simulation checkbox in the dialog. Click Apply to save the changes. Click OK to exit the properties dialog.

Save the Schematic Diagram File

Click the Save button on the toolbar.

Enter the filename knowm_mr_test for the schematic diagram. Click Save to save the schematic to the .sch file.

Set Keyboard Preferences (Optional)

Open System Preferences and select Keyboard . Then check thebox F1 , F2 , etc as standard function keys. NOTE: You can change the keyboard mapping for other the keys in macOS by selecting the Shortcuts tab then define the new key mappings in the Keyboard group.

Run a Simulation

Press F2 or select Simulate from the Simulation menu or the Run button on the toolbar.

Check simulation for errors or warnings . See the status bar at the bottom of the Qucs window lower right corner . Click the Exit button to close the Simulation window. You can view and messages written by the simulator by clicking the F5 key or selecting Show Last Messages from the Simulations menu. You can save the current netlist by clicking the Save Netlist button on the simulation window. NOTE: The F6 key or Show Last Netlist from the Simulations menu currently only displays the last netlist for the lastest Qucsator simulation. If you save the netlist using the button on the simulation window then you can open the .cir file under Others list in the project tree. The raw data file knowm_mr_test_tran.txt produced by the transient simulation will be automatically created in the $HOME/.qucs/qus4spice/ directory.

Check Tabular Results

Select the Components tab from the Main Dock. Open the diagrams from the drop-down list. Select the Tabular and then left click on the schematic to place the table. Double click on the tran.I(PR1) row to add it to the graph. Double click on the tran.V(VMR) row to add it to the graph. Click Apply to set the value. Click OK to save the changes. Press the Esc key to exit place mode.

Create a Memristor Current,Voltage vs. Time Plot

Select the Components tab from the Main Dock. Open the diagrams from the drop-down list. Select the Cartesian and then left click on the schematic to place the symbol. Select tran.V(VMR) row to add it to the graph. Double click on the tran.I(PR1) row to add it to the graph. Select the tran.I(PR1) in the Graph window. Select right axis in the y-Axis: drop-down list. Click Apply to save the changes. Click OK to exit the properties dialog. Press the Esc key to exit place mode. Left click anywhere on the plot window and use the corner grab handles to resize the plot.

Create a Hysteresis Plot

Select the Components tab from the Main Dock. Open the diagrams from the drop-down list. Select the Cartesian and then left click on the schematic to place the symbol. Double click on the tran.I(PR1) row to add it to the graph. Select the tran.I(PR1) in the Graph window. Select tran.V(VMR) in the Plot Vs. drop-down list. Notice that the Graph Input changes to xyce/tran.I(PR1)@tran.V(VMR) Click Apply to save the changes. Click OK to exit the properties dialog. Press the Esc key to exit place mode. Left click anywhere on the plot window and use the corner grab handles to resize the plot.

That completes this basic tutorial.

You should also checkout the documentation and other examples listed in the Qucs 0.0.19 and Qucs-S 0.0.19 documentation available on the web at the following URLs.

Other References

Further Resources