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

Gated counter and toggle gate #111

Merged
merged 57 commits into from
Nov 20, 2024
Merged

Gated counter and toggle gate #111

merged 57 commits into from
Nov 20, 2024

Conversation

mkorbel1
Copy link
Contributor

Description & Motivation

Introduces two new components:

  • A ToggleGate which helps avoid toggles on combinational hardware when it's not necessary
  • A GatedCounter which partitions the flops into two groups and clock gates them independently as needed

Related Issue(s)

Found intel/rohd#516 during development of random tests on the GatedCounter

Testing

Lots of unit tests and random tests

Backwards-compatibility

Is this a breaking change that will not be backwards-compatible? If yes, how so?

No

Documentation

Does the change require any updates to documentation? If so, where? Are they included?

Yes, needs API docs and component docs

@mkorbel1 mkorbel1 requested a review from desmonddak October 22, 2024 16:46
The `ToggleGate` component is intended to help save power by avoiding unnecessary toggles through combinational logic. It accomplishes this by flopping the previous value of data and muxing the previous value to the `gatedData` output if the `enable` is low. By default, the flops within the `ToggleGate` are also clock gated for extra power savings, but it can be controlled via a `ClockGateControlInterface`.

As an example use case, if you have a large arithmetic unit but only care about the result when a `valid` bit is high, you could use a `ToggleGate` so that the inputs to that combinational logic do not change unless `valid` is high.

Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be an interface?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

can you elaborate? what do you mean?

Copy link
Contributor

@desmonddak desmonddak left a comment

Choose a reason for hiding this comment

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

Only a few comments, mostly questions as to new things I learned from this code (like @VisibleForTesting).

@mkorbel1 mkorbel1 merged commit d8d72f8 into intel:main Nov 20, 2024
4 checks passed
@mkorbel1 mkorbel1 deleted the gated_counter branch November 20, 2024 16:54
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.

2 participants