<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://script.spoken-tutorial.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=ESim%2FC2%2FUploading-a-spice-Subcircuit-file%2FEnglish</id>
		<title>ESim/C2/Uploading-a-spice-Subcircuit-file/English - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=ESim%2FC2%2FUploading-a-spice-Subcircuit-file%2FEnglish"/>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=ESim/C2/Uploading-a-spice-Subcircuit-file/English&amp;action=history"/>
		<updated>2026-04-09T09:16:52Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.17</generator>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=ESim/C2/Uploading-a-spice-Subcircuit-file/English&amp;diff=53524&amp;oldid=prev</id>
		<title>Nancyvarkey at 10:00, 10 August 2020</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=ESim/C2/Uploading-a-spice-Subcircuit-file/English&amp;diff=53524&amp;oldid=prev"/>
				<updated>2020-08-10T10:00:16Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://script.spoken-tutorial.org/index.php?title=ESim/C2/Uploading-a-spice-Subcircuit-file/English&amp;amp;diff=53524&amp;amp;oldid=53466&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Nancyvarkey</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=ESim/C2/Uploading-a-spice-Subcircuit-file/English&amp;diff=53466&amp;oldid=prev</id>
		<title>Glorianandihal: Created page with &quot;'''Uploading a spice Subcircuit file in eSim'''  '''Author: Gloria N '''  '''Keywords: esim, Subcircuit, KiCad, Eeschema, .include, device models   {| border=&quot;1&quot; |- | style=&quot;c...&quot;</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=ESim/C2/Uploading-a-spice-Subcircuit-file/English&amp;diff=53466&amp;oldid=prev"/>
				<updated>2020-08-05T19:03:42Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;Uploading a spice Subcircuit file in eSim&amp;#039;&amp;#039;&amp;#039;  &amp;#039;&amp;#039;&amp;#039;Author: Gloria N &amp;#039;&amp;#039;&amp;#039;  &amp;#039;&amp;#039;&amp;#039;Keywords: esim, Subcircuit, KiCad, Eeschema, .include, device models   {| border=&amp;quot;1&amp;quot; |- | style=&amp;quot;c...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''Uploading a spice Subcircuit file in eSim'''&lt;br /&gt;
