-
Notifications
You must be signed in to change notification settings - Fork 305
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
[DCToHW] Pass creates invalid ESI connections #7949
Comments
Hello! I am running into the same issue, with a potentially simpler example that hopefully helps:
handshake.func @ops(%arg0: i32, %arg1: i32, %arg2: i32, %arg3: i32, %clk: i32, %rst: i32) -> (i32, none) {
%arg5 = merge %arg0, %arg1 : i32
%arg23 = join %arg5 : i32
return %arg5, %arg23: i32, none
}
module {
hw.module @ops(in %arg0 : !dc.value<i32>, in %arg1 : !dc.value<i32>, in %arg2 : !dc.value<i32>, in %arg3 : !dc.value<i32>, in %clk : !dc.value<i32>, in %rst : !dc.value<i32>, in %clk_0 : !seq.clock {dc.clock}, in %rst_0 : i1 {dc.reset}, out out0 : !dc.value<i32>, out out1 : !dc.token) {
%token, %output = dc.unpack %arg0 : !dc.value<i32>
%token_0, %output_1 = dc.unpack %arg1 : !dc.value<i32>
%0 = dc.merge %token, %token_0
%token_2, %output_3 = dc.unpack %0 : !dc.value<i1>
%1 = arith.select %output_3, %output, %output_1 : i32
%2 = dc.pack %token_2, %1 : i32
%token_4, %output_5 = dc.unpack %2 : !dc.value<i32>
%3 = dc.join %token_4
hw.output %2, %3 : !dc.value<i32>, !dc.token
}
}
module {
hw.module @ops(in %arg0 : !dc.value<i32>, in %arg1 : !dc.value<i32>, in %arg2 : !dc.value<i32>, in %arg3 : !dc.value<i32>, in %clk : !dc.value<i32>, in %rst : !dc.value<i32>, in %clk_0 : !seq.clock {dc.clock}, in %rst_0 : i1 {dc.reset}, out out0 : !dc.value<i32>, out out1 : !dc.token) {
%token, %output = dc.unpack %rst : !dc.value<i32>
dc.sink %token
%token_0, %output_1 = dc.unpack %clk : !dc.value<i32>
dc.sink %token_0
%token_2, %output_3 = dc.unpack %arg3 : !dc.value<i32>
dc.sink %token_2
%token_4, %output_5 = dc.unpack %arg2 : !dc.value<i32>
dc.sink %token_4
%token_6, %output_7 = dc.unpack %arg0 : !dc.value<i32>
%token_8, %output_9 = dc.unpack %arg1 : !dc.value<i32>
%0 = dc.merge %token_6, %token_8
%token_10, %output_11 = dc.unpack %0 : !dc.value<i1>
%1 = arith.select %output_11, %output_7, %output_9 : i32
%2 = dc.pack %token_10, %1 : i32
%token_12, %output_13 = dc.unpack %2 : !dc.value<i32>
%3:2 = dc.fork [2] %token_12
%4 = dc.pack %3#0, %output_13 : i32
%5 = dc.pack %3#1, %output_13 : i32
%token_14, %output_15 = dc.unpack %5 : !dc.value<i32>
%6 = dc.join %token_14
hw.output %4, %6 : !dc.value<i32>, !dc.token
}
}
|
It's by no means a fix to this issue, since we should be able to successfully lower any valid DC program to HW, assuming it has materialized forks/sinks... ... but, i re-added some old disabled canonicalization patterns (that were previously folders) + a few new ones. PR is here: #7952 |
thanks a lot!! |
@mortbopet Now I cannot run the canonicalizer in between materialize and lower:
If I don't run the canonicalizer in between, it doesn't error out. |
OK. With that PR I think I figured out the hack: "builtin.module(lower-handshake-to-dc)",
"builtin.module(dc-materialize-forks-sinks)",
"builtin.module(canonicalize)",
"builtin.module(dc-materialize-forks-sinks)",
"builtin.module(lower-dc-to-hw)", That sequence seems to work. |
This has already been through
--dc-materialize-forks-sinks
.Sorry I haven't been able to simplify the example further.
The text was updated successfully, but these errors were encountered: