-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathOpMapHeightEval.py
More file actions
34 lines (26 loc) · 933 Bytes
/
OpMapHeightEval.py
File metadata and controls
34 lines (26 loc) · 933 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# This file is part of GenMap and released under the MIT License, see LICENSE.
# Author: Takuya Kojima
from EvalBase import EvalBase
class OpMapHeightEval(EvalBase):
def __init__(self):
pass
@staticmethod
def eval(CGRA, app, sim_params, individual):
"""Return op mapping height.
Args:
CGRA (PEArrayModel): A model of the CGRA
app (Application): An application to be optimized
sim_params (SimParameters): parameters for some simulations
individual (Individual): An individual to be evaluated
Returns:
int: op mapping height
"""
y_coords = [y for (x, y) in individual.mapping.values()]
map_width = max(y_coords) + 1
return map_width
@staticmethod
def isMinimize():
return True
@staticmethod
def name():
return "Op_Mapping_Height"