Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve implementation of Freeze and Release #3829

Open
ktbarrett opened this issue Apr 7, 2024 · 0 comments
Open

Improve implementation of Freeze and Release #3829

ktbarrett opened this issue Apr 7, 2024 · 0 comments
Labels
category:codebase:handle relating to handles or handle types (BinaryValue) type:bug a bug in existing functionality

Comments

@ktbarrett
Copy link
Member

Currently, these actions are implemented using the same mechanism as regular value sets. They first sample the current value and then use then as the value in their "set". This overwrites other explicit writes with the implicit write the implementation does. This is surprising behavior and should be avoided.

If you update a value and then immediately do a Freeze, it will freeze the current simulator value, not the value just scheduled.

# dut.signal.value == 10
dut.signal.value = 12
dut.signal.value = Freeze()
await Timer(...)
assert dut.signal.value == 12  # will always fail

Or if you do a Force followed immediately followed by a Release you get the same issue

# dut.signal.value == 10
dut.signal.value = Force(12)
dut.signal.value = Release()
await Timer(...)
assert dut.signal.value == 12  # will always fail
@ktbarrett ktbarrett added type:bug a bug in existing functionality category:codebase:handle relating to handles or handle types (BinaryValue) labels Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:codebase:handle relating to handles or handle types (BinaryValue) type:bug a bug in existing functionality
Projects
None yet
Development

No branches or pull requests

1 participant