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

Update dialect overview diagram #2072

Merged
merged 12 commits into from
Dec 10, 2021
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 123 additions & 0 deletions docs/dialects.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
Digraph G {
// Note: Remember to run the circt/utils/update-docs-dialects.sh script after
// modifying this file to regenerate the .svg and .png renders of the graph.
rankdir = TB
splines=spline;
node [shape=box style=filled fillcolor="white"]
nodesep=0.2 // horizontal compression
ranksep=0.5 // vertical compression

// MLIR dialects
subgraph cluster_mlir {
label = "Upstream MLIR";
SCF [fillcolor="lightblue"]
Standard [fillcolor="lightblue"]
Arith [fillcolor="lightblue"]
Affine [fillcolor="lightblue"]
}
mortbopet marked this conversation as resolved.
Show resolved Hide resolved

// ===== Nodes =====

subgraph cluster_circt {
label = "CIRCT"
Copy link
Member

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.

// CIRCT dialects
Calyx [URL="https://circt.llvm.org/docs/Dialects/Calyx/"]
Handshake [URL="https://circt.llvm.org/docs/Dialects/Handshake/"]
FIRRTL [URL="https://circt.llvm.org/docs/Dialects/FIRRTL/"]
LLHD [URL="https://circt.llvm.org/docs/Dialects/LLHD/"]
HW [URL="https://circt.llvm.org/docs/Dialects/HW/"]
SV [URL="https://circt.llvm.org/docs/Dialects/SV/"]
Comb [URL="https://circt.llvm.org/docs/Dialects/Comb/"]
Seq [URL="https://circt.llvm.org/docs/Dialects/Seq/"]
StaticLogic [URL="https://circt.llvm.org/docs/Dialects/StaticLogic/"]
MSFT [URL="https://circt.llvm.org/docs/Dialects/MSFT/"]
ESI [URL="https://circt.llvm.org/docs/Dialects/ESI/"]
FSM [URL="https://circt.llvm.org/docs/Dialects/FSM/"]

// Internal tools
ExportVerilog [fillcolor="darksalmon"]
FIRRTLParser [label="FIRRTL Parser" fillcolor="darksalmon"]
Scheduling [fillcolor="darksalmon"]
llhd_sim [label="LLHD Sim" fillcolor="darksalmon"]
PyCDE [fillcolor="darksalmon"]
mortbopet marked this conversation as resolved.
Show resolved Hide resolved
}

// External tools
Moore [shape=octagon fillcolor="gold"]
Circilator [shape=octagon fillcolor="gold" style="dashed,filled"]
Calyx_native [label="Calyx Native" shape=octagon fillcolor="gold"]

// File formats
VCDTrace [label=".vcd" fillcolor="yellowgreen" shape=note]
CPPFile [label=".cpp" fillcolor="yellowgreen" shape=note]
SVFile [label=".sv" fillcolor="yellowgreen" shape=note]
CapNProto [label="Cap'n Proto" fillcolor="yellowgreen" shape=note]
TCL [label=".tcl" fillcolor="yellowgreen" shape=note]
FIRFile [label=".fir" fillcolor="yellowgreen" shape=note]
SVVHDL [label=".sv/.vhd" fillcolor="yellowgreen" shape=note]
PyFile [label=".py" fillcolor="yellowgreen" shape=note]
mortbopet marked this conversation as resolved.
Show resolved Hide resolved

// ===== Connections =====

// Dialect conversions
SCF -> Calyx
Affine -> StaticLogic [style=dashed]
StaticLogic -> Calyx [style=dashed]
Standard -> Calyx
Arith -> Calyx
Standard -> Handshake
Arith -> Handshake
mortbopet marked this conversation as resolved.
Show resolved Hide resolved

Handshake -> FIRRTL
Calyx -> FSM [style=dashed]
Seq -> SV
FIRRTL -> HW
FSM -> HW
ESI -> HW
MSFT -> HW
HW -> LLHD
FIRRTL->Comb
Comb -> ExportVerilog

// Tool flows
Scheduling -> StaticLogic [dir=both]
FIRFile -> FIRRTLParser
FIRRTLParser -> FIRRTL
HW -> ExportVerilog
SV -> ExportVerilog
SVVHDL -> Moore [weight=999]
Moore -> LLHD
LLHD -> Circilator [style=dashed]
HW -> Circilator [style=dashed]
Calyx -> Calyx_native
ExportVerilog -> SVFile
Circilator -> CPPFile [style=dashed]
LLHD -> llhd_sim
Comb -> llhd_sim
HW -> llhd_sim
Seq -> llhd_sim
llhd_sim -> VCDTrace
Calyx_native -> SVFile
ESI -> CapNProto
MSFT -> TCL
PyFile -> PyCDE
PyCDE -> HW
PyCDE -> Comb
PyCDE -> Seq
PyCDE -> LLHD
Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for adding it!

Copy link
Contributor Author

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 🤔.

PyCDE -> ESI [style=dashed]

// ====== Some fake edges to coerce a good layout ======
// Note: Modify these if you make changes to the above diagram, and things
// start looking weird.
Standard -> Scheduling [weight=999 style=invis]
FIRFile -> PyFile [weight=999 style=invis]
Calyx -> Calyx_native [weight=999 style=invis]
Calyx_native -> SVVHDL [weight=999 style=invis]

// Fix the following sink nodes below the CIRCT cluster
llhd_sim -> SVFile [weight=999 style=invis]
llhd_sim -> Circilator [weight=999 style=invis]
llhd_sim -> TCL [weight=999 style=invis]
llhd_sim -> CapNProto [weight=999 style=invis]
}
Loading