SHA256
1
0
forked from pool/gnucap
Lars Vogdt 2008-09-25 10:54:14 +00:00 committed by Git OBS Bridge
commit 3465144f70
9 changed files with 486 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

1
_link.disabled Normal file
View File

@ -0,0 +1 @@
<link project='science' package='gnucap'/>

250
gnucap-0.34-debian.patch Normal file
View File

@ -0,0 +1,250 @@
--- gnucap-0.35/doc/whatisit.debian 2000-08-16 10:15:00.000000000 +0200
+++ gnucap-0.35/doc/whatisit 2007-02-14 13:04:05.000000000 +0100
@@ -1,4 +1,4 @@
-ACS is a general purpose circuit simulator. It performs nonlinear
+Gnucap is a general purpose circuit simulator. It performs nonlinear
dc and transient analyses, fourier analysis, and ac analysis
linearized at an operating point. It is fully interactive and
command driven. It can also be run in batch mode or as a server.
@@ -6,7 +6,7 @@
for the MOSFET (level 1-7) and diode are included in this
release.
-ACS is not based on Berkeley Spice, but some of the models have been
+Gnucap is not based on Berkeley Spice, but some of the models have been
derived from the Berleley models.
Since it is fully interactive, it is possible to make changes and
@@ -19,7 +19,7 @@
bipolar design.
In batch mode it is mostly Spice compatible, so it is often possible
-to use the same file for both ACS and Spice.
+to use the same file for both Gnucap and Spice.
The analog simulation is based on traditional nodal analysis with
iteration by Newton's method and LU decomposition. An event queue
@@ -36,11 +36,11 @@
experimental and needs work. There will be substantial improvements
in future releases.
-ACS also has a simple behavioral modeling language that allows
+Gnucap also has a simple behavioral modeling language that allows
simple behavioral descriptions of most components including capacitors
and inductors.
-ACS uses an object oriented approach to modeling. Complex models like
+Gnucap uses an object oriented approach to modeling. Complex models like
MOSFETS are made of simpler ones like resistors, capacitors, diodes,
and any other models that may already exist. The model designer does
not need to worry about details like convergence checking, bypass
@@ -54,17 +54,13 @@
If you are tired of Spice and want a second opinion, you want to
play with the circuit and want a simulator that is interactive, or
you want to study the source code and want something easier to
-follow than Spice, try ACS.
+follow than Spice, try Gnucap.
-ACS is an ongoing research project. It is being released in a
+Gnucap is an ongoing research project. It is being released in a
preliminary phase in hopes that it will be useful and that others
will use it as a thrust or base for their research. I also hope
for some comments that may help me direct my research.
-ACS ftp sites:
- ftp://sunsite.unc.edu/pub/Linux/apps/circuits/acs-0.27.tar.gz
- ftp://ftp.geda.seul.org/pub/geda/dist/acs-0.27.tar.gz
- http://www.geda.seul.org/dist/acs-0.27.tar.gz
Albert Davis
aldavis@ieee.org
--- gnucap-0.35/src/bm.cc.debian 2006-08-28 08:15:43.000000000 +0200
+++ gnucap-0.35/src/bm.cc 2007-02-14 13:04:05.000000000 +0100
@@ -141,7 +141,8 @@
/*--------------------------------------------------------------------------*/
void EVAL_BM_ACTION_BASE::tr_finish_tdv(ELEMENT* d, double val)const
{
- d->_y0 = FPOLY1(CPOLY1(ioffset(d->_y0.x), 0., val));
+ CPOLY1 cp1(ioffset(d->_y0.x), 0., val);
+ d->_y0 = FPOLY1(cp1);
tr_final_adjust(&(d->_y0), false);
}
/*--------------------------------------------------------------------------*/
--- gnucap-0.35/src/e_card.h.debian 2006-08-28 08:15:43.000000000 +0200
+++ gnucap-0.35/src/e_card.h 2007-02-14 13:04:05.000000000 +0100
@@ -35,6 +35,7 @@
class CARD_LIST;
class CS;
class COMMON_COMPONENT;
+CARD_LIST::fat_iterator findbranch(CS&,CARD_LIST::fat_iterator);
/*--------------------------------------------------------------------------*/
class CARD : public CKT_BASE {
private:
--- gnucap-0.35/src/d_vcvs.cc.debian 2006-08-28 08:15:43.000000000 +0200
+++ gnucap-0.35/src/d_vcvs.cc 2007-02-14 13:04:05.000000000 +0100
@@ -61,7 +61,8 @@
assert(_y0.f0 != LINEAR);
store_values();
q_load();
- _m0 = CPOLY1(_y0);
+ CPOLY1 cp1(_y0);
+ _m0 =cp1;
_m0 *= -_loss0;
}else{
assert(conchk(_loss0, 1./OPT::shortckt));
--- gnucap-0.35/src/u_sdp.h.debian 2006-08-28 08:15:43.000000000 +0200
+++ gnucap-0.35/src/u_sdp.h 2007-02-14 13:04:05.000000000 +0100
@@ -32,6 +32,9 @@
/*--------------------------------------------------------------------------*/
class OMSTREAM;
class CARD_LIST;
+class SDP;
+bool get(CS& cmd, const std::string& key, SDP* value,
+ AP_MOD mod, double scale);
/*--------------------------------------------------------------------------*/
class SDP {
friend bool get(CS& cmd, const std::string& key, SDP* value);
--- gnucap-0.35/src/e_storag.cc.debian 2006-08-28 08:15:43.000000000 +0200
+++ gnucap-0.35/src/e_storag.cc 2007-02-14 13:04:05.000000000 +0100
@@ -78,7 +78,8 @@
_dt = NOT_VALID;
_i0 = _q[0] = _q[1] = _q[2] = FPOLY1(0., 0., 0.);
_it1_f0 = 0.;
- _m1 = _m0 = CPOLY1(0., 0., 0.);
+ CPOLY1 cp1(0., 0., 0.);
+ _m1 = _m0 = cp1;
assert(_loss0 == 0.);
assert(_loss1 == 0.);
if (!using_tr_eval()) {
--- gnucap-0.35/src/d_admit.cc.debian 2006-08-28 08:15:43.000000000 +0200
+++ gnucap-0.35/src/d_admit.cc 2007-02-14 13:04:05.000000000 +0100
@@ -57,7 +57,8 @@
assert(_y0.f0 != LINEAR);
store_values();
q_load();
- _m0 = CPOLY1(_y0);
+ CPOLY1 cp1(_y0);
+ _m0 = cp1;
}else{
assert(_y0.f0 == LINEAR);
assert(_y0.f1 == value());
@@ -172,7 +173,8 @@
bool DEV_CPOLY_G::do_tr()
{
assert(_values);
- _m0 = CPOLY1(0., _values[0], _values[1]);
+ CPOLY1 cp1(0., _values[0], _values[1]);
+ _m0 = cp1;
return do_tr_con_chk_and_q();
}
/*--------------------------------------------------------------------------*/
@@ -195,7 +197,8 @@
}
}
trace2("", _values[0], c0);
- _m0 = CPOLY1(0., c0, _values[1]);
+ CPOLY1 cp1(0., c0, _values[1]);
+ _m0 = cp1;
return do_tr_con_chk_and_q();
}
--- gnucap-0.35/src/e_compon.h.debian 2006-08-28 08:15:43.000000000 +0200
+++ gnucap-0.35/src/e_compon.h 2007-02-14 13:04:05.000000000 +0100
@@ -43,6 +43,9 @@
}
/*--------------------------------------------------------------------------*/
enum {CC_STATIC=27342}; // mid-sized arbitrary positive int
+class COMMON_COMPONENT;
+void attach_common(COMMON_COMPONENT* c, COMMON_COMPONENT** to);
+void detach_common(COMMON_COMPONENT** from);
// pass this as an argument to a common constructor to mark it as static,
// so it won't be deleted
/*--------------------------------------------------------------------------*/
--- gnucap-0.35/src/d_cap.cc.debian 2006-08-28 08:15:43.000000000 +0200
+++ gnucap-0.35/src/d_cap.cc 2007-02-14 13:05:47.000000000 +0100
@@ -47,7 +47,8 @@
_i0.x = _y0.x;
_i0.f0 = differentiate();
_i0.f1 = tr_c_to_g(_q[0].f1, _i0.f1);
- _m0 = CPOLY1(_i0);
+ CPOLY1 cp1(_i0);
+ _m0 = cp1;
return converged();
}
/*--------------------------------------------------------------------------*/
@@ -191,7 +192,8 @@
assert(_vi0[i] == _vi0[i]);
}
- _m0 = CPOLY1(0., _vi0[0], _vi0[1]);
+ CPOLY1 cp1(0., _vi0[0], _vi0[1]);
+ _m0 = cp1;
return do_tr_con_chk_and_q();
}
/*--------------------------------------------------------------------------*/
--- gnucap-0.35/src/l_timer.h.debian 2006-08-28 08:15:43.000000000 +0200
+++ gnucap-0.35/src/l_timer.h 2007-02-14 13:04:05.000000000 +0100
@@ -26,6 +26,8 @@
#define U_TIMER_H
#include "io_.h"
/*--------------------------------------------------------------------------*/
+class TIMER;
+TIMER operator-(const TIMER&,const TIMER&);
class TIMER {
private:
enum {_T_NAME_LEN = 8};
--- gnucap-0.35/modelgen/mg_.h.debian 2006-08-28 07:45:36.000000000 +0200
+++ gnucap-0.35/modelgen/mg_.h 2007-02-14 13:04:05.000000000 +0100
@@ -120,7 +120,7 @@
}
T* p = new T(file);
{if (!file.stuck(&here)) {
- _list.push_back(p);
+ this->_list.push_back(p);
}else {
delete p;
file.warn(0, "not valid here");
@@ -141,7 +141,7 @@
int here = file.cursor();
T* m = new T(file);
{if (!file.stuck(&here)) {
- _list.push_back(m);
+ this->_list.push_back(m);
}else{
delete m;
file.warn(0, "what's this??");
--- gnucap-0.35/examples/runall.debian 2000-09-05 06:22:00.000000000 +0200
+++ gnucap-0.35/examples/runall 2007-02-14 13:04:05.000000000 +0100
@@ -1,16 +1,16 @@
-#
-$1 -b eq2-145.ckt
-$1 -b eq2-289.ckt
-$1 -b eq2-577.ckt
-$1 -b eq3-1153.ckt
-$1 -b eq4-2305.ckt
-$1 -b eqboost.ckt
-$1 -b eqflat.ckt
-$1 -b eqmodify.ckt
-$1 -b killzap.ckt
-$1 -b nmos100.ckt
-$1 -b nmos18.ckt
-$1 -b nmos30.ckt
-$1 -b nmp100.ckt
-$1 -b opamp-ol.ckt
-$1 -b opamp-vf.ckt
+#!/bin/sh
+gnucap -b eq2-145.ckt
+gnucap -b eq2-289.ckt
+gnucap -b eq2-577.ckt
+gnucap -b eq3-1153.ckt
+gnucap -b eq4-2305.ckt
+gnucap -b eqboost.ckt
+gnucap -b eqflat.ckt
+gnucap -b eqmodify.ckt
+gnucap -b killzap.ckt
+gnucap -b nmos100.ckt
+gnucap -b nmos18.ckt
+gnucap -b nmos30.ckt
+gnucap -b nmp100.ckt
+gnucap -b opamp-ol.ckt
+gnucap -b opamp-vf.ckt

100
gnucap-0.35-gcc43.patch Normal file
View File

@ -0,0 +1,100 @@
--- gnucap-0.35/modelgen/ap.h 2006-08-28 08:15:43.000000000 +0200
+++ gnucap-0.35.new/modelgen/ap.h 2008-01-08 22:28:50.000000000 +0100
@@ -24,6 +24,7 @@
//testing=script,sparse 2006.07.17
#ifndef AP_H
#define AP_H
+#include <string.h>
#include "md.h"
/*--------------------------------------------------------------------------*/
enum AP_MOD{
--- gnucap-0.35/src/ap.h 2006-08-28 08:15:43.000000000 +0200
+++ gnucap-0.35.new/src/ap.h 2008-01-08 22:29:01.000000000 +0100
@@ -24,6 +24,7 @@
//testing=script,sparse 2006.07.17
#ifndef AP_H
#define AP_H
+#include <string.h>
#include "md.h"
/*--------------------------------------------------------------------------*/
enum AP_MOD{
--- gnucap-0.35/src/e_base.h 2006-08-28 08:15:43.000000000 +0200
+++ gnucap-0.35.new/src/e_base.h 2008-01-08 22:29:59.000000000 +0100
@@ -24,6 +24,7 @@
//testing=script,complete 2006.07.12
#ifndef E_BASE_H
#define E_BASE_H
+#include <strings.h>
#include "l_compar.h"
#include "u_opt.h"
#include "u_status.h"
--- gnucap-0.35/src/io_findf.cc 2006-08-28 08:15:43.000000000 +0200
+++ gnucap-0.35.new/src/io_findf.cc 2008-01-08 22:33:15.000000000 +0100
@@ -32,6 +32,7 @@
* PATHSEP, ENDDIR are system dependent, defined in md.h
*/
//testing=script,sparse 2006.07.17
+#include <string.h>
#include "l_lib.h"
/*--------------------------------------------------------------------------*/
std::string findfile(const std::string& filename, const std::string& path,
--- gnucap-0.35/src/io_getln.cc 2006-08-28 08:15:43.000000000 +0200
+++ gnucap-0.35.new/src/io_getln.cc 2008-01-08 22:32:51.000000000 +0100
@@ -27,6 +27,7 @@
* start with + is extension line, spice compatibility.
*/
//testing=script 2006.07.17
+#include <string.h>
#include "l_lib.h"
/*--------------------------------------------------------------------------*/
std::string getlines(FILE *fileptr)
--- gnucap-0.35/src/io_out.cc 2006-08-28 08:15:43.000000000 +0200
+++ gnucap-0.35.new/src/io_out.cc 2008-01-08 22:33:34.000000000 +0100
@@ -31,6 +31,7 @@
* but I have yet to find a system that did not meet this form.
*/
//testing=script,sparse 2006.07.17
+#include <string.h>
#include "u_opt.h"
/*--------------------------------------------------------------------------*/
const char* octal(int x);
--- gnucap-0.35/src/l_ftos.cc 2006-08-28 08:15:43.000000000 +0200
+++ gnucap-0.35.new/src/l_ftos.cc 2008-01-08 22:33:53.000000000 +0100
@@ -37,6 +37,7 @@
* after that, the space is overwritten, every POOLSIZE calls
*/
//testing=script 2005.10.11
+#include <string.h>
#include "l_lib.h"
#include "constant.h"
/*--------------------------------------------------------------------------*/
--- gnucap-0.35/src/l_timer.cc 2006-08-28 08:15:43.000000000 +0200
+++ gnucap-0.35.new/src/l_timer.cc 2008-01-08 22:34:16.000000000 +0100
@@ -22,6 +22,7 @@
* Time a command, or whatever
*/
//testing=script,sparse 2006.07.13
+#include <string.h>
#include "l_timer.h"
/*--------------------------------------------------------------------------*/
// TIMER::TIMER();
--- gnucap-0.35/src/main.cc 2006-09-20 19:18:52.000000000 +0200
+++ gnucap-0.35.new/src/main.cc 2008-01-08 22:31:35.000000000 +0100
@@ -23,6 +23,7 @@
* it all starts here
*/
//testing=script 2006.07.14
+#include <strings.h>
#include "patchlev.h"
#include "c_comand.h"
#include "declare.h" /* lots */
--- gnucap-0.35/src/plot.cc 2006-08-28 08:15:43.000000000 +0200
+++ gnucap-0.35.new/src/plot.cc 2008-01-08 22:34:56.000000000 +0100
@@ -2,6 +2,7 @@
* (this file is a mess. it should be redone.)
*/
//testing=script 2006.07.17
+#include <string.h>
#include "declare.h" /* self */
#include "s__.h"
#include "u_prblst.h"

View File

@ -0,0 +1,24 @@
Index: gnucap-0.35/src/ap.h
===================================================================
--- gnucap-0.35.orig/src/ap.h
+++ gnucap-0.35/src/ap.h
@@ -24,6 +24,7 @@
//testing=script,sparse 2006.07.17
#ifndef AP_H
#define AP_H
+#include <cstring>
#include "md.h"
/*--------------------------------------------------------------------------*/
enum AP_MOD{
Index: gnucap-0.35/src/ap_construct.cc
===================================================================
--- gnucap-0.35.orig/src/ap_construct.cc
+++ gnucap-0.35/src/ap_construct.cc
@@ -22,6 +22,7 @@
* construction, copy, etc.
*/
//testing=script,sparse 2006.07.17
+#include <cstring>
#include "ap.h"
/*--------------------------------------------------------------------------*/
CS::CS(CS_FILE, const std::string& name, int i)

3
gnucap-0.35.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8cf16bbc229115349ebf6d86fc43b7fd48c2b2c7f7971dbe12c5c98b2a583edc
size 876263

12
gnucap.changes Normal file
View File

@ -0,0 +1,12 @@
-------------------------------------------------------------------
Thu Sep 25 12:54:09 CEST 2008 - lars@linux-schulserver.de
- moved to Education base repository
-------------------------------------------------------------------
Tue May 27 23:37:29 CEST 2008 - lars@linux-schulserver.de
- initial version for openSUSE-Education
- fix build with GCC4.3
- use debian patch

72
gnucap.spec Normal file
View File

@ -0,0 +1,72 @@
#
# spec file for package gnucap
#
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
Name: gnucap
Summary: Gnucap is the Gnu Circuit Analysis Package
Version: 0.35
Release: 10
License: GPL
Group: Productivity/Scientific/Electronics
Url: http://www.geda.seul.org/tools/gnucap
Vendor: openSUSE-Education
Source: http://www.gnucap.org/dist/%name-%version.tar.bz2
Patch1: gnucap-0.35-gcc43.patch
Patch2: gnucap-0.34-debian.patch
BuildRequires: gcc-c++ libpng-devel readline-devel
BuildRequires: ncurses-devel
%if 0%{?suse_version} > 1020
BuildRequires: texlive-devel texlive-latex
%else
BuildRequires: te_latex tetex
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
The primary component is a general purpose circuit simulator. It
performs nonlinear dc and transient analyses, fourier analysis, and ac
analysis. Spice compatible models for the MOSFET (level 1-7), BJT, and
diode are included in this release.
Gnucap is not based on Spice, but some of the models have been derived
from the Berkeley models.
Unlike Spice, the engine is designed to do true mixed-mode
simulation. Most of the code is in place for future support of event
driven analog simulation, and true multi-rate simulation.
%prep
%setup -q
# use ncurses instead of termcap
sed -i 's/-ltermcap/-lncurses/g' configure
%patch1 -p1
%patch2 -p1
%build
%configure
%{__make} %{?jobs:-j%jobs}
%install
%makeinstall
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%{_prefix}/bin/*
%{_mandir}/*
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/doc
%dir %{_datadir}/%{name}/examples
%dir %{_datadir}/%{name}/manual
%doc %{_datadir}/%{name}/doc/*
%doc %{_datadir}/%{name}/examples/*
%doc %{_datadir}/%{name}/manual/*
%changelog