Skip to content

Commit 39a1701

Browse files
committed
vpr: resolve merge conflict
2 parents 7cb6b05 + d85eb6a commit 39a1701

File tree

495 files changed

+182318
-1606
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

495 files changed

+182318
-1606
lines changed

.github/travis/cron_build.sh

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
#!/bin/bash
2+
3+
source .github/travis/common.sh
4+
set -e
5+
6+
$SPACER
7+
8+
if [ "_${_COVERITY_EMAIL}" == "_" ] ||
9+
[ "_${_COVERITY_URL}" == "_" ] ||
10+
[ "_${_COVERITY_MD5}" == "_" ]
11+
then
12+
echo "_COVERITY_EMAIL, _COVERITY_URL and _COVERITY_MD5 must be set before using this script"
13+
exit 1
14+
fi
15+
16+
build_root=${PWD}
17+
18+
##########################
19+
# download coverity tool
20+
start_section "coverity download" "${GREEN}Downloading coverity tool..${NC}"
21+
22+
mkdir -p ${HOME}/coverity
23+
cd ${HOME}/coverity
24+
25+
# get coverity and extract it
26+
wget --quiet ${_COVERITY_URL} --post-data="token=${COVERITY_SCAN_TOKEN}&project=Verilog+to+Routing" -O coverity.tar.gz
27+
echo "${_COVERITY_MD5} coverity.tar.gz" | md5sum -c -
28+
tar xzf coverity.tar.gz
29+
rm -f coverity.tar.gz
30+
31+
# export the coverity tool
32+
coverity_dir=$(ls -d cov-analysis-linux64*)
33+
export PATH="${PATH}:${HOME}/coverity/${coverity_dir}/bin"
34+
which cov-build
35+
36+
# make sure we use the compiler so we clear the cache, disable ccache and remove it from the path
37+
ccache --clear
38+
export CCACHE_DISABLE=1
39+
export PATH=${PATH/'/usr/bin/ccache:'/}
40+
export PATH=${PATH/':/usr/lib/ccache'/}
41+
42+
#tell coverity about the CC compiler used
43+
cov-configure --template --compiler ${CC} --comptype gcc
44+
45+
46+
cd ${build_root}
47+
48+
end_section "coverity download"
49+
50+
51+
$SPACER
52+
53+
54+
#######################
55+
# build with coverity
56+
start_section "coverity.vtr.build" "${GREEN}Building..${NC}"
57+
58+
# make sure we use the compiler so we clear the cache
59+
60+
# remove old files in case they exist (usefull if we run this locally)
61+
rm -f CMakeCache.txt
62+
rm -Rf build
63+
64+
# prepare the build
65+
mkdir -p build
66+
cd build
67+
cmake -DCMAKE_BUILD_TYPE=debug -DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on ..
68+
69+
# now build and scan
70+
cov-build --dir cov-int make -j$(nproc --all)
71+
72+
end_section "coverity.vtr.build"
73+
74+
75+
$SPACER
76+
77+
78+
#######################
79+
# export to coverity
80+
start_section "coverity.export" "${GREEN}Exporting..${NC}"
81+
82+
tar -czvf vtr_coverity.tar.gz cov-int
83+
84+
curl --form token=${COVERITY_SCAN_TOKEN} \
85+
--form email=${_COVERITY_EMAIL} \
86+
--form file=@vtr_coverity.tar.gz\
87+
--form version="master branch head" \
88+
--form description="$(git log -1|head -1)" \
89+
https://scan.coverity.com/builds?project=Verilog+to+Routing
90+
91+
end_section "coverity.export"
92+
93+
94+
$SPACER

.travis.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,14 @@ env:
7171
- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
7272

7373
stages:
74-
#- Build
75-
- Test
76-
- Build Compatibility
74+
# - name: Build
75+
# if: type != cron
76+
- name: Test
77+
if: type != cron
78+
- name: Build Compatibility
79+
if: type != cron
80+
- name: Build Coverity
81+
if: type = cron
7782

7883
jobs:
7984
include:
@@ -160,6 +165,14 @@ jobs:
160165
- MATRIX_EVAL="CC=clang-8 && CXX=clang++-8"
161166
script:
162167
- ./.github/travis/build.sh
168+
- stage: Build Coverity
169+
name: "Coverity Scan"
170+
env:
171+
- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
172+
- _COVERITY_URL="https://scan.coverity.com/download/linux64"
173+
- _COVERITY_MD5="d0d7d7df9d6609e578f85096a755fb8f"
174+
script:
175+
- ./.github/travis/cron_build.sh
163176

