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>
This commit is contained in:
Keith Rothman 2021-03-19 18:28:48 -07:00
parent 53ed6979a9
commit 0f4014615c
5 changed files with 128 additions and 17 deletions

View File

@ -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
$<TARGET_FILE:nextpnr-fpga_interchange>
--chipdb ${chipdb_bin}
--package ${test_package}
--test
DEPENDS
${chipdb_bin}
chipdb-${device}-bin
)
add_custom_target(
chipdb-${device}-bin-check-test-data
COMMAND

View File

@ -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

View File

@ -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
)

View File

@ -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

View File

@ -9,7 +9,7 @@ set(RAPIDWRIGHT_PATH $ENV{HOME}/RapidWright CACHE PATH "Path to RapidWright")
set(INVOKE_RAPIDWRIGHT ${RAPIDWRIGHT_PATH}/scripts/invoke_rapidwright.sh CACHE PATH "Path to RapidWright invocation script")
# FIXME: Make patch data available in the python package and remove this cached var
set(PYTHON_INTERCHANGE_PATH $ENV{HOME}/python-fpga-interchange CACHE PATH "Path to the FPGA interchange python library")
set(INTERCHANGE_SCHEMA_PATH $ENV{HOME}/fpga_interchange_schema CACHE PATH "Path to the FPGA interchange schema dir")
set(INTERCHANGE_SCHEMA_PATH ${PROJECT_SOURCE_DIR}/3rdparty/fpga-interchange-schema/interchange CACHE PATH "Path to the FPGA interchange schema dir")
add_subdirectory(3rdparty/fpga-interchange-schema/cmake/cxx_static)