Get delays of signed extended continuous assignments right.
Padding and continuous assignment caused problems if the continuous assignment includes a delay. The problem is that the padding was not necessarily included in the delay. Rework the elaboration to make sure the padding is indeed included in the delay.
This commit is contained in:
parent
db851c235f
commit
f1f2806e3c
|
|
@ -279,8 +279,13 @@ void NetCompare::dump_node(ostream&o, unsigned ind) const
|
|||
void NetConcat::dump_node(ostream&o, unsigned ind) const
|
||||
{
|
||||
o << setw(ind) << "" << "NetConcat: "
|
||||
<< name()
|
||||
<< " scope=" << scope_path(scope())
|
||||
<< name();
|
||||
if (rise_time())
|
||||
o << " #(" << *rise_time()
|
||||
<< "," << *fall_time() << "," << *decay_time() << ")";
|
||||
else
|
||||
o << " #(0,0,0)";
|
||||
o << " scope=" << scope_path(scope())
|
||||
<< " width=" << width_ << endl;
|
||||
dump_node_pins(o, ind+4);
|
||||
dump_obj_attr(o, ind+4);
|
||||
|
|
@ -302,7 +307,10 @@ void NetMult::dump_node(ostream&o, unsigned ind) const
|
|||
|
||||
void NetPow::dump_node(ostream&o, unsigned ind) const
|
||||
{
|
||||
o << setw(ind) << "" << "LPM_POW (NetPow): " << name() << endl;
|
||||
o << setw(ind) << "" << "LPM_POW (NetPow): " << name()
|
||||
<< " scope=" << scope_path(scope())
|
||||
<< " delay=(" << *rise_time() << "," << *fall_time() << ","
|
||||
<< *decay_time() << ")" << endl;
|
||||
dump_node_pins(o, ind+4);
|
||||
dump_obj_attr(o, ind+4);
|
||||
}
|
||||
|
|
@ -457,7 +465,9 @@ void NetPartSelect::dump_node(ostream&o, unsigned ind) const
|
|||
break;
|
||||
}
|
||||
o << setw(ind) << "" << "NetPartSelect(" << pt << "): "
|
||||
<< name() << " off=" << off_ << " wid=" << wid_ <<endl;
|
||||
<< name() << " #(" << rise_time()
|
||||
<< "," << fall_time() << "," << decay_time() << ") "
|
||||
<< " off=" << off_ << " wid=" << wid_ <<endl;
|
||||
dump_node_pins(o, ind+4);
|
||||
dump_obj_attr(o, ind+4);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ void PGAssign::elaborate(Design*des, NetScope*scope) const
|
|||
generated NetNet. */
|
||||
NetNet*rval = pin(1)->elaborate_net(des, scope,
|
||||
lval->vector_width(),
|
||||
rise_time, fall_time, decay_time,
|
||||
0, 0, 0,
|
||||
drive0, drive1);
|
||||
if (rval == 0) {
|
||||
cerr << get_fileline() << ": error: Unable to elaborate r-value: "
|
||||
|
|
@ -311,6 +311,12 @@ void PGAssign::elaborate(Design*des, NetScope*scope) const
|
|||
rval = osig;
|
||||
}
|
||||
|
||||
/* If there is a rise/fall/decay time, then attach that delay
|
||||
to the drivers for this net. */
|
||||
if (rise_time || fall_time || decay_time) {
|
||||
rval->pin(0).drivers_delays(rise_time, fall_time, decay_time);
|
||||
}
|
||||
|
||||
connect(lval->pin(0), rval->pin(0));
|
||||
|
||||
if (lval->local_flag())
|
||||
|
|
|
|||
18
net_link.cc
18
net_link.cc
|
|
@ -101,6 +101,11 @@ Link::DIR Link::get_dir() const
|
|||
return dir_;
|
||||
}
|
||||
|
||||
void Link::drivers_delays(NetExpr*rise, NetExpr*fall, NetExpr*decay)
|
||||
{
|
||||
nexus_->drivers_delays(rise, fall, decay);
|
||||
}
|
||||
|
||||
void Link::drive0(Link::strength_t str)
|
||||
{
|
||||
drive0_ = str;
|
||||
|
|
@ -245,6 +250,19 @@ verinum::V Nexus::get_init() const
|
|||
return verinum::Vz;
|
||||
}
|
||||
|
||||
void Nexus::drivers_delays(NetExpr*rise, NetExpr*fall, NetExpr*decay)
|
||||
{
|
||||
for (Link*cur = list_ ; cur ; cur = cur->next_) {
|
||||
if (cur->get_dir() != Link::OUTPUT)
|
||||
continue;
|
||||
|
||||
NetObj*obj = cur->get_obj();
|
||||
obj->rise_time(rise);
|
||||
obj->fall_time(fall);
|
||||
obj->decay_time(decay);
|
||||
}
|
||||
}
|
||||
|
||||
void Nexus::unlink(Link*that)
|
||||
{
|
||||
if (name_) {
|
||||
|
|
|
|||
|
|
@ -148,6 +148,9 @@ class Link {
|
|||
void set_dir(DIR d);
|
||||
DIR get_dir() const;
|
||||
|
||||
// Set the delay for all the drivers to this nexus.
|
||||
void drivers_delays(NetExpr*rise, NetExpr*fall, NetExpr*decay);
|
||||
|
||||
// A link has a drive strength for 0 and 1 values. The drive0
|
||||
// strength is for when the link has the value 0, and drive1
|
||||
// strength is for when the link has a value 1.
|
||||
|
|
@ -255,6 +258,8 @@ class Nexus {
|
|||
const char* name() const;
|
||||
verinum::V get_init() const;
|
||||
|
||||
void drivers_delays(NetExpr*rise, NetExpr*fall, NetExpr*decay);
|
||||
|
||||
Link*first_nlink();
|
||||
const Link* first_nlink()const;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue