Skip to content

Commit 5527733

Browse files
Merge branch 'master' into api_num_configurable_edges
2 parents 8d77256 + f92cfeb commit 5527733

File tree

530 files changed

+127478
-12592
lines changed

Some content is hidden

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

530 files changed

+127478
-12592
lines changed

.github/scripts/install_dependencies.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ sudo apt install -y \
1010
binutils \
1111
binutils-gold \
1212
build-essential \
13+
capnproto \
1314
cmake \
1415
ctags \
1516
curl \
@@ -20,6 +21,7 @@ sudo apt install -y \
2021
git \
2122
gperf \
2223
libcairo2-dev \
24+
libcapnp-dev \
2325
libgtk-3-dev \
2426
libevent-dev \
2527
libfontconfig1-dev \
@@ -54,3 +56,9 @@ sudo apt install -y \
5456
# libtbb-dev
5557

5658
pip install -r requirements.txt
59+
60+
git clone https://github.com/capnproto/capnproto-java.git $GITHUB_WORKSPACE/env/capnproto-java
61+
pushd $GITHUB_WORKSPACE/env/capnproto-java
62+
make
63+
sudo make install
64+
popd

CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ option(VTR_ENABLE_CAPNPROTO "Enable capnproto binary serialization support in VP
4040
#Allow the user to enable/disable VPR analytic placement
4141
#VPR option --enable_analytic_placer is also required for Analytic Placement
4242
option(VPR_ANALYTIC_PLACE "Enable analytic placement in VPR." ON)
43+
option(VPR_ENABLE_INTERCHANGE "Enable FPGA interchange." ON)
4344

4445
option(WITH_BLIFEXPLORER "Enable build with blifexplorer" OFF)
4546

@@ -121,6 +122,11 @@ endif()
121122
# Build type flags
122123
#
123124

125+
set(EXTRA_FLAGS "")
126+
if(VPR_ENABLE_INTERCHANGE)
127+
set(EXTRA_FLAGS "-lz")
128+
endif()
129+
124130
if(NOT MSVC)
125131
# for GCC and Clang
126132
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g3")
@@ -295,7 +301,7 @@ endif()
295301
# Set final flags
296302
#
297303
separate_arguments(
298-
ADDITIONAL_FLAGS UNIX_COMMAND "${SANITIZE_FLAGS} ${PROFILING_FLAGS} ${COVERAGE_FLAGS} ${LOGGING_FLAGS} ${COLORED_COMPILE}"
304+
ADDITIONAL_FLAGS UNIX_COMMAND "${SANITIZE_FLAGS} ${PROFILING_FLAGS} ${COVERAGE_FLAGS} ${LOGGING_FLAGS} ${COLORED_COMPILE} ${EXTRA_FLAGS}"
299305
)
300306
separate_arguments(
301307
WARN_FLAGS UNIX_COMMAND "${WARN_FLAGS}"
@@ -366,7 +372,6 @@ if (VPR_USE_EZGL STREQUAL "auto")
366372
endif()
367373
endif()
368374

369-
370375
#Add the various sub-projects
371376
if(${WITH_ABC})
372377
add_subdirectory(abc)

ODIN_II/Makefile

Lines changed: 50 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
ODIN_ROOT=$(PWD)
22
NB_OF_PROCESS ?= $(shell /usr/bin/env python3 -c "import multiprocessing; print(multiprocessing.cpu_count())")
33

4+
# handling elaborator name
5+
ifdef ELABORATOR
6+
_ELABORATOR=$(shell echo $(ELABORATOR) | tr '[:lower:]' '[:upper:]')
7+
else
8+
_ELABORATOR=ODIN
9+
endif
10+
11+
# Yosys+Odin-II compile flags
12+
ifeq ($(_ELABORATOR), YOSYS)
13+
_YOSYS_COMPILE_FLAG="-DODIN_USE_YOSYS=ON"
14+
endif
15+
416
################
517
# build with ninja when doable
618
################
@@ -57,33 +69,29 @@ $(ODIN_BUILD_DIR)/.%.build: _init
5769

5870
_set_build: $(ODIN_BUILD_DIR)/.regular.build
5971
cd $(BUILD_DIR) &&\
60-
cmake $(CMAKE_GEN_ARGS) $(CMAKE_ARGS) ..
72+
cmake $(CMAKE_GEN_ARGS) $(CMAKE_ARGS) $(_YOSYS_COMPILE_FLAG) ..
6173

6274
_set_debug: $(ODIN_BUILD_DIR)/.debug.build
6375
cd $(BUILD_DIR) &&\
64-
cmake $(CMAKE_GEN_ARGS) $(CMAKE_ARGS) -DODIN_DEBUG=on ..
76+
cmake $(CMAKE_GEN_ARGS) $(CMAKE_ARGS) $(_YOSYS_COMPILE_FLAG) -DODIN_DEBUG=on ..
6577

6678
_set_warn: $(ODIN_BUILD_DIR)/.warn.build
6779
cd $(BUILD_DIR) &&\
68-
cmake $(CMAKE_GEN_ARGS) $(CMAKE_ARGS) -DODIN_WARN=on ..
80+
cmake $(CMAKE_GEN_ARGS) $(CMAKE_ARGS) $(_YOSYS_COMPILE_FLAG) -DODIN_WARN=on ..
6981

7082
_set_gcov: $(ODIN_BUILD_DIR)/.gcov.build
7183
cd $(BUILD_DIR) &&\
72-
cmake $(CMAKE_GEN_ARGS) $(CMAKE_ARGS) -DODIN_COVERAGE=on ..
84+
cmake $(CMAKE_GEN_ARGS) $(CMAKE_ARGS) $(_YOSYS_COMPILE_FLAG) -DODIN_COVERAGE=on ..
7385

7486
_set_clang_tidy: $(ODIN_BUILD_DIR)/.tidy.build
7587
cd $(BUILD_DIR) &&\
76-
cmake $(CMAKE_GEN_ARGS) $(CMAKE_ARGS) -DODIN_TIDY=on ..
88+
cmake $(CMAKE_GEN_ARGS) $(CMAKE_ARGS) $(_YOSYS_COMPILE_FLAG) -DODIN_TIDY=on ..
7789

7890
_set_sanitize: $(ODIN_BUILD_DIR)/.sanitize.build
7991
cd $(BUILD_DIR) &&\
80-
cmake $(CMAKE_GEN_ARGS) $(CMAKE_ARGS) -DODIN_SANITIZE=on ..
92+
cmake $(CMAKE_GEN_ARGS) $(CMAKE_ARGS) $(_YOSYS_COMPILE_FLAG) -DODIN_SANITIZE=on ..
8193

82-
_set_yosys+odin: $(ODIN_BUILD_DIR)/.yosys+odin.build
83-
cd $(BUILD_DIR) &&\
84-
cmake $(CMAKE_GEN_ARGS) $(CMAKE_ARGS) -DODIN_USE_YOSYS=ON ..
85-
86-
BUILD_IT_TARGETS = build debug warn gcov clang_tidy sanitize yosys+odin
94+
BUILD_IT_TARGETS = build debug warn gcov clang_tidy sanitize
8795
$(foreach t,$(BUILD_IT_TARGETS), $(eval $(call _build_it_gen,$(t))))
8896

8997
scrub:
@@ -105,17 +113,27 @@ test_coverage:
105113
$(MAKE) gcovr
106114

107115
test:
116+
ifeq ($(_ELABORATOR), ODIN)
108117
$(MAKE) sanitize \
109118
&& ./verify_odin.sh --no_report -j $(NB_OF_PROCESS) \
110119
-t regression_test/benchmark/suite/light_suite \
111120
-t regression_test/benchmark/suite/vtr_light_suite \
112121
&& $(MAKE) build \
113122
&& ./verify_odin.sh --no_report --continue -j $(NB_OF_PROCESS) \
114123
-t regression_test/benchmark/suite/heavy_suite; \
115-
./verify_odin.sh --status_only
116-
124+
./verify_odin.sh --status_only
125+
else ifeq ($(_ELABORATOR), YOSYS)
126+
$(MAKE) sanitize ELABORATOR=YOSYS \
127+
&& ./verify_odin.sh --no_report -j $(NB_OF_PROCESS) \
128+
-t regression_test/benchmark/suite/yosys+odin/techmap_lightsuite \
129+
&& $(MAKE) build ELABORATOR=YOSYS \
130+
&& ./verify_odin.sh --no_report --continue -j $(NB_OF_PROCESS) \
131+
-t regression_test/benchmark/suite/yosys+odin/techmap_heavysuite; \
132+
./verify_odin.sh --status_only
133+
endif
117134

118135
generate_expectation:
136+
ifeq ($(_ELABORATOR), ODIN)
119137
$(MAKE) sanitize \
120138
&& ./verify_odin.sh --$@ --no_report -j $(NB_OF_PROCESS) \
121139
-t regression_test/benchmark/suite/light_suite \
@@ -124,8 +142,18 @@ generate_expectation:
124142
&& ./verify_odin.sh --$@ --no_report --continue -j $(NB_OF_PROCESS) \
125143
-t regression_test/benchmark/suite/heavy_suite; \
126144
./verify_odin.sh --status_only
145+
else ifeq ($(_ELABORATOR), YOSYS)
146+
$(MAKE) sanitize ELABORATOR=YOSYS \
147+
&& ./verify_odin.sh --$@ --no_report -j $(NB_OF_PROCESS) \
148+
-t regression_test/benchmark/suite/yosys+odin/techmap_lightsuite \
149+
$(MAKE) build ELABORATOR=YOSYS \
150+
&& ./verify_odin.sh --$@ --no_report --continue -j $(NB_OF_PROCESS) \
151+
-t regression_test/benchmark/suite/yosys+odin/techmap_heavysuite; \
152+
./verify_odin.sh --status_only
153+
endif
127154

128155
regenerate_expectation:
156+
ifeq ($(_ELABORATOR), ODIN)
129157
$(MAKE) sanitize \
130158
&& ./verify_odin.sh --$@ --no_report -j $(NB_OF_PROCESS) \
131159
-t regression_test/benchmark/suite/light_suite \
@@ -134,3 +162,12 @@ regenerate_expectation:
134162
&& ./verify_odin.sh --$@ --no_report --continue -j $(NB_OF_PROCESS) \
135163
-t regression_test/benchmark/suite/heavy_suite; \
136164
./verify_odin.sh --status_only
165+
else ifeq ($(_ELABORATOR), YOSYS)
166+
$(MAKE) sanitize ELABORATOR=YOSYS \
167+
&& ./verify_odin.sh --$@ --no_report -j $(NB_OF_PROCESS) \
168+
-t regression_test/benchmark/suite/yosys+odin/techmap_lightsuite \
169+
$(MAKE) build ELABORATOR=YOSYS \
170+
&& ./verify_odin.sh --$@ --no_report --continue -j $(NB_OF_PROCESS) \
171+
-t regression_test/benchmark/suite/yosys+odin/techmap_heavysuite; \
172+
./verify_odin.sh --status_only
173+
endif

ODIN_II/regression_test/tools/run_yosys.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ RED=$'\033[31;1m'
3939
NC=$'\033[0m' # No Color
4040

4141
# defaults
42-
_YOSYS_EXEC="yosys"
42+
_YOSYS_EXEC="${VTR_DIR}/libs/EXTERNAL/libyosys/yosys"
4343
_TEST_INPUT_LIST=()
4444
_VERILOG_INPUT_LIST=()
4545
_REGENERATE_BLIF="off"

ODIN_II/regression_test/tools/synth.tcl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ yosys -import
44
# Feel free to specify file paths using "$env(VTR_ROOT)/ ..."
55

66
# Read the hardware decription Verilog
7-
read_verilog -nomem2reg -nolatches $env(VTR_ROOT)/ODIN_II/regression_test/benchmark/verilog/common/mux.v;
7+
read_verilog -nomem2reg -nolatches $env(TCL_CIRCUIT);
88
# Check that cells match libraries and find top module
99
hierarchy -check -auto-top;
1010

@@ -20,8 +20,8 @@ memory_collect; memory_dff; opt;
2020
# Looking for combinatorial loops, wires with multiple drivers and used wires without any driver.
2121
check;
2222
# resolve asynchronous dffs
23-
techmap -map $env(VTR_ROOT)/ODIN_II/techlib/adff2dff.v;
24-
techmap -map $env(VTR_ROOT)/ODIN_II/techlib/adffe2dff.v;
23+
techmap -map $env(ODIN_TECHLIB)/adff2dff.v;
24+
techmap -map $env(ODIN_TECHLIB)/adffe2dff.v;
2525
# convert mem block to bram/rom
2626

2727
# [NOTE]: Yosys complains about expression width more than 24 bits.
@@ -40,3 +40,5 @@ opt -undriven -full; # -noff #potential option to remove all sdff and etc. Only
4040
autoname;
4141
# Print statistics
4242
stat;
43+
44+
write_blif -param -impltf $env(TCL_BLIF);

dev/subtree_config.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,9 @@
4444
internal_path="libs/EXTERNAL/libinterchange"
4545
external_url="https://github.com/chipsalliance/fpga-interchange-schema.git"
4646
default_external_ref="main"/>
47+
<subtree
48+
name="libcatch2"
49+
internal_path="libs/EXTERNAL/libcatch2"
50+
external_url="https://github.com/catchorg/Catch2.git"
51+
default_external_ref="devel"/>
4752
</subtrees>

doc/src/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ For more specific documentation about VPR see :ref:`vpr`.
3737
arch/index
3838
vpr/index
3939
odin/index
40+
yosys+odin/index
41+
yosys/index
4042
abc/index
4143
tutorials/index
4244
utils/index

doc/src/odin/dev_guide/contributing.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,18 @@ Make changes to that branch.
2828
Then, create a pull request with that branch and **include WIP in the title.**
2929
This will automatically indicate that this PR is not ready to be merged.
3030
Continue to work on the branch, pushing the commits regularly.
31-
Like a PR, test cases are also needed to be included through the use of benchmarks.
31+
Like a PR, test cases must be included through the use of benchmarks.
3232
See [regression tests](./regression_tests) for further instruction.
3333

3434
### Formating
3535

3636
Odin II shares the same contributing philosophy as [VPR](https://docs.verilogtorouting.org/en/latest/dev/contributing/contributing/).
3737
Most importantly PRs will be rejected if they do not respect the coding standard: see [VPRs coding standard](https://docs.verilogtorouting.org/en/latest/dev/developing/#code-formatting)
3838

39+
To correct any code formatting issues flagged by the CI system, simply run ``make format`` to adapt the newly added code to VPR's coding standard.
40+
If you have made alterations to python scripts, you would probably need to run ``make format-py`` and ``./dev/pylint_check.py`` from the VTR root directory to correct the python code formatting and check for lint errors.
41+
42+
3943
## Odin II's Flow
4044

4145
Odin II functions by systematically executing a set of steps determined by the files and arguments passed in.

0 commit comments

Comments
 (0)