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
class Clustering:
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,
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: src_dir, help="directory for source codes", type = str
......@@ -67,7 +68,6 @@ class Clustering:
self.net_file = self.hypergraph_file + ".net"
# set up result directories
result_dir = "./results"
if not os.path.exists(result_dir):
os.mkdir(result_dir)
......@@ -764,12 +764,14 @@ class ProBufFormat:
if (len(adj_list[macro_pin]) == 0):
offset = self.macro_pin_offset[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, \
offset[0], offset[1]))
offset[0], offset[1], macro_type))
else:
offset = self.macro_pin_offset[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())
self.insts[inst_name].AddOutputPin(Pin)
......@@ -777,12 +779,13 @@ class ProBufFormat:
# add input pin
inst_name = "Grp_" + str(i)
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
for key, weight in adj_list[inst_name].items():
macro_pin = inst_name + "/Output_" + str(output_idx)
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)
if key not in self.ios or key not in self.macro_pin_map:
Pin.SpecifyWeight(weight)
......@@ -794,7 +797,7 @@ class ProBufFormat:
f = open(self.pbf_file, "w")
for inst_name, inst in self.insts.items():
f.write(str(inst))
if (inst.GetType() == "MACRO"):
if inst.GetType() in ["MACRO","macro"]:
for macro_pin in inst.GetPins():
f.write(str(macro_pin))
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