164177
before_script:
165178
- source .github/travis/common.sh

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ else()
145145
"-Winit-self" #Warn about self-initialization
146146
"-Wcatch-value=3" #Warn when catch statements don't catch by reference
147147
"-Wextra-semi" #Warn about redudnant semicolons
148+
"-Wimplicit-fallthrough=3" #Warn about case fallthroughs, but allow 'fallthrough' comments to suppress warnings
148149
#GCC-like optional
149150
#"-Wsuggest-final-types" #Suggest where 'final' would help if specified on a type methods
150151
#"-Wsuggest-final-methods" #Suggest where 'final' would help if specified on methods

ODIN_II/Makefile

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,23 @@ help:
3636
large_test run the complete battery of test before merging changes\n\
3737
"
3838

39-
_init:
39+
_init: clean
4040
mkdir -p $(ODIN_BUILD_DIR)
4141

4242
clean:
4343
$(RM) -f $(ODIN_BUILD_DIR)/.*.build
4444
$(RM) -Rf $(BUILD_DIR)/CMakeCache.txt
4545
$(RM) -Rf $(BUILD_DIR)/ODIN_II
4646

47-
_build_it:
47+
define _build_it_gen
48+
_build_it_$(1): _set_$(1)
4849
cd $(BUILD_DIR) &&\
4950
$(BUILDER)
5051

51-
$(ODIN_BUILD_DIR)/.%.build: clean _init
52+
$(1): _build_it_$(1)
53+
endef
54+
55+
$(ODIN_BUILD_DIR)/.%.build: _init
5256
touch $@
5357

5458
_set_build: $(ODIN_BUILD_DIR)/.regular.build
@@ -71,15 +75,8 @@ _set_clang_tidy: $(ODIN_BUILD_DIR)/.tidy.build
7175
cd $(BUILD_DIR) &&\
7276
cmake $(CMAKE_GEN_ARGS) $(CMAKE_ARGS) -DODIN_TIDY=on ..
7377

74-
build: _set_build _build_it
75-
76-
debug: _set_debug _build_it
77-
78-
warn: _set_warn _build_it
79-
80-
gcov: _set_gcov _build_it
81-
82-
clang_tidy: _set_clang_tidy _build_it
78+
BUILD_IT_TARGETS = build debug warn gcov clang_tidy
79+
$(foreach t,$(BUILD_IT_TARGETS), $(eval $(call _build_it_gen,$(t))))
8380

8481
scrub:
8582
find SRC/ -type f \( -iname \*.gcno -or -iname \*.gcda -or -iname \*.gcov \) -exec rm -f {} \;

ODIN_II/SRC/adders.cpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,3 +1500,34 @@ void instantiate_add_w_carry_block(int *width, nnode_t *node, short mark, netlis
15001500
connect_output_pin_to_node(width, i, 0, node, current_adder, subtraction);
15011501
}
15021502
}
1503+
1504+
bool is_ast_adder(ast_node_t *node)
1505+
{
1506+
bool is_adder;
1507+
ast_node_t *instance = node->children[1];
1508+
is_adder = (!strcmp(node->children[0]->types.identifier, "adder"))
1509+
&& (instance->children[1]->num_children == 5);
1510+
1511+
ast_node_t *connect_list = instance->children[1];
1512+
if (is_adder && connect_list->children[0]->children[0])
1513+
{
1514+
/* port connections were passed by name; verify port names */
1515+
for (int i = 0; i < connect_list->num_children && is_adder; i++)
1516+
{
1517+
char *id = connect_list->children[i]->children[0]->types.identifier;
1518+
1519+
if ((strcmp(id, "a") != 0) &&
1520+
(strcmp(id, "b") != 0) &&
1521+
(strcmp(id, "cin") != 0) &&
1522+
(strcmp(id, "cout") != 0) &&
1523+
(strcmp(id, "sumout") != 0)
1524+
)
1525+
{
1526+
is_adder = false;
1527+
break;
1528+
}
1529+
}
1530+
}
1531+
1532+
return is_adder;
1533+
}

0 commit comments

Comments
 (0)