Commit 347de1d1 by sakundu

Updated CodeElement formatTranslators and added Ariane133-NG45 clustered netlist

Signed-off-by: sakundu <sakundu@ucsd.edu>
parent ededa3b5
...@@ -13,7 +13,8 @@ from FormatTranslators import MacroPin ...@@ -13,7 +13,8 @@ from FormatTranslators import MacroPin
class Clustering: class Clustering:
def __init__(self, design, src_dir, fixed_file, step_threshold = 100.6, distance = 1000.0, def __init__(self, design, src_dir, fixed_file, step_threshold = 100.6, distance = 1000.0,
grid_width = 30.0, max_num_vertices = 1000000, net_size_threshold = 300, grid_width = 30.0, max_num_vertices = 1000000, net_size_threshold = 300,
Nparts = 500, setup_file = "setup.tcl", RePlace = True, placement_density = 0.7, GUI = True): Nparts = 500, setup_file = "setup.tcl", result_dir = "./results",
RePlace = True, placement_density = 0.7, GUI = True):
""" """
parameter: design, help="design_name: ariane, MegaBoom_x2 ", type = str parameter: design, help="design_name: ariane, MegaBoom_x2 ", type = str
parameter: src_dir, help="directory for source codes", type = str parameter: src_dir, help="directory for source codes", type = str
...@@ -67,7 +68,6 @@ class Clustering: ...@@ -67,7 +68,6 @@ class Clustering:
self.net_file = self.hypergraph_file + ".net" self.net_file = self.hypergraph_file + ".net"
# set up result directories # set up result directories
result_dir = "./results"
if not os.path.exists(result_dir): if not os.path.exists(result_dir):
os.mkdir(result_dir) os.mkdir(result_dir)
...@@ -764,12 +764,14 @@ class ProBufFormat: ...@@ -764,12 +764,14 @@ class ProBufFormat:
if (len(adj_list[macro_pin]) == 0): if (len(adj_list[macro_pin]) == 0):
offset = self.macro_pin_offset[macro_pin] offset = self.macro_pin_offset[macro_pin]
inst_name = self.macro_pin_map[macro_pin] inst_name = self.macro_pin_map[macro_pin]
macro_type = self.insts[inst_name].GetType()
self.insts[inst_name].AddInputPin(MacroPin(macro_pin, inst_name, \ self.insts[inst_name].AddInputPin(MacroPin(macro_pin, inst_name, \
offset[0], offset[1])) offset[0], offset[1], macro_type))
else: else:
offset = self.macro_pin_offset[macro_pin] offset = self.macro_pin_offset[macro_pin]
inst_name = self.macro_pin_map[macro_pin] inst_name = self.macro_pin_map[macro_pin]
Pin = MacroPin(macro_pin, inst_name, offset[0], offset[1]) macro_type = self.insts[inst_name].GetType()
Pin = MacroPin(macro_pin, inst_name, offset[0], offset[1], macro_type)
Pin.AddSinks(adj_list[macro_pin].keys()) Pin.AddSinks(adj_list[macro_pin].keys())
self.insts[inst_name].AddOutputPin(Pin) self.insts[inst_name].AddOutputPin(Pin)
...@@ -777,12 +779,13 @@ class ProBufFormat: ...@@ -777,12 +779,13 @@ class ProBufFormat:
# add input pin # add input pin
inst_name = "Grp_" + str(i) inst_name = "Grp_" + str(i)
macro_pin = inst_name + "/Input" macro_pin = inst_name + "/Input"
self.insts[inst_name].AddInputPin(MacroPin(macro_pin, inst_name, 0.0, 0.0)) macro_type = self.insts[inst_name].GetType()
self.insts[inst_name].AddInputPin(MacroPin(macro_pin, inst_name, macro_type, 0.0, 0.0))
output_idx = 1 output_idx = 1
for key, weight in adj_list[inst_name].items(): for key, weight in adj_list[inst_name].items():
macro_pin = inst_name + "/Output_" + str(output_idx) macro_pin = inst_name + "/Output_" + str(output_idx)
output_idx += 1 output_idx += 1
Pin = MacroPin(macro_pin, inst_name, 0.0, 0.0) Pin = MacroPin(macro_pin, inst_name, macro_type, 0.0, 0.0)
Pin.AddSink(key) Pin.AddSink(key)
if key not in self.ios or key not in self.macro_pin_map: if key not in self.ios or key not in self.macro_pin_map:
Pin.SpecifyWeight(weight) Pin.SpecifyWeight(weight)
...@@ -794,7 +797,7 @@ class ProBufFormat: ...@@ -794,7 +797,7 @@ class ProBufFormat:
f = open(self.pbf_file, "w") f = open(self.pbf_file, "w")
for inst_name, inst in self.insts.items(): for inst_name, inst in self.insts.items():
f.write(str(inst)) f.write(str(inst))
if (inst.GetType() == "MACRO"): if inst.GetType() in ["MACRO","macro"]:
for macro_pin in inst.GetPins(): for macro_pin in inst.GetPins():
f.write(str(macro_pin)) f.write(str(macro_pin))
f.close() f.close()
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment