diff --git a/sam/onyx/hw_nodes/compute_node.py b/sam/onyx/hw_nodes/compute_node.py index 2fb7620f..2482f399 100644 --- a/sam/onyx/hw_nodes/compute_node.py +++ b/sam/onyx/hw_nodes/compute_node.py @@ -81,7 +81,7 @@ def connect(self, other, edge, kwargs=None): pe = self.get_name() new_conns = { f'pe_to_reduce': [ - ([(pe, "res"), (other_red, f"data_in")], 17), + ([(pe, "res"), (other_red, f"reduce_data_in")], 17), ] } return new_conns @@ -151,6 +151,12 @@ def configure(self, attributes): comment = attributes['comment'].strip('"') print(c_op) op_code = 0 + # configuring via sam, it is a sparse app + use_dense = False + # mapping to pe only, configuring only the pe, ignore the reduce + pe_only = True + # data I/O should interface with other primitive outside of the cluster + pe_in_external = 1 if c_op == 'mul': op_code = 1 elif c_op == 'add' and 'sub=1' not in comment: @@ -158,6 +164,9 @@ def configure(self, attributes): elif c_op == 'add' and 'sub=1' in comment: op_code = 2 cfg_kwargs = { - 'op': op_code + 'op': op_code, + 'use_dense': use_dense, + 'pe_only': pe_only, + 'pe_in_external': pe_in_external } - return op_code, cfg_kwargs + return (op_code, use_dense, pe_only, pe_in_external), cfg_kwargs diff --git a/sam/onyx/hw_nodes/merge_node.py b/sam/onyx/hw_nodes/merge_node.py index 9b1f1ae7..c0b3d158 100644 --- a/sam/onyx/hw_nodes/merge_node.py +++ b/sam/onyx/hw_nodes/merge_node.py @@ -68,7 +68,7 @@ def connect(self, other, edge, kwargs=None): other_red = other.get_name() new_conns = { f'merge_to_reduce_inner': [ - ([(merge, f"cmrg_coord_out_{0}"), (other_red, f"data_in")], 17), + ([(merge, f"cmrg_coord_out_{0}"), (other_red, f"reduce_data_in")], 17), ] } diff --git a/sam/onyx/hw_nodes/reduce_node.py b/sam/onyx/hw_nodes/reduce_node.py index 5caac658..6ed41cf7 100644 --- a/sam/onyx/hw_nodes/reduce_node.py +++ b/sam/onyx/hw_nodes/reduce_node.py @@ -39,7 +39,7 @@ def connect(self, other, edge, kwargs=None): new_conns = { 'reduce_to_wr_scan': [ # send output to rd scanner - ([(red, "data_out"), (wr_scan, "data_in")], 17), + ([(red, "reduce_data_out"), (wr_scan, "data_in")], 17), # ([(red, "eos_out"), (wr_scan, "eos_in_0")], 1), # ([(wr_scan, "ready_out_0"), (red, "ready_in")], 1), # ([(red, "valid_out"), (wr_scan, "valid_in_0")], 1), @@ -53,7 +53,7 @@ def connect(self, other, edge, kwargs=None): new_conns = { 'reduce_to_reduce': [ # send output to rd scanner - ([(red, "data_out"), (other_red, "data_in")], 17), + ([(red, "reduce_data_out"), (other_red, "reduce_data_in")], 17), # ([(red, "eos_out"), (wr_scan, "eos_in_0")], 1), # ([(wr_scan, "ready_out_0"), (red, "ready_in")], 1), # ([(red, "valid_out"), (wr_scan, "valid_in_0")], 1), @@ -72,7 +72,7 @@ def connect(self, other, edge, kwargs=None): new_conns = { f'reduce_to_pe_{other_conn}': [ # send output to rd scanner - ([(red, "data_out"), (pe, f"data{other_conn}")], 17), + ([(red, "reduce_data_out"), (pe, f"data{other_conn}")], 17), # ([(red, "eos_out"), (wr_scan, "eos_in_0")], 1), # ([(wr_scan, "ready_out_0"), (red, "ready_in")], 1), # ([(red, "valid_out"), (wr_scan, "valid_in_0")], 1), @@ -102,7 +102,19 @@ def connect(self, other, edge, kwargs=None): def configure(self, attributes): # TODO stop_lvl = 2 + # bypassing the fifos in the pe, get result in a single cycle + pe_only = False + # configuring both the pe and the reduce + pe_connected_to_reduce = True + # data I/O to and from the PE should be internal with the reduce + pe_in_external = 0 + # op is set to integer add for the PE TODO: make this configurable in the sam graph + op = 0 cfg_kwargs = { - 'stop_lvl': stop_lvl + 'stop_lvl': stop_lvl, + 'pe_connected_to_reduce': pe_connected_to_reduce, + 'pe_only': pe_only, + 'pe_in_external': pe_in_external, + 'op': op } - return stop_lvl, cfg_kwargs + return (stop_lvl, pe_connected_to_reduce, pe_only, pe_in_external, op), cfg_kwargs