Skip to content

Commit 9f18666

Browse files
committed
Merge branch 'master' into PlacerSetupSlacks
2 parents 74d279c + 0fea9d1 commit 9f18666

File tree

218 files changed

+14120
-7310
lines changed

Some content is hidden

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

218 files changed

+14120
-7310
lines changed

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ d91bc203bf1ae80e6a4371ef7c168886bb536c1c
77
# Autoformat run on 2019-07-25T20:04:01.740240
88
80de7854fa5fea9a281df72cbbd2413ae4018c7c
99

10+
# Autoformat run on 2020-08-13T15:57:15.777946
11+
03b0b77b06943b595e9cb1f38ffa0ff00ff1ab76
12+

.travis.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ addons:
4444
- libxft-dev
4545
- libxml++2.6-dev
4646
- perl
47-
- python-lxml
4847
- texinfo
4948
- time
5049
- valgrind
@@ -88,17 +87,17 @@ jobs:
8887
#- ./.github/travis/build.sh
8988

9089
- stage: Test
91-
name: "Code Formatting"
90+
name: "Code Formatting - C/C++"
9291
script:
9392
- ./dev/check-format.sh
93+
- state: Test
94+
name: "Code Formatting - Python"
95+
script:
96+
- ./dev/check-format-py.sh
9497
- stage: Test
9598
name: "Python Lint"
9699
script:
97-
- curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
98-
- python3.6 get-pip.py
99-
- python3.6 -m pip install pylint
100-
- rm get-pip.py
101-
- python3.6 ./dev/pylint_check.py
100+
- python3 ./dev/pylint_check.py
102101
- stage: Test
103102
name: "C++ Unit Tests"
104103
env:
@@ -240,6 +239,14 @@ before_script:
240239
- pyenv install -f 3.6.3
241240
- pyenv global 3.6.3
242241

242+
# Install python modules
243+
- curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
244+
- python3 get-pip.py
245+
- rm get-pip.py
246+
- python3 -m pip install \
247+
pylint \
248+
black
249+
243250
- source .github/travis/common.sh
244251
- ./.github/travis/setup.sh
245252

CMakeLists.txt

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,16 @@ else()
109109
message(STATUS "Building with IPO: off")
110110
endif()
111111

112+
#
113+
# Build type flags
114+
#
115+
116+
if(NOT MSVC)
117+
# for GCC and Clang
118+
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g3")
119+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g3")
120+
endif()
121+
112122
#
113123
# Warning flags
114124
#
@@ -407,5 +417,13 @@ list(APPEND DIRS_TO_FORMAT_CPP "${CMAKE_CURRENT_SOURCE_DIR}/libs/liblog")
407417
list(APPEND DIRS_TO_FORMAT_CPP "${CMAKE_CURRENT_SOURCE_DIR}/libs/librtlnumber")
408418
list(APPEND DIRS_TO_FORMAT_CPP "${CMAKE_CURRENT_SOURCE_DIR}/ODIN_II")
409419

410-
411420
include(AutoClangFormat)
421+
422+
list(APPEND DIRS_TO_FORMAT_PY "${CMAKE_CURRENT_SOURCE_DIR}/ODIN_II")
423+
list(APPEND DIRS_TO_FORMAT_PY "${CMAKE_CURRENT_SOURCE_DIR}/ace2")
424+
list(APPEND DIRS_TO_FORMAT_PY "${CMAKE_CURRENT_SOURCE_DIR}/dev")
425+
list(APPEND DIRS_TO_FORMAT_PY "${CMAKE_CURRENT_SOURCE_DIR}/doc")
426+
list(APPEND DIRS_TO_FORMAT_PY "${CMAKE_CURRENT_SOURCE_DIR}/vpr")
427+
list(APPEND DIRS_TO_FORMAT_PY "${CMAKE_CURRENT_SOURCE_DIR}/vtr_flow")
428+
429+
include(AutoPyFormat)

ODIN_II/Makefile

Lines changed: 25 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -101,41 +101,32 @@ test_coverage:
101101
$(MAKE) gcovr
102102

103103
test:
104-
# rebuild with sanitize flags on to run the same test as travis
105-
$(MAKE) sanitize
106-
./verify_odin.sh -j $(NB_OF_PROCESS) \
107-
-t regression_test/benchmark/suite/light_suite \
108-
-t vtr_reg_basic \
109-
-t vtr_reg_strong
110-
# larger test should run with regular flags to speed up the process
111-
$(MAKE) build
112-
./verify_odin.sh -j $(NB_OF_PROCESS) \
113-
-t regression_test/benchmark/suite/heavy_suite
104+
$(MAKE) sanitize \
105+
&& ./verify_odin.sh --no_report -j $(NB_OF_PROCESS) \
106+
-t regression_test/benchmark/suite/light_suite \
107+
-t regression_test/benchmark/suite/vtr_light_suite \
108+
&& $(MAKE) build \
109+
&& ./verify_odin.sh --no_report --continue -j $(NB_OF_PROCESS) \
110+
-t regression_test/benchmark/suite/heavy_suite; \
111+
./verify_odin.sh --status_only
112+
114113

