8 changed files with 206 additions and 10 deletions
-
12contrib/ChangeLog
-
24contrib/mslib/inc_inp.c
-
77contrib/mslib/liblook
-
70contrib/mslib/libprm
-
14contrib/mslib/libprm_readme
-
3contrib/mslib/makefile
-
7contrib/spiceprm/CHANGES
-
5contrib/spiceprm/spiceprm
@ -1,10 +1,16 @@ |
|||
2000-03-22 Paolo Nenzi <p.nenzi@ieee.org> |
|||
2000-10-10 Arno W. Peters <A.W.Peters@ieee.org> |
|||
|
|||
* mslib: Major update. M. Widlok sent the new version of it's programs. |
|||
* mslib, spiceprm: Michael Widlok released new version of his |
|||
programs. |
|||
|
|||
2000-03-22 Paolo Nenzi <p.nenzi@ieee.org> |
|||
|
|||
* mslib: Major update. M. Widlok sent the new version of it's |
|||
programs. |
|||
|
|||
* spiceprm: Major update. See above line. |
|||
|
|||
1999-09-14 Arno <A.W.Peters@ieee.org> |
|||
1999-09-14 Arno W. Peters <A.W.Peters@ieee.org> |
|||
|
|||
* mslib: Added. |
|||
|
|||
|
|||
@ -0,0 +1,77 @@ |
|||
#!/bin/sh |
|||
#set -x -v |
|||
|
|||
# MW. Lib search / show program |
|||
|
|||
# usage liblook libname [text_to_find] [l_before] [l_after] |
|||
|
|||
LIBPATH=/usr/local/lib |
|||
|
|||
function trapper() |
|||
{ |
|||
echo User break! |
|||
echo Exiting . . . |
|||
unset LIBPATH |
|||
exit 1 |
|||
} |
|||
|
|||
trap trapper SIGINT SIGQUIT |
|||
|
|||
function operror() |
|||
{ |
|||
echo Incorrect parameters: $*, $# |
|||
echo Usage: liblook libname [text_to_find] [l_before] [l_after] |
|||
unset LIBPATH |
|||
exit 2 |
|||
} |
|||
|
|||
function showlib() |
|||
{ |
|||
if test -f $LIBPATH/$1; then |
|||
less $LIBPATH/$1; exit 0; fi |
|||
|
|||
if test -f [C./$1; then |
|||
less ./$1; exit 0; fi |
|||
|
|||
echo Searching $1 in ~/ . . . |
|||
less $(find ~/ -name $1) |
|||
} |
|||
|
|||
function searchlib() |
|||
{ |
|||
if test -f $LIBPATH/$1; then |
|||
echo File: $1; echo; |
|||
grep -B"$3" -A"$4" --ignore-case -e "$2" $LIBPATH/$1; |
|||
echo; exit 0; fi |
|||
|
|||
if test -f ./$1; then |
|||
echo File: $1; echo; |
|||
grep -B"$3" -A"$4" --ignore-case -e "$2" ./$1; |
|||
echo; exit 0; fi |
|||
|
|||
#if *.lib or sth like this |
|||
|
|||
echo Searching $1 in ~/ . . .;echo; |
|||
if (grep -B"$3" -A"$4" --ignore-case -e "$2" $(find ~/ -name $1)); then |
|||
echo; exit 0; fi |
|||
|
|||
echo Searching $1 in $LIBPATH;echo; |
|||
if (grep -B"$3" -A"$4" --ignore-case -e "$2" $(find $LIBPATH -name $1)); then |
|||
echo; exit 0; fi |
|||
|
|||
} |
|||
|
|||
|
|||
# Main body |
|||
if test $# -lt 1 -o $# -gt 4; then operror $*; fi |
|||
|
|||
case $# in |
|||
1) showlib $*;; |
|||
2) searchlib $1 $2 2 2;; |
|||
3) searchlib $1 $2 $3 2;; |
|||
4) searchlib $1 $2 $3 $4;; |
|||
esac |
|||
|
|||
unset LIBPATH |
|||
exit 0 |
|||
|
|||
@ -0,0 +1,70 @@ |
|||
#!/bin/sh |
|||
#set -x -v |
|||
|
|||
# MW. Lip / Param parsing program for spice |
|||
|
|||
# -n normal, -f full (keep everything), -r replace original file |
|||
# -e new addition start with editor, then like normal |
|||
|
|||
export TMPLP=/tmp/LibPrm.$$- |
|||
|
|||
function trapper() |
|||
{ |
|||
echo User break! |
|||
echo Exiting . . . |
|||
rm -f -v ${TMPLP}* |
|||
unset TMPLP |
|||
exit 1 |
|||
} |
|||
|
|||
trap trapper SIGINT SIGQUIT |
|||
|
|||
function operror() |
|||
{ |
|||
echo Incorrect parameters: $*, $# |
|||
unset TMPLP |
|||
exit 2 |
|||
} |
|||
|
|||
function repnormpl() |
|||
{ |
|||
mslib $1 ${TMPLP}1 |
|||
sed -n -e 'p' -e "1r ${TMPLP}1" $1 >${TMPLP}2 |
|||
spiceprm ${TMPLP}2 $2 |
|||
} |
|||
|
|||
function keepall() |
|||
{ |
|||
mslib $1 |
|||
sed -n -e 'p' -e "1r $1.lib" $1 >${TMPLP}2 |
|||
spiceprm ${TMPLP}2 $2 |
|||
} |
|||
|
|||
function withedit() |
|||
{ |
|||
joe $1 |
|||
mslib $1 ${TMPLP}1 |
|||
sed -n -e 'p' -e "1r ${TMPLP}1" $1 >${TMPLP}2 |
|||
spiceprm ${TMPLP}2 $2 |
|||
} |
|||
|
|||
|
|||
# Main body |
|||
if test $# -lt 2 -o $# -gt 3; then operror $*; fi |
|||
if !(test -f $2); then operror $*; fi |
|||
|
|||
case $1$# in |
|||
-r3) operror $*;; |
|||
-n2) repnormpl $2 ${2%.cir}.ckt;; |
|||
-n3) repnormpl $2 $3;; |
|||
-r2) repnormpl $2 $2;; |
|||
-f2) keepall $2 ${2%.cir}.ckt;; |
|||
-f3) keepall $2 $3;; |
|||
-e2) withedit $2 ${2%.cir}.ckt;; |
|||
-e3) withedit $2 $3;; |
|||
esac |
|||
|
|||
rm -f ${TMPLP}* |
|||
unset TMPLP |
|||
exit 0 |
|||
|
|||
@ -0,0 +1,14 @@ |
|||
So, this is my idea of using parametrized subckts with spice3f4. |
|||
|
|||
First I create an input file like foo.cir and I include commands for |
|||
mslib (*MOD, *SUB, *LIB) in it. Then I run "libprm -n foo.cir". Libprm then |
|||
runs mslib first to get all models and subckts form given libraries and then |
|||
runs spiceprm to evaluate all used parameters. |
|||
This works quite right for me, and I hope that You will find my idea |
|||
useful. Spiceprm is not my program (I get it from Internet), but I think |
|||
that it will better to enclose all used programs in this packet. Spiceprm |
|||
has it's own directory with very good readme and examples. If You want to |
|||
find out more about libprm or mslib look for the source code. These are rather |
|||
short and easy programs - they are all that I could write in quite short |
|||
time. |
|||
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue