Skip to content

Commit

Permalink
Merge pull request #217 from in3otd/issue_216
Browse files Browse the repository at this point in the history
Corrected netlist generation for disabled (shorted) components.
  • Loading branch information
yodalee committed Apr 16, 2015
2 parents 45cfdaa + d3118b7 commit f6f3da2
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions qucs/qucs/components/component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -639,11 +639,13 @@ QString Component::getNetlist()

// Component is shortened.
int z=0;
QString s;
QString Node1 = Ports.first()->Connection->Name;
foreach(Port *pp, Ports)
QListIterator<Port *> iport(Ports);
Port *pp = iport.next();
QString Node1 = pp->Connection->Name;
QString s = "";
while (iport.hasNext())
s += "R:" + Name + "." + QString::number(z++) + " " +
Node1 + " " + pp->Connection->Name + " R=\"0\"\n";
Node1 + " " + iport.next()->Connection->Name + " R=\"0\"\n";
return s;
}

Expand All @@ -664,11 +666,12 @@ QString Component::get_Verilog_Code(int NumPorts)
}

// Component is shortened.
Port *p = Ports.first();
QString Node1 = p->Connection->Name;
QListIterator<Port *> iport(Ports);
Port *pp = iport.next();
QString Node1 = pp->Connection->Name;
QString s = "";
foreach(Port *p, Ports)
s += " assign " + p->Connection->Name + " = " + Node1 + ";\n";
while (iport.hasNext())
s += " assign " + iport.next()->Connection->Name + " = " + Node1 + ";\n";
return s;
}

Expand Down

0 comments on commit f6f3da2

Please sign in to comment.