diff --git a/calyx-py/calyx/builder.py b/calyx-py/calyx/builder.py index a928073a1..6b0cda8fc 100644 --- a/calyx-py/calyx/builder.py +++ b/calyx-py/calyx/builder.py @@ -221,7 +221,7 @@ def case( width = self.infer_width(signal) ifs = [] for branch, controllable in cases.items(): - std_eq = self.eq(width, f"{signal.name}_eq_{branch}", signed) + std_eq = self.eq(width, self.generate_name(f"{signal.name}_eq_{branch}"), signed) with self.continuous: std_eq.left = signal diff --git a/calyx-py/test/case.expect b/calyx-py/test/case.expect index d201c6428..89cbefc56 100644 --- a/calyx-py/test/case.expect +++ b/calyx-py/test/case.expect @@ -3,24 +3,24 @@ import "primitives/binary_operators.futil"; component my_comp(in_1: 8) -> (out_1: 16) { cells { comp_reg = std_reg(1); - in_1_eq_1 = std_eq(8); - in_1_eq_2 = std_eq(8); + in_1_eq_1_1 = std_eq(8); + in_1_eq_2_2 = std_eq(8); } wires { group my_group { } - in_1_eq_1.left = in_1; - in_1_eq_1.right = 8'd1; - in_1_eq_2.left = in_1; - in_1_eq_2.right = 8'd2; + in_1_eq_1_1.left = in_1; + in_1_eq_1_1.right = 8'd1; + in_1_eq_2_2.left = in_1; + in_1_eq_2_2.right = 8'd2; } control { par { - if in_1_eq_1.out { + if in_1_eq_1_1.out { my_group; } - if in_1_eq_2.out { + if in_1_eq_2_2.out { invoke comp_reg(in=1'd1)(); } } diff --git a/frontends/queues/cycles.sh b/frontends/queues/cycles.sh new file mode 100755 index 000000000..c35b0b161 --- /dev/null +++ b/frontends/queues/cycles.sh @@ -0,0 +1,19 @@ +#!/usr/bin/bash + +shopt -s globstar + +cd "$(dirname "$0")/../.." # move to root + +for file in frontends/queues/tests/**/*.py; do + name="$(basename $file .py)" + dir="$(dirname $file)" + + cycles="$(python3 $file 20000 --keepgoing |\ + fud e --from calyx --to jq \ + --through verilog \ + --through dat \ + -s verilog.data "$dir/$name.data" \ + -s jq.expr ".cycles" \ + -q)" + echo "${file#*tests/}: $cycles" +done diff --git a/frontends/queues/cycles.txt b/frontends/queues/cycles.txt new file mode 100644 index 000000000..43d63d382 --- /dev/null +++ b/frontends/queues/cycles.txt @@ -0,0 +1,30 @@ +binheap/binheap_test.py: 750 +binheap/fifo_test.py: 1509164 +binheap/pifo_test.py: 1784719 +binheap/round_robin/rr_2flow_test.py: 1870740 +binheap/round_robin/rr_3flow_test.py: 1884450 +binheap/round_robin/rr_4flow_test.py: 1897807 +binheap/round_robin/rr_5flow_test.py: 1903303 +binheap/round_robin/rr_6flow_test.py: 1934811 +binheap/round_robin/rr_7flow_test.py: 1944544 +binheap/stable_binheap_test.py: 1802173 +binheap/strict/strict_2flow_test.py: 1785391 +binheap/strict/strict_3flow_test.py: 1826179 +binheap/strict/strict_4flow_test.py: 1842823 +binheap/strict/strict_5flow_test.py: 1852314 +binheap/strict/strict_6flow_test.py: 1851588 +complex_tree_test.py: 1504412 +fifo_test.py: 595422 +pifo_tree_test.py: 1199525 +round_robin/rr_2flow_test.py: 993313 +round_robin/rr_3flow_test.py: 1013489 +round_robin/rr_4flow_test.py: 1032869 +round_robin/rr_5flow_test.py: 1051211 +round_robin/rr_6flow_test.py: 1125919 +round_robin/rr_7flow_test.py: 1136933 +sdn_test.py: 1244054 +strict/strict_2flow_test.py: 1058077 +strict/strict_3flow_test.py: 1144637 +strict/strict_4flow_test.py: 1233029 +strict/strict_5flow_test.py: 1315433 +strict/strict_6flow_test.py: 1481437 diff --git a/frontends/queues/cycles_round_robin.png b/frontends/queues/cycles_round_robin.png new file mode 100644 index 000000000..9cf7c28a0 Binary files /dev/null and b/frontends/queues/cycles_round_robin.png differ diff --git a/frontends/queues/cycles_strict.png b/frontends/queues/cycles_strict.png new file mode 100644 index 000000000..b786dc641 Binary files /dev/null and b/frontends/queues/cycles_strict.png differ diff --git a/frontends/queues/lut_round_robin.png b/frontends/queues/lut_round_robin.png new file mode 100644 index 000000000..464d97715 Binary files /dev/null and b/frontends/queues/lut_round_robin.png differ diff --git a/frontends/queues/lut_strict.png b/frontends/queues/lut_strict.png new file mode 100644 index 000000000..6853a5d11 Binary files /dev/null and b/frontends/queues/lut_strict.png differ diff --git a/frontends/queues/muxes_round_robin.png b/frontends/queues/muxes_round_robin.png new file mode 100644 index 000000000..d02466a87 Binary files /dev/null and b/frontends/queues/muxes_round_robin.png differ diff --git a/frontends/queues/muxes_strict.png b/frontends/queues/muxes_strict.png new file mode 100644 index 000000000..6b0c52e41 Binary files /dev/null and b/frontends/queues/muxes_strict.png differ diff --git a/frontends/queues/plot.py b/frontends/queues/plot.py new file mode 100644 index 000000000..19b3bd7dc --- /dev/null +++ b/frontends/queues/plot.py @@ -0,0 +1,122 @@ +import os +import sys +import json +import numpy as np +import matplotlib.pyplot as plt + +stat = sys.argv[1] + +def append_path_prefix(file): + path_to_script = os.path.dirname(__file__) + path_to_file = os.path.join(path_to_script, file) + return path_to_file + +def parse(stat, file): + binheap_rr = [] + specialized_rr = [] + binheap_strict = [] + specialized_strict = [] + + with open(file) as file: + if stat == "cycles": + for line in file: + split = line.strip().split(":") + tup = (split[0].split("flow")[0][-1], int(split[1])) + if "round_robin" in line: + if "binheap" in line: + binheap_rr.append(tup) + else: + specialized_rr.append(tup) + if "strict" in line: + if "binheap" in line: + binheap_strict.append(tup) + else: + specialized_strict.append(tup) + else: + data = file.read().strip() + for d in data.split("\n\n"): + split = d.split("\n") + name = split[0] + stats = json.loads("\n".join(split[1:])) + tup = (name.split("flow")[0][-1], stats[stat]) + if "round_robin" in name: + if "binheap" in name: + binheap_rr.append(tup) + else: + specialized_rr.append(tup) + if "strict" in name: + if "binheap" in name: + binheap_strict.append(tup) + else: + specialized_strict.append(tup) + + return (specialized_rr, + binheap_rr, + specialized_strict, + binheap_strict) + +def draw(specialized, binheap, name, filename, details=None): + fig, ax = plt.subplots(1, 1) + fig.set_size_inches(20, 10, forward=True) + ax.set_title(name, + fontweight='bold', + fontsize=20) + ax.set_xlabel("number of flows", + fontsize=20) + if details is None: + ax.set_ylabel(stat, + fontsize=20) + else: + ax.set_ylabel(f"{stat} ({details})", + fontsize=20) + specialized = ax.scatter( + list(map(lambda x: x[0], specialized)), + list(map(lambda x: x[1], specialized)), + c='b') + binheap = ax.scatter( + list(map(lambda x: x[0], binheap)), + list(map(lambda x: x[1], binheap)), + c='g') + plt.legend((specialized, binheap), + ("Specialized (i.e. Cassandra style PIFO)", "Binary Heap"), + fontsize=12) + file = append_path_prefix(f"{stat}_{filename}") + plt.savefig(file) + print(f"Generated {file}.png") + +# Parse data for round_robin and strict queues +(specialized_rr, binheap_rr, specialized_strict, binheap_strict) = ([], [], [], []) +if stat == "total_time": + file1 = sys.argv[2] + file2 = sys.argv[3] + + (specialized_cycles_rr, + binheap_cycles_rr, + specialized_cycles_strict, + binheap_cycles_strict) = parse("cycles", file1) + (specialized_slacks_rr, + binheap_slacks_rr, + specialized_slacks_strict, + binheap_slacks_strict) = parse("worst_slack", file2) + + def map2(cycles, slacks): + cycles.sort(key=lambda c: c[0]) + slacks.sort(key=lambda s: s[0]) + + def f(c,s): + return (c[0], (1000*c[1])/(7 - s[1])) + + return list(map(f, cycles, slacks)) + + specialized_rr = map2(specialized_cycles_rr, specialized_slacks_rr) + binheap_rr = map2(binheap_cycles_rr, binheap_slacks_rr) + specialized_strict = map2(specialized_cycles_strict, specialized_slacks_strict) + binheap_strict = map2(binheap_cycles_strict, binheap_slacks_strict) +else: + file = sys.argv[2] + (specialized_rr, binheap_rr, specialized_strict, binheap_strict) = parse(stat, file) + +# Draw results +details = "μs" if stat == "total_time" else None +draw(specialized_rr, binheap_rr, "Round Robin Queues", "round_robin", details) +draw(specialized_strict, binheap_strict, "Strict Queues", "strict", details) diff --git a/frontends/queues/queues/__init__.py b/frontends/queues/queues/__init__.py index 4ea212407..1f57ae076 100644 --- a/frontends/queues/queues/__init__.py +++ b/frontends/queues/queues/__init__.py @@ -5,4 +5,6 @@ import queues.binheap.stable_binheap as stable_binheap import queues.binheap.fifo as binheap_fifo import queues.binheap.pifo as binheap_pifo +import queues.binheap.round_robin as binheap_rr +import queues.binheap.strict as binheap_strict import queues.binheap.binheap as binheap diff --git a/frontends/queues/queues/binheap/flow_inference.py b/frontends/queues/queues/binheap/flow_inference.py new file mode 100644 index 000000000..27744e338 --- /dev/null +++ b/frontends/queues/queues/binheap/flow_inference.py @@ -0,0 +1,33 @@ +# pylint: disable=import-error +import calyx.builder as cb + + +def insert_flow_inference(comp, value, flow, boundaries, name): + bound_checks = [] + + for b in range(len(boundaries)): + lt = comp.lt(32) + le = comp.le(32) + guard = comp.and_(1) + + with comp.comb_group(f"{name}_bound_check_{b}") as bound_check_b: + le.left = value + le.right = boundaries[b] + if b > 0: + lt.left = boundaries[b-1] + lt.right = value + else: + lt.left = 0 + lt.right = 1 + guard.left = le.out + guard.right = lt.out + + set_flow_b = comp.reg_store(flow, b, f"{name}_set_flow_{b}") + bound_check = cb.if_with( + cb.CellAndGroup(guard, bound_check_b), + set_flow_b + ) + + bound_checks.append(bound_check) + + return cb.par(*bound_checks) diff --git a/frontends/queues/queues/binheap/round_robin.py b/frontends/queues/queues/binheap/round_robin.py new file mode 100644 index 000000000..8385c5392 --- /dev/null +++ b/frontends/queues/queues/binheap/round_robin.py @@ -0,0 +1,122 @@ +# pylint: disable=import-error +import calyx.builder as cb +from calyx.utils import bits_needed +from queues.binheap.stable_binheap import insert_stable_binheap +from queues.binheap.flow_inference import insert_flow_inference + +FACTOR = 4 + + +def insert_binheap_rr(prog, name, boundaries, queue_size_factor=FACTOR): + n = len(boundaries) + + comp = prog.component(name) + + binheap = insert_stable_binheap(prog, "binheap", queue_size_factor) + binheap = comp.cell("binheap", binheap) + + cmd = comp.input("cmd", 1) + value = comp.input("value", 32) + + ans = comp.reg(32, "ans", is_ref=True) + err = comp.reg(1, "err", is_ref=True) + + err_eq_0 = comp.eq_use(err.out, 0) + + flow_in = comp.reg(bits_needed(n - 1), "flow_in") + infer_flow_in = insert_flow_inference( + comp, value, flow_in, boundaries, "infer_flow_in" + ) + + flow_out = comp.reg(bits_needed(n - 1), "flow_out") + infer_flow_out = insert_flow_inference( + comp, ans.out, flow_out, boundaries, "infer_flow_out" + ) + + rank_ptrs = [comp.reg(32, f"r_{i}") for i in range(n)] + rank_ptr_incrs = dict([(i, comp.incr(rank_ptrs[i], n)) for i in range(n)]) + + turn = comp.reg(bits_needed(n - 1), "turn") + turn_neq_flow_out = comp.neq_use(turn.out, flow_out.out) + turn_incr_mod_n = cb.if_with( + comp.eq_use(turn.out, n - 1), + comp.reg_store(turn, 0), + comp.incr(turn) + ) + + init = comp.reg(1, "init") + init_eq_0 = comp.eq_use(init.out, 0) + init_state = cb.if_with( + init_eq_0, + [ + cb.par(*[ comp.reg_store(rank_ptrs[i], i) for i in range(n) ]), + comp.incr(init) + ] + ) + + def binheap_invoke(value, rank): + return cb.invoke( + binheap, + in_value=value, + in_rank=rank, + in_cmd=cmd, + ref_ans=ans, + ref_err=err, + ) + binheap_invokes = dict([ + (i, binheap_invoke(value, rank_ptrs[i].out)) + for i in range(n) + ]) + + comp.control += [ + init_state, + infer_flow_in, + comp.case(flow_in.out, binheap_invokes), + cb.if_with( + err_eq_0, + comp.case( + cmd, + { + 0: + [ + infer_flow_out, + cb.while_with( + turn_neq_flow_out, + [ + comp.case(turn.out, rank_ptr_incrs), + turn_incr_mod_n + ] + ), + turn_incr_mod_n + ], + 1: + comp.case(flow_in.out, rank_ptr_incrs) + } + ) + ) + ] + + return comp + + +def generate(prog, numflows): + """Generates queue with specific `boundaries`""" + + if numflows == 2: + boundaries = [200, 400] + elif numflows == 3: + boundaries = [133, 266, 400] + elif numflows == 4: + boundaries = [100, 200, 300, 400] + elif numflows == 5: + boundaries = [80, 160, 240, 320, 400] + elif numflows == 6: + boundaries = [66, 100, 200, 220, 300, 400] + elif numflows == 7: + boundaries = [50, 100, 150, 200, 250, 300, 400] + else: + raise ValueError("Unsupported number of flows") + + pifo = insert_binheap_rr(prog, "pifo", boundaries) + + return pifo diff --git a/frontends/queues/queues/binheap/strict.py b/frontends/queues/queues/binheap/strict.py new file mode 100644 index 000000000..0d545ce0e --- /dev/null +++ b/frontends/queues/queues/binheap/strict.py @@ -0,0 +1,80 @@ +# pylint: disable=import-error +import calyx.builder as cb +from calyx.utils import bits_needed +from queues.binheap.stable_binheap import insert_stable_binheap +from queues.binheap.flow_inference import insert_flow_inference + +FACTOR = 4 + + +def insert_binheap_strict( + prog, + name, + boundaries, + order, + queue_size_factor=FACTOR): + n = len(boundaries) + + comp = prog.component(name) + + binheap = insert_stable_binheap(prog, "binheap", queue_size_factor) + binheap = comp.cell("binheap", binheap) + + cmd = comp.input("cmd", 1) + value = comp.input("value", 32) + + ans = comp.reg(32, "ans", is_ref=True) + err = comp.reg(1, "err", is_ref=True) + + flow = comp.reg(bits_needed(n - 1), "flow") + infer_flow = insert_flow_inference( + comp, value, flow, boundaries, "infer_flow" + ) + + def binheap_invoke(value, rank): + return cb.invoke( + binheap, + in_value=value, + in_rank=cb.const(32, rank), + in_cmd=cmd, + ref_ans=ans, + ref_err=err, + ) + binheap_invokes = dict([ + (i, binheap_invoke(value, order.index(i))) + for i in range(n) + ]) + + comp.control += [ infer_flow, comp.case(flow.out, binheap_invokes) ] + + return comp + + +def generate(prog, numflows): + """Generates queue with specific `boundaries`""" + + if numflows == 2: + boundaries = [200, 400] + order = [1, 0] + elif numflows == 3: + boundaries = [133, 266, 400] + order = [1, 2, 0] + elif numflows == 4: + boundaries = [100, 200, 300, 400] + order = [3, 0, 2, 1] + elif numflows == 5: + boundaries = [80, 160, 240, 320, 400] + order = [0, 1, 2, 3, 4] + elif numflows == 6: + boundaries = [66, 100, 200, 220, 300, 400] + order = [3, 1, 5, 2, 4, 0] + elif numflows == 7: + boundaries = [50, 100, 150, 200, 250, 300, 400] + order = [0, 1, 2, 3, 4, 5, 6] + else: + raise ValueError("Unsupported number of flows") + + pifo = insert_binheap_strict(prog, "pifo", boundaries, order) + + return pifo + diff --git a/frontends/queues/queues/strict_or_rr.py b/frontends/queues/queues/strict_or_rr.py index 807cd2e26..1b4490967 100644 --- a/frontends/queues/queues/strict_or_rr.py +++ b/frontends/queues/queues/strict_or_rr.py @@ -125,7 +125,7 @@ def insert_queue( for b in range(numflows) ] invoke_subqueues_value_guard = cb.par( - invoke_subqueues_value_guard_seq + *invoke_subqueues_value_guard_seq ) # Execute in parallel. incr_hot_wraparound = cb.if_with( diff --git a/frontends/queues/registers_round_robin.png b/frontends/queues/registers_round_robin.png new file mode 100644 index 000000000..db81e96b7 Binary files /dev/null and b/frontends/queues/registers_round_robin.png differ diff --git a/frontends/queues/registers_strict.png b/frontends/queues/registers_strict.png new file mode 100644 index 000000000..a795a0a54 Binary files /dev/null and b/frontends/queues/registers_strict.png differ diff --git a/frontends/queues/resources.sh b/frontends/queues/resources.sh new file mode 100755 index 000000000..66659c2fd --- /dev/null +++ b/frontends/queues/resources.sh @@ -0,0 +1,26 @@ +#!/usr/bin/bash + +shopt -s globstar + +if [ "$#" -gt 1 ]; then + echo "usage: ./resources.sh [resource]" + exit 1 +fi + +cd "$(dirname "$0")/../.." # move to root + +for file in frontends/queues/tests/**/*.py; do + name="$(basename $file .py)" + dir="$(dirname $file)" + + resources="$(python3 $file 20000 --keepgoing |\ + fud e --from calyx --to resource-estimate)" + + if [ "$#" -eq 1 ]; then + resource=$(jq ".$1" <<< "$resources") + echo "${file#*tests/}: $resource" + else + newline=$'\n' + echo "${file#*tests/}${newline}$resources${newline}" + fi +done diff --git a/frontends/queues/resources.txt b/frontends/queues/resources.txt new file mode 100644 index 000000000..ebafeebd6 --- /dev/null +++ b/frontends/queues/resources.txt @@ -0,0 +1,780 @@ +binheap/binheap_test.py +{ + "lut": 628, + "dsp": 0, + "registers": 64, + "muxes": 46, + "clb_registers": 641, + "carry8": 16, + "f7_muxes": 0, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 1285, + "meet_timing": 1, + "worst_slack": 3.264, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 2, + "cell_lut2": 62, + "cell_lut3": 96, + "cell_lut4": 133, + "cell_lut5": 344, + "cell_lut6": 188, + "cell_fdre": 641 +} + +binheap/fifo_test.py +{ + "lut": 662, + "dsp": 0, + "registers": 92, + "muxes": 66, + "clb_registers": 786, + "carry8": 30, + "f7_muxes": 0, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 1478, + "meet_timing": 1, + "worst_slack": 3.27, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 5, + "cell_lut2": 98, + "cell_lut3": 153, + "cell_lut4": 79, + "cell_lut5": 323, + "cell_lut6": 241, + "cell_fdre": 786 +} + +binheap/pifo_test.py +{ + "lut": 817, + "dsp": 0, + "registers": 124, + "muxes": 83, + "clb_registers": 868, + "carry8": 38, + "f7_muxes": 0, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 1723, + "meet_timing": 1, + "worst_slack": 2.599, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 6, + "cell_lut2": 123, + "cell_lut3": 163, + "cell_lut4": 148, + "cell_lut5": 375, + "cell_lut6": 257, + "cell_fdre": 868 +} + +binheap/round_robin/rr_2flow_test.py +{ + "lut": 887, + "dsp": 0, + "registers": 144, + "muxes": 85, + "clb_registers": 881, + "carry8": 44, + "f7_muxes": 0, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 1812, + "meet_timing": 1, + "worst_slack": 2.526, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 7, + "cell_lut2": 128, + "cell_lut3": 142, + "cell_lut4": 92, + "cell_lut5": 462, + "cell_lut6": 293, + "cell_fdre": 881 +} + +binheap/round_robin/rr_3flow_test.py +{ + "lut": 1020, + "dsp": 0, + "registers": 154, + "muxes": 92, + "clb_registers": 921, + "carry8": 52, + "f7_muxes": 0, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 1993, + "meet_timing": 1, + "worst_slack": 2.84, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 6, + "cell_lut2": 259, + "cell_lut3": 157, + "cell_lut4": 68, + "cell_lut5": 420, + "cell_lut6": 395, + "cell_fdre": 921 +} + +binheap/round_robin/rr_4flow_test.py +{ + "lut": 1047, + "dsp": 0, + "registers": 164, + "muxes": 91, + "clb_registers": 954, + "carry8": 60, + "f7_muxes": 0, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 2061, + "meet_timing": 1, + "worst_slack": 1.584, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 8, + "cell_lut2": 276, + "cell_lut3": 141, + "cell_lut4": 90, + "cell_lut5": 448, + "cell_lut6": 431, + "cell_fdre": 954 +} + +binheap/round_robin/rr_5flow_test.py +{ + "lut": 1138, + "dsp": 0, + "registers": 174, + "muxes": 99, + "clb_registers": 998, + "carry8": 68, + "f7_muxes": 0, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 2204, + "meet_timing": 1, + "worst_slack": 2.182, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 13, + "cell_lut2": 291, + "cell_lut3": 130, + "cell_lut4": 86, + "cell_lut5": 440, + "cell_lut6": 521, + "cell_fdre": 998 +} + +binheap/round_robin/rr_6flow_test.py +{ + "lut": 1261, + "dsp": 0, + "registers": 184, + "muxes": 97, + "clb_registers": 1032, + "carry8": 76, + "f7_muxes": 0, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 2369, + "meet_timing": 1, + "worst_slack": 2.539, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 14, + "cell_lut2": 289, + "cell_lut3": 143, + "cell_lut4": 86, + "cell_lut5": 509, + "cell_lut6": 582, + "cell_fdre": 1032 +} + +binheap/round_robin/rr_7flow_test.py +{ + "lut": 1360, + "dsp": 0, + "registers": 194, + "muxes": 99, + "clb_registers": 1072, + "carry8": 84, + "f7_muxes": 0, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 2516, + "meet_timing": 1, + "worst_slack": 2.403, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 22, + "cell_lut2": 295, + "cell_lut3": 147, + "cell_lut4": 102, + "cell_lut5": 434, + "cell_lut6": 728, + "cell_fdre": 1072 +} + +binheap/stable_binheap_test.py +{ + "lut": 657, + "dsp": 0, + "registers": 94, + "muxes": 66, + "clb_registers": 819, + "carry8": 30, + "f7_muxes": 0, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 1506, + "meet_timing": 1, + "worst_slack": 3.096, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 5, + "cell_lut2": 124, + "cell_lut3": 154, + "cell_lut4": 47, + "cell_lut5": 426, + "cell_lut6": 148, + "cell_fdre": 819 +} + +binheap/strict/strict_2flow_test.py +{ + "lut": 767, + "dsp": 0, + "registers": 112, + "muxes": 73, + "clb_registers": 799, + "carry8": 36, + "f7_muxes": 0, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 1602, + "meet_timing": 1, + "worst_slack": 2.597, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 5, + "cell_lut2": 91, + "cell_lut3": 162, + "cell_lut4": 83, + "cell_lut5": 277, + "cell_lut6": 341, + "cell_fdre": 799 +} + +binheap/strict/strict_3flow_test.py +{ + "lut": 749, + "dsp": 0, + "registers": 118, + "muxes": 76, + "clb_registers": 804, + "carry8": 40, + "f7_muxes": 0, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 1593, + "meet_timing": 1, + "worst_slack": 2.703, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 5, + "cell_lut2": 127, + "cell_lut3": 126, + "cell_lut4": 80, + "cell_lut5": 455, + "cell_lut6": 228, + "cell_fdre": 804 +} + +binheap/strict/strict_4flow_test.py +{ + "lut": 785, + "dsp": 0, + "registers": 124, + "muxes": 75, + "clb_registers": 808, + "carry8": 44, + "f7_muxes": 0, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 1637, + "meet_timing": 1, + "worst_slack": 2.469, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 5, + "cell_lut2": 97, + "cell_lut3": 129, + "cell_lut4": 74, + "cell_lut5": 517, + "cell_lut6": 240, + "cell_fdre": 808 +} + +binheap/strict/strict_5flow_test.py +{ + "lut": 890, + "dsp": 0, + "registers": 130, + "muxes": 79, + "clb_registers": 815, + "carry8": 48, + "f7_muxes": 0, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 1753, + "meet_timing": 1, + "worst_slack": 2.41, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 5, + "cell_lut2": 96, + "cell_lut3": 134, + "cell_lut4": 87, + "cell_lut5": 427, + "cell_lut6": 369, + "cell_fdre": 815 +} + +binheap/strict/strict_6flow_test.py +{ + "lut": 972, + "dsp": 0, + "registers": 136, + "muxes": 78, + "clb_registers": 817, + "carry8": 52, + "f7_muxes": 0, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 1841, + "meet_timing": 1, + "worst_slack": 2.418, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 6, + "cell_lut2": 252, + "cell_lut3": 136, + "cell_lut4": 353, + "cell_lut5": 386, + "cell_lut6": 227, + "cell_fdre": 817 +} + +complex_tree_test.py +{ + "lut": 2162, + "dsp": 0, + "registers": 558, + "muxes": 318, + "clb_registers": 1138, + "carry8": 132, + "f7_muxes": 32, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 3464, + "meet_timing": 1, + "worst_slack": 2.307, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 150, + "cell_lut2": 168, + "cell_lut3": 477, + "cell_lut4": 641, + "cell_lut5": 697, + "cell_lut6": 511, + "cell_fdre": 1138 +} + +fifo_test.py +{ + "lut": 169, + "dsp": 0, + "registers": 60, + "muxes": 30, + "clb_registers": 210, + "carry8": 10, + "f7_muxes": 0, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 389, + "meet_timing": 1, + "worst_slack": 4.758, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 5, + "cell_lut2": 110, + "cell_lut3": 38, + "cell_lut4": 17, + "cell_lut5": 18, + "cell_lut6": 49, + "cell_fdre": 210 +} + +pifo_tree_test.py +{ + "lut": 912, + "dsp": 0, + "registers": 240, + "muxes": 138, + "clb_registers": 538, + "carry8": 62, + "f7_muxes": 0, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 1512, + "meet_timing": 1, + "worst_slack": 2.933, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 73, + "cell_lut2": 105, + "cell_lut3": 239, + "cell_lut4": 228, + "cell_lut5": 275, + "cell_lut6": 208, + "cell_fdre": 538 +} + +round_robin/rr_2flow_test.py +{ + "lut": 537, + "dsp": 0, + "registers": 150, + "muxes": 84, + "clb_registers": 374, + "carry8": 36, + "f7_muxes": 0, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 947, + "meet_timing": 1, + "worst_slack": 3.612, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 39, + "cell_lut2": 88, + "cell_lut3": 226, + "cell_lut4": 118, + "cell_lut5": 97, + "cell_lut6": 125, + "cell_fdre": 374 +} + +round_robin/rr_3flow_test.py +{ + "lut": 717, + "dsp": 0, + "registers": 196, + "muxes": 106, + "clb_registers": 444, + "carry8": 42, + "f7_muxes": 0, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 1203, + "meet_timing": 1, + "worst_slack": 3.223, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 42, + "cell_lut2": 164, + "cell_lut3": 203, + "cell_lut4": 129, + "cell_lut5": 149, + "cell_lut6": 198, + "cell_fdre": 444 +} + +round_robin/rr_4flow_test.py +{ + "lut": 864, + "dsp": 0, + "registers": 242, + "muxes": 126, + "clb_registers": 514, + "carry8": 48, + "f7_muxes": 0, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 1426, + "meet_timing": 1, + "worst_slack": 3.282, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 45, + "cell_lut2": 107, + "cell_lut3": 336, + "cell_lut4": 194, + "cell_lut5": 176, + "cell_lut6": 217, + "cell_fdre": 514 +} + +round_robin/rr_5flow_test.py +{ + "lut": 1039, + "dsp": 0, + "registers": 288, + "muxes": 135, + "clb_registers": 584, + "carry8": 54, + "f7_muxes": 0, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 1677, + "meet_timing": 1, + "worst_slack": 2.607, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 48, + "cell_lut2": 104, + "cell_lut3": 351, + "cell_lut4": 296, + "cell_lut5": 246, + "cell_lut6": 245, + "cell_fdre": 584 +} + +round_robin/rr_6flow_test.py +{ + "lut": 1178, + "dsp": 0, + "registers": 334, + "muxes": 150, + "clb_registers": 654, + "carry8": 60, + "f7_muxes": 0, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 1892, + "meet_timing": 1, + "worst_slack": 2.886, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 51, + "cell_lut2": 120, + "cell_lut3": 419, + "cell_lut4": 364, + "cell_lut5": 222, + "cell_lut6": 289, + "cell_fdre": 654 +} + +round_robin/rr_7flow_test.py +{ + "lut": 1357, + "dsp": 0, + "registers": 380, + "muxes": 171, + "clb_registers": 724, + "carry8": 66, + "f7_muxes": 0, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 2147, + "meet_timing": 1, + "worst_slack": 2.947, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 54, + "cell_lut2": 120, + "cell_lut3": 480, + "cell_lut4": 424, + "cell_lut5": 285, + "cell_lut6": 333, + "cell_fdre": 724 +} + +sdn_test.py +{ + "lut": 912, + "dsp": 0, + "registers": 240, + "muxes": 138, + "clb_registers": 538, + "carry8": 62, + "f7_muxes": 0, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 1512, + "meet_timing": 1, + "worst_slack": 2.933, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 73, + "cell_lut2": 105, + "cell_lut3": 239, + "cell_lut4": 228, + "cell_lut5": 275, + "cell_lut6": 208, + "cell_fdre": 538 +} + +strict/strict_2flow_test.py +{ + "lut": 553, + "dsp": 0, + "registers": 150, + "muxes": 87, + "clb_registers": 405, + "carry8": 36, + "f7_muxes": 0, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 994, + "meet_timing": 1, + "worst_slack": 3.539, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 39, + "cell_lut2": 150, + "cell_lut3": 188, + "cell_lut4": 116, + "cell_lut5": 79, + "cell_lut6": 135, + "cell_fdre": 405 +} + +strict/strict_3flow_test.py +{ + "lut": 722, + "dsp": 0, + "registers": 196, + "muxes": 109, + "clb_registers": 475, + "carry8": 42, + "f7_muxes": 0, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 1239, + "meet_timing": 1, + "worst_slack": 3.384, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 42, + "cell_lut2": 93, + "cell_lut3": 257, + "cell_lut4": 122, + "cell_lut5": 164, + "cell_lut6": 211, + "cell_fdre": 475 +} + +strict/strict_4flow_test.py +{ + "lut": 877, + "dsp": 0, + "registers": 242, + "muxes": 129, + "clb_registers": 545, + "carry8": 48, + "f7_muxes": 0, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 1470, + "meet_timing": 1, + "worst_slack": 3.558, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 45, + "cell_lut2": 111, + "cell_lut3": 334, + "cell_lut4": 236, + "cell_lut5": 135, + "cell_lut6": 228, + "cell_fdre": 545 +} + +strict/strict_5flow_test.py +{ + "lut": 1041, + "dsp": 0, + "registers": 288, + "muxes": 142, + "clb_registers": 615, + "carry8": 54, + "f7_muxes": 0, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 1710, + "meet_timing": 1, + "worst_slack": 3.192, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 48, + "cell_lut2": 99, + "cell_lut3": 344, + "cell_lut4": 290, + "cell_lut5": 189, + "cell_lut6": 300, + "cell_fdre": 615 +} + +strict/strict_6flow_test.py +{ + "lut": 1194, + "dsp": 0, + "registers": 334, + "muxes": 157, + "clb_registers": 685, + "carry8": 60, + "f7_muxes": 33, + "f8_muxes": 0, + "f9_muxes": 0, + "clb": 1972, + "meet_timing": 1, + "worst_slack": 2.973, + "period": 7.0, + "frequency": 142.857, + "uram": -1, + "cell_lut1": 51, + "cell_lut2": 105, + "cell_lut3": 398, + "cell_lut4": 344, + "cell_lut5": 206, + "cell_lut6": 350, + "cell_fdre": 685 +} + diff --git a/frontends/queues/test_data_gen/clean_test_data.sh b/frontends/queues/test_data_gen/clean_test_data.sh index 56a04ed2c..14f3d4332 100755 --- a/frontends/queues/test_data_gen/clean_test_data.sh +++ b/frontends/queues/test_data_gen/clean_test_data.sh @@ -6,6 +6,8 @@ cd binheap/ for test in fifo_test pifo_test stable_binheap_test; do rm -rf $test.data $test.expect done +rm -rf round_robin/*.data round_robin/*.expect +rm -rf strict/*.data strict/*.expect cd ../round_robin rm -rf *.data *.expect diff --git a/frontends/queues/test_data_gen/gen_test_data.sh b/frontends/queues/test_data_gen/gen_test_data.sh index 45d692886..1448f826d 100755 --- a/frontends/queues/test_data_gen/gen_test_data.sh +++ b/frontends/queues/test_data_gen/gen_test_data.sh @@ -29,18 +29,6 @@ for queue_kind in fifo pifo pifo_tree complex_tree; do [[ "$queue_kind" != "pifo" && $? -eq 0 ]] && echo "Generated ${queue_kind}_test.expect" done -# Copying/Moving into binheap/ - -cp $tests_dir/fifo_test.data $tests_dir/binheap/ -[[ $? -eq 0 ]] && echo "Generated binheap/fifo_test.data" -cp $tests_dir/fifo_test.expect $tests_dir/binheap/ -[[ $? -eq 0 ]] && echo "Generated binheap/fifo_test.expect" - -mv $tests_dir/pifo_test.data $tests_dir/binheap/ -[[ $? -eq 0 ]] && echo "Generated binheap/pifo_test.data" -mv $tests_dir/pifo_test.expect $tests_dir/binheap/ -[[ $? -eq 0 ]] && echo "Generated binheap/pifo_test.expect" - # Here, we test the queues for non-work-conserving algorithms, # which are the following: @@ -54,6 +42,7 @@ for queue_kind in pieo nwc_simple; do [[ $? -eq 0 ]] && echo "Generated ${queue_kind}_test.expect" done + # For the Binary Heap, we drop piezo mode and enable ranks for data gen and # use binheap_oracle to generate the expected output @@ -62,6 +51,7 @@ python3 $data_gen_dir/gen_oracle_data.py $num_cmds --use-rank > $tests_dir/binhe cat $tests_dir/binheap/stable_binheap_test.data | python3 $data_gen_dir/binheap_oracle.py $num_cmds $queue_size --keepgoing > $tests_dir/binheap/stable_binheap_test.expect [[ $? -eq 0 ]] && echo "Generated binheap/stable_binheap_test.expect" + # For the Round Robin queues, we drop piezo mode as well and use rrqueue_oracle to # generate the expected output for queues with 2..7 flows. This generates 6 data expect file pairs. @@ -72,6 +62,7 @@ for n in {2..7}; do [[ $? -eq 0 ]] && echo "Generated round_robin/rr_${n}flow_test.expect" done + # For Strict queues, we use strict_queue_oracle.py to generate the expected output # for queues with 2..6 flows, each with a different strict ordering. This generates 5 # expect file pairs. @@ -82,3 +73,40 @@ for n in {2..6}; do cat $tests_dir/strict/strict_${n}flow_test.data | python3 $data_gen_dir/strict_queue_oracle.py $num_cmds $queue_size $n --keepgoing > $tests_dir/strict/strict_${n}flow_test.expect [[ $? -eq 0 ]] && echo "Generated strict/strict_${n}flow_test.expect" done + + +# Copying/Moving into binheap/ + +cp $tests_dir/fifo_test.data $tests_dir/binheap/ +[[ $? -eq 0 ]] && echo "Generated binheap/fifo_test.data" +cp $tests_dir/fifo_test.expect $tests_dir/binheap/ +[[ $? -eq 0 ]] && echo "Generated binheap/fifo_test.expect" + +mv $tests_dir/pifo_test.data $tests_dir/binheap/ +[[ $? -eq 0 ]] && echo "Generated binheap/pifo_test.data" +mv $tests_dir/pifo_test.expect $tests_dir/binheap/ +[[ $? -eq 0 ]] && echo "Generated binheap/pifo_test.expect" + +for i in $tests_dir/round_robin/*.data; do + file="$(basename $i)" + cp $i $tests_dir/binheap/round_robin/$file + [[ $? -eq 0 ]] && echo "Generated binheap/round_robin/$file" +done + +for i in $tests_dir/round_robin/*.expect; do + file="$(basename $i)" + cp $i $tests_dir/binheap/round_robin/$file + [[ $? -eq 0 ]] && echo "Generated binheap/round_robin/$file" +done + +for i in $tests_dir/strict/*.data; do + file="$(basename $i)" + cp $i $tests_dir/binheap/strict/$file + [[ $? -eq 0 ]] && echo "Generated binheap/strict/$file" +done + +for i in $tests_dir/strict/*.expect; do + file="$(basename $i)" + cp $i $tests_dir/binheap/strict/$file + [[ $? -eq 0 ]] && echo "Generated binheap/strict/$file" +done diff --git a/frontends/queues/tests/binheap/round_robin/rr_2flow_test.py b/frontends/queues/tests/binheap/round_robin/rr_2flow_test.py new file mode 100644 index 000000000..572f1dfb1 --- /dev/null +++ b/frontends/queues/tests/binheap/round_robin/rr_2flow_test.py @@ -0,0 +1,15 @@ +import sys +import calyx.builder as cb +import queues.queue_call as qc +from queues import binheap_rr + + +if __name__ == "__main__": + """Invoke the top-level function to build the program, with 2 flows.""" + num_cmds = int(sys.argv[1]) + keepgoing = "--keepgoing" in sys.argv + + prog = cb.Builder() + pifo = binheap_rr.generate(prog, 2) + qc.insert_main(prog, pifo, num_cmds, keepgoing=keepgoing) + prog.program.emit() diff --git a/frontends/queues/tests/binheap/round_robin/rr_3flow_test.py b/frontends/queues/tests/binheap/round_robin/rr_3flow_test.py new file mode 100644 index 000000000..2162b757f --- /dev/null +++ b/frontends/queues/tests/binheap/round_robin/rr_3flow_test.py @@ -0,0 +1,15 @@ +import sys +import calyx.builder as cb +import queues.queue_call as qc +from queues import binheap_rr + + +if __name__ == "__main__": + """Invoke the top-level function to build the program, with 3 flows.""" + num_cmds = int(sys.argv[1]) + keepgoing = "--keepgoing" in sys.argv + + prog = cb.Builder() + pifo = binheap_rr.generate(prog, 3) + qc.insert_main(prog, pifo, num_cmds, keepgoing=keepgoing) + prog.program.emit() diff --git a/frontends/queues/tests/binheap/round_robin/rr_4flow_test.py b/frontends/queues/tests/binheap/round_robin/rr_4flow_test.py new file mode 100644 index 000000000..d326567ee --- /dev/null +++ b/frontends/queues/tests/binheap/round_robin/rr_4flow_test.py @@ -0,0 +1,15 @@ +import sys +import calyx.builder as cb +import queues.queue_call as qc +from queues import binheap_rr + + +if __name__ == "__main__": + """Invoke the top-level function to build the program, with 4 flows.""" + num_cmds = int(sys.argv[1]) + keepgoing = "--keepgoing" in sys.argv + + prog = cb.Builder() + pifo = binheap_rr.generate(prog, 4) + qc.insert_main(prog, pifo, num_cmds, keepgoing=keepgoing) + prog.program.emit() diff --git a/frontends/queues/tests/binheap/round_robin/rr_5flow_test.py b/frontends/queues/tests/binheap/round_robin/rr_5flow_test.py new file mode 100644 index 000000000..44fd71e2c --- /dev/null +++ b/frontends/queues/tests/binheap/round_robin/rr_5flow_test.py @@ -0,0 +1,15 @@ +import sys +import calyx.builder as cb +import queues.queue_call as qc +from queues import binheap_rr + + +if __name__ == "__main__": + """Invoke the top-level function to build the program, with 5 flows.""" + num_cmds = int(sys.argv[1]) + keepgoing = "--keepgoing" in sys.argv + + prog = cb.Builder() + pifo = binheap_rr.generate(prog, 5) + qc.insert_main(prog, pifo, num_cmds, keepgoing=keepgoing) + prog.program.emit() diff --git a/frontends/queues/tests/binheap/round_robin/rr_6flow_test.py b/frontends/queues/tests/binheap/round_robin/rr_6flow_test.py new file mode 100644 index 000000000..01596c534 --- /dev/null +++ b/frontends/queues/tests/binheap/round_robin/rr_6flow_test.py @@ -0,0 +1,15 @@ +import sys +import calyx.builder as cb +import queues.queue_call as qc +from queues import binheap_rr + + +if __name__ == "__main__": + """Invoke the top-level function to build the program, with 6 flows.""" + num_cmds = int(sys.argv[1]) + keepgoing = "--keepgoing" in sys.argv + + prog = cb.Builder() + pifo = binheap_rr.generate(prog, 6) + qc.insert_main(prog, pifo, num_cmds, keepgoing=keepgoing) + prog.program.emit() diff --git a/frontends/queues/tests/binheap/round_robin/rr_7flow_test.py b/frontends/queues/tests/binheap/round_robin/rr_7flow_test.py new file mode 100644 index 000000000..0c89de620 --- /dev/null +++ b/frontends/queues/tests/binheap/round_robin/rr_7flow_test.py @@ -0,0 +1,15 @@ +import sys +import calyx.builder as cb +import queues.queue_call as qc +from queues import binheap_rr + + +if __name__ == "__main__": + """Invoke the top-level function to build the program, with 7 flows.""" + num_cmds = int(sys.argv[1]) + keepgoing = "--keepgoing" in sys.argv + + prog = cb.Builder() + pifo = binheap_rr.generate(prog, 7) + qc.insert_main(prog, pifo, num_cmds, keepgoing=keepgoing) + prog.program.emit() diff --git a/frontends/queues/tests/binheap/strict/strict_2flow_test.py b/frontends/queues/tests/binheap/strict/strict_2flow_test.py new file mode 100644 index 000000000..dc66bb147 --- /dev/null +++ b/frontends/queues/tests/binheap/strict/strict_2flow_test.py @@ -0,0 +1,15 @@ +import sys +import calyx.builder as cb +import queues.queue_call as qc +from queues import binheap_strict + + +if __name__ == "__main__": + """Invoke the top-level function to build the program, with 2 flows.""" + num_cmds = int(sys.argv[1]) + keepgoing = "--keepgoing" in sys.argv + + prog = cb.Builder() + pifo = binheap_strict.generate(prog, 2) + qc.insert_main(prog, pifo, num_cmds, keepgoing=keepgoing) + prog.program.emit() diff --git a/frontends/queues/tests/binheap/strict/strict_3flow_test.py b/frontends/queues/tests/binheap/strict/strict_3flow_test.py new file mode 100644 index 000000000..8b2322c3f --- /dev/null +++ b/frontends/queues/tests/binheap/strict/strict_3flow_test.py @@ -0,0 +1,15 @@ +import sys +import calyx.builder as cb +import queues.queue_call as qc +from queues import binheap_strict + + +if __name__ == "__main__": + """Invoke the top-level function to build the program, with 3 flows.""" + num_cmds = int(sys.argv[1]) + keepgoing = "--keepgoing" in sys.argv + + prog = cb.Builder() + pifo = binheap_strict.generate(prog, 3) + qc.insert_main(prog, pifo, num_cmds, keepgoing=keepgoing) + prog.program.emit() diff --git a/frontends/queues/tests/binheap/strict/strict_4flow_test.py b/frontends/queues/tests/binheap/strict/strict_4flow_test.py new file mode 100644 index 000000000..3e1227c8c --- /dev/null +++ b/frontends/queues/tests/binheap/strict/strict_4flow_test.py @@ -0,0 +1,15 @@ +import sys +import calyx.builder as cb +import queues.queue_call as qc +from queues import binheap_strict + + +if __name__ == "__main__": + """Invoke the top-level function to build the program, with 4 flows.""" + num_cmds = int(sys.argv[1]) + keepgoing = "--keepgoing" in sys.argv + + prog = cb.Builder() + pifo = binheap_strict.generate(prog, 4) + qc.insert_main(prog, pifo, num_cmds, keepgoing=keepgoing) + prog.program.emit() diff --git a/frontends/queues/tests/binheap/strict/strict_5flow_test.py b/frontends/queues/tests/binheap/strict/strict_5flow_test.py new file mode 100644 index 000000000..d20517110 --- /dev/null +++ b/frontends/queues/tests/binheap/strict/strict_5flow_test.py @@ -0,0 +1,15 @@ +import sys +import calyx.builder as cb +import queues.queue_call as qc +from queues import binheap_strict + + +if __name__ == "__main__": + """Invoke the top-level function to build the program, with 5 flows.""" + num_cmds = int(sys.argv[1]) + keepgoing = "--keepgoing" in sys.argv + + prog = cb.Builder() + pifo = binheap_strict.generate(prog, 5) + qc.insert_main(prog, pifo, num_cmds, keepgoing=keepgoing) + prog.program.emit() diff --git a/frontends/queues/tests/binheap/strict/strict_6flow_test.py b/frontends/queues/tests/binheap/strict/strict_6flow_test.py new file mode 100644 index 000000000..2d7692d3f --- /dev/null +++ b/frontends/queues/tests/binheap/strict/strict_6flow_test.py @@ -0,0 +1,15 @@ +import sys +import calyx.builder as cb +import queues.queue_call as qc +from queues import binheap_strict + + +if __name__ == "__main__": + """Invoke the top-level function to build the program, with 6 flows.""" + num_cmds = int(sys.argv[1]) + keepgoing = "--keepgoing" in sys.argv + + prog = cb.Builder() + pifo = binheap_strict.generate(prog, 6) + qc.insert_main(prog, pifo, num_cmds, keepgoing=keepgoing) + prog.program.emit() diff --git a/frontends/queues/total_time_round_robin.png b/frontends/queues/total_time_round_robin.png new file mode 100644 index 000000000..27d5be30a Binary files /dev/null and b/frontends/queues/total_time_round_robin.png differ diff --git a/frontends/queues/total_time_strict.png b/frontends/queues/total_time_strict.png new file mode 100644 index 000000000..d2cf7371b Binary files /dev/null and b/frontends/queues/total_time_strict.png differ diff --git a/frontends/queues/worst_slack_round_robin.png b/frontends/queues/worst_slack_round_robin.png new file mode 100644 index 000000000..21f8679a3 Binary files /dev/null and b/frontends/queues/worst_slack_round_robin.png differ diff --git a/frontends/queues/worst_slack_strict.png b/frontends/queues/worst_slack_strict.png new file mode 100644 index 000000000..f931c33f4 Binary files /dev/null and b/frontends/queues/worst_slack_strict.png differ diff --git a/runt.toml b/runt.toml index 5533ace48..95ebcc7a0 100644 --- a/runt.toml +++ b/runt.toml @@ -112,7 +112,9 @@ paths = [ "frontends/queues/tests/*.py", "frontends/queues/tests/round_robin/*.py", "frontends/queues/tests/strict/*.py", - "frontends/queues/tests/binheap/*.py" + "frontends/queues/tests/binheap/*.py", + "frontends/queues/tests/binheap/round_robin/*.py", + "frontends/queues/tests/binheap/strict/*.py" ] cmd = """ name=$(basename {} .py) &&