aboutsummaryrefslogtreecommitdiffstats
path: root/fpga_interchange/examples/tests.cmake
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-03-22 18:32:04 +0000
committerGitHub <noreply@github.com>2021-03-22 18:32:04 +0000
commita3ed97c0db8aced801a7bceb8d336d6203a671ad (patch)
tree2df15cb63b0e315b9bac9b0b0cc9b6a7f243e7d9 /fpga_interchange/examples/tests.cmake
parente8d36bf5bdda84503d5c796b933b1c986a277bf5 (diff)
parent32f2ec86c4b83d1e0f3c0982566ff4de30edebb3 (diff)
downloadnextpnr-a3ed97c0db8aced801a7bceb8d336d6203a671ad.tar.gz
nextpnr-a3ed97c0db8aced801a7bceb8d336d6203a671ad.tar.bz2
nextpnr-a3ed97c0db8aced801a7bceb8d336d6203a671ad.zip
Merge pull request #637 from litghost/refine_site_router
Refine site router
Diffstat (limited to 'fpga_interchange/examples/tests.cmake')
-rw-r--r--fpga_interchange/examples/tests.cmake92
1 files changed, 89 insertions, 3 deletions
diff --git a/fpga_interchange/examples/tests.cmake b/fpga_interchange/examples/tests.cmake
index 7598d25c..9df19903 100644
--- a/fpga_interchange/examples/tests.cmake
+++ b/fpga_interchange/examples/tests.cmake
@@ -69,12 +69,12 @@ function(add_interchange_test)
set(synth_json ${CMAKE_CURRENT_BINARY_DIR}/${name}.json)
add_custom_command(
OUTPUT ${synth_json}
- COMMAND
- SOURCES=${sources}
+ COMMAND ${CMAKE_COMMAND} -E env
+ SOURCES="${sources}"
OUT_JSON=${synth_json}
TECHMAP=${techmap}
yosys -c ${tcl}
- DEPENDS ${sources}
+ DEPENDS ${sources} ${techmap} ${tcl}
)
add_custom_target(test-${family}-${name}-json DEPENDS ${synth_json})
@@ -134,12 +134,98 @@ function(add_interchange_test)
--phys ${phys}
--package ${package}
DEPENDS
+ nextpnr-fpga_interchange
+ ${netlist}
+ ${xdc}
+ ${chipdb_bin_target}
+ ${chipdb_bin_loc}
+ )
+
+ add_custom_target(
+ test-${family}-${name}-phys-verbose
+ COMMAND
+ nextpnr-fpga_interchange
+ --chipdb ${chipdb_bin_loc}
+ --xdc ${xdc}
+ --netlist ${netlist}
+ --phys ${phys}
+ --package ${package}
+ --verbose
+ DEPENDS
+ ${netlist}
+ ${xdc}
+ ${chipdb_bin_target}
+ ${chipdb_bin_loc}
+ )
+
+ add_custom_target(
+ test-${family}-${name}-phys-verbose2
+ COMMAND
+ nextpnr-fpga_interchange
+ --chipdb ${chipdb_bin_loc}
+ --xdc ${xdc}
+ --netlist ${netlist}
+ --phys ${phys}
+ --package ${package}
+ --debug
+ DEPENDS
${netlist}
${xdc}
${chipdb_bin_target}
${chipdb_bin_loc}
)
+ add_custom_target(
+ test-${family}-${name}-phys-debug
+ COMMAND gdb --args
+ $<TARGET_FILE:nextpnr-fpga_interchange>
+ --chipdb ${chipdb_bin_loc}
+ --xdc ${xdc}
+ --netlist ${netlist}
+ --phys ${phys}
+ --package ${package}
+ DEPENDS
+ ${netlist}
+ ${xdc}
+ ${chipdb_bin_target}
+ ${chipdb_bin_loc}
+ )
+
+ add_custom_target(
+ test-${family}-${name}-phys-valgrind
+ COMMAND
+ PYTHONMALLOC=malloc valgrind
+ $<TARGET_FILE:nextpnr-fpga_interchange>
+ --chipdb ${chipdb_bin_loc}
+ --xdc ${xdc}
+ --netlist ${netlist}
+ --phys ${phys}
+ --package ${package}
+ DEPENDS
+ ${netlist}
+ ${xdc}
+ ${chipdb_bin_target}
+ ${chipdb_bin_loc}
+ )
+
+ if(PROFILER)
+ add_custom_target(
+ test-${family}-${name}-phys-profile
+ COMMAND CPUPROFILE=${name}.prof
+ $<TARGET_FILE:nextpnr-fpga_interchange>
+ --chipdb ${chipdb_bin_loc}
+ --xdc ${xdc}
+ --netlist ${netlist}
+ --phys ${phys}
+ --package ${package}
+ DEPENDS
+ ${netlist}
+ ${xdc}
+ ${chipdb_bin_target}
+ ${chipdb_bin_loc}
+ )
+ endif()
+
add_custom_target(test-${family}-${name}-phys DEPENDS ${phys})
# Physical Netlist YAML