Commit 29e2bbc1 authored by Justin Borromeo's avatar Justin Borromeo
Browse files

WIP

parent 668c69a6
......@@ -212,7 +212,7 @@ class cma_approach(object):
# TODO investigate if we can decrease the better-performing
# partitions to make room for the worst partition?
if sum([r**2 for r in res]) > self.max_res_unit:
if sum([r**2 for r in res]) > variable_max_res_unit:
res[max_idx] -= self.res_step
limit_reached = True
if pp.isPackable(res, self.max_pack_size):
......@@ -228,8 +228,8 @@ class cma_approach(object):
# Calculate latencies of final solution.
latencies, max_idx = self.find_max_latency(layer, last_packable_res)
return latencies[max_idx], latencies, res, layer
return latencies[max_idx], latencies, last_packable_res, layer
def max_packable_res_units_penalty(self, layer):
# res is a list where each element corresponds to a partition. res_step
......@@ -279,7 +279,7 @@ class cma_approach(object):
# variable_max_res_unit.
max_res_unit_decrease = self.max_res_unit - variable_max_res_unit
packing_penalty = pp.calculatePackingPenalty(max_res_unit_decrease)
return latencies[max_idx], latencies, res, layer
return latencies[max_idx], latencies, last_packable_res, layer
def evaluation_top_level(self, in_val):
pid, sampling = in_val
......@@ -444,7 +444,7 @@ class cma_approach(object):
# packed_area = sum([r**2 for r in res])
pp.printPNG(res, self.max_pack_size, directory_path + pngFileName)
else:
print('asdf')
raise Exception("Non-packing solution generated :(.")
result = [self.target_col,
self.i,
......
......@@ -24,8 +24,7 @@ targets = ['DRAM_cycle', 'Cycles']
seedings = ['allzeros', 'optimised']
# packing_strategies = ['unconstrained', 'no_penalty', 'overflow_penalty']
packing_strategies = ['no_penalty']
packing_strategies = ['unconstrained', 'no_penalty', 'overflow_penalty']
MAX_TRIAL = 20
MAX_PACK_SIZE = 129
......
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