Skip to content

Commit 9060ae6

Browse files
sync & cleanup
1 parent b954d5e commit 9060ae6

16 files changed

Lines changed: 149 additions & 93 deletions

d_poly_g_uf.cc

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,34 +109,33 @@ class COMMON_G_POLY_K : public EVAL_BM_ACTION_BASE {
109109
return 0; // TODO
110110
}
111111
std::string param_name(int i, int j)const override{ untested();return j?"":param_name(i); }
112-
std::string param_name(int i)const override
112+
std::string param_name(int I)const override
113113
{ untested();
114-
switch (COMMON_G_POLY_K::param_count() - 1 - i) {
114+
switch (I) {
115115
case 0: return "coeffs";
116-
default: return EVAL_BM_ACTION_BASE::param_name(i);
116+
default: return EVAL_BM_ACTION_BASE::param_name(I-1);
117117
}
118118
}
119119

120120
void set_param_by_index(int i, std::string& s, int)override { untested();
121-
// unsigned i = COMMON_G_POLY_K::param_count() - 1 - I;
122121
if(i < int(_coeff.size())) { untested();
123122
//ok.
124123
}else{ untested();
125124
_coeff.resize(i+1);
126125
}
127126
_coeff[i] = s;
128127
}
129-
bool param_is_printable(int i)const override { untested();
130-
switch (COMMON_G_POLY_K::param_count() - 1 - i) {
128+
bool param_is_printable(int I)const override { untested();
129+
switch (I) {
131130
case 0: return true;
132-
default: return EVAL_BM_ACTION_BASE::param_is_printable(i);
131+
default: return EVAL_BM_ACTION_BASE::param_is_printable(I-1);
133132
}
134133
}
135134

136-
std::string param_value(int i)const override { untested();
137-
switch (COMMON_G_POLY_K::param_count() - 1 - i) {
135+
std::string param_value(int I)const override { untested();
136+
switch (I) {
138137
case 0: return _coeffs.string();
139-
default: return EVAL_BM_ACTION_BASE::param_value(i);
138+
default: return EVAL_BM_ACTION_BASE::param_value(I-1);
140139
}
141140
}
142141

@@ -289,14 +288,14 @@ class DEV_CPOLY_G : public ELEMENT {
289288
// std::string param_name(int i, int)const{ untested(); return param_name(i); }
290289
// std::string param_name(int i)const
291290
// { untested();
292-
// switch (DEV_CPOLY_G::param_count() - 1 - i) {
291+
// switch (i) {
293292
// // case 0: return "coeffs";
294293
// default: return ELEMENT::param_name(i);
295294
// }
296295
// }
297296
// bool param_is_printable(int i)const
298297
// { untested();
299-
// switch (DEV_CPOLY_G::param_count() - 1 - i) {
298+
// switch (i) {
300299
// case 0: return true;
301300
// default: return ELEMENT::param_is_printable(i);
302301
// }

d_spembed.cc

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ bool COMMON_SPEMBED::operator==(const COMMON_COMPONENT& x)const
261261
void COMMON_SPEMBED::set_param_by_index(int I, std::string& Value, int Offset)
262262
{ untested();
263263
incomplete();
264-
switch (COMMON_SPEMBED::param_count() - 1 - I) {
264+
switch (I) {
265265
default: COMMON_COMPONENT::set_param_by_index(I, Value, Offset);
266266
}
267267
}
@@ -284,21 +284,19 @@ int COMMON_SPEMBED::set_param_by_name(std::string Name, std::string Value)
284284
return 0; // incomplete();
285285
}
286286
/*--------------------------------------------------------------------------*/
287-
bool COMMON_SPEMBED::param_is_printable(int i)const
287+
bool COMMON_SPEMBED::param_is_printable(int I)const
288288
{
289-
size_t idx = COMMON_SPEMBED::param_count() - 1 - i;
290-
if(idx == 0){
289+
if(I == 0){
291290
return true;
292291
}else{
293292
incomplete();
294-
return COMMON_COMPONENT::param_is_printable(i);
293+
return COMMON_COMPONENT::param_is_printable(I-1);
295294
}
296295
}
297296
/*--------------------------------------------------------------------------*/
298-
std::string COMMON_SPEMBED::param_name(int i)const
297+
std::string COMMON_SPEMBED::param_name(int I)const
299298
{
300-
size_t idx = COMMON_SPEMBED::param_count() - 1 - i;
301-
switch(idx){
299+
switch(I){
302300
case 0:
303301
return "File";
304302
case 1:
@@ -310,7 +308,7 @@ std::string COMMON_SPEMBED::param_name(int i)const
310308
case 4:
311309
return "duringDC";
312310
}
313-
return COMMON_COMPONENT::param_name(i);
311+
return COMMON_COMPONENT::param_name(I-5);
314312
}
315313
/*--------------------------------------------------------------------------*/
316314
std::string COMMON_SPEMBED::param_name(int i, int j)const
@@ -322,10 +320,9 @@ std::string COMMON_SPEMBED::param_name(int i, int j)const
322320
}
323321
}
324322
/*--------------------------------------------------------------------------*/
325-
std::string COMMON_SPEMBED::param_value(int i)const
323+
std::string COMMON_SPEMBED::param_value(int I)const
326324
{
327-
size_t idx = COMMON_SPEMBED::param_count() - 1 - i;
328-
switch(idx){
325+
switch(I){
329326
case 0:
330327
return "File";
331328
case 1:
@@ -337,7 +334,7 @@ std::string COMMON_SPEMBED::param_value(int i)const
337334
case 4:
338335
return "duringDC";
339336
}
340-
return COMMON_COMPONENT::param_value(i);
337+
return COMMON_COMPONENT::param_value(I-5);
341338
}
342339
/*--------------------------------------------------------------------------*/
343340
void skipcom(CS& f)

d_subckt.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class DEV_SUBCKT_PROTO : public DEV_SUBCKT {
109109
CARD_LIST* scope()override {return subckt();}
110110
const CARD_LIST* scope()const override {return subckt();}
111111
private: // no-ops for prototype
112-
void precalc_first()override;
112+
void precalc_first()override {}
113113
void expand()override {}
114114
void precalc_last()override {}
115115
void map_nodes()override {}
@@ -134,6 +134,7 @@ class DEV_SUBCKT_PROTO : public DEV_SUBCKT {
134134
} pp;
135135
DISPATCHER<CARD>::INSTALL d1(&device_dispatcher, "X|subckt", &pp);
136136
/*--------------------------------------------------------------------------*/
137+
#if 0
137138
void DEV_SUBCKT_PROTO::precalc_first()
138139
{
139140
BASE_SUBCKT::precalc_first();
@@ -155,6 +156,7 @@ void DEV_SUBCKT_PROTO::precalc_first()
155156
}
156157
}
157158
}
159+
#endif
158160
/*--------------------------------------------------------------------------*/
159161
DEV_SUBCKT_PROTO::DEV_SUBCKT_PROTO(const DEV_SUBCKT_PROTO& p)
160162
:DEV_SUBCKT(p)

d_trln.cc

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,7 @@ bool COMMON_TRANSLINE::operator==(const COMMON_COMPONENT& x)const
224224
/*--------------------------------------------------------------------------*/
225225
void COMMON_TRANSLINE::set_param_by_index(int I, std::string& Value, int Offset)
226226
{
227-
trace3("spbn", I, Value, COMMON_TRANSLINE::param_count() - 1 - I);
228-
switch (COMMON_TRANSLINE::param_count() - 1 - I) {
227+
switch (I) {
229228
case 0: len = Value; break;
230229
case 1: R = Value; break;
231230
case 2: L = Value; break;
@@ -236,14 +235,14 @@ void COMMON_TRANSLINE::set_param_by_index(int I, std::string& Value, int Offset)
236235
case 7: f = Value; break;
237236
case 8: nl = Value; break;
238237
case 9: alpha = Value; break;
239-
default: COMMON_COMPONENT::set_param_by_index(I, Value, Offset); break;
238+
default: COMMON_COMPONENT::set_param_by_index(I-10, Value, Offset+10); break;
240239
}
241240
//BUG// does not print IC
242241
}
243242
/*--------------------------------------------------------------------------*/
244243
bool COMMON_TRANSLINE::param_is_printable(int I)const
245244
{ untested();
246-
switch (COMMON_TRANSLINE::param_count() - 1 - I) {
245+
switch (I) {
247246
case 0: return len.has_hard_value();
248247
case 1: return R.has_hard_value();
249248
case 2: return L.has_hard_value();
@@ -254,7 +253,7 @@ bool COMMON_TRANSLINE::param_is_printable(int I)const
254253
case 7: return f.has_hard_value();
255254
case 8: return nl.has_hard_value();
256255
case 9: return alpha.has_hard_value();
257-
default: return COMMON_COMPONENT::param_is_printable(I);
256+
default: return COMMON_COMPONENT::param_is_printable(I-10);
258257
}
259258
//BUG// does not print IC
260259
#if 0
@@ -270,7 +269,7 @@ bool COMMON_TRANSLINE::param_is_printable(int I)const
270269
/*--------------------------------------------------------------------------*/
271270
std::string COMMON_TRANSLINE::param_name(int I)const
272271
{
273-
switch (COMMON_TRANSLINE::param_count() - 1 - I) {
272+
switch (I) {
274273
case 0: return "len";
275274
case 1: return "r";
276275
case 2: return "l";
@@ -281,7 +280,7 @@ std::string COMMON_TRANSLINE::param_name(int I)const
281280
case 7: return "f";
282281
case 8: return "nl";
283282
case 9: return "alpha";
284-
default: return COMMON_COMPONENT::param_name(I);
283+
default: return COMMON_COMPONENT::param_name(I-10);
285284
}
286285
//BUG// does not print IC
287286
}
@@ -290,23 +289,23 @@ std::string COMMON_TRANSLINE::param_name(int I, int j)const
290289
{
291290
if (j == 0) {
292291
return param_name(I);
293-
}else if (I >= COMMON_COMPONENT::param_count()) {
294-
switch (COMMON_TRANSLINE::param_count() - 1 - I) {
292+
}else if (I < 10) {
293+
switch (I) {
295294
case 5: return (j==1) ? "z" : (j==2) ? "zo" : "";
296295
case 6: return (j==1) ? "d" : (j==2) ? "delay" : "";
297296
case 7: return (j==1) ? "freq" : "";
298297
case 9: return (j==1) ? "alpha" : "";
299298
default: return "";
300299
}
301300
}else{ untested();
302-
return COMMON_COMPONENT::param_name(I, j);
301+
return COMMON_COMPONENT::param_name(I-10, j);
303302
}
304303
//BUG// does not print IC
305304
}
306305
/*--------------------------------------------------------------------------*/
307306
std::string COMMON_TRANSLINE::param_value(int I)const
308307
{ untested();
309-
switch (COMMON_TRANSLINE::param_count() - 1 - I) {
308+
switch (I) {
310309
case 0: return len.string();
311310
case 1: return R.string();
312311
case 2: return L.string();
@@ -317,7 +316,7 @@ std::string COMMON_TRANSLINE::param_value(int I)const
317316
case 7: return f.string();
318317
case 8: return nl.string();
319318
case 9: return alpha.string();
320-
default: return COMMON_COMPONENT::param_value(I);
319+
default: return COMMON_COMPONENT::param_value(I-10);
321320
}
322321
//BUG// does not print IC
323322
}

include/logic.v

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ simulator lang=spice
4646
.model qucs_logic logic ( delay= 1n rise= 1n fall= 1n rs= 100. rw= 1.G
4747
+ thh= 0.9 thl= 0.1 mr= 5. mf= 5. over=10k vmax=1 vmin= 0. )
4848
******************************************************************************
49-
.list
5049
.verilog
5150
module AND(y, a, b);
5251
parameter V=1;

lang_qucs.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ void LANG_QUCSATOR::print_command(OMSTREAM& o, const DEV_DOT* x)
848848
void LANG_QUCSATOR::print_args(OMSTREAM& o, const MODEL_CARD* x)
849849
{
850850
assert(x);
851-
for (int ii = x->param_count() - 1; ii >= x->param_count_dont_print(); --ii) {
851+
for (int ii = 0; ii < x->param_count(); ++ii) {
852852
if (x->param_is_printable(ii)) {
853853
o << " " << x->param_name(ii) <<"=\""<<x->param_value(ii);
854854
o << "\"";
@@ -867,7 +867,7 @@ void LANG_QUCSATOR::print_args(OMSTREAM& o, const COMPONENT* x)
867867
{
868868
assert(x);
869869
o << ' ';
870-
for (int ii = x->param_count() - 1; ii >= x->param_count_dont_print(); --ii) {
870+
for (int ii = 0; ii < x->param_count(); ++ii) {
871871
if (x->param_is_printable(ii)) {
872872
if ((ii != x->param_count() - 1) || (x->param_name(ii) != x->value_name())) {
873873
// skip name if plain value

lang_spice.cc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -821,16 +821,16 @@ void LANG_SPICE_BASE::print_command(OMSTREAM& o, const DEV_DOT* x)
821821
/*--------------------------------------------------------------------------*/
822822
/*--------------------------------------------------------------------------*/
823823
void LANG_SPICE_BASE::print_args(OMSTREAM& o, const MODEL_CARD* x)
824-
{ untested();
824+
{
825825
assert(x);
826-
if (x->use_obsolete_callback_print()) { untested();
826+
if (x->use_obsolete_callback_print()) {
827827
x->print_args_obsolete_callback(o, this); //BUG//callback//
828-
}else{ untested();
829-
for (int ii = x->param_count() - 1; ii >= x->param_count_dont_print(); --ii) { untested();
830-
if (x->param_is_printable(ii)) { untested();
828+
}else{
829+
for (int ii = 0; ii < x->param_count()-x->param_count_dont_print(); ++ii) {
830+
if (x->param_is_printable(ii)) {
831831
std::string arg = " " + x->param_name(ii) + "=" + x->param_value(ii);
832832
o << arg;
833-
}else{ untested();
833+
}else{
834834
}
835835
}
836836
}
@@ -857,12 +857,12 @@ void LANG_SPICE_BASE::print_args(OMSTREAM& o, const COMPONENT* x)
857857
{
858858
assert(x);
859859
o << ' ';
860-
if (x->use_obsolete_callback_print()) { untested();
860+
if (x->use_obsolete_callback_print()) {
861861
x->print_args_obsolete_callback(o, this); //BUG//callback//
862862
}else{
863-
for (int ii = x->param_count() - 1; ii >= x->param_count_dont_print(); --ii) {
863+
for (int ii = 0; ii < x->param_count()-x->param_count_dont_print(); ++ii) {
864864
if (x->param_is_printable(ii)) {
865-
if ((ii != x->param_count() - 1) || (x->param_name(ii) != x->value_name())) { untested();
865+
if ((ii != 0) || (x->param_name(ii) != x->value_name())) {
866866
// skip name if plain value
867867
o << " " << x->param_name(ii) << "=";
868868
}else{

0 commit comments

Comments
 (0)