Skip to content

Commit

Permalink
changes for onyx demo
Browse files Browse the repository at this point in the history
  • Loading branch information
yuchen-mei committed Jul 26, 2024
1 parent 33316c3 commit 9740093
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
26 changes: 15 additions & 11 deletions garnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,27 +503,31 @@ def load_netlist(self, app, load_only, pipeline_input_broadcasts,
connections_list[idx] = (tag_, pin_remap)
netlist_info['netlist'][netlist_id] = connections_list

pond_remap = {}
pond_remap["data_in_pond_0"] = "PondTop_input_width_17_num_0"
pond_remap["data_out_pond_0"] = "PondTop_output_width_17_num_0"
pond_remap["data_in_pond_1"] = "PondTop_input_width_17_num_1"
pond_remap["data_out_pond_1"] = "PondTop_output_width_17_num_1"

if not self.amber_pond:
# temporally remapping of port names for the new Pond
for name, mapping in netlist_info["netlist"].items():
for i in range(len(mapping)):
(inst_name, port_name) = mapping[i]
if "data_in_pond_0" in port_name:
mapping[i] = (inst_name, "PondTop_input_width_17_num_0")
if "data_out_pond_0" in port_name:
mapping[i] = (inst_name, "PondTop_output_width_17_num_0")
if "data_in_pond_1" in port_name:
mapping[i] = (inst_name, "PondTop_input_width_17_num_1")
if "data_out_pond_1" in port_name:
mapping[i] = (inst_name, "PondTop_output_width_17_num_1")
if port_name in pond_remap:
mapping[i] = (inst_name, pond_remap[port_name])


self.pack_ponds(netlist_info)

all_remaps = {}
all_remaps['pe'] = pe_remap['alu']
all_remaps['pond'] = pond_remap
all_remaps['mem'] = mem_remap

port_remap_fout = open(app_dir + "/design.port_remap", "w")
port_remap_fout.write(json.dumps(pe_remap['alu']))
port_remap_fout.write(json.dumps(all_remaps))
port_remap_fout.close()

print_netlist_info(netlist_info, self.pes_with_packed_ponds, app_dir + "/netlist_info.txt")

return (netlist_info["id_to_name"], netlist_info["instance_to_instrs"], netlist_info["netlist"],
Expand Down
4 changes: 2 additions & 2 deletions mapper/netlist_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1079,8 +1079,8 @@ def tile_to_char(t):
node_info = {t: tile_to_char(t) for t in tile_info}
nodes_to_ids = CreateIDs(node_info).doit(pdag)

if load_only:
name_to_id = {name: id_ for id_, name in id_to_name.items()}
# if load_only:
# name_to_id = {name: id_ for id_, name in id_to_name.items()}

info = {}
info["id_to_name"] = {id: node for node, id in nodes_to_ids.items()}
Expand Down

0 comments on commit 9740093

Please sign in to comment.