From 0f4014615cf9059332a75244a0ef5a9df4886ed0 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Fri, 19 Mar 2021 18:28:48 -0700 Subject: Add missing dependencies to CMake targets. - Add additional targets useful for various situations. - Have counter test use common remap.v file. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- fpga_interchange/examples/chipdb.cmake | 36 +++++++++ fpga_interchange/examples/tests.cmake | 92 +++++++++++++++++++++- .../examples/tests/counter/CMakeLists.txt | 4 +- fpga_interchange/examples/tests/counter/remap.v | 11 --- 4 files changed, 127 insertions(+), 16 deletions(-) delete mode 100644 fpga_interchange/examples/tests/counter/remap.v (limited to 'fpga_interchange/examples') diff --git a/fpga_interchange/examples/chipdb.cmake b/fpga_interchange/examples/chipdb.cmake index e0cf2c13..676c8c77 100644 --- a/fpga_interchange/examples/chipdb.cmake +++ b/fpga_interchange/examples/chipdb.cmake @@ -314,6 +314,42 @@ function(generate_chipdb) chipdb-${device}-bin ) + add_custom_target( + chipdb-${device}-bin-check-verbose + COMMAND + nextpnr-fpga_interchange + --chipdb ${chipdb_bin} + --package ${test_package} + --test --verbose + DEPENDS + ${chipdb_bin} + chipdb-${device}-bin + ) + + add_custom_target( + chipdb-${device}-bin-check-verbose2 + COMMAND + nextpnr-fpga_interchange + --chipdb ${chipdb_bin} + --package ${test_package} + --test --debug + DEPENDS + ${chipdb_bin} + chipdb-${device}-bin + ) + + add_custom_target( + chipdb-${device}-bin-check-debug + COMMAND gdb --args + $ + --chipdb ${chipdb_bin} + --package ${test_package} + --test + DEPENDS + ${chipdb_bin} + chipdb-${device}-bin + ) + add_custom_target( chipdb-${device}-bin-check-test-data COMMAND 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}) @@ -133,6 +133,41 @@ function(add_interchange_test) --netlist ${netlist} --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} @@ -140,6 +175,57 @@ function(add_interchange_test) ${chipdb_bin_loc} ) + add_custom_target( + test-${family}-${name}-phys-debug + COMMAND gdb --args + $ + --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 + $ + --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 + $ + --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 diff --git a/fpga_interchange/examples/tests/counter/CMakeLists.txt b/fpga_interchange/examples/tests/counter/CMakeLists.txt index dc41d8da..6e187071 100644 --- a/fpga_interchange/examples/tests/counter/CMakeLists.txt +++ b/fpga_interchange/examples/tests/counter/CMakeLists.txt @@ -6,7 +6,7 @@ add_interchange_test( tcl run.tcl xdc counter_basys3.xdc sources counter.v - techmap remap.v + techmap ../../remap.v ) add_interchange_test( @@ -17,5 +17,5 @@ add_interchange_test( tcl run.tcl xdc counter_arty.xdc sources counter.v - techmap remap.v + techmap ../../remap.v ) diff --git a/fpga_interchange/examples/tests/counter/remap.v b/fpga_interchange/examples/tests/counter/remap.v deleted file mode 100644 index 6dfc0b4a..00000000 --- a/fpga_interchange/examples/tests/counter/remap.v +++ /dev/null @@ -1,11 +0,0 @@ -module INV(input I, output O); - -LUT1 #(.INIT(2'b01)) _TECHMAP_REPLACE_ (.I0(I), .O(O)); - -endmodule - -module BUF(input I, output O); - -LUT1 #(.INIT(2'b10)) _TECHMAP_REPLACE_ (.I0(I), .O(O)); - -endmodule -- cgit v1.2.3