From Script | Spoken-Tutorial
Jump to: navigation, search
Time Narration
00:01 Welcome to the spoken tutorial on Uploading a spice Subcircuit file in eSim.
00:08 In this tutorial, using eSim we will learn to upload an external spice subcircuit file in eSim.
00:17 To record this tutorial, we will use-

Ubuntu Linux OS version 16.04

eSim version 2.0

00:29 To practice this tutorial, you should know how to create and simulate a circuit and subcircuit in eSim.
00:38 If not, watch the prerequisite eSim tutorials on this website.
00:44 The subcircuit file always begins with the dot subckt statement.
00:50 Subname is the subcircuit component name.
00:55 N1, N2 are the nodes. The subcircuit ends with dot Ends followed by the subcircuit name.
01:05 This option is available in the eSim 2 point 0 and later versions.
01:12 The subcircuit file is added to the eSim subcircuit library.
01:18 You can also refer to the subcircuit files available in the Ngspice manual.
01:25 To launch eSim, you need to double-click on the eSim icon on your Desktop.
01:31 I have already opened eSim.
01:35 On the eSim main window, click on the Subcircuit button from the left toolbar.
01:41 In the previous tutorial, we have seen how to create a new subcircuit and edit an existing subcircuit.
01:51 Pause the video here. Download Fulladder_using_Nand text file from the Code file section available on this page.
02:01 Save it on Desktop with a dot sub extension.
02:06 Now, on the Subcircuit tab, click on Upload a Subcircuit option. I have saved this file on my Desktop.
02:16 Double-click on the Desktop folder.
02:19 Click on Full_adder_using_Nand dot sub and then click on the Open button.
02:27 The subcircuit uploaded using Upload option loads only dot sub file.
02:34 As you can see here, only dot sub files will be available.
02:39 No sch or cir files will be present in this folder.
02:45 Let us simulate the Full Adder example with the newly added subcircuit library.
02:52 Open the FullAdder example from the Examples folder of eSim installer.
02:59 Click on the Open Project option from the top menu.
03:04 Locate the directory where the eSim is installed and double-click on the Examples folder.
03:13 Now select the FullAdder example and click on the Open button.
03:20 On the eSim window, select FullAdder under Projects.
03:25 Then click on Convert Kicad to Ngspice button from the left toolbar.
03:31 Let the transient analysis parameters and Source details be the same.
03:37 We will not change it. Skip the Ngspice Model and Device Modeling tab.
03:44 Under the Subcircuits tab, click the ADD button.
03:49 Click on FA using NAND dot sub file.
03:54 Now click on the Open button. On the Kicad to Ngspice tab, click on the Convert button.
04:04 On the eSim window, click on the Simulation button from the left toolbar.
04:10 An Ngspice terminal and plot windows open along with a Python plot window.
04:17 We have given the inputs as 5, 5 and 0.
04:25 Hence, the output for Sum is 0 volts and Carry is 5 volts. Close the Ngspice terminal and plot windows.
04:36 In the Python plot window, check the Sum node and Cout node.
04:43 And click on the Plot button. You can see the output of the sum and carry node.
04:51 Close the Python plot window.
04:54 The subcircuit file can also have model or subcircuit components within it.
05:01 These components can be from existing eSim libraries.
05:06 If the models or subcircuits are not present in eSim library then the user has to define the same.
05:14 For example: Let us open the UJT subcircuit file present in eSim.
05:21 In this file, there is a subcircuit of a Half adder and this is from eSim libraries.
05:29 Hence the statement, dot include is added in this file.
05:35 Here, the model RMOD and Emitter are the two models which are defined by the user.
05:43 These model files are not available under eSim libraries.
05:48 Hence, you need to mention the parameters in the spice model format.
05:54 If any subcircuit is used, then the parameters are defined in the spice subcircuit format.
06:04 Let us summarize.

In this tutorial, we learnt to upload an external spice subcircuit file in eSim

06:11 Do you have questions in this Spoken Tutorial? Please visit this site.
06:17 For any general or technical questions on eSim, visit the FOSSEE forum and post your question.
06:25 The FOSSEE team coordinates the Circuit Simulation project.
06:30 We give Certificates and Honorarium to the contributors. For more details, please visit this site.
06:40 The FOSSEE team coordinates the Lab Migration project. For more details, please visit this site.
06:50 Spoken Tutorial Project is funded by NMEICT, MHRD, Govt. of India.
06:57 This is Gloria N from IIT Bombay signing off. Thank you

Contributors and Content Editors

Pratik kamble