[Pkg-electronics-commits] [gnucap] 07/17: precalc_last-2 -- modelgen and subckt

felix salfelder felix-guest at moszumanska.debian.org
Fri Jul 29 11:08:38 UTC 2016


This is an automated email from the git hooks/post-receive script.

felix-guest pushed a commit to branch master
in repository gnucap.

commit 0c55cd1fbf741aad5f59b1c144d9bb321f8e5bf1
Author: al davis <ad211 at freeelectron.net>
Date:   Tue Mar 29 04:19:22 2016 -0400

    precalc_last-2 -- modelgen and subckt
---
 lib/d_subckt.cc           |  9 +++++----
 lib/e_compon.cc           |  5 +++--
 modelgen/mg_out_common.cc | 10 ----------
 modelgen/mg_out_h.cc      |  1 -
 4 files changed, 8 insertions(+), 17 deletions(-)

diff --git a/lib/d_subckt.cc b/lib/d_subckt.cc
index 3dc2eae..8787c1a 100644
--- a/lib/d_subckt.cc
+++ b/lib/d_subckt.cc
@@ -101,17 +101,18 @@ void COMMON_SUBCKT::precalc_first(const CARD_LIST* Scope)
 {
   assert(Scope);
   COMMON_COMPONENT::precalc_first(Scope);
-
-  for (PARAM_LIST::iterator i = _params.begin(); i != _params.end(); ++i) {
-    i->second.e_val(NOT_INPUT,Scope);
-  }
   _mfactor = _params.deep_lookup("m");
+  //BUG//  _mfactor must be in precalc_first
 }
 /*--------------------------------------------------------------------------*/
 void COMMON_SUBCKT::precalc_last(const CARD_LIST* Scope)
 {
   assert(Scope);
   COMMON_COMPONENT::precalc_last(Scope);
+
+  for (PARAM_LIST::iterator i = _params.begin(); i != _params.end(); ++i) {
+    i->second.e_val(NOT_INPUT,Scope);
+  }
 }
 /*--------------------------------------------------------------------------*/
 MODEL_SUBCKT::MODEL_SUBCKT()
diff --git a/lib/e_compon.cc b/lib/e_compon.cc
index 9256ecf..e1d5286 100644
--- a/lib/e_compon.cc
+++ b/lib/e_compon.cc
@@ -532,11 +532,10 @@ void COMPONENT::precalc_first()
     _mfactor = common()->mfactor();
   }else{
   }
-  
+
   //BUG//  _mfactor must be in precalc_first
 
   _mfactor.e_val(1, scope());
-  _value.e_val(0.,scope());
   trace1(long_label().c_str(), double(_mfactor));
   if (const COMPONENT* o = prechecked_cast<const COMPONENT*>(owner())) {
     _mfactor_fixed = o->mfactor() * _mfactor;
@@ -557,6 +556,8 @@ void COMPONENT::precalc_last()
     }
   }else{
   }
+
+  _value.e_val(0.,scope());
 }
 /*--------------------------------------------------------------------------*/
 void COMPONENT::map_nodes()
diff --git a/modelgen/mg_out_common.cc b/modelgen/mg_out_common.cc
index a00af90..b1b29cc 100644
--- a/modelgen/mg_out_common.cc
+++ b/modelgen/mg_out_common.cc
@@ -368,16 +368,6 @@ static void make_common_expand(std::ofstream& out, const Device& d)
     "  assert(c == this);\n"
     "}\n"
     "/*--------------------------------------------------------------------------*/\n"
-    "void COMMON_" << d.name() << "::precalc_first(const CARD_LIST* par_scope)\n"
-    "{\n"
-    "  assert(par_scope);\n"
-    "  COMMON_COMPONENT::precalc_first(par_scope);\n";
-
-  make_final_adjust_eval_parameter_list(out, d.common().raw());
-
-  out <<
-    "}\n"
-    "/*--------------------------------------------------------------------------*/\n"
     "void COMMON_" << d.name() << "::precalc_last(const CARD_LIST* par_scope)\n"
     "{\n"
     "  assert(par_scope);\n"
diff --git a/modelgen/mg_out_h.cc b/modelgen/mg_out_h.cc
index 7b54c00..bd2ad8d 100644
--- a/modelgen/mg_out_h.cc
+++ b/modelgen/mg_out_h.cc
@@ -178,7 +178,6 @@ static void make_common(std::ofstream& out, const Device& d)
     "  int param_count()const {return (" 
 	     << d.common().override().size() + d.common().raw().size()
 	     << " + COMMON_COMPONENT::param_count());}\n"
-    "  void     precalc_first(const CARD_LIST*);\n"
     "  void     expand(const COMPONENT*);\n"
     "  void     precalc_last(const CARD_LIST*);\n"
     "  std::string name()const {itested();return \"" << d.parse_name() << "\";}\n"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-electronics/gnucap.git



More information about the Pkg-electronics-commits mailing list