Skip to content

Commit b111918

Browse files
committed
[Odin] fix env, dockerfile, odin bm
this commit: - fix makefile to use usr bin env python3 - mimic travis with the dockerfile to allow easier test to replicate buildbot and travis bugs - add a lower bound to the parser
1 parent 9a2966f commit b111918

File tree

7 files changed

+108
-38
lines changed

7 files changed

+108
-38
lines changed

Dockerfile

Lines changed: 81 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,87 @@
1-
FROM ubuntu:bionic
1+
FROM ubuntu:trusty as builder
22

3-
ENV WORKSPACE=/workspace
3+
RUN apt-get update
4+
RUN apt-get install -y \
5+
software-properties-common
6+
7+
# add auto gpg key other lauchpad ppa
8+
RUN add-apt-repository ppa:nilarimogard/webupd8
9+
RUN apt-get update && apt-get install -y \
10+
launchpad-getkeys
11+
12+
# add llvm PPA
13+
RUN printf "\n\
14+
deb http://ppa.launchpad.net/george-edison55/precise-backports/ubuntu precise main \n\
15+
deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu trusty main \n\
16+
deb https://apt.llvm.org/precise llvm-toolchain-precise-3.6 main \n\
17+
deb https://apt.llvm.org/trusty llvm-toolchain-trusty-6.0 main \n\
18+
deb https://apt.llvm.org/trusty llvm-toolchain-trusty-7 main \n\
19+
deb https://apt.llvm.org/trusty llvm-toolchain-trusty-8 main \n\
20+
" >> /etc/apt/sources.list
421

