diff options
-rw-r--r-- | mppa_k1c/Asmblockgenproof0.v (renamed from mppa_k1c/lib/Asmblockgenproof0.v) | 0 | ||||
-rw-r--r-- | mppa_k1c/PostpassSchedulingOracle.ml | 4 | ||||
-rw-r--r-- | mppa_k1c/lib/Machblock.v (renamed from mppa_k1c/Machblock.v) | 0 | ||||
-rw-r--r-- | mppa_k1c/lib/Machblockgen.v (renamed from mppa_k1c/Machblockgen.v) | 0 | ||||
-rw-r--r-- | mppa_k1c/lib/Machblockgenproof.v (renamed from mppa_k1c/Machblockgenproof.v) | 0 | ||||
-rwxr-xr-x | test/monniaux/clean_benches.sh | 1 | ||||
-rwxr-xr-x | test/monniaux/generate_makefiles.sh | 2 | ||||
-rwxr-xr-x | test/monniaux/gengraphs.py | 78 |
8 files changed, 45 insertions, 40 deletions
diff --git a/mppa_k1c/lib/Asmblockgenproof0.v b/mppa_k1c/Asmblockgenproof0.v index 89d41017..89d41017 100644 --- a/mppa_k1c/lib/Asmblockgenproof0.v +++ b/mppa_k1c/Asmblockgenproof0.v diff --git a/mppa_k1c/PostpassSchedulingOracle.ml b/mppa_k1c/PostpassSchedulingOracle.ml index 9067f8e1..7015fd5f 100644 --- a/mppa_k1c/PostpassSchedulingOracle.ml +++ b/mppa_k1c/PostpassSchedulingOracle.ml @@ -603,9 +603,9 @@ let rec_to_usage r = | Some U27L5 | Some U27L10 -> mau_x | Some E27U27L10 -> mau_y) | Nop -> alu_nop - | Sraw | Srlw | Srsw | Sllw | Srad | Srld | Slld -> (match encoding with None | Some U6 -> alu_tiny | _ -> raise InvalidEncoding) + | Sraw | Srlw | Sllw | Srad | Srld | Slld -> (match encoding with None | Some U6 -> alu_tiny | _ -> raise InvalidEncoding) (* TODO: check *) - | Srsd | Rorw -> (match encoding with None | Some U6 -> alu_lite | _ -> raise InvalidEncoding) + | Srsw | Srsd | Rorw -> (match encoding with None | Some U6 -> alu_lite | _ -> raise InvalidEncoding) | Extfz | Extfs | Insf -> (match encoding with None -> alu_lite | _ -> raise InvalidEncoding) | Fixeduwz | Fixedwz | Floatwz | Floatuwz | Fixeddz | Fixedudz | Floatdz | Floatudz -> mau | Lbs | Lbz | Lhs | Lhz | Lws | Ld | Lq | Lo -> diff --git a/mppa_k1c/Machblock.v b/mppa_k1c/lib/Machblock.v index 30393fd5..30393fd5 100644 --- a/mppa_k1c/Machblock.v +++ b/mppa_k1c/lib/Machblock.v diff --git a/mppa_k1c/Machblockgen.v b/mppa_k1c/lib/Machblockgen.v index 4dfc309e..4dfc309e 100644 --- a/mppa_k1c/Machblockgen.v +++ b/mppa_k1c/lib/Machblockgen.v diff --git a/mppa_k1c/Machblockgenproof.v b/mppa_k1c/lib/Machblockgenproof.v index 9186e54a..9186e54a 100644 --- a/mppa_k1c/Machblockgenproof.v +++ b/mppa_k1c/lib/Machblockgenproof.v diff --git a/test/monniaux/clean_benches.sh b/test/monniaux/clean_benches.sh index d246e110..c0a87ff9 100755 --- a/test/monniaux/clean_benches.sh +++ b/test/monniaux/clean_benches.sh @@ -5,3 +5,4 @@ rm -f commands.txt for bench in $benches; do (cd $bench && make clean) done +rm -f *.o diff --git a/test/monniaux/generate_makefiles.sh b/test/monniaux/generate_makefiles.sh index 1c05538f..ecbbdf4d 100755 --- a/test/monniaux/generate_makefiles.sh +++ b/test/monniaux/generate_makefiles.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash source benches.sh diff --git a/test/monniaux/gengraphs.py b/test/monniaux/gengraphs.py index fd8098b7..3ffe6f3d 100755 --- a/test/monniaux/gengraphs.py +++ b/test/monniaux/gengraphs.py @@ -18,7 +18,6 @@ with open(csv_file, "r") as f: df = pd.read_csv(csv_file) benches = df["benches"] -print(benches[0]) host_measures_cols = [col for col in df if "host" in col] k1c_measures_cols = [col for col in df if "k1c" in col] @@ -29,62 +28,67 @@ colors = ["forestgreen", "darkorange", "cornflowerblue", "darkorchid", "darksalm # Generating PDF ## -def extract_envs(keys: List[str]) -> List[str]: - envs = [] - for key in keys: - words = key.split()[:-1] - envs.append(" ".join(words)) - return envs +def extract_compiler(env: str) -> str: + words = env.split()[:-1] + return " ".join(words) +def extract_compilers(envs: List[str]) -> List[str]: + compilers: List[str] = [] + for env in envs: + compiler = extract_compiler(env) + if compiler not in compilers: + compilers.append(compiler) + return compilers -def subdivide_interv(inf: float, sup: float, n: int) -> List[float]: +def subdivide_interv(inf: Any, sup: float, n: int) -> List[float]: return [inf + k*(sup-inf)/n for k in range(n)] +# df associates the environment string (e.g. "gcc host") to the cycles +# envs is the list of environments to compare +# The returned value will be a dictionnary associating the compiler (e.g. "gcc") to his relative comparison on the best result +def make_relative_heights(data: Any, envs: List[str]) -> Dict[str, List[float]]: + n_benches: int = len((data.values)) # type: ignore + cols: Dict[str, List[int]] = {extract_compiler(env):data[env] for env in envs} + + ret: Dict[str, List[float]] = {} + for compiler in cols: + ret[compiler] = [] + + for i in range(n_benches): + max_time: int = max([cols[compiler][i] for compiler in cols]) + for compiler in cols: + ret[compiler].append(cols[compiler][i] / float(max_time)) + + return ret + + def generate_file(f: str, cols: List[str]) -> None: ind = np.arange(len(df[cols[0]])) - width = 0.35 # the width of the bars + width = 0.25 # the width of the bars - envs = extract_envs(cols) - start_inds = subdivide_interv(ind, ind+width, len(envs)) + compilers = extract_compilers(cols) + start_inds = subdivide_interv(ind, ind+2*width, len(compilers)) + heights: Dict[str, List[float]] = make_relative_heights(df, cols) fig, ax = plt.subplots() rects = [] - for i, env in enumerate(envs): - for col in cols: - if env in col: - break - rects.append(ax.bar(start_inds[i], df[col], width, color=colors[i], label=env)) + for i, compiler in enumerate(compilers): + rects.append(ax.bar(start_inds[i], heights[compiler], width, color=colors[i], label=compiler)) # Add some text for labels, title and custom x-axis tick labels, etc. - ax.set_ylabel('Cycles') + ax.set_ylabel('Cycles (%)') + ax.set_yticklabels(['{:,.0%}'.format(x) for x in ax.get_yticks()]) ax.set_title('TITLE') ax.set_xticks(ind) ax.set_xticklabels(benches) ax.legend() - def autolabel(rects: List[Any], xpos='center') -> None: - """ - Attach a text label above each bar in *rects*, displaying its height. - - *xpos* indicates which side to place the text w.r.t. the center of - the bar. It can be one of the following {'center', 'right', 'left'}. - """ - - xpos = xpos.lower() # normalize the case of the parameter - ha = {'center': 'center', 'right': 'left', 'left': 'right'} - offset = {'center': 0.5, 'right': 0.57, 'left': 0.43} # x_txt = x + w*off - - for rect in rects: - height = rect.get_height() - ax.text(rect.get_x() + rect.get_width()*offset[xpos], 1.01*height, - '{}'.format(height), ha=ha[xpos], va='bottom') - - for rect in rects: - autolabel(rect) + plt.setp(ax.get_xticklabels(), rotation=30, horizontalalignment='right') + plt.xticks(size=5) plt.savefig(f) generate_file("measures-host.pdf", host_measures_cols) -#generate_file("measures-k1c.pdf", k1c_measures_cols) +generate_file("measures-k1c.pdf", k1c_measures_cols) |