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

[LLHD] Remove RegOp #7508

Merged
merged 1 commit into from
Aug 11, 2024
Merged

[LLHD] Remove RegOp #7508

merged 1 commit into from
Aug 11, 2024

Conversation

maerhart
Copy link
Member

LLHD's reg operation dates back to when the seq dialect was not a thing yet. It has the disadvantage that

  • it only works with inout values
  • while it can model all kinds of registers and latches you can think of, more than is actually used/necessary in practice, it is very complicated to work with

Instead of having this operation, we can

  • use the seq registers
  • if we need to work with inout values, we can continuously drive the seq register output to the signal with an additional llhd.drv operation
  • If some state element occurs frequently for which we don't have an operation in the seq dialect, we can add one there specifically for that kind of element (e.g., a latch?)
  • the lllhd.reg operation can specify triggers with different clocks. The most common case are async resets which we also support in the seq dialect. Other, more weird constructs could also just be left in the llhd.process based representation. We need to support them in simulation and verilog export anyway. Alternatively, we could also decompose it to the bare logic gates with feedback loops directly, don't know why that would be necessary though.

Please let me know what you think about this. Maybe I'm missing something.

Copy link
Contributor

@fabianschuiki fabianschuiki left a comment

Choose a reason for hiding this comment

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

Love this! I totally agree that the original register wad way too generic to be of practical use. Using the Seq dialect instead is a great idea. It also gets us away from operating on signals, which should be a lot easier 🙂.

Base automatically changed from maerhart-llhd-test-cleanup to main August 11, 2024 15:38
@maerhart maerhart force-pushed the maerhart-llhd-remove-regop branch from 7770c97 to f3387df Compare August 11, 2024 15:48
@maerhart maerhart merged commit 08fd04f into main Aug 11, 2024
4 checks passed
@maerhart maerhart deleted the maerhart-llhd-remove-regop branch August 11, 2024 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants