Insert drivers for undriven nets
Trying to add a drive strength or delay to a undriven net will result in an assertion. Make sure that a driver is added to undriven nets. A driver is already added for all NetESignals, which covers most expression that can produce a raw net rvalue. But there are other ways we can end up with just a net as the rvalue, e.g. when applying a sign cast to a net. The following example triggers the issue ``` wire [7:0] a; wire [7:0] b = $signed(a); ``` Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
parent
74c52d6fa1
commit
d97c1bc6db
|
|
@ -185,7 +185,7 @@ void PGAssign::elaborate(Design*des, NetScope*scope) const
|
||||||
// expression. In this case, we will need to create a driver
|
// expression. In this case, we will need to create a driver
|
||||||
// (later) to carry strengths.
|
// (later) to carry strengths.
|
||||||
bool need_driver_flag = false;
|
bool need_driver_flag = false;
|
||||||
if (dynamic_cast<NetESignal*>(rval_expr))
|
if (dynamic_cast<NetESignal*>(rval_expr) ||!rval->is_linked())
|
||||||
need_driver_flag = true;
|
need_driver_flag = true;
|
||||||
|
|
||||||
// expression elaboration should have caused the rval width to
|
// expression elaboration should have caused the rval width to
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue