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

Add attributes for components and implement counter_fsm attribute #453

Merged
merged 13 commits into from
Sep 4, 2024

Conversation

UnsignedByte
Copy link
Collaborator

Adds the language capability for component level attributes, implementing #299.

Currently adds one attribute, slow_fsms=n telling the compilation pass to use slow counter based FSMs with N states per count. Requires that n divides the II of the component.

This currently has a few implementation details and limitations that need to be discussed:

  • This is only available at the component level, so this does not allow us to generate different types of FSMs for different events.
  • The delay of a slow FSM must divide the II of the event (in multi event components this means it must divide the GCD), there is not a really nice way to detect this sort of issue.
  • 0 is currently used to specify simple FSMs.
  • The attribute is now added automatically by a pass rather than decided at compile time, which subscribes it to the same limitations as everything else.

As a proof of concept, this also adds the #[counter_fsm] attribute, which allows the user to specify whether an attribute instantiates a counter fsm or not.

@UnsignedByte UnsignedByte linked an issue Sep 4, 2024 that may be closed by this pull request
@UnsignedByte UnsignedByte changed the title Add attributes for components and implement toplevel and counter_fsm attributes Add attributes for components and implement counter_fsm attribute Sep 4, 2024
@UnsignedByte UnsignedByte merged commit c5e18c3 into main Sep 4, 2024
4 checks passed
@UnsignedByte UnsignedByte deleted the comp-attributes branch September 4, 2024 18:55
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.

Attributes for components
1 participant