File tree Expand file tree Collapse file tree 10 files changed +70
-4
lines changed Expand file tree Collapse file tree 10 files changed +70
-4
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ make install
28
28
popd
29
29
ln -sf /usr/local/bin/make /usr/bin/make
30
30
31
+ # Copy java.capnp needed by NISP
32
+ cp ./third_party/nextpnr-fpga-interchange-site-preprocessor/third_party/capnproto-java/compiler/src/main/schema/capnp/java.capnp /usr/include/capnp/java.capnp
33
+
31
34
# Check versions
32
35
make --version
33
36
cmake --version
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ LINK_PREFIX=$3
37
37
INSTALL_DIR=" $( pwd) /install"
38
38
39
39
# Prepare environment
40
+ source " $HOME /.cargo/env"
40
41
make env
41
42
source env/conda/bin/activate fpga-interchange
42
43
Original file line number Diff line number Diff line change 10
10
set -e
11
11
apt-get -qqy update
12
12
apt-get -qqy install build-essential git make locales libtinfo-dev \
13
- cmake python3 wget unzip curl openjdk-11-jdk-headless capnproto
13
+ cmake python3 wget unzip curl openjdk-11-jdk-headless capnproto libcapnp-dev
14
14
dpkg-reconfigure locales
15
15
16
+ # Copy java.capnp needed by NISP
17
+ cp ./third_party/nextpnr-fpga-interchange-site-preprocessor/third_party/capnproto-java/compiler/src/main/schema/capnp/java.capnp /usr/include/capnp/java.capnp
18
+
16
19
# Vivado is erroring out due to a missing library in CI.
17
20
# https://support.xilinx.com/s/article/76585?language=en_US
18
21
ln -s /lib/x86_64-linux-gnu/libtinfo.so.6 /lib/x86_64-linux-gnu/libtinfo.so.5
Original file line number Diff line number Diff line change @@ -80,11 +80,17 @@ jobs:
80
80
run : |
81
81
.github/scripts/ubuntu-setup.sh
82
82
83
+ - name : Install Rust
84
+ run : |
85
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
86
+
83
87
- name : Create environment
84
- run : make env
88
+ run : |
89
+ make env
85
90
86
91
- name : Build CMake
87
92
run : |
93
+ source "$HOME/.cargo/env"
88
94
make build
89
95
make update
90
96
Original file line number Diff line number Diff line change 36
36
steps :
37
37
38
38
- uses : actions/checkout@v2
39
+ with :
40
+ submodules : recursive
39
41
40
42
- name : Install prerequisites
41
43
run : |
47
49
apt update -qqy
48
50
apt install -qqy gnupg2 google-cloud-cli
49
51
52
+ - name : Install Rust
53
+ run : |
54
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
55
+
50
56
- name : Save timestamp
51
57
id : timestamp
52
58
run : |
Original file line number Diff line number Diff line change 34
34
[submodule "third_party/litex-boards "]
35
35
path = third_party/litex-boards
36
36
url = https://github.com/litex-hub/litex-boards.git
37
+ [submodule "third_party/nextpnr-fpga-interchange-site-preprocessor "]
38
+ path = third_party/nextpnr-fpga-interchange-site-preprocessor
39
+ url = https://github.com/antmicro/nextpnr-fpga-interchange-site-preprocessor
Original file line number Diff line number Diff line change @@ -53,6 +53,16 @@ set_program(vvp)
53
53
set_program(xcfasm)
54
54
set_program(yosys)
55
55
56
+ if (DEFINED ENV{"NISP" })
57
+ set (NISP_PATH $ENV{"NISP" })
58
+ else ()
59
+ get_filename_component (NISP_PATH "third_party/nextpnr-fpga-interchange-site-preprocessor/nisp" ABSOLUTE )
60
+ endif ()
61
+
62
+ set_target_properties (
63
+ programs PROPERTIES NISP ${NISP_PATH}
64
+ )
65
+
56
66
include (boards/boards.cmake)
57
67
include (devices/chipdb.cmake)
58
68
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ ENVIRONMENT_FILE := conda_lock.yml
12
12
13
13
# Paths
14
14
RAPIDWRIGHT_PATH ?= $(TOP_DIR ) /third_party/RapidWright
15
+ NISP_PATH = third_party/nextpnr-fpga-interchange-site-preprocessor
15
16
16
17
third_party/make-env/conda.mk :
17
18
git submodule init
@@ -26,11 +27,23 @@ update:
26
27
make compile && \
27
28
popd
28
29
30
+ ${NISP_PATH}/nisp :
31
+ @$(IN_CONDA_ENV ) cd ${NISP_PATH} && (FPGA_INTERCHANGE_SCHEMA_DIR=third_party/fpga-interchange-schema cargo build --release)
32
+ @ln -s ` realpath ${NISP_PATH} /target/release/nisp` ${NISP_PATH} /nisp
33
+
34
+ .PHONY : nisp
35
+ nisp : ${NISP_PATH}/nisp
36
+
37
+ .PHONY : clean-nisp
38
+ clean-nisp :
39
+ @rm -rf ${NISP_PATH} /target
40
+ -@unlink ${NISP_PATH} /nisp
41
+
29
42
.PHONY : build
30
- build :
43
+ build : ${NISP_PATH}/nisp
31
44
# Build test suite
32
45
@$(IN_CONDA_ENV ) mkdir -p build && cd build && cmake .. ${CMAKE_FLAGS}
33
46
34
47
.PHONY : clean-build
35
- clean-build :
48
+ clean-build : clean-nisp
36
49
rm -rf build/*
Original file line number Diff line number Diff line change @@ -248,6 +248,7 @@ function(generate_chipdb)
248
248
249
249
get_target_property (PYTHON3 programs PYTHON3)
250
250
get_target_property (BBASM programs BBASM)
251
+ get_target_property (NISP programs NISP)
251
252
252
253
get_target_property (device_loc ${device_target} LOCATION )
253
254
set (chipdb_bba ${CMAKE_CURRENT_BINARY_DIR} /chipdb.bba)
@@ -280,6 +281,22 @@ function(generate_chipdb)
280
281
281
282
add_custom_target (chipdb-${device} -bin DEPENDS ${chipdb_bin} )
282
283
284
+ # TODO: Currently we invoke NISP to generate JSON data and we keep the
285
+ # JSON file. Ultimately this data should be imported to the BBA file.
286
+ set (nisp_json ${CMAKE_CURRENT_BINARY_DIR} /${device} _site_routability.json)
287
+ add_custom_command (
288
+ OUTPUT ${nisp_json}
289
+ COMMAND
290
+ ${NISP} ${device_loc} ${chipdb_bba} preprocess --json :all --threads 1 --no -formula-opt -c
291
+ DEPENDS
292
+ chipdb-${device} -bba
293
+ ${device_target}
294
+ ${device_loc}
295
+ ${NISP}
296
+ )
297
+
298
+ add_custom_target (chipdb-${device} -json DEPENDS ${nisp_json} )
299
+
283
300
# Setting device target properties
284
301
add_custom_target (device-${device} )
285
302
set_target_properties (
@@ -299,16 +316,19 @@ function(generate_chipdb)
299
316
300
317
install (FILES ${device_loc} DESTINATION devices/${device} )
301
318
install (FILES ${chipdb_bin} DESTINATION devices/${device} )
319
+ install (FILES ${nisp_json} DESTINATION devices/${device} )
302
320
303
321
add_custom_target (
304
322
install_${device} _device
305
323
ALL
306
324
DEPENDS
307
325
${device_target}
308
326
chipdb-${device} -bin
327
+ chipdb-${device} -json
309
328
)
310
329
311
330
add_dependencies (all -device-data chipdb-${device} -bin)
331
+ add_dependencies (all -device-data chipdb-${device} -json)
312
332
313
333
endfunction ()
314
334
You can’t perform that action at this time.
0 commit comments