115114
generate_expectation:
116-
# rebuild with sanitize flags on to run the same test as travis
117-
$(MAKE) sanitize
118-
./verify_odin.sh -j $(NB_OF_PROCESS) \
119-
--generate_expectation\
120-
-t regression_test/benchmark/suite/light_suite \
121-
-t vtr_reg_basic \
122-
-t vtr_reg_strong || true
123-
# larger test should run with regular flags to speed up the process
124-
$(MAKE) build
125-
./verify_odin.sh -j $(NB_OF_PROCESS) \
126-
--generate_expectation \
127-
-t regression_test/benchmark/suite/heavy_suite
115+
$(MAKE) sanitize \
116+
&& ./verify_odin.sh --$@ --no_report -j $(NB_OF_PROCESS) \
117+
-t regression_test/benchmark/suite/light_suite \
118+
-t regression_test/benchmark/suite/vtr_light_suite; \
119+
$(MAKE) build \
120+
&& ./verify_odin.sh --$@ --no_report --continue -j $(NB_OF_PROCESS) \
121+
-t regression_test/benchmark/suite/heavy_suite; \
122+
./verify_odin.sh --status_only
128123

129124
regenerate_expectation:
130-
# rebuild with sanitize flags on to run the same test as travis
131-
$(MAKE) sanitize
132-
./verify_odin.sh -j $(NB_OF_PROCESS) \
133-
--regenerate_expectation\
134-
-t regression_test/benchmark/suite/light_suite \
135-
-t vtr_reg_basic \
136-
-t vtr_reg_strong || true
137-
# larger test should run with regular flags to speed up the process
138-
$(MAKE) build
139-
./verify_odin.sh -j $(NB_OF_PROCESS) \
140-
--regenerate_expectation \
141-
-t regression_test/benchmark/suite/heavy_suite
125+
$(MAKE) sanitize \
126+
&& ./verify_odin.sh --$@ --no_report -j $(NB_OF_PROCESS) \
127+
-t regression_test/benchmark/suite/light_suite \
128+
-t regression_test/benchmark/suite/vtr_light_suite; \
129+
$(MAKE) build \
130+
&& ./verify_odin.sh --$@ --no_report --continue -j $(NB_OF_PROCESS) \
131+
-t regression_test/benchmark/suite/heavy_suite; \
132+
./verify_odin.sh --status_only

ODIN_II/SRC/HardSoftLogicMixer.cpp

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/*
2+
* Permission is hereby granted, free of charge, to any person
3+
* obtaining a copy of this software and associated documentation
4+
* files (the "Software"), to deal in the Software without
5+
* restriction, including without limitation the rights to use,
6+
* copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
* copies of the Software, and to permit persons to whom the
8+
* Software is furnished to do so, subject to the following
9+
* conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be
12+
* included in all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
16+
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18+
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19+
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21+
* OTHER DEALINGS IN THE SOFTWARE.
22+
*/
23+
#include "HardSoftLogicMixer.hpp"
24+
25+
#include <stdint.h> // INT_MAX
26+
#include <vector>
27+
28+
#include "multipliers.h" // instantiate_simple_soft_multiplier
29+
#include "odin_error.h" // error_message
30+
31+
HardSoftLogicMixer::HardSoftLogicMixer() {
32+
for (int i = 0; i < operation_list_END; i++) {
33+
if (i == MULTIPLY) {
34+
this->_opts[i] = new MultsOpt();
35+
} else {
36+
this->_opts[i] = new MixingOpt();
37+
}
38+
}
39+
}
40+
41+
HardSoftLogicMixer::~HardSoftLogicMixer() {
42+
for (int i = 0; i < operation_list_END; i++) {
43+
delete this->_opts[i];
44+
}
45+
}
46+
void HardSoftLogicMixer::note_candidate_node(nnode_t* opNode) {
47+
_nodes_by_opt[opNode->type].push_back(opNode);
48+
}
49+
50+
bool HardSoftLogicMixer::hardenable(nnode_t* node) {
51+
return this->_opts[node->type]->hardenable(node);
52+
}
53+
54+
bool HardSoftLogicMixer::enabled(nnode_t* node) {
55+
return this->_opts[node->type]->enabled();
56+
}
57+
58+
int HardSoftLogicMixer::hard_blocks_needed(operation_list opt) {
59+
return _nodes_by_opt[opt].size();
60+
}
61+
62+
void HardSoftLogicMixer::partial_map_node(nnode_t* node, short traverse_number, netlist_t* netlist) {
63+
_opts[node->type]->partial_map_node(node, traverse_number, netlist, this);
64+
}
65+
66+
void HardSoftLogicMixer::perform_optimizations(netlist_t* netlist) {
67+
if (_opts[MULTIPLY]->enabled()) {
68+
int blocks_needed = this->hard_blocks_needed(MULTIPLY);
69+
_opts[MULTIPLY]->set_blocks_needed(blocks_needed);
70+
_opts[MULTIPLY]->assign_weights(netlist, _nodes_by_opt[MULTIPLY]);
71+
_opts[MULTIPLY]->perform(netlist, _nodes_by_opt[MULTIPLY]);
72+
_opts[MULTIPLY]->instantiate_soft_logic(netlist, _nodes_by_opt[MULTIPLY]);
73+
}
74+
}

0 commit comments

Comments
 (0)