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:
Lars-Peter Clausen 2022-11-29 20:03:43 -08:00
parent 74c52d6fa1
commit d97c1bc6db
1 changed files with 1 additions and 1 deletions

View File

@ -185,7 +185,7 @@ void PGAssign::elaborate(Design*des, NetScope*scope) const
// expression. In this case, we will need to create a driver
// (later) to carry strengths.
bool need_driver_flag = false;
if (dynamic_cast<NetESignal*>(rval_expr))
if (dynamic_cast<NetESignal*>(rval_expr) ||!rval->is_linked())
need_driver_flag = true;
// expression elaboration should have caused the rval width to