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 QucsQuite 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.

knowm_mr_symbol

Knowm Memristor Symbol

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

  1. Double click on the bundle qucs_knowm_oss_eda-0.0.19s-rc1.dmg to mount the bundle.

  2. Copy or drag-n-drop the qucs folder to /Applications folder.

  3. Open the qucs folder that you just copied and open the ./bin folder.

  4. Drag the Qucs.app to the Launcher Bar.

  5. Right click on the Qucs-S bundle and select Eject Qucs-S from the context menu.

Install Xyce-6.6-Open_Source bundle

  1. Double click on the bundle xyce_knowm_oss_eda-6.6-rc1.dmg to mount the bundle.

  2. Copy or drag-n-drop the xyce folder to /Applications folder.

  3. 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

  1. Download the package qucs-knowm-oss-eda-0.0.19s-rc1.deb to the $HOME/Downloads directory.

  2. Install using dpkg the following command $ sudo dpkg -i qucs-knowm-oss-eda-0.0.19s-rc1.deb

  3. Set the PATH variable export PATH=/usr/local/qucs/bin:$PATH

  4. Test the install by typing qucs --version.

  5. Execution should return Qucs 0.0.19 (7526999).

Install Xyce-6.6-Open_Source bundle

  1. Download the package xyce-knowm-oss-eda-6.6-rc1.deb to the $HOME/Downloads directory.

  2. Install using dpkg the following command $ sudo dpkg -i xyce-knowm-oss-eda-6.6-rc1.deb

  3. Set the LD_LIBRARY_PATH variable export LD_LIBRARY_PATH=/usr/local/xyce-6.6/serial/lib

  4. Set the PATH variable export PATH=/usr/local/xyce-6.6/serial/bin:$PATH

  5. Test the install by typing runxyce -v.

Launch Qucs-S

  1. 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.

  2. Click Ok and then select Xyce (Serial) as the default.

  3. Click the Select button to the right of the Xyce executable location edit field.

  4. Select runxyce from the file browser and then click Open

    qucs_default_sim_set

    Default Simulator Settings

  5. Click Apply changes

    qucs_default_sim_select

    Default Simulator Selection

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.

  1. Select File -> Application Settings... from the menu.

  2. Click the Locations tab.

    qucs_app_settings

    qucs app settings

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.

  1. 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.

  1. 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.

  1. 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

  1. Click Apply to save the settings.

  2. Click OK to exit the settings dialog.

Create a Project File

  1. Select the Projects tab on the left of the Main Dock.

  2. Click New to create a new project.

  3. Enter Ymemristor for the project name.

  4. Click the Create button to create the project.

    qucs_new_project

    Qucs New Project Dialog

    NOTE: The project Ymemristor_prj is displayed in the Project tab.

  5. Double click the Ymemristor_prj to automatically open the Content tab.

    qucs_proj_list

    Qucs Project List

    qucs_proj_contents

    Qucs Project Contents

Create the Schematic diagram

  1. Select the Components tab in the Main Dock.

  2. Open the sources from the drop-down list.

  3. Select the ac Voltage Source and then left click on the schematic to place the symbol.

  4. Press the Esc key to exit place mode.

    qucs_comp_sources_select

    Qucs Component Sources

    qucs_sch_ac_vsrc

    AC Voltage Source

  5. Open the non-linear components from the drop-down list.

  6. Select the MR Memristor and then left click on the schematic to place the symbol.

  7. Press the Esc key to exit place mode.

    qucs_comp_non_linear_select

    Non-linear Components Selection

    qucs_sch_ac_vsrc_mr

    Components MR1 Memristor

  8. Open the probes from the drop-down list.

  9. Select the Current Probe and then left click on the schematic to place the symbol.

  10. Press the Esc key to exit place mode.

    qucs_comp_probes_select

    Component Current Probe

    qucs_sch_ac_vsrc_mr_prb

    AC Voltage Source, MR1 Memristor and Current Probe

    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.

  11. Select the Gnd symbol on the toolbar then left click on the schematic to place the symbol.

    qucs_toolbar_gnd

    Gnd Toolbar Button

  12. Click on the minus terminal of the ac Voltage Source to place another Gnd symbol on the schematic.

  13. Press the Esc key to exit place mode.

    qucs_sch_ac_vsrc_mr_prb_gnd

    AC Voltage Source, MR1 Memristor, Current Probe and Grounds

Set AC Voltage Source properties

  1. Double click on the ac Voltage Source symbol to open the parameters for the source.

  2. Select the U row in the properties table.

  3. Change the voltage from 1 V to 500 mV.

  4. Click Apply to set the voltage value.

    qucs_ac_volts_set

    AC Voltage Source Settings

  5. Select the f row in the properties table.

  6. Change the frequency from 1 GHz to 10 Hz.

  7. Select the display in schematic checkbox.

    qucs_ac_freq_set

    AC Voltage Source Frequency Setting

  8. Click Apply to set the frequency value.

  9. Click OK to exit the properties dialog.

    qucs_sch_ac_vsrc_set_done

    AC Source Voltage and Frequency Set

Wire the Schematic Components

  1. Select the Wire tool button on the toolbar.

    qucs_toolbar_wire

    Wire Toolbar Button

  2. Select the free Gnd node and then left click the negative node of the memristor symbol.

  3. Press the Esc key to exit place mode.

  4. Select the positive node of the ac Voltage Source and then left click the input node of the Current Probe.

  5. Select the out node of the Current Probe and and drag to the positive node of the MR Memristor.

    qucs_sch_wired

    Wired Components

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

  1. Click the Name button on the toolbar.

    qucs_toolbar_name

    Named Node Toolbar Button

  2. Left click on the positive node of the MR1 Memristor symbol.

  3. Enter the Vmr for the label.

    qucs_add_name_vmr

    Vmr Named Node

  4. Click OK to save the changes.

  5. Press the Esc key to exit place mode.

  6. Click on the Vmr label and drag it to a position below the memristor symbol.

  7. Left click on the schematic to exit move mode.

    qucs_sch_name_vmr

    Named Node Vmr

Clean up component and set MR Memristor parameters

  1. Right click on the MR Memristor symbol and select the Move Component Text from the context menu.

  2. Left click on the MR1 MEMERISTOR label and drag it to a position below the memristor symbol.

  3. Left click anywhere on the schematic to exit move mode.

    qucs_mr1_move_text

    Move Component Text for MR1 Memristor

Configure the Transient Simulation of the MR1 Memristor Model

  1. Select the Components tab from the Main Dock.

  2. Open the simulations from the drop-down list.

  3. Click and drag the Transient Simulation and drop it on the schematic and left click to place the symbol.

  4. Press the Esc key to exit place mode.

    qucs_comp_sims_select

    Component Simulators Selection

    qucs_sch_clean_wired

    Transient Simulation

  5. Double click on the transient simulation symbol to open the setup parameters dialog.

  6. Enter 500 ms in the stop param field.

  7. Enter 101 in the number value field to set a 10 ms step size.

    qucs_sim_tran_set

    Transient Simulation Settings

  8. Click Apply to save the changes.

  9. Click OK to exit the properties dialog.

    qucs_sch_mr_sims_tran

    Transient Simulation

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

qucs_lib_xyce_memristor_tech

Xyce Memristor Technology Lib

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.

  1. Select the Libraries tab from the Main Dock.

  2. 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.

  3. Select the appropriate MRM(X) file for the model you want to use. In this case MRM5

    qucs_lib_xyce_mr_select

    Xyce Memristor Knowm MSS Model (MRM5)

    qucs_sch_mr1_mrm5_model

    Knowm Memristor .Model Directive

  4. Left click to place the .Model directive on the schematic.

  5. Press the Esc key to exit place mode.

    qucs_sch_mrm5_model

    Knowm MSS Memristor Model

Select the model for the MR1 Memeristor component

  1. Double click on the MR1 symbol to open the setup parameters dialog.

  2. Select MEMRISTOR line 1.

  3. Enter MRM5 in the param list and model spec field.

    qucs_mr1_mrm5_set

    MR1 Memristor Settings

  4. Click Apply to save the changes.

  5. Click OK to exit the properties dialog.

    qucs_sch_mr1_mrm5_model

    MR1 Memristor Defined as MRM5

Configure the Rinit .PARAM for the MR Memristor Model

  1. Select the Components tab from the Main Dock.

  2. Open the SPICE specific sections from the drop-down list.

  3. Click and drag the .PARAM Section and drop it on the schematic and left click to place the symbol.

  4. Press the Esc key to exit place mode.

    qucs_comp_spice_select

    Components SPICE Specific

    qucs_sch_spice_rinit

    SPICE .Param Component

  5. Double click on the .PARAM symbol to open the setup parameters dialog.

  6. Enter Rinit in the param field.

  7. Enter 500 in the value field to set Rinit=500 ohms.

    qucs_parm_rinit_set

    .PARAM Rinit Settings

  8. Click Apply to save the changes.

  9. Click OK to exit the properties dialog.

    qucs_sch_spice_rinit_set

    RInit .PARAM Directive

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.

  1. Right click on the schematic and select Document Settings...

  2. Select Simulations tab.

  3. Uncheck open data display after simulation checkbox in the dialog.

    qucs_doc_set

    Current Document Settings

  4. Click Apply to save the changes.

  5. Click OK to exit the properties dialog.