&lt;br /&gt;
'''Author: Gloria N '''&lt;br /&gt;
&lt;br /&gt;
'''Keywords: esim, Subcircuit, KiCad, Eeschema, .include, device models&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#000000;&amp;quot; | '''Visual cue'''&lt;br /&gt;
| style=&amp;quot;color:#000000;&amp;quot; | '''Narration'''&lt;br /&gt;
|-&lt;br /&gt;
||   '''Show Slide:'''&lt;br /&gt;
Opening Slide&lt;br /&gt;
||   Welcome to the spoken tutorial on '''Uploading a spice Subcircuit file''' in '''eSim'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||'''Show Slide:'''&lt;br /&gt;
Learning Objectives		&lt;br /&gt;
||In this tutorial, using '''eSim''' we will learn to-&lt;br /&gt;
*Upload an external spice '''Subcircuit''' file in '''eSim'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||'''Show Slide:'''&lt;br /&gt;
Systems Requirements		&lt;br /&gt;
||To record this tutorial, we will use-&lt;br /&gt;
*'''Ubuntu Linux OS''' version 16.04  &lt;br /&gt;
*'''eSim''' version 2.0&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||'''Show Slide:'''			&lt;br /&gt;
Pre-requisites	&lt;br /&gt;
||To practice this tutorial, you should know how to create and simulate a circuit in '''eSim'''.&lt;br /&gt;
&lt;br /&gt;
If not, watch the prerequisite '''eSim''' tutorials on this website.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||'''Show Slide:'''		&lt;br /&gt;
General form of Subcircuit&lt;br /&gt;
||The subcircuit file always begins with the dot '''subckt''' statement.&lt;br /&gt;
&lt;br /&gt;
'''Subname''' is the subcircuit component name.&lt;br /&gt;
&lt;br /&gt;
'''N1''','''N2'''  are the nodes.&lt;br /&gt;
&lt;br /&gt;
The subcircuit ends with dot '''ENDS''' followed by the subcircuit name.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||'''Show Slide:'''&lt;br /&gt;
Introduction&lt;br /&gt;
||This option is available in the '''eSim 2''' point '''0''' and later versions.&lt;br /&gt;
&lt;br /&gt;
The subcircuit file is added to the '''eSim subcircuit''' library.&lt;br /&gt;
&lt;br /&gt;
You can also refer to the subcircuit files available in the '''Ngspice''' manual.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||'''System Computer:'''&lt;br /&gt;
Desktop icon		&lt;br /&gt;
||To launch '''eSim''', you need to double-click on the '''eSim''' icon on your '''Desktop'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||'''System Computer:'''&lt;br /&gt;
eSim startup window&lt;br /&gt;
||I have already opened '''eSim'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||eSim Main Window:&lt;br /&gt;
Click on  '''Subcircuit'''.&lt;br /&gt;
||On the '''eSim''' main window, click on the '''Subcircuit''' button from the left toolbar.&lt;br /&gt;
&lt;br /&gt;
In the previous tutorial, we have seen how to create a '''new''' subcircuit and '''edit''' an existing subcircuit.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||'''Slide Show:''' &lt;br /&gt;
Code File&lt;br /&gt;
||Pause the video here.&lt;br /&gt;
&lt;br /&gt;
Download '''Fulladder_using_Nand''' text file from the '''Code''' file section available on this page.&lt;br /&gt;
&lt;br /&gt;
Save it on '''Desktop''' with a  dot '''sub''' extension.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||'''Subcircuit tab:'''&lt;br /&gt;
Click on Upload a Subcircuit&lt;br /&gt;
||Now, on the '''Subcircuit''' tab, click on '''Upload a Subcircuit''' option.&lt;br /&gt;
&lt;br /&gt;
I have saved this file on my '''Desktop'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||'''System Computer:'''&lt;br /&gt;
Double click on  '''Desktop'''&amp;gt;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
click on '''Fulladder_using_Nand.sub''' &amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click  '''Open'''&lt;br /&gt;
||Double-click on the '''Desktop''' folder.&lt;br /&gt;
&lt;br /&gt;
Click on '''Full_adder_using_Nand''' dot '''sub''' and then click on the '''Open''' button.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||'''System computer:'''&lt;br /&gt;
Opening the subcircuit '''FA using NAND''' folder.&lt;br /&gt;
||The subcircuit uploaded using '''Upload''' option loads only '''.sub''' file.&lt;br /&gt;
&lt;br /&gt;
As you can see here, only dot '''sub''' files will be available.&lt;br /&gt;
&lt;br /&gt;
No '''sch''' or '''cir''' files will be present in this folder.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||'''eSim Main Window:'''&lt;br /&gt;
Click on '''Open Project''' option from top menu&amp;gt;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
click on '''eSim-2.0'''&amp;gt;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Double click on '''Examples'''&amp;gt;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
select '''FullAdder''' &amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Open'''&lt;br /&gt;
&lt;br /&gt;
||Let us simulate the '''Full Adder''' example with the newly added subcircuit library.&lt;br /&gt;
&lt;br /&gt;
Open the '''FullAdder''' example from the '''Examples''' folder of '''eSim''' installer.&lt;br /&gt;
&lt;br /&gt;
Click on the '''Open Project''' option from the top menu.&lt;br /&gt;
&lt;br /&gt;
Locate the directory where the '''eSim''' is installed and double-click on the '''Examples''' folder.&lt;br /&gt;
&lt;br /&gt;
Now select the '''FullAdder''' example and click on the '''Open''' button.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||'''eSim Main Window:'''&lt;br /&gt;
Select '''FullAdder''' under Projects&amp;gt;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
click on '''Convert Kicad to Ngspice'''&lt;br /&gt;
&lt;br /&gt;
||On the '''eSim''' window, select '''FullAdder''' under Projects.&lt;br /&gt;
&lt;br /&gt;
Then click on '''Convert Kicad to Ngspice''' button from the left toolbar.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||'''Kicad to Ngspice Converter:'''&lt;br /&gt;
'''Analysis''' Tab&lt;br /&gt;
 &lt;br /&gt;
