Skip to content

Conversation

@Spooky-Firefox
Copy link
Collaborator

This PR adds the Simulator as a parameter to the unclock method of components, changing its signature to unclock(&self, sim: &Simulator). This allows components to access their inputs and outputs during the undo cycle, simplifying state management and enabling easier reversion of state when needed.

unclock is also called in the reverse order compared to clock

Additionally, when a simulator is created using new, it automatically calls reset on all components. This reset call can be used to set initial values, define signal formats, and perform any other necessary setup.

Copy link
Collaborator

@onsdagens onsdagens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can't find an implementation of this function where the simulator is not under an anonymous identifier, do we actually need the argument?

Copy link
Collaborator

@onsdagens onsdagens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we discussed this in person, it's not used as is, but is nifty to have for later. LGTM

@Spooky-Firefox Spooky-Firefox merged commit 8aaf7af into master Aug 27, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants