From 600e62496f2238bf37034773660d106ebbc9cb96 Mon Sep 17 00:00:00 2001 From: Arnaud Gardelein Date: Thu, 17 Jan 2013 23:07:33 +0100 Subject: [PATCH] Rework demo script to highlight update feature Remove comments, add possibility to edit commands to run gschem/gnetlist/gnucap, improve explanations And fix typo in the banner --- data/ipython_config.py | 2 +- demo/demo.oscopy | 57 ++++++++++++++++++++++++++++++++++++++++++-------- test/demo.oscopy | 57 ++++++++++++++++++++++++++++++++++++++++++-------- 3 files changed, 97 insertions(+), 19 deletions(-) diff --git a/data/ipython_config.py b/data/ipython_config.py index 30c42fc..4d72fea 100644 --- a/data/ipython_config.py +++ b/data/ipython_config.py @@ -188,7 +188,7 @@ c.TerminalIPythonApp.exec_files = ['@bindir@/ioscopy.py'] # The part of the banner to be printed after the profile # c.TerminalInteractiveShell.banner2 = '' -c.TerminalInteractiveShell.banner2 = """This is oscopy, a program to view electrical simulation results on top of IPython\nCopyright (C) 2008 - 2012 Arnaud Gardelein and others.\nThis is free software, you are invited to redistribute it \nunder certain conditions.\nThere is ABSOLUTELY NO WARRANTY; not even for MERCHANTIBILITY or\nFITNESS FOR A PARTICULAR PURPOSE.""" +c.TerminalInteractiveShell.banner2 = """This is oscopy, a program to view electrical simulation results on top of IPython\nCopyright (C) 2008 - 2012 Arnaud Gardelein and others.\nThis is free software, you are invited to redistribute it \nunder certain conditions.\nThere is ABSOLUTELY NO WARRANTY; not even for MERCHANTIBILITY or\nFITNESS FOR A PARTICULAR PURPOSE.\n""" # # c.TerminalInteractiveShell.separate_out2 = '' diff --git a/demo/demo.oscopy b/demo/demo.oscopy index 2f0d195..1e0823c 100644 --- a/demo/demo.oscopy +++ b/demo/demo.oscopy @@ -1,5 +1,5 @@ +import os # First read data from IRF540 simulation -print "*** Reading files and setting plots" oread demo/irf540.dat oadd vgs ocreate @@ -7,9 +7,8 @@ oadd iRD oadd vgs oadd vgs oadd vds -print "*** Fig 2 layout to quad" +# Fig 2 layout to quad olayout quad -print "*** Done" # Oops, forgot a signal in figure 2 graph 3 oselect 2-3 oinsert vds @@ -31,7 +30,7 @@ v1=vsqu*3+10 oimport v1 oadd v1 ounit V -print "*** Insert and remove a signal" +# Insert and remove a signal oselect 4-1 oinsert v1 oremove v1 @@ -44,7 +43,9 @@ oimport vs oimport vs2 ocreate vs ounit V +print '***' print "*** List of figures" +print '***' ofiglist # Create a copy of vout and freeze it vo=vout @@ -54,11 +55,49 @@ oselect 3-1 oinsert vo osiglist # Updating -print "*** Now change C value in schematic and rerun gnetlist + gnucap" +print '***' +print '*** Now we will show the updating capabilties of ioscopy.' +print '*** We will use Figure 3 that has currently two identical signals' +print '*** \'vout\' and \'vo\' where \'vo\' is a frozen copy of vout.' +print '*** vout is the response of a simple RC lowpass filter.' +print '***' +print '*** We will change a value in the schematics and then run simulation' +print '*** tools. Make sure you have gschem, gnetlist and gnucap installed' +print '***' +print '*** Before updating simulation results we will run gschem.' +print '*** In the schematics, change value of capacitor \'C\' eg from 10n to 1n.' +print '*** Close gschem when finished to continue' +cmd = 'gschem demo/demo.sch' +c = raw_input('Command: %s [Y/n/c] ' % cmd) +if not c: c = 'y' +if c in ['e','E']: cmd = raw_input('Enter command to execute: ') +if c in ['e', 'E', 'y', 'Y']: os.system(cmd) #pause... -print "*** Updating" -#oupdate -print "*** Now look at figure 3" -#plot +print '***' +print '*** Now we will run gnetlist' +print '*** press enter or \'y\' to continue, \'n\' to skip, \'e\' to change' +print '***' +cmd = 'cd demo && gnetlist -g spice-sdb -s -o demo.net demo.sch' +c = raw_input('Command: %s [Y/n/c] ' % cmd) +if not c: c = 'y' +if c in ['e','E']: cmd = raw_input('Enter command to execute: ') +if c in ['e', 'E', 'y', 'Y']: os.system(cmd) +print '***' +print '*** Now we will run gnucap' +print '*** press enter or \'y\' to continue, \'n\' to skip, \'e\' to change' +print '***' +cmd = 'cd demo && gnucap -b demo.net' +c = raw_input('Command: %s [Y/n/c] ' % cmd) +if not c: c = 'y' +if c in ['e','E']: cmd = raw_input('Enter command to execute: ') +if c in ['e', 'E', 'y', 'Y']: os.system(cmd) +print '***' +print "*** Unless there are errors simulation is complete we can update ioscopy" +print '***' +oupdate +print '***' +print "*** Now you should look at figure 3" +print '***' + # Saving results owrite gnucap (ow:1) demo/res.dat v1,vsqu diff --git a/test/demo.oscopy b/test/demo.oscopy index 2f0d195..1e0823c 100644 --- a/test/demo.oscopy +++ b/test/demo.oscopy @@ -1,5 +1,5 @@ +import os # First read data from IRF540 simulation -print "*** Reading files and setting plots" oread demo/irf540.dat oadd vgs ocreate @@ -7,9 +7,8 @@ oadd iRD oadd vgs oadd vgs oadd vds -print "*** Fig 2 layout to quad" +# Fig 2 layout to quad olayout quad -print "*** Done" # Oops, forgot a signal in figure 2 graph 3 oselect 2-3 oinsert vds @@ -31,7 +30,7 @@ v1=vsqu*3+10 oimport v1 oadd v1 ounit V -print "*** Insert and remove a signal" +# Insert and remove a signal oselect 4-1 oinsert v1 oremove v1 @@ -44,7 +43,9 @@ oimport vs oimport vs2 ocreate vs ounit V +print '***' print "*** List of figures" +print '***' ofiglist # Create a copy of vout and freeze it vo=vout @@ -54,11 +55,49 @@ oselect 3-1 oinsert vo osiglist # Updating -print "*** Now change C value in schematic and rerun gnetlist + gnucap" +print '***' +print '*** Now we will show the updating capabilties of ioscopy.' +print '*** We will use Figure 3 that has currently two identical signals' +print '*** \'vout\' and \'vo\' where \'vo\' is a frozen copy of vout.' +print '*** vout is the response of a simple RC lowpass filter.' +print '***' +print '*** We will change a value in the schematics and then run simulation' +print '*** tools. Make sure you have gschem, gnetlist and gnucap installed' +print '***' +print '*** Before updating simulation results we will run gschem.' +print '*** In the schematics, change value of capacitor \'C\' eg from 10n to 1n.' +print '*** Close gschem when finished to continue' +cmd = 'gschem demo/demo.sch' +c = raw_input('Command: %s [Y/n/c] ' % cmd) +if not c: c = 'y' +if c in ['e','E']: cmd = raw_input('Enter command to execute: ') +if c in ['e', 'E', 'y', 'Y']: os.system(cmd) #pause... -print "*** Updating" -#oupdate -print "*** Now look at figure 3" -#plot +print '***' +print '*** Now we will run gnetlist' +print '*** press enter or \'y\' to continue, \'n\' to skip, \'e\' to change' +print '***' +cmd = 'cd demo && gnetlist -g spice-sdb -s -o demo.net demo.sch' +c = raw_input('Command: %s [Y/n/c] ' % cmd) +if not c: c = 'y' +if c in ['e','E']: cmd = raw_input('Enter command to execute: ') +if c in ['e', 'E', 'y', 'Y']: os.system(cmd) +print '***' +print '*** Now we will run gnucap' +print '*** press enter or \'y\' to continue, \'n\' to skip, \'e\' to change' +print '***' +cmd = 'cd demo && gnucap -b demo.net' +c = raw_input('Command: %s [Y/n/c] ' % cmd) +if not c: c = 'y' +if c in ['e','E']: cmd = raw_input('Enter command to execute: ') +if c in ['e', 'E', 'y', 'Y']: os.system(cmd) +print '***' +print "*** Unless there are errors simulation is complete we can update ioscopy" +print '***' +oupdate +print '***' +print "*** Now you should look at figure 3" +print '***' + # Saving results owrite gnucap (ow:1) demo/res.dat v1,vsqu -- 2.11.4.GIT