-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathOpMapWidthEval.py
More file actions
34 lines (26 loc) · 923 Bytes
/
OpMapWidthEval.py
File metadata and controls
34 lines (26 loc) · 923 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 OpMapWidthEval(EvalBase):
def __init__(self):
pass
@staticmethod
def eval(CGRA, app, sim_params, individual):
"""Return mapping width.
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: mapping width
"""
x_coords = [x for (x, y) in individual.mapping.values()]
map_width = max(x_coords) + 1
return map_width
@staticmethod
def isMinimize():
return True
@staticmethod
def name():
return "Op_Mapping_Width"