Non-synthesizable APIs such as posedge or value depend on the result of packed to compute their value. This is generally accurate, but has two major downsides:
Calling packed creates and connects a new signal. If a testbench calls packed (directly or indirectly) on a signal within a Module, it will generate some additional hardware (though it won't have any functional impact).
The previousValue will be null the first time it is called since packed is lazily initialized. This can cause surprising testbench failures.
To Reproduce
Call previousValue on a LogicStructure and observe that it is null.
Expected behavior
The APIs should not have side effects of creating hardware (even without functional impact) and should be functional in the same way as Logic.
Describe the bug
Non-synthesizable APIs such as
posedge
orvalue
depend on the result ofpacked
to compute their value. This is generally accurate, but has two major downsides:packed
creates and connects a new signal. If a testbench callspacked
(directly or indirectly) on a signal within aModule
, it will generate some additional hardware (though it won't have any functional impact).previousValue
will benull
the first time it is called sincepacked
is lazily initialized. This can cause surprising testbench failures.To Reproduce
Call
previousValue
on aLogicStructure
and observe that it isnull
.Expected behavior
The APIs should not have side effects of creating hardware (even without functional impact) and should be functional in the same way as
Logic
.Actual behavior
No response
Additional: Dart SDK info
No response
Additional: pubspec.yaml
No response
Additional: Context
No response