-
Notifications
You must be signed in to change notification settings - Fork 299
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
Update dialect overview diagram #2072
Conversation
Seeing as quite a few new dialects and conversions have entered CIRCT since this diagram was made, I think it's due for an update! Let me know what you think, and if you have anything you'd like to have added/removed.
This is extremely timely. I'm going to suck this into the CIRCT keynote at the devmtg in two weeks :-) |
One node that could be added is "CHIRRTL" which is the predecessor the High FIRRTL. The FIR Parser can produce all of CHIRRTL, High, Mid, and Low FIRRTL. |
From a FIRRTL perspective:
updated: We are missing a some dialects: Fabian has some notes about some changes to LLHD. |
How about basing this on a From something like the following: Digraph G {
// MLIR dialects
subgraph cluster_mlir {
label = "Upstream MLIR";
SCF [fillcolor="lightblue"]
Standard [fillcolor="lightblue"]
Arith [fillcolor="lightblue"]
}
// ===== Nodes =====
subgraph cluster_circt {
label = "CIRCT"
// CIRCT dialects
Calyx
Handshake
FIRRTL
BLLHD [label="Behavioral LLHD"]
...
// Internal tools
EmitVerilog [fillcolor="darksalmon"]
FIRRTLParser [label="FIRRTL Parser" fillcolor="darksalmon"]
Scheduling [fillcolor="darksalmon"]
}
// External tools
Moore [shape=octagon fillcolor="gold"]
...
// File formats
FIRFile [label="FIR file" fillcolor="yellowgreen" shape=note]
...
// ===== Connections =====
// Dialect conversions
SCF -> Calyx
SCF -> StaticLogic [style=dashed]
Handshake -> FIRRTL
BLLHD -> SLLHD
...
// Tool flows
Scheduling -> StaticLogic [dir=both]
FIRFile -> FIRRTLParser
FIRRTLParser -> FIRRTL
FIRRTL -> EmitVerilog
...
}
``` |
I don't mind the graphviz output, though it is messier. Manually placing some of the nodes could make it clearer (IIRC graphviz supports X/Y coordinates). I don't much care if we move to graphviz. Is it possible to add a legend to the graphviz diagram? That's important. Notes:
|
Also, using 'ortho splines' mode would better match the previous image: https://graphviz.org/docs/attrs/splines/ |
Quick comment:
|
I think a refresh is great in general, and I support checking in a .dot file as well as the rendered diagram. One quick note on the Scheduling + StaticLogic side: we are moving towards doing the scheduling based on Affine dialect rather than SCF, since upstream tools provide the level of detail scheduling needs only for Affine out of the box. So that would be a dotted line from Affine to StaticLogic. We may do progressive lowering through SCF internally, or we may just created the pipeline directly from Affine. I'll leave it to @maerhart and @fabianschuiki to drill into the LLHD parts, but my impression is that work is moving away from converting to the LLHD dialect, and instead supporting the core dialects in the simulator directly. |
Thank you for the inputs, I've tried to update the diagram accordingly. @teqdruid I'll try to work in a legend; it's quite tricky to do directly in GraphViz without messing up the layout... but I'm thinking that we can just embed an image of the legend inside a node somewhere. Regarding using ortho lines, I'd say it yields worse results that the other possible spline types: Another interesting possibility with this diagram is to embed links on both nodes (link to Dialect docs) and edges (link to conversion pass), providing a visual way of navigating the proejct. |
Yep -- ortho is ugly. Can you push your dot file? I'd like to use a modified version in some slides I'm prepping now. |
Thanks for the dot! I also think that PyCDE deserves a mention as a frontend which is in active development and about to be in use. It can theoretically produce any dialect but HW, Comb, Seq, MSFT are the ones it currently targets with ESI planned. |
Thanks for updating this @mortbopet! And @mikeurbach is right: @maerhart has been removing a lot of ops from LLHD in favor of the core dialects. "Structural LLHD" and "Behavioural LLHD" are now basically just "LLHD", and the simulator takes in a mixture of HW/Comb/Seq and LLHD. |
3686df3
to
5f2efd5
Compare
docs/dialects.dot
Outdated
PyCDE -> HW | ||
PyCDE -> Comb | ||
PyCDE -> Seq | ||
PyCDE -> LLHD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PyCDE doesn't directly produce LLHD... though it'd be interesting to expose some of LLHD's timing constructs through PyCDE.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you prefer a dotted edge between PyCDE and LLHD, or no edge? I guess there's also a danger in adding hypothetical edges all over, cluttering up the graph 🤔.
Regarding the legend, i think the best looking choice will be to just have it as a separate image above the generated image. Trying to embed it into the dot file seems to be messing too much with the layout engine. |
Color nit: I would like to use "better" colors for this. In the past, I've used Colorbrewer as I didn't trust myself to pick good colors. For four colors that are print friendly and colorblind safe, we could use: There are more options if we don't need to be colorblind safe, e.g.: Or: |
Purely for reference, below is the graphviz I've used for this previously. This is a cartoon compared to what you're showing here, however! This is also a very Chisel-centric view. One approach that may compact things further is to use sub-clusterings and have arrows start/stop at the cluster boundary. This may hurt accuracy, which I feel is important with this diagram, here as opposed to the cartoon I've used to explain the project. (You can see an example of this in the graphviz below.) graphviz source
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks awesome.
Some nits about how to DRY out the graphviz. 😄
7f6d99c
to
ff2545e
Compare
@seldridge thank you for the tips! I've incorporated it into the preview at the top 👍 . |
This is looking really great to me |
} | ||
|
||
subgraph cluster_circt { | ||
label = "CIRCT" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A labeljust="r"
would get this out of the way of the SCF/Arith arrows.
I omitted the CIRCT box in the diagrams I modified for my talk, instead
putting non-CIRCT stuff in boxes. It made the diagram significantly better.
…On Fri, Nov 5, 2021 at 10:52 AM Schuyler Eldridge ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In docs/dialects.dot
<#2072 (comment)>:
> + ranksep=0.5 // vertical compression
+ compound=true
+
+ // MLIR dialects
+ subgraph cluster_mlir {
+ label = "Upstream MLIR";
+ node [fillcolor="#beaed4"]
+ SCF Affine
+ subgraph cluster_std_arith_dialect {
+ label = ""
+ Standard Arith
+ }
+ }
+
+ subgraph cluster_circt {
+ label = "CIRCT"
A labeljust="r" would get this out of the way of the SCF/Arith arrows.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2072 (review)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALNXYGU2KP2WG72GJKSBADUKQRX7ANCNFSM5HG4I2OQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
@teqdruid I agree that the CIRCT box might not be necessary and constrains the layout too much... but i do think we loose a bit on distinguishing what is part of CIRCT and what is not. What did you put in those non-circt boxes? A well defined box could be fir/chisel/py/.sv.vhd/moore but other than that, boxes seem to constrain the layout too heavily. |
@mortbopet the diagram @teqdruid is referring to is much more abstract than what you are working on here. See below for what we included in the talk. I do agree that removing the CIRCT box could help with layout. For the diagram we are discussing here, what if we removed the CIRCT box, and added some invisible edges to try to help line up the layout? That's what I did for the below diagram from the same talk. There are invisible edges from both Standard and SCF to Scheduling. It's still more abstract than what you are doing here, but I think the same idea holds. |
the dot format does allow specifying x, y coordinates instead of invisible
edges.
…On Mon, Nov 8, 2021 at 11:27 AM mikeurbach ***@***.***> wrote:
@mortbopet <https://github.com/mortbopet> the diagram @teqdruid
<https://github.com/teqdruid> is referring to is much more abstract than
what you are working on here. See below for what we included in the talk.
[image: Screenshot from 2021-11-08 12-22-43]
<https://user-images.githubusercontent.com/1182100/140804690-65c7c655-8709-4712-afd2-c4d6ec5f0590.png>
I do agree that removing the CIRCT box could help with layout. For the
diagram we are discussing here, what if we removed the CIRCT box, and added
some invisible edges to try to help line up the layout? That's what I did
for the below diagram from the same talk. There are invisible edges from
both Standard and SCF to Scheduling. It's still more abstract than what you
are doing here, but I think the same idea holds.
[image: Screenshot from 2021-11-08 12-26-07]
<https://user-images.githubusercontent.com/1182100/140804978-54117607-e5ae-46d5-989a-9472cb61ad62.png>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2072 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALNXYGBFYARPB5ASEFDQDTULAQDPANCNFSM5HG4I2OQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Since several of us are now using this dot based diagram in talks, can we merge this PR? I think it is already a great starting point. |
Fine by me; i think the current version is fine as well - if someone wants to spend some time on manually layout'ing it by adding coordinates, i am not opposed to that either (that will -most likely- not be me, though 😉). |
@mortbopet do you have commit access or need help landing this? |
@lattner i do; merged it for now and then we'll take it from there. |
Seeing as quite a few new dialects and conversions have entered CIRCT since this diagram was made, I think it's due for an update! Let me know what you think, and if you have anything you'd like to have added/removed.
note: I'll keep the below preview updated wrt. feedback in the comments.