EPFL-LAP / dynamatic

DHLS (Dynamic High-Level Synthesis) compiler based on MLIR
Other
60 stars 18 forks source link

[Handshake] Improve assembly format of `BundleOp` and `UnbundleOp` #99

Closed lucas-rami closed 2 months ago

lucas-rami commented 3 months ago

The initial assembly format introduced as part of 9fef8a5 for the two bundling-related operations is very verbose, especially when used for channel types with extra signals. In particular, there is redundancy between the channel type and the type of the individual signals that are being bundled into or unbundled from it. There is also redundancy between the operand types and the result types; the exact handshake::ChannelType or handshake::ControlType involved in the operation is sufficient to characterize the type of all operands/results uniquely.

Below are proposed simplification examples.

// Old
%channel, %extra = bundle %ctrl, %data : (!handshake.control, i32) -> (!handshake.channel<i32, [extra: i1]>, i1)
// Proposed
%channel, %extra = bundle %ctrl, %data : ... -> !handshake.channel<i32, [extra: i1]>

// -----

// Old
%ctrl, %data = unbundle %channel [%extra] : (!handshake.channel<i32, [extra: i2 (U)]>) -> (!handshake.control, i32, i2)
// Proposed
%ctrl, %data = unbundle %channel [%extra] : !handshake.channel<i32, [extra: i2 (U)]> -> ...

Implementing the above syntax requires custom parsers/printers, as ODS won't let us specify this declaratively.

This is related to the type system redesign (#86).