5-
RUN apt-get update && \
6-
apt-get install --no-install-recommends --yes \
7-
sudo \
8-
build-essential \
9-
flex \
10-
bison \
11-
ccache \
12-
ninja \
13-
cmake \
14-
fontconfig \
15-
libcairo2-dev \
16-
libfontconfig1-dev \
17-
libx11-dev \
18-
libxft-dev \
19-
libgtk-3-dev \
20-
perl \
21-
liblist-moreutils-perl \
22-
python \
23-
time \
24-
git \
25-
valgrind \
26-
gdb \
27-
ctags \
28-
vim \
29-
gcc-7 \
30-
libasan4 && \
31-
apt-get autoremove -y && \
32-
apt-get clean && \
33-
rm -rf /var/lib/apt/lists/*
22+
# grab llvm keys
23+
RUN launchpad-getkeys
3424

25+
RUN apt-get update
26+
RUN apt-get install -y \
27+
ninja \
28+
libssl-dev \
29+
autoconf \
30+
automake \
31+
bash \
32+
bison \
33+
binutils \
34+
binutils-gold \
35+
build-essential \
36+
ctags \
37+
curl \
38+
doxygen \
39+
flex \
40+
fontconfig \
41+
gdb \
42+
git \
43+
gperf \
44+
libcairo2-dev \
45+
libgtk-3-dev \
46+
libevent-dev \
47+
libfontconfig1-dev \
48+
liblist-moreutils-perl \
49+
libncurses5-dev \
50+
libx11-dev \
51+
libxft-dev \
52+
libxml++2.6-dev \
53+
perl \
54+
python \
55+
python-lxml \
56+
texinfo \
57+
time \
58+
valgrind \
59+
zip \
60+
qt5-default \
61+
clang-format-7 \
62+
g++-5 \
63+
gcc-5 \
64+
g++-6 \
65+
gcc-6 \
66+
g++-7 \
67+
gcc-7 \
68+
g++-8 \
69+
gcc-8 \
70+
g++-9 \
71+
gcc-9 \
72+
clang-6.0 \
73+
clang-8
74+
75+
# install CMake
76+
WORKDIR /tmp
77+
ENV CMAKE=cmake-3.17.0
78+
RUN curl -s https://cmake.org/files/v3.17/${CMAKE}.tar.gz | tar xvzf -
79+
RUN cd ${CMAKE} && ./configure && make && make install
80+
81+
# set out workspace
82+
ENV WORKSPACE=/workspace
3583
RUN mkdir -p ${WORKSPACE}
3684
VOLUME ${WORKSPACE}
85+
WORKDIR ${WORKSPACE}
3786

38-
ENTRYPOINT [ "/bin/bash" ]
87+
CMD [ "/bin/bash" ]

ODIN_II/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ODIN_ROOT=$(PWD)
2-
NB_OF_PROCESS ?= $(shell python -c "import multiprocessing; print(multiprocessing.cpu_count())")
2+
NB_OF_PROCESS ?= $(shell /usr/bin/env python3 -c "import multiprocessing; print(multiprocessing.cpu_count())")
33

44
################
55
# build with ninja when doable

ODIN_II/regression_test/benchmark/task/large/task.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ archs_dir=../vtr_flow/arch/timing
1212
# one arch allows it to run faster given it is single threaded
1313
arch_list_add=k6_frac_N10_frac_chain_mem32K_40nm.xml
1414

15-
circuits_dir=./
15+
circuits_dir=./regression_test/benchmark/verilog
1616

1717
# glob the large benchmark and the vtr ones to prevent duplicate run
18-
circuit_list_add=regression_test/benchmark/verilog/large/*.v
19-
circuit_list_add=../vtr_flow/benchmarks/verilog/*.v
18+
circuit_list_add=large/*.v
19+
circuit_list_add=../../../../vtr_flow/benchmarks/verilog/*.v
2020

2121
synthesis_parse_file=regression_test/parse_result/conf/synth.toml

ODIN_II/regression_test/parse_result/conf/basic.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@
77
['max_rss(MiB)']
88
# Memory usage can be very off depending on the number of cores
99
range = [ 0.0, 100.0 ]
10+
# we cutoff anything bellow 250 MiB as it is subject to noise
11+
cutoff = 250.0
1012
regex = 'Odin II took .* \(max_rss (\d+|\d+.\d+) MiB\)'
1113
default = -1
1214

1315
['exec_time(ms)']
1416
# timing can be very off due to how fast odin runs
1517
range = [ 0.0, 100.0 ]
18+
# we cutoff anything bellow 1 second as it is subject to noise
19+
cutoff = 1000.0
1620
regex = 'Total time: (\d+|\d+.\d+)ms'
1721
default = -1
1822

ODIN_II/regression_test/parse_result/conf/sim.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
regex = 'Simulation time: (\d+|\d+.\d+)ms'
1111
# timing can be very off due to how fast odin runs
1212
range = [ 0.0, 100.0 ]
13+
# we cutoff anything bellow 1 second as it is subject to noise
14+
cutoff = 1000.0
1315
default = -1
1416

1517
['test_coverage(%)']

ODIN_II/regression_test/parse_result/conf/synth.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
regex = 'Elaboration Time: (\d+|\d+.\d+)ms'
1111
# timing can be very off due to how fast odin runs
1212
range = [ 0.0, 100.0 ]
13+
# we cutoff anything bellow 1 second as it is subject to noise
14+
cutoff = 1000.0
1315
default = -1
1416

1517
#include node.toml

ODIN_II/regression_test/parse_result/parse_result.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import json
1111

1212
import csv
13+
import math
1314

1415
c_red='\033[31m'
1516
c_grn='\033[32m'
@@ -60,6 +61,7 @@ def is_json_str(value):
6061
_K_KEY='key'
6162
_K_REGEX='regex'
6263
_K_RANGE='range'
64+
_K_CUTOFF='cutoff'
6365

6466
def preproc_toml(file):
6567
current_dir=os.getcwd()
@@ -231,12 +233,23 @@ def sanity_check(header, toml_dict, golden_tbl, tbl):
231233
def range(header, toml_dict, golden_tbl, tbl):
232234
if len(toml_dict[header][_K_RANGE]) != 2:
233235
print("expected a min and a max for range = [ min, max ]")
236+
exit(1)
234237
elif golden_tbl[header] != tbl[header]:
238+
239+
low_cutoff = None
240+
if _K_CUTOFF in toml_dict[header]:
241+
low_cutoff = toml_dict[header][_K_CUTOFF]
242+
243+
value = float(tbl[header])
235244
gold_value = float(golden_tbl[header])
245+
if low_cutoff is not None:
246+
if value < low_cutoff:
247+
value = low_cutoff
248+
if gold_value < low_cutoff:
249+
gold_value = low_cutoff
250+
236251
min_ratio = float(toml_dict[header][_K_RANGE][0])
237252
max_ratio = float(toml_dict[header][_K_RANGE][1])
238-
value = float(tbl[header])
239-
240253
min_range = ( min_ratio * gold_value )
241254
max_range = ( max_ratio * gold_value )
242255
if value < min_range or value > max_range:

0 commit comments

Comments
 (0)