'''Source Details''' Tab&lt;br /&gt;
&lt;br /&gt;
||Let the '''transient analysis''' parameters and '''Source details''' be the same. &lt;br /&gt;
&lt;br /&gt;
We will not change it.&lt;br /&gt;
&lt;br /&gt;
Skip the '''Ngspice Model''' and '''Device Modeling''' tab.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||'''Kicad to Ngspice Converter:'''&lt;br /&gt;
'''Subcircuit''' Tab&lt;br /&gt;
&lt;br /&gt;
Click on '''ADD''&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
click on '''FA_using_NAND''' &amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
click on '''Open'''.&lt;br /&gt;
&lt;br /&gt;
Click on '''Convert''' button&lt;br /&gt;
&lt;br /&gt;
||Under the '''Subcircuits''' tab, click the '''ADD''' button.&lt;br /&gt;
&lt;br /&gt;
Click on '''FA using NAND''' dot '''sub''' file.&lt;br /&gt;
&lt;br /&gt;
Now click on the '''Open''' button.&lt;br /&gt;
&lt;br /&gt;
On the  '''Kicad to Ngspice''' tab, click on the '''Convert''' button.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||'''eSim Main Window:'''&lt;br /&gt;
Click on '''Simulation'''.&lt;br /&gt;
&lt;br /&gt;
||On the '''eSim''' window, click on the '''Simulation''' button from the left toolbar.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||'''Ngspice plot:'''&lt;br /&gt;
&lt;br /&gt;
||An '''Ngspice''' terminal and ''plot'' windows open along with a '''python''' plot window.&lt;br /&gt;
&lt;br /&gt;
We have given the inputs as '''5''', '''5''' and '''0'''.&lt;br /&gt;
&lt;br /&gt;
Hence, the output for '''Sum''' is '''0''' volts and '''Carry''' is '''5''' volts.&lt;br /&gt;
&lt;br /&gt;
Close the '''Ngspice''' terminal and plot windows.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||'''Python Plot Window:'''&lt;br /&gt;
Check  '''sum''' node &amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
check '''cout''' node &amp;gt;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
click '''Plot'''&lt;br /&gt;
||In the '''python''' plot window, check the '''Sum''' node and '''Cout''' node.&lt;br /&gt;
&lt;br /&gt;
And click on the '''Plot''' button.&lt;br /&gt;
&lt;br /&gt;
You can see the output of the '''sum''' and '''carry''' node.&lt;br /&gt;
&lt;br /&gt;
Close the '''Python''' plot window.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||'''System Computer:'''&lt;br /&gt;
UJT.sub file&lt;br /&gt;
&lt;br /&gt;
Open '''eSim 2.0''' folder&amp;gt;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Double click on '''Library''' folder &amp;gt;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Double click on '''SubcircuitLibrary''' folder &amp;gt;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Click on '''UJT''' folder&amp;gt;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
open '''UJT.sub''' file.&lt;br /&gt;
&lt;br /&gt;
||The subcircuit file can also have ''model'' or ''subcircuit'' components within it.&lt;br /&gt;
&lt;br /&gt;
These components can be from existing '''eSim''' libraries.&lt;br /&gt;
&lt;br /&gt;
If the models or subcircuits are not present in '''eSim''' library then the user has to define the same.&lt;br /&gt;
&lt;br /&gt;
For example: Let us open the '''UJT''' subcircuit file present in '''eSim'''.&lt;br /&gt;
&lt;br /&gt;
In this file, there is a '''subcircuit''' of a '''Half adder''' and this is from '''eSim''' libraries.&lt;br /&gt;
&lt;br /&gt;
Hence the statement, dot '''include''' is added in this file.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||'''System Computer:''' &lt;br /&gt;
UJT.sub file  &lt;br /&gt;
&lt;br /&gt;
Explaining the '''model RMOD''' and '''model Emitter''' &lt;br /&gt;
&lt;br /&gt;
||Here, the '''model RMOD''' and '''Emitter''' are the two models which are defined by the user.&lt;br /&gt;
&lt;br /&gt;
These model files are not available under '''eSim''' libraries.&lt;br /&gt;
 &lt;br /&gt;
Hence, you need to mention the parameters in the '''spice model''' format.&lt;br /&gt;
&lt;br /&gt;
If any subcircuit is used, then the parameters are defined in the '''spice subcircuit''' format.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||'''Show Slide:'''&lt;br /&gt;
Summary&lt;br /&gt;
&lt;br /&gt;
||Let us summarize.&lt;br /&gt;
In this tutorial, we learnt to -&lt;br /&gt;
*Upload an external spice '''Subcircuit''' file in '''eSim'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||'''Show Slide:'''&lt;br /&gt;
Forum to answer questions&lt;br /&gt;
&lt;br /&gt;
https://forums.spoken-tutorial.org/&lt;br /&gt;
&lt;br /&gt;
||Do you have questions in this '''Spoken Tutorial'''?&lt;br /&gt;
&lt;br /&gt;
Please visit this site.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||'''Show Slide:'''	&lt;br /&gt;
FOSSEE Forum&lt;br /&gt;
&lt;br /&gt;
https://forums.fossee.in/&lt;br /&gt;
&lt;br /&gt;
||For any general or  technical questions on '''eSim''', visit the '''FOSSEE''' forum and post your question.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||'''Show Slide:'''&lt;br /&gt;
Circuit Simulation&lt;br /&gt;
&lt;br /&gt;
https://esim.fossee.in/circuit-simulation-project&lt;br /&gt;
&lt;br /&gt;
||The '''FOSSEE''' team coordinates the '''Circuit Simulation''' project.&lt;br /&gt;
&lt;br /&gt;
We give '''Certificates''' and '''Honorarium''' to the contributors.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||'''Show Slide:'''			&lt;br /&gt;
Lab Migration&lt;br /&gt;
&lt;br /&gt;
https://esim.fossee.in/lab-migration-project&lt;br /&gt;
&lt;br /&gt;
||The '''FOSSEE''' team coordinates the '''Lab Migration''' project.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||'''Show Slide:'''&lt;br /&gt;
Acknowledgment&lt;br /&gt;
&lt;br /&gt;
http://spoken-tutorial.org&lt;br /&gt;
&lt;br /&gt;
||'''Spoken Tutorial''' Project is funded by '''NMEICT''', '''MHRD''', '''Govt. of India'''.&lt;br /&gt;
&lt;br /&gt;
For more details, visit this site.&lt;br /&gt;
		&lt;br /&gt;
|-	&lt;br /&gt;
||'''Thank you slide'''&lt;br /&gt;
		&lt;br /&gt;
||This is Gloria N  from IIT Bombay signing off.&lt;br /&gt;
&lt;br /&gt;
Thank you&lt;/div&gt;</summary>
		<author><name>Glorianandihal</name></author>	</entry>

	</feed>