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

[Seq] Merge seq lowerings #5639

Open
mortbopet opened this issue Jul 20, 2023 · 2 comments
Open

[Seq] Merge seq lowerings #5639

mortbopet opened this issue Jul 20, 2023 · 2 comments
Labels
Seq Involving the `seq` dialect

Comments

@mortbopet
Copy link
Contributor

We currently have a lot of seq dialect lowerings. Some of these are probably warranted (i.e. targets different lower-level abstractions than the others), some can probably be merged.

      --lower-seq-fifo                                             -   Lower seq.fifo ops
      --lower-seq-firmem                                           -   Lower seq.firmem ops to instances of hw.module.generated ops
      --lower-seq-firrtl-init-to-sv                                -   Prep the module with macro definitions for firrtl registers.
      --lower-seq-firrtl-to-sv                                     -   Lower sequential firrtl ops to SV.
      --lower-seq-hlmem                                            -   Lowers seq.hlmem operations.
      --lower-seq-to-sv                                            -   Lower sequential ops to SV.

I'd expect a merging of:

  • lower-seq-fifo, lower-seq-hlmem, lower-seq-firmem - either lowers Seq ops to other seq ops or hw ops
  • lower-seq-to-sv, lower-seq-firrtl-to-sv, lower-seq-firrtl-init-to-sv - lowers (presumably) as low-level-as-possible-seq to sv.

Somewhat also pertains to #5463 (@fabianschuiki).

@mortbopet mortbopet added the Seq Involving the `seq` dialect label Jul 20, 2023
@fabianschuiki
Copy link
Contributor

This is a great idea! I did a quick attempt at merging some of this a while ago, but that didn't go very far. But it looks like internally these passes are a combination of the dialect conversion framework and global passes over the IR. We should be able to create a pass that does a global sweep over the IR to collect the important stuff, then do a more localized lowering where all the dialect conversion stuff is also called.

@fabianschuiki
Copy link
Contributor

Maybe we should move this into Conversions and create SeqToHW and SeqToSV lowerings as you suggest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Seq Involving the `seq` dialect
Projects
None yet
Development

No branches or pull requests

2 participants