-
Notifications
You must be signed in to change notification settings - Fork 77
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
For something like an async reset flop, it will trigger sampling on posedge reset
but there will be an if(reset)
within the sequential logic. In this case, the value of reset
for computation should be 1
, but instead Sequential
treats it like any other signal and finds the "previous" value before the edge and finds 0
. This is improper modelling for asynchronous reset, and other use cases that follow a similar pattern.
To Reproduce
test('async reset samples correct reset value', () async {
final clk = Logic();
final reset = Logic();
final val = Logic();
reset.inject(0);
clk.inject(0);
Sequential.multi(
[clk, reset],
reset: reset,
[
val < 1,
],
);
Simulator.registerAction(10, () {
clk.inject(1);
});
Simulator.registerAction(14, () {
reset.inject(1);
});
Simulator.registerAction(15, () {
expect(val.value.toInt(), 0);
});
await Simulator.run();
});
Expected behavior
If a signal is a trigger that triggered that event change, it should be that value for execution consideration.
Actual behavior
Triggers and non-triggers are treated the same way.
Additional: Dart SDK info
No response
Additional: pubspec.yaml
No response
Additional: Context
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working