Save the Schematic Diagram File

  1. Click the Save button on the toolbar.

    qucs_toolbar_save

    Save Toolbar Button

  2. Enter the filename knowm_mr_test for the schematic diagram.

  3. Click Save to save the schematic to the .sch file.

Set Keyboard Preferences (Optional)

  1. Open System Preferences and select Keyboard.

  2. Then check thebox F1, F2,etc as standard function keys.

    keyboard_preferences

    Change Keyboard Preferences for F1, F2 Selection

    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

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

    qucs_toolbar_run

    Run Simulation Toolbar Button

  2. Check simulation for errors or warnings. See the status bar at the bottom of the Qucs window lower right corner.

    qucs_sim_extern_sim

    External Simulation Window

  3. Click the Exit button to close the Simulation window.

  4. You can view and messages written by the simulator by clicking the F5 key or selecting Show Last Messages from the Simulations menu.

    qucs_xyce_sim_trans_msg

    Xyce Simulation Messages

  5. 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.

    qucs_knowm_mr_test_netlist

    Qucs Generated Xyce Netlist

  6. 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

  1. Select the Components tab from the Main Dock.

  2. Open the diagrams from the drop-down list.

    qucs_comp_diag_tab

    Component Diagram Tabular Data

  3. Select the Tabular and then left click on the schematic to place the table.

    qucs_diag_tab_set

    Diagram Tabular Data Settings

  4. Double click on the tran.I(PR1) row to add it to the graph.

  5. Double click on the tran.V(VMR) row to add it to the graph.

  6. Click Apply to set the value.

  7. Click OK to save the changes.

    qucs_sch_sim_res_trans_tab

    Tabular Data Display

  8. Press the Esc key to exit place mode.

Create a Memristor Current,Voltage vs. Time Plot

  1. Select the Components tab from the Main Dock.

  2. Open the diagrams from the drop-down list.

  3. Select the Cartesian and then left click on the schematic to place the symbol.

    qucs_comp_diag_cart

    Component Diagram Cartesian Plot

  4. Select tran.V(VMR) row to add it to the graph.

    qucs_diag_cart_v_set

    Diagram Cartesian Vmr Settings

  5. Double click on the tran.I(PR1) row to add it to the graph.

    qucs_diag_cart_vi_set

    Diagram Cartesian Pr1 Current Setting

  6. Select the tran.I(PR1) in the Graph window.

  7. Select right axis in the y-Axis: drop-down list.

    qucs_diag_cart_iv_t_set

    Cartesian I,V vs. Time Plot Settings

  8. Click Apply to save the changes.

  9. Click OK to exit the properties dialog.

  10. Press the Esc key to exit place mode.

  11. Left click anywhere on the plot window and use the corner grab handles to resize the plot.

    qucs_sch_diag_cart_iv_t_plot

    Cartesian I,V vs. Time Plot

Create a Hysteresis Plot

  1. Select the Components tab from the Main Dock.

  2. Open the diagrams from the drop-down list.

  3. Select the Cartesian and then left click on the schematic to place the symbol.

    qucs_comp_diag_cart

    Component Diagram Cartesian Plot

  4. Double click on the tran.I(PR1) row to add it to the graph.

    qucs_diag_cart_i_set

    Cartesian Pr1 Current Setting

  5. Select the tran.I(PR1) in the Graph window.

  6. 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)

    qucs_diag_cart_iv_set

    Cartesian I vs V Plot Settings

  7. Click Apply to save the changes.

  8. Click OK to exit the properties dialog.

  9. Press the Esc key to exit place mode.

  10. Left click anywhere on the plot window and use the corner grab handles to resize the plot.

    qucs_sch_diag_cart_iv_hys_plot

    Cartesian I vs V Hysteresis Plot

That completes this basic tutorial.

qucs_sch_sim_res_trans_iv_cart

Transient Simulation Results

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

Michael Arendall

Michael Arendall is an experienced software developer, entrepreneur and innovator with more than 25 years experience working with leading semiconductor manufacturers, academia and government laboratories; directly supporting research and development labs by building tools and apparatus for characterizing, analyzing and performing reliability studies on advanced semiconductor process nodes.

Related Posts

Subscribe To Our Newsletter

Join our low volume mailing list to receive the latest news and updates from our team.

3 Comments

Leave a Comment

Knowm 32X32 Crossbar

Knowm Newsletter

Are you ready for memristor AI processors? With our newsletter, you will be.