[Handshake] Remove default arg and res name for ctrl signals (#3974)

This commit is contained in:
Christian Ulmann 2022-09-22 16:14:19 +02:00 committed by GitHub
parent f956b4114e
commit 20891276ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
56 changed files with 94 additions and 104 deletions

View File

@ -1,8 +1,8 @@
import cocotb
from helper import initDut
inNames = ["in0", "in1", "in2", "inCtrl"]
outNames = ["out0", "out1", "outCtrl"]
inNames = ["in0", "in1", "in2", "in3"]
outNames = ["out0", "out1", "out2"]
@cocotb.test()

View File

@ -4,8 +4,7 @@ from helper import initDut
@cocotb.test()
async def oneInput(dut):
[inCtrl], [out0, outCtrl] = await initDut(dut, ["inCtrl"],
["out0", "outCtrl"])
[inCtrl], [out0, outCtrl] = await initDut(dut, ["in0"], ["out0", "out1"])
out0Check = cocotb.start_soon(out0.checkOutputs([3589632]))
inCtrlSend = cocotb.start_soon(inCtrl.send())

View File

@ -4,8 +4,7 @@ from helper import initDut
@cocotb.test()
async def oneInput(dut):
[inCtrl], [out0, outCtrl] = await initDut(dut, ["inCtrl"],
["out0", "outCtrl"])
[inCtrl], [out0, outCtrl] = await initDut(dut, ["in0"], ["out0", "out1"])
out0Check = cocotb.start_soon(out0.checkOutputs([448704]))
inCtrlSend = cocotb.start_soon(inCtrl.send())

View File

@ -2,7 +2,7 @@ import cocotb
from helper import initDut
import random
inNames = [f"in{i}" for i in range(8)] + ["inCtrl"]
inNames = [f"in{i}" for i in range(8)] + ["in8"]
def genInOutPair():
@ -13,7 +13,7 @@ def genInOutPair():
@cocotb.test()
async def oneInput(dut):
ins, [out0, outCtrl] = await initDut(dut, inNames, ["out0", "outCtrl"])
ins, [out0, outCtrl] = await initDut(dut, inNames, ["out0", "out1"])
inCtrl = ins[-1]
inPorts = ins[:-1]
@ -35,7 +35,7 @@ async def oneInput(dut):
@cocotb.test()
async def multipleInputs(dut):
ins, [out0, outCtrl] = await initDut(dut, inNames, ["out0", "outCtrl"])
ins, [out0, outCtrl] = await initDut(dut, inNames, ["out0", "out1"])
inCtrl = ins[-1]
inPorts = ins[:-1]

View File

@ -5,9 +5,8 @@ import math
@cocotb.test()
async def oneInput(dut):
[in0, inCtrl], [out0, out1,
outCtrl] = await initDut(dut, ["in0", "inCtrl"],
["out0", "out1", "outCtrl"])
[in0, inCtrl], [out0, out1, outCtrl] = await initDut(dut, ["in0", "in1"],
["out0", "out1", "out2"])
out0Check = cocotb.start_soon(out0.checkOutputs([15]))
out1Check = cocotb.start_soon(out1.checkOutputs([120]))
@ -23,9 +22,8 @@ async def oneInput(dut):
@cocotb.test()
async def sendMultiple(dut):
[in0, inCtrl], [out0, out1,
outCtrl] = await initDut(dut, ["in0", "inCtrl"],
["out0", "out1", "outCtrl"])
[in0, inCtrl], [out0, out1, outCtrl] = await initDut(dut, ["in0", "in1"],
["out0", "out1", "out2"])
N = 10
res0 = [i * (i + 1) / 2 for i in range(N)]

View File

@ -5,8 +5,8 @@ import random
@cocotb.test()
async def oneInput(dut):
[in0, inCtrl], [out0, outCtrl] = await initDut(dut, ["in0", "inCtrl"],
["out0", "outCtrl"])
[in0, inCtrl], [out0, outCtrl] = await initDut(dut, ["in0", "in1"],
["out0", "out1"])
out0Check = cocotb.start_soon(out0.checkOutputs([0]))
in0Send = cocotb.start_soon(in0.send(10))
@ -30,8 +30,8 @@ def getResInput(i):
@cocotb.test()
async def sendMultiple(dut):
[in0, inCtrl], [out0, outCtrl] = await initDut(dut, ["in0", "inCtrl"],
["out0", "outCtrl"])
[in0, inCtrl], [out0, outCtrl] = await initDut(dut, ["in0", "in1"],
["out0", "out1"])
N = 20
inputs = [random.randint(0, 300) for _ in range(N)]

View File

@ -4,8 +4,8 @@ from helper import initDut
@cocotb.test()
async def oneInput(dut):
[in0, inCtrl], [out0, outCtrl] = await initDut(dut, ["in0", "inCtrl"],
["out0", "outCtrl"])
[in0, inCtrl], [out0, outCtrl] = await initDut(dut, ["in0", "in1"],
["out0", "out1"])
out0Check = cocotb.start_soon(out0.checkOutputs([4]))
in0Send = cocotb.start_soon(in0.send(2))
@ -19,8 +19,8 @@ async def oneInput(dut):
@cocotb.test()
async def sendMultiple(dut):
[in0, inCtrl], [out0, outCtrl] = await initDut(dut, ["in0", "inCtrl"],
["out0", "outCtrl"])
[in0, inCtrl], [out0, outCtrl] = await initDut(dut, ["in0", "in1"],
["out0", "out1"])
N = 10
# sum_{i = 0}^n (sum_{j=0}^i i) = 1/6 * (n^3 + 3n^2 + 2n)

View File

@ -4,8 +4,8 @@ from helper import initDut
@cocotb.test()
async def oneInput(dut):
[in0, inCtrl], [out0, outCtrl] = await initDut(dut, ["in0", "inCtrl"],
["out0", "outCtrl"])
[in0, inCtrl], [out0, outCtrl] = await initDut(dut, ["in0", "in1"],
["out0", "out1"])
resCheck = cocotb.start_soon(out0.checkOutputs([100]))
@ -20,8 +20,8 @@ async def oneInput(dut):
@cocotb.test()
async def sendMultiple(dut):
[in0, inCtrl], [out0, outCtrl] = await initDut(dut, ["in0", "inCtrl"],
["out0", "outCtrl"])
[in0, inCtrl], [out0, outCtrl] = await initDut(dut, ["in0", "in1"],
["out0", "out1"])
resCheck = cocotb.start_soon(
out0.checkOutputs([100, 24, 100, 24, 100, 24, 100, 24]))

View File

@ -5,8 +5,8 @@ from helper import initDut
@cocotb.test()
async def oneInput(dut):
[in0, in1, inCtrl], [out0,
outCtrl] = await initDut(dut, ["in0", "in1", "inCtrl"],
["out0", "outCtrl"])
outCtrl] = await initDut(dut, ["in0", "in1", "in2"],
["out0", "out1"])
resCheck = cocotb.start_soon(out0.checkOutputs([42]))
@ -24,8 +24,8 @@ async def oneInput(dut):
@cocotb.test()
async def multipleInputs(dut):
[in0, in1, inCtrl], [out0,
outCtrl] = await initDut(dut, ["in0", "in1", "inCtrl"],
["out0", "outCtrl"])
outCtrl] = await initDut(dut, ["in0", "in1", "in2"],
["out0", "out1"])
resCheck = cocotb.start_soon(out0.checkOutputs([42, 42, 10, 10, 10]))

View File

@ -559,17 +559,11 @@ parseFuncOpArgs(OpAsmParser &parser,
/// Generates names for a handshake.func input and output arguments, based on
/// the number of args as well as a prefix.
static SmallVector<Attribute> getFuncOpNames(Builder &builder, TypeRange types,
static SmallVector<Attribute> getFuncOpNames(Builder &builder, unsigned cnt,
StringRef prefix) {
SmallVector<Attribute> resNames;
llvm::transform(
llvm::enumerate(types), std::back_inserter(resNames), [&](auto it) {
bool lastOperand = it.index() == types.size() - 1;
std::string suffix = lastOperand && it.value().template isa<NoneType>()
? "Ctrl"
: std::to_string(it.index());
return builder.getStringAttr(prefix + suffix);
});
for (unsigned i = 0; i < cnt; ++i)
resNames.push_back(builder.getStringAttr(prefix + std::to_string(i)));
return resNames;
}
@ -610,8 +604,8 @@ void handshake::FuncOp::resolveArgAndResNames() {
/// Generate a set of fallback names. These are used in case names are
/// missing from the currently set arg- and res name attributes.
auto fallbackArgNames = getFuncOpNames(builder, getArgumentTypes(), "in");
auto fallbackResNames = getFuncOpNames(builder, getResultTypes(), "out");
auto fallbackArgNames = getFuncOpNames(builder, getNumArguments(), "in");
auto fallbackResNames = getFuncOpNames(builder, getNumResults(), "out");
auto argNames = getArgNames().getValue();
auto resNames = getResNames().getValue();
@ -662,7 +656,7 @@ ParseResult FuncOp::parse(OpAsmParser &parser, OperationState &result) {
bool noSSANames =
llvm::any_of(args, [](auto arg) { return arg.ssaName.name.empty(); });
if (noSSANames) {
argNames = getFuncOpNames(builder, argTypes, "in");
argNames = getFuncOpNames(builder, args.size(), "in");
} else {
llvm::transform(args, std::back_inserter(argNames), [&](auto arg) {
return builder.getStringAttr(arg.ssaName.name.drop_front());
@ -678,7 +672,7 @@ ParseResult FuncOp::parse(OpAsmParser &parser, OperationState &result) {
if (!result.attributes.get("argNames"))
result.addAttribute("argNames", builder.getArrayAttr(argNames));
if (!result.attributes.get("resNames")) {
auto resNames = getFuncOpNames(builder, resTypes, "out");
auto resNames = getFuncOpNames(builder, resTypes.size(), "out");
result.addAttribute("resNames", builder.getArrayAttr(resNames));
}

View File

@ -1,10 +1,10 @@
// RUN: circt-opt -lower-handshake-to-firrtl %s | FileCheck %s
// CHECK: firrtl.module @foo(in %[[VAL_0:.*]]: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>, data: uint<32>>, in %[[VAL_1:.*]]: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>>, out %[[VAL_2:.*]]: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>, data: uint<32>>, out %[[VAL_3:.*]]: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>>, in %[[VAL_4:.*]]: !firrtl.clock, in %[[VAL_5:.*]]: !firrtl.uint<1>) {
// CHECK: %[[VAL_6:.*]], %[[VAL_7:.*]], %[[VAL_8:.*]], %[[VAL_9:.*]], %[[VAL_10:.*]], %[[VAL_11:.*]] = firrtl.instance bar0 @bar(in a: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>, data: uint<32>>, in ctrl: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>>, out out0: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>, data: uint<32>>, out outCtrl: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>>, in clock: !firrtl.clock, in reset: !firrtl.uint<1>)
// CHECK: %[[VAL_6:.*]], %[[VAL_7:.*]], %[[VAL_8:.*]], %[[VAL_9:.*]], %[[VAL_10:.*]], %[[VAL_11:.*]] = firrtl.instance bar0 @bar(in a: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>, data: uint<32>>, in ctrl: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>>, out out0: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>, data: uint<32>>, out out1: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>>, in clock: !firrtl.clock, in reset: !firrtl.uint<1>)
// CHECK: firrtl.module @bar(in %[[VAL_12:.*]]: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>, data: uint<32>>, in %[[VAL_13:.*]]: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>>, out %[[VAL_14:.*]]: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>, data: uint<32>>, out %[[VAL_15:.*]]: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>>, in %[[VAL_16:.*]]: !firrtl.clock, in %[[VAL_17:.*]]: !firrtl.uint<1>) {
// CHECK: %[[VAL_18:.*]], %[[VAL_19:.*]], %[[VAL_20:.*]], %[[VAL_21:.*]], %[[VAL_22:.*]], %[[VAL_23:.*]] = firrtl.instance baz0 @baz(in a: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>, data: uint<32>>, in ctrl: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>>, out out0: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>, data: uint<32>>, out outCtrl: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>>, in clock: !firrtl.clock, in reset: !firrtl.uint<1>)
// CHECK: %[[VAL_18:.*]], %[[VAL_19:.*]], %[[VAL_20:.*]], %[[VAL_21:.*]], %[[VAL_22:.*]], %[[VAL_23:.*]] = firrtl.instance baz0 @baz(in a: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>, data: uint<32>>, in ctrl: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>>, out out0: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>, data: uint<32>>, out out1: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>>, in clock: !firrtl.clock, in reset: !firrtl.uint<1>)
// CHECK: firrtl.module @baz(in %[[VAL_77:.*]]: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>, data: uint<32>>, in %[[VAL_78:.*]]: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>>, out %[[VAL_79:.*]]: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>, data: uint<32>>, out %[[VAL_80:.*]]: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>>, in %[[VAL_81:.*]]: !firrtl.clock, in %[[VAL_82:.*]]: !firrtl.uint<1>) {
// CHECK: %[[VAL_83:.*]], %[[VAL_84:.*]], %[[VAL_85:.*]], %[[VAL_86:.*]], %[[VAL_87:.*]] = firrtl.instance handshake_fork0 @handshake_fork_in_ui32_out_ui32_ui32(in in0: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>, data: uint<32>>, out out0: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>, data: uint<32>>, out out1: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>, data: uint<32>>, in clock: !firrtl.clock, in reset: !firrtl.uint<1>)

View File

@ -5,7 +5,7 @@
// CHECK: in %b: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>, data: uint<64>>,
// CHECK: in %inCtrl: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>>,
// CHECK: out %out0: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>, data: uint<64>>,
// CHECK: out %outCtrl: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>>,
// CHECK: out %out1: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>>,
// CHECK: in %clock: !firrtl.clock,
// CHECK: in %reset: !firrtl.uint<1>) {
handshake.func @main(%a: index, %b: index, %inCtrl: none, ...) -> (index, none) {
@ -61,7 +61,7 @@ handshake.func @test_mux(%arg0: index, %arg1: index, %arg2: index, %arg3: none,
// CHECK: stDone0: bundle<valid: uint<1>, ready flip: uint<1>>,
// CHECK: ldDone0: bundle<valid: uint<1>, ready flip: uint<1>>>,
// CHECK: in %argCtrl: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>>,
// CHECK: out %outCtrl: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>>,
// CHECK: out %out0: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>>,
// CHECK: in %clock: !firrtl.clock,
// CHECK: in %reset: !firrtl.uint<1>) {
// CHECK: %handshake_extmemory0_extmem, %handshake_extmemory0_stData0, %handshake_extmemory0_stAddr0, %handshake_extmemory0_ldAddr0, %handshake_extmemory0_ldData0, %handshake_extmemory0_stDone0, %handshake_extmemory0_ldDone0 = firrtl.instance handshake_extmemory0 @handshake_extmemory_in_ui32_ui64_ui64_out_ui32(in extmem: !firrtl.bundle<stData0 flip: bundle<valid: uint<1>, ready flip: uint<1>, data: uint<32>>, stAddr0 flip: bundle<valid: uint<1>, ready flip: uint<1>, data: uint<64>>, ldAddr0 flip: bundle<valid: uint<1>, ready flip: uint<1>, data: uint<64>>, ldData0: bundle<valid: uint<1>, ready flip: uint<1>, data: uint<32>>, stDone0: bundle<valid: uint<1>, ready flip: uint<1>>, ldDone0: bundle<valid: uint<1>, ready flip: uint<1>>>, in stData0: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>, data: uint<32>>, in stAddr0: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>, data: uint<64>>, in ldAddr0: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>, data: uint<64>>, out ldData0: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>, data: uint<32>>, out stDone0: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>>, out ldDone0: !firrtl.bundle<valid: uint<1>, ready flip: uint<1>>)

View File

@ -1,7 +1,7 @@
// NOTE: Assertions have been autogenerated by utils/update_mlir_test_checks.py
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @simple_loop(
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none attributes {argNames = ["inCtrl"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none
// CHECK: %[[VAL_1:.*]] = br %[[VAL_0]] : none
// CHECK: %[[VAL_2:.*]], %[[VAL_3:.*]] = control_merge %[[VAL_1]] : none
// CHECK: %[[VAL_4:.*]]:3 = fork [3] %[[VAL_2]] : none

View File

@ -2,7 +2,7 @@
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @affine_dma_start(
// CHECK-SAME: %[[VAL_0:.*]]: index,
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> none attributes {argNames = ["in0", "inCtrl"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> none
// CHECK: %[[VAL_2:.*]] = merge %[[VAL_0]] : index
// CHECK: %[[VAL_3:.*]]:6 = fork [6] %[[VAL_1]] : none
// CHECK: %[[VAL_4:.*]] = memref.alloc() : memref<100xf32>

View File

@ -1,7 +1,7 @@
// NOTE: Assertions have been autogenerated by utils/update_mlir_test_checks.py
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @imperfectly_nested_loops(
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none attributes {argNames = ["inCtrl"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none
// CHECK: %[[VAL_1:.*]]:4 = fork [4] %[[VAL_0]] : none
// CHECK: %[[VAL_2:.*]] = constant %[[VAL_1]]#2 {value = 0 : index} : index
// CHECK: %[[VAL_3:.*]] = constant %[[VAL_1]]#1 {value = 42 : index} : index

View File

@ -1,7 +1,7 @@
// NOTE: Assertions have been autogenerated by utils/update_mlir_test_checks.py
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @more_imperfectly_nested_loops(
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none attributes {argNames = ["inCtrl"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none
// CHECK: %[[VAL_1:.*]]:4 = fork [4] %[[VAL_0]] : none
// CHECK: %[[VAL_2:.*]] = constant %[[VAL_1]]#2 {value = 0 : index} : index
// CHECK: %[[VAL_3:.*]] = constant %[[VAL_1]]#1 {value = 42 : index} : index

View File

@ -2,7 +2,7 @@
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @affine_apply_loops_shorthand(
// CHECK-SAME: %[[VAL_0:.*]]: index,
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> none attributes {argNames = ["in0", "inCtrl"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> none
// CHECK: %[[VAL_2:.*]] = merge %[[VAL_0]] : index
// CHECK: %[[VAL_3:.*]]:3 = fork [3] %[[VAL_1]] : none
// CHECK: %[[VAL_4:.*]] = constant %[[VAL_3]]#1 {value = 0 : index} : index

View File

@ -2,7 +2,7 @@
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @affine_store(
// CHECK-SAME: %[[VAL_0:.*]]: index,
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> none attributes {argNames = ["in0", "inCtrl"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> none
// CHECK: %[[VAL_2:.*]] = memory[ld = 0, st = 1] (%[[VAL_3:.*]], %[[VAL_4:.*]]) {id = 0 : i32, lsq = false} : memref<10xf32>, (f32, index) -> none
// CHECK: %[[VAL_5:.*]] = merge %[[VAL_0]] : index
// CHECK: %[[VAL_6:.*]]:5 = fork [5] %[[VAL_1]] : none

View File

@ -2,7 +2,7 @@
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @affine_load(
// CHECK-SAME: %[[VAL_0:.*]]: index,
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> none attributes {argNames = ["in0", "inCtrl"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> none
// CHECK: %[[VAL_2:.*]]:2 = memory[ld = 1, st = 0] (%[[VAL_3:.*]]) {id = 0 : i32, lsq = false} : memref<10xf32>, (index) -> (f32, none)
// CHECK: %[[VAL_4:.*]] = merge %[[VAL_0]] : index
// CHECK: %[[VAL_5:.*]]:4 = fork [4] %[[VAL_1]] : none

View File

@ -2,7 +2,7 @@
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @affine_apply_ceildiv(
// CHECK-SAME: %[[VAL_0:.*]]: index,
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> (index, none) attributes {argNames = ["in0", "inCtrl"], resNames = ["out0", "outCtrl"]} {
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> (index, none)
// CHECK: %[[VAL_2:.*]] = merge %[[VAL_0]] : index
// CHECK: %[[VAL_3:.*]]:3 = fork [3] %[[VAL_2]] : index
// CHECK: %[[VAL_4:.*]]:4 = fork [4] %[[VAL_1]] : none

View File

@ -2,7 +2,7 @@
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @affine_apply_floordiv(
// CHECK-SAME: %[[VAL_0:.*]]: index,
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> (index, none) attributes {argNames = ["in0", "inCtrl"], resNames = ["out0", "outCtrl"]} {
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> (index, none)
// CHECK: %[[VAL_2:.*]] = merge %[[VAL_0]] : index
// CHECK: %[[VAL_3:.*]]:3 = fork [3] %[[VAL_2]] : index
// CHECK: %[[VAL_4:.*]]:4 = fork [4] %[[VAL_1]] : none

View File

@ -2,7 +2,7 @@
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @affine_apply_mod(
// CHECK-SAME: %[[VAL_0:.*]]: index,
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> (index, none) attributes {argNames = ["in0", "inCtrl"], resNames = ["out0", "outCtrl"]} {
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> (index, none)
// CHECK: %[[VAL_2:.*]] = merge %[[VAL_0]] : index
// CHECK: %[[VAL_3:.*]]:3 = fork [3] %[[VAL_1]] : none
// CHECK: %[[VAL_4:.*]] = constant %[[VAL_3]]#1 {value = 42 : index} : index

View File

@ -1,7 +1,7 @@
// NOTE: Assertions have been autogenerated by utils/update_mlir_test_checks.py
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @affine_applies(
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none attributes {argNames = ["inCtrl"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none
// CHECK: %[[VAL_1:.*]]:18 = fork [18] %[[VAL_0]] : none
// CHECK: %[[VAL_2:.*]] = constant %[[VAL_1]]#16 {value = 0 : index} : index
// CHECK: %[[VAL_3:.*]]:2 = fork [2] %[[VAL_2]] : index

View File

@ -1,7 +1,7 @@
// NOTE: Assertions have been autogenerated by utils/update_mlir_test_checks.py
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @imperfectly_nested_loops(
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none attributes {argNames = ["inCtrl"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none
// CHECK: %[[VAL_1:.*]] = br %[[VAL_0]] : none
// CHECK: %[[VAL_2:.*]], %[[VAL_3:.*]] = control_merge %[[VAL_1]] : none
// CHECK: %[[VAL_4:.*]]:3 = fork [3] %[[VAL_2]] : none

View File

@ -2,7 +2,7 @@
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @min_reduction_tree(
// CHECK-SAME: %[[VAL_0:.*]]: index,
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> none attributes {argNames = ["in0", "inCtrl"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> none
// CHECK: %[[VAL_2:.*]] = merge %[[VAL_0]] : index
// CHECK: %[[VAL_3:.*]]:14 = fork [14] %[[VAL_2]] : index
// CHECK: %[[VAL_4:.*]]:3 = fork [3] %[[VAL_1]] : none

View File

@ -2,7 +2,7 @@
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @loop_min_max(
// CHECK-SAME: %[[VAL_0:.*]]: index,
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> none attributes {argNames = ["in0", "inCtrl"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> none
// CHECK: %[[VAL_2:.*]] = merge %[[VAL_0]] : index
// CHECK: %[[VAL_3:.*]]:4 = fork [4] %[[VAL_1]] : none
// CHECK: %[[VAL_4:.*]] = constant %[[VAL_3]]#2 {value = 0 : index} : index

View File

@ -3,7 +3,7 @@
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @if_only(
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none attributes {argNames = ["inCtrl"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none
// CHECK: %[[VAL_1:.*]]:4 = fork [4] %[[VAL_0]] : none
// CHECK: %[[VAL_2:.*]] = constant %[[VAL_1]]#2 {value = 0 : index} : index
// CHECK: %[[VAL_3:.*]]:2 = fork [2] %[[VAL_2]] : index

View File

@ -1,7 +1,7 @@
// NOTE: Assertions have been autogenerated by utils/update_mlir_test_checks.py
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @simple_loop(
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none attributes {argNames = ["inCtrl"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none
// CHECK: %[[VAL_1:.*]] = br %[[VAL_0]] : none
// CHECK: %[[VAL_2:.*]], %[[VAL_3:.*]] = control_merge %[[VAL_1]] : none
// CHECK: %[[VAL_4:.*]]:2 = fork [2] %[[VAL_2]] : none

View File

@ -2,7 +2,7 @@
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @affine_load(
// CHECK-SAME: %[[VAL_0:.*]]: index,
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> none attributes {argNames = ["in0", "inCtrl"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> none
// CHECK: %[[VAL_2:.*]]:3 = memory[ld = 1, st = 1] (%[[VAL_3:.*]], %[[VAL_4:.*]], %[[VAL_5:.*]]) {id = 1 : i32, lsq = false} : memref<10xf32>, (f32, index, index) -> (f32, none, none)
// CHECK: %[[VAL_6:.*]]:2 = fork [2] %[[VAL_2]]#2 : none
// CHECK: %[[VAL_7:.*]]:2 = memory[ld = 1, st = 0] (%[[VAL_8:.*]]) {id = 0 : i32, lsq = false} : memref<10xf32>, (index) -> (f32, none)

View File

@ -4,7 +4,7 @@
// CHECK-LABEL: handshake.func @load_store(
// CHECK-SAME: %[[VAL_0:.*]]: memref<4xi32>,
// CHECK-SAME: %[[VAL_1:.*]]: index,
// CHECK-SAME: %[[VAL_2:.*]]: none, ...) -> none attributes {argNames = ["in0", "in1", "inCtrl"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_2:.*]]: none, ...) -> none
// CHECK: %[[VAL_3:.*]]:3 = extmemory[ld = 1, st = 1] (%[[VAL_0]] : memref<4xi32>) (%[[VAL_4:.*]], %[[VAL_5:.*]], %[[VAL_6:.*]]) {id = 0 : i32} : (i32, index, index) -> (i32, none, none)
// CHECK: %[[VAL_7:.*]]:2 = fork [2] %[[VAL_3]]#1 : none
// CHECK: %[[VAL_8:.*]] = merge %[[VAL_1]] : index

View File

@ -1,7 +1,7 @@
// NOTE: Assertions have been autogenerated by utils/update_mlir_test_checks.py
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @more_imperfectly_nested_loops(
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none attributes {argNames = ["inCtrl"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none
// CHECK: %[[VAL_1:.*]] = br %[[VAL_0]] : none
// CHECK: %[[VAL_2:.*]], %[[VAL_3:.*]] = control_merge %[[VAL_1]] : none
// CHECK: %[[VAL_4:.*]]:3 = fork [3] %[[VAL_2]] : none

View File

@ -2,7 +2,7 @@
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @affine_load(
// CHECK-SAME: %[[VAL_0:.*]]: index,
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> none attributes {argNames = ["in0", "inCtrl"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> none
// CHECK: %[[VAL_2:.*]]:7 = memory[ld = 3, st = 1] (%[[VAL_3:.*]], %[[VAL_4:.*]], %[[VAL_5:.*]], %[[VAL_6:.*]], %[[VAL_7:.*]]) {id = 0 : i32, lsq = false} : memref<10xf32>, (f32, index, index, index, index) -> (f32, f32, f32, none, none, none, none)
// CHECK: %[[VAL_8:.*]]:2 = fork [2] %[[VAL_2]]#6 : none
// CHECK: %[[VAL_9:.*]]:2 = fork [2] %[[VAL_2]]#5 : none

View File

@ -2,7 +2,7 @@
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @affine_load(
// CHECK-SAME: %[[VAL_0:.*]]: index,
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> none attributes {argNames = ["in0", "inCtrl"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> none
// CHECK: %[[VAL_2:.*]]:3 = memory[ld = 1, st = 1] (%[[VAL_3:.*]], %[[VAL_4:.*]], %[[VAL_5:.*]]) {id = 1 : i32, lsq = false} : memref<10xf32>, (f32, index, index) -> (f32, none, none)
// CHECK: %[[VAL_6:.*]]:2 = fork [2] %[[VAL_2]]#2 : none
// CHECK: %[[VAL_7:.*]]:4 = memory[ld = 2, st = 0] (%[[VAL_8:.*]], %[[VAL_9:.*]]) {id = 0 : i32, lsq = false} : memref<10xf32>, (index, index) -> (f32, f32, none, none)

View File

@ -1,7 +1,7 @@
// NOTE: Assertions have been autogenerated by utils/update_mlir_test_checks.py
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @test(
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none attributes {argNames = ["inCtrl"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none
// CHECK: %[[VAL_1:.*]]:5 = memory[ld = 2, st = 1] (%[[VAL_2:.*]], %[[VAL_3:.*]], %[[VAL_4:.*]], %[[VAL_5:.*]]) {id = 0 : i32, lsq = false} : memref<10xf32>, (f32, index, index, index) -> (f32, f32, none, none, none)
// CHECK: %[[VAL_6:.*]]:2 = fork [2] %[[VAL_1]]#4 : none
// CHECK: %[[VAL_7:.*]]:2 = fork [2] %[[VAL_0]] : none

View File

@ -1,7 +1,7 @@
// NOTE: Assertions have been autogenerated by utils/update_mlir_test_checks.py
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @test(
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none attributes {argNames = ["inCtrl"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none
// CHECK: %[[VAL_1:.*]]:5 = memory[ld = 2, st = 1] (%[[VAL_2:.*]], %[[VAL_3:.*]], %[[VAL_4:.*]], %[[VAL_5:.*]]) {id = 0 : i32, lsq = false} : memref<10xf32>, (f32, index, index, index) -> (f32, f32, none, none, none)
// CHECK: %[[VAL_6:.*]]:2 = fork [2] %[[VAL_1]]#4 : none
// CHECK: %[[VAL_7:.*]]:2 = fork [2] %[[VAL_1]]#3 : none

View File

@ -1,7 +1,7 @@
// NOTE: Assertions have been autogenerated by utils/update_mlir_test_checks.py
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @test(
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none attributes {argNames = ["inCtrl"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none
// CHECK: %[[VAL_1:.*]]:5 = memory[ld = 2, st = 1] (%[[VAL_2:.*]], %[[VAL_3:.*]], %[[VAL_4:.*]], %[[VAL_5:.*]]) {id = 0 : i32, lsq = false} : memref<10xf32>, (f32, index, index, index) -> (f32, f32, none, none, none)
// CHECK: %[[VAL_6:.*]]:2 = fork [2] %[[VAL_1]]#3 : none
// CHECK: %[[VAL_7:.*]]:2 = fork [2] %[[VAL_1]]#2 : none

View File

@ -1,7 +1,7 @@
// NOTE: Assertions have been autogenerated by utils/update_mlir_test_checks.py
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @test(
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none attributes {argNames = ["inCtrl"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none
// CHECK: %[[VAL_1:.*]]:3 = memory[ld = 1, st = 1] (%[[VAL_2:.*]], %[[VAL_3:.*]], %[[VAL_4:.*]]) {id = 1 : i32, lsq = false} : memref<10xf32>, (f32, index, index) -> (f32, none, none)
// CHECK: %[[VAL_5:.*]]:3 = memory[ld = 1, st = 1] (%[[VAL_6:.*]], %[[VAL_7:.*]], %[[VAL_8:.*]]) {id = 0 : i32, lsq = false} : memref<10xf32>, (f32, index, index) -> (f32, none, none)
// CHECK: %[[VAL_9:.*]]:3 = fork [3] %[[VAL_0]] : none

View File

@ -1,7 +1,7 @@
// NOTE: Assertions have been autogenerated by utils/update_mlir_test_checks.py
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK: handshake.func @ops(%[[VAL_0:.*]]: f32, %[[VAL_1:.*]]: f32, %[[VAL_2:.*]]: i32, %[[VAL_3:.*]]: i32, %[[VAL_4:.*]]: none, ...) -> (f32, i32, none) attributes {argNames = ["in0", "in1", "in2", "in3", "inCtrl"], resNames = ["out0", "out1", "outCtrl"]} {
// CHECK: handshake.func @ops(%[[VAL_0:.*]]: f32, %[[VAL_1:.*]]: f32, %[[VAL_2:.*]]: i32, %[[VAL_3:.*]]: i32, %[[VAL_4:.*]]: none, ...) -> (f32, i32, none)
// CHECK: %[[VAL_5:.*]] = merge %[[VAL_0]] : f32
// CHECK: %[[VAL_6:.*]]:3 = fork [3] %[[VAL_5]] : f32
// CHECK: %[[VAL_7:.*]] = merge %[[VAL_1]] : f32

View File

@ -1,7 +1,7 @@
// NOTE: Assertions have been autogenerated by utils/update_mlir_test_checks.py
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @dfs_block_order(
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> (i32, none) attributes {argNames = ["inCtrl"], resNames = ["out0", "outCtrl"]} {
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> (i32, none)
// CHECK: %[[VAL_1:.*]]:2 = fork [2] %[[VAL_0]] : none
// CHECK: %[[VAL_2:.*]] = constant %[[VAL_1]]#0 {value = 42 : i32} : i32
// CHECK: %[[VAL_3:.*]] = br %[[VAL_1]]#1 : none

View File

@ -1,7 +1,7 @@
// NOTE: Assertions have been autogenerated by utils/update_mlir_test_checks.py
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK: handshake.func @ops(%[[VAL_0:.*]]: f32, %[[VAL_1:.*]]: f32, %[[VAL_2:.*]]: i32, %[[VAL_3:.*]]: i32, %[[VAL_4:.*]]: none, ...) -> (f32, i32, none) attributes {argNames = ["in0", "in1", "in2", "in3", "inCtrl"], resNames = ["out0", "out1", "outCtrl"]} {
// CHECK: handshake.func @ops(%[[VAL_0:.*]]: f32, %[[VAL_1:.*]]: f32, %[[VAL_2:.*]]: i32, %[[VAL_3:.*]]: i32, %[[VAL_4:.*]]: none, ...) -> (f32, i32, none)
// CHECK: %[[VAL_5:.*]] = merge %[[VAL_0]] : f32
// CHECK: %[[VAL_6:.*]] = merge %[[VAL_1]] : f32
// CHECK: %[[VAL_7:.*]]:3 = fork [3] %[[VAL_6]] : f32

View File

@ -1,7 +1,7 @@
// NOTE: Assertions have been autogenerated by utils/update_mlir_test_checks.py
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @simple_loop(
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none attributes {argNames = ["inCtrl"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none
// CHECK: %[[VAL_1:.*]] = br %[[VAL_0]] : none
// CHECK: %[[VAL_2:.*]], %[[VAL_3:.*]] = control_merge %[[VAL_1]] : none
// CHECK: %[[VAL_4:.*]]:2 = fork [2] %[[VAL_2]] : none

View File

@ -1,7 +1,7 @@
// NOTE: Assertions have been autogenerated by utils/update_mlir_test_checks.py
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @simple_loop(
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none attributes {argNames = ["inCtrl"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none
// CHECK: %[[VAL_1:.*]] = br %[[VAL_0]] : none
// CHECK: %[[VAL_2:.*]], %[[VAL_3:.*]] = control_merge %[[VAL_1]] : none
// CHECK: %[[VAL_4:.*]]:2 = fork [2] %[[VAL_2]] : none

View File

@ -2,7 +2,7 @@
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @affine_dma_wait(
// CHECK-SAME: %[[VAL_0:.*]]: index,
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> none attributes {argNames = ["in0", "inCtrl"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> none
// CHECK: %[[VAL_2:.*]] = merge %[[VAL_0]] : index
// CHECK: %[[VAL_3:.*]]:5 = fork [5] %[[VAL_1]] : none
// CHECK: %[[VAL_4:.*]] = memref.alloc() : memref<1xi32>

View File

@ -2,7 +2,7 @@
// CHECK-LABEL: handshake.func @bar(
// CHECK-SAME: %[[VAL_0:.*]]: i32,
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> (i32, none) attributes {argNames = ["in0", "inCtrl"], resNames = ["out0", "outCtrl"]} {
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> (i32, none)
// CHECK: %[[VAL_2:.*]] = merge %[[VAL_0]] : i32
// CHECK: return %[[VAL_2]], %[[VAL_1]] : i32, none
// CHECK: }
@ -12,7 +12,7 @@ func.func @bar(%0 : i32) -> i32 {
// CHECK-LABEL: handshake.func @foo(
// CHECK-SAME: %[[VAL_0:.*]]: i32,
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> (i32, none) attributes {argNames = ["in0", "inCtrl"], resNames = ["out0", "outCtrl"]} {
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> (i32, none)
// CHECK: %[[VAL_2:.*]] = merge %[[VAL_0]] : i32
// CHECK: %[[VAL_3:.*]]:2 = fork [2] %[[VAL_1]] : none
// CHECK: %[[VAL_4:.*]]:2 = instance @bar(%[[VAL_2]], %[[VAL_3]]#0) : (i32, none) -> (i32, none)

View File

@ -2,7 +2,7 @@
// RUN: circt-opt -lower-std-to-handshake="disable-task-pipelining" %s | FileCheck %s
// CHECK-LABEL: handshake.func @simple_loop(
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none attributes {argNames = ["inCtrl"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none
// CHECK: %[[VAL_1:.*]] = br %[[VAL_0]] : none
// CHECK: %[[VAL_2:.*]], %[[VAL_3:.*]] = control_merge %[[VAL_1]] : none
// CHECK: %[[VAL_4:.*]]:3 = fork [3] %[[VAL_2]] : none

View File

@ -2,7 +2,7 @@
// CHECK-LABEL: handshake.func @main(
// CHECK-SAME: %[[VAL_0:.*]]: memref<4xi32>,
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> (i32, none) attributes {argNames = ["in0", "inCtrl"], resNames = ["out0", "outCtrl"]} {
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> (i32, none)
// CHECK: %[[VAL_2:.*]]:2 = extmemory[ld = 1, st = 0] (%[[VAL_0]] : memref<4xi32>) (%[[VAL_3:.*]]) {id = 0 : i32} : (index) -> (i32, none)
// CHECK: %[[VAL_4:.*]]:2 = fork [2] %[[VAL_1]] : none
// CHECK: %[[VAL_5:.*]]:2 = fork [2] %[[VAL_4]]#1 : none

View File

@ -2,7 +2,7 @@
// CHECK-LABEL: handshake.func @simple_loop(
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none attributes {argNames = ["arg0"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none
// CHECK: %[[VAL_1:.*]] = br %[[VAL_0]] : none
// CHECK: %[[VAL_2:.*]], %[[VAL_3:.*]] = control_merge %[[VAL_1]] : none
// CHECK: %[[VAL_4:.*]] = buffer [2] fifo %[[VAL_3]] : index

View File

@ -1,6 +1,6 @@
// RUN: circt-opt -lower-std-to-handshake %s | FileCheck %s
// CHECK-LABEL: handshake.func @main(%arg0: i32, %arg1: i32, %arg2: i32, %arg3: none, ...) -> (i32, none) attributes {argNames = ["a", "b", "c", "inCtrl"], resNames = ["res", "outCtrl"]} {
func.func @main(%arg0 : i32, %b : i32, %c: i32) -> i32 attributes {argNames = ["a", "b", "c"], resNames = ["res"]} {
// CHECK-LABEL: handshake.func @main(%arg0: i32, %arg1: i32, %arg2: i32, %arg3: none, ...) -> (i32, none) attributes {argNames = ["a", "b", "c", "in3"], resNames = ["res", "outCtrl"]} {
func.func @main(%arg0 : i32, %b : i32, %c: i32) -> i32 attributes {argNames = ["a", "b", "c"], resNames = ["res", "outCtrl"]} {
return %arg0 : i32
}

View File

@ -2,7 +2,7 @@
// CHECK-LABEL: handshake.func @foo(
// CHECK-SAME: %[[VAL_0:.*]]: i32,
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> (i32, none) attributes {argNames = ["in0", "inCtrl"], resNames = ["out0", "outCtrl"]} {
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> (i32, none)
// CHECK: %[[VAL_2:.*]] = source
// CHECK: %[[VAL_3:.*]] = constant %[[VAL_2]] {value = 1 : i32} : i32
// CHECK: %[[VAL_4:.*]] = arith.addi %[[VAL_0]], %[[VAL_3]] : i32

View File

@ -1,6 +1,6 @@
// RUN: circt-opt --handshake-add-ids %s | FileCheck %s
// CHECK: handshake.func @simple_c(%arg0: i32, %arg1: i32, %arg2: none, ...) -> (i32, none) attributes {argNames = ["arg0", "arg1", "arg2"], handshake_id = 0 : index, resNames = ["out0", "outCtrl"]} {
// CHECK: handshake.func @simple_c(%arg0: i32, %arg1: i32, %arg2: none, ...) -> (i32, none) attributes {argNames = ["arg0", "arg1", "arg2"], handshake_id = 0 : index, resNames = ["out0", "out1"]} {
// CHECK: %0 = buffer [2] seq %arg0 {handshake_id = 0 : index} : i32
// CHECK: %1 = buffer [2] seq %arg1 {handshake_id = 1 : index} : i32
// CHECK: %2 = arith.addi %0, %1 {handshake_id = 0 : index} : i32

View File

@ -1,7 +1,7 @@
// RUN: circt-opt -split-input-file -canonicalize='top-down=true region-simplify=true' %s | FileCheck %s
// CHECK-LABEL: handshake.func @simple(
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none attributes {argNames = ["arg0"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none
// CHECK: %[[VAL_1:.*]] = constant %[[VAL_0]] {value = 1 : index} : index
// CHECK: %[[VAL_2:.*]]:2 = fork [2] %[[VAL_0]] : none
// CHECK: %[[VAL_3:.*]] = constant %[[VAL_2]]#0 {value = 42 : index} : index
@ -24,7 +24,7 @@ handshake.func @simple(%arg0: none, ...) -> none {
// -----
// CHECK: handshake.func @cmerge_with_control_used(%[[VAL_0:.*]]: none, %[[VAL_1:.*]]: none, %[[VAL_2:.*]]: none, ...) -> (none, index, none) attributes {argNames = ["arg0", "arg1", "arg2"], resNames = ["out0", "out1", "outCtrl"]} {
// CHECK: handshake.func @cmerge_with_control_used(%[[VAL_0:.*]]: none, %[[VAL_1:.*]]: none, %[[VAL_2:.*]]: none, ...) -> (none, index, none)
// CHECK: %[[VAL_3:.*]], %[[VAL_4:.*]] = control_merge %[[VAL_0]], %[[VAL_1]] : none
// CHECK: return %[[VAL_3]], %[[VAL_4]], %[[VAL_2]] : none, index, none
// CHECK: }
@ -36,7 +36,7 @@ handshake.func @cmerge_with_control_used(%arg0: none, %arg1: none, %arg2: none)
// -----
// CHECK: handshake.func @cmerge_with_control_sunk(%[[VAL_0:.*]]: none, %[[VAL_1:.*]]: none, %[[VAL_2:.*]]: none, ...) -> (none, none) attributes {argNames = ["arg0", "arg1", "arg2"], resNames = ["out0", "outCtrl"]} {
// CHECK: handshake.func @cmerge_with_control_sunk(%[[VAL_0:.*]]: none, %[[VAL_1:.*]]: none, %[[VAL_2:.*]]: none, ...) -> (none, none)
// CHECK: %[[VAL_3:.*]] = merge %[[VAL_0]], %[[VAL_1]] : none
// CHECK: return %[[VAL_3]], %[[VAL_2]] : none, none
// CHECK: }
@ -48,7 +48,7 @@ handshake.func @cmerge_with_control_sunk(%arg0: none, %arg1: none, %arg2: none)
// -----
// CHECK: handshake.func @cmerge_with_control_ignored(%[[VAL_0:.*]]: none, %[[VAL_1:.*]]: none, %[[VAL_2:.*]]: none, ...) -> (none, none) attributes {argNames = ["arg0", "arg1", "arg2"], resNames = ["out0", "outCtrl"]} {
// CHECK: handshake.func @cmerge_with_control_ignored(%[[VAL_0:.*]]: none, %[[VAL_1:.*]]: none, %[[VAL_2:.*]]: none, ...) -> (none, none)
// CHECK: %[[VAL_3:.*]] = merge %[[VAL_0]], %[[VAL_1]] : none
// CHECK: return %[[VAL_3]], %[[VAL_2]] : none, none
// CHECK: }
@ -60,7 +60,7 @@ handshake.func @cmerge_with_control_ignored(%arg0: none, %arg1: none, %arg2: non
// -----
// CHECK-LABEL: handshake.func @sunk_constant(
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none attributes {argNames = ["arg0"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none
// CHECK: return %[[VAL_0]] : none
// CHECK: }
handshake.func @sunk_constant(%arg0: none) -> (none) {
@ -72,7 +72,7 @@ handshake.func @sunk_constant(%arg0: none) -> (none) {
// -----
// CHECK-LABEL: handshake.func @unused_fork_result(
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> (none, none) attributes {argNames = ["arg0"], resNames = ["out0", "outCtrl"]} {
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> (none, none)
// CHECK: %[[VAL_1:.*]]:2 = fork [2] %[[VAL_0]] : none
// CHECK: return %[[VAL_1]]#0, %[[VAL_1]]#1 : none, none
// CHECK: }

View File

@ -2,7 +2,7 @@
// CHECK-LABEL: handshake.func private @private_func(
// CHECK-SAME: %[[VAL_0:.*]]: i32,
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> (i32, none) attributes {argNames = ["arg0", "ctrl"], resNames = ["out0", "outCtrl"]} {
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> (i32, none) attributes {argNames = ["arg0", "ctrl"], resNames = ["out0", "out1"]} {
// CHECK: return %[[VAL_0]], %[[VAL_1]] : i32, none
// CHECK: }
handshake.func private @private_func(%arg0 : i32, %ctrl: none) -> (i32, none) {
@ -13,7 +13,7 @@ handshake.func private @private_func(%arg0 : i32, %ctrl: none) -> (i32, none) {
// CHECK-LABEL: handshake.func public @public_func(
// CHECK-SAME: %[[VAL_0:.*]]: i32,
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> (i32, none) attributes {argNames = ["arg0", "ctrl"], resNames = ["out0", "outCtrl"]} {
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> (i32, none) attributes {argNames = ["arg0", "ctrl"], resNames = ["out0", "out1"]} {
// CHECK: return %[[VAL_0]], %[[VAL_1]] : i32, none
// CHECK: }
handshake.func public @public_func(%arg0 : i32, %ctrl: none) -> (i32, none) {
@ -33,11 +33,11 @@ handshake.func public @no_none_type() {
// -----
// CHECK-LABEL: handshake.func @external(
// CHECK-SAME: i32, none, ...) -> none attributes {argNames = ["arg0", "ctrl"], resNames = ["outCtrl"]}
// CHECK-SAME: i32, none, ...) -> none attributes {argNames = ["arg0", "ctrl"], resNames = ["out0"]}
handshake.func @external(%arg0: i32, %ctrl: none, ...) -> none
// ----
// CHECK-LABEL: handshake.func @no_ssa_names(
// CHECK-SAME: i32, none, ...) -> none attributes {argNames = ["in0", "inCtrl"], resNames = ["outCtrl"]}
// CHECK-SAME: i32, none, ...) -> none attributes {argNames = ["in0", "in1"], resNames = ["out0"]}
handshake.func @no_ssa_names(i32, none, ...) -> none

View File

@ -2,7 +2,7 @@
// CHECK-LABEL: handshake.func @missing_fork_and_sink(
// CHECK-SAME: %[[VAL_0:.*]]: i32,
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> none attributes {argNames = ["arg0", "ctrl"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> none
// CHECK: %[[VAL_2:.*]]:2 = fork [2] %[[VAL_0]] : i32
// CHECK: %[[VAL_3:.*]] = arith.addi %[[VAL_2]]#0, %[[VAL_2]]#1 : i32
// CHECK: sink %[[VAL_3]] : i32
@ -18,7 +18,7 @@ handshake.func @missing_fork_and_sink(%arg0 : i32, %ctrl: none) -> (none) {
// CHECK-LABEL: handshake.func @missing_arg_sink(
// CHECK-SAME: %[[VAL_0:.*]]: i32,
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> none attributes {argNames = ["arg0", "ctrl"], resNames = ["outCtrl"]} {
// CHECK-SAME: %[[VAL_1:.*]]: none, ...) -> none
// CHECK: sink %[[VAL_0]] : i32
// CHECK: return %[[VAL_1]] : none
// CHECK: }
@ -29,5 +29,5 @@ handshake.func @missing_arg_sink(%arg0 : i32, %ctrl: none) -> (none) {
// -----
// CHECK-LABEL: handshake.func @external(
// CHECK-SAME: i32, none, ...) -> none attributes {argNames = ["arg0", "ctrl"], resNames = ["outCtrl"]}
// CHECK-SAME: i32, none, ...) -> none
handshake.func @external(%arg0: i32, %ctrl: none, ...) -> none

View File

@ -17,5 +17,5 @@ handshake.func @simple_c(%arg0: i32, %arg1: i32, %arg2: none) -> (i32, none) {
// -----
// CHECK-LABEL: handshake.func @external(
// CHECK-SAME: i32, none, ...) -> none attributes {argNames = ["arg0", "ctrl"], resNames = ["outCtrl"]}
// CHECK-SAME: i32, none, ...) -> none
handshake.func @external(%arg0: i32, %ctrl: none, ...) -> none

View File

@ -47,5 +47,5 @@ handshake.func @gcd(%arg0: i32, %arg1: i32, %arg2: none, ...) -> (i32, none) {
// -----
// CHECK-LABEL: handshake.func @external(
// CHECK-SAME: i32, none, ...) -> none attributes {argNames = ["arg0", "ctrl"], resNames = ["outCtrl"]}
// CHECK-SAME: i32, none, ...) -> none
handshake.func @external(%arg0: i32, %ctrl: none, ...) -> none

View File

@ -50,5 +50,5 @@ handshake.func @triangle(%arg0: i32, %arg1: i1, %arg2: none, ...) -> (i32, none)
// -----
// CHECK-LABEL: handshake.func @external(
// CHECK-SAME: i32, none, ...) -> none attributes {argNames = ["arg0", "ctrl"], resNames = ["outCtrl"]}
// CHECK-SAME: i32, none, ...) -> none
handshake.func @external(%arg0: i32, %ctrl: none, ...) -> none