aboutsummaryrefslogtreecommitdiffstats
path: root/fpga_interchange/examples/tests.cmake
diff options
context:
space:
mode:
authorAlessandro Comodi <acomodi@antmicro.com>2021-03-16 21:49:06 +0100
committerAlessandro Comodi <acomodi@antmicro.com>2021-03-16 22:02:06 +0100
commitc1e668f8238141a7d19525e9eb7a23c17cd1b120 (patch)
tree522ac7362ca83cde34b04233fc7dcce75d24b666 /fpga_interchange/examples/tests.cmake
parentf9e9fadbc8ec794ed43f94d237fe4b889c5e13d8 (diff)
downloadnextpnr-c1e668f8238141a7d19525e9eb7a23c17cd1b120.tar.gz
nextpnr-c1e668f8238141a7d19525e9eb7a23c17cd1b120.tar.bz2
nextpnr-c1e668f8238141a7d19525e9eb7a23c17cd1b120.zip
fpga_interchange: address review comments
Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
Diffstat (limited to 'fpga_interchange/examples/tests.cmake')
-rw-r--r--fpga_interchange/examples/tests.cmake53
1 files changed, 46 insertions, 7 deletions
diff --git a/fpga_interchange/examples/tests.cmake b/fpga_interchange/examples/tests.cmake
index 899bfa4a..194a3f21 100644
--- a/fpga_interchange/examples/tests.cmake
+++ b/fpga_interchange/examples/tests.cmake
@@ -2,6 +2,7 @@ function(add_interchange_test)
# ~~~
# add_interchange_test(
# name <name>
+ # family <family>
# device <common device>
# package <package>
# tcl <tcl>
@@ -20,7 +21,7 @@ function(add_interchange_test)
# - test-fpga_interchange-<name>-dcp : design checkpoint with RapidWright
set(options)
- set(oneValueArgs name device package tcl xdc top techmap)
+ set(oneValueArgs name family device package tcl xdc top techmap)
set(multiValueArgs sources)
cmake_parse_arguments(
@@ -32,6 +33,7 @@ function(add_interchange_test)
)
set(name ${add_interchange_test_name})
+ set(family ${add_interchange_test_family})
set(device ${add_interchange_test_device})
set(package ${add_interchange_test_package})
set(top ${add_interchange_test_top})
@@ -64,8 +66,8 @@ function(add_interchange_test)
add_custom_target(test-${family}-${name}-json DEPENDS ${synth_json})
# Logical Netlist
- set(device_target constraints-luts-${device}-device)
- get_property(device_loc TARGET constraints-luts-${device}-device PROPERTY LOCATION)
+ get_property(device_target TARGET device-${device} PROPERTY DEVICE_TARGET)
+ get_property(device_loc TARGET device-${device} PROPERTY DEVICE_LOC)
set(netlist ${CMAKE_CURRENT_BINARY_DIR}/${name}.netlist)
add_custom_command(
@@ -85,27 +87,64 @@ function(add_interchange_test)
add_custom_target(test-${family}-${name}-netlist DEPENDS ${netlist})
- set(chipdb_target chipdb-${device}-bin)
+ # Logical Netlist YAML
+ set(netlist_yaml ${CMAKE_CURRENT_BINARY_DIR}/${name}.netlist.yaml)
+ add_custom_command(
+ OUTPUT ${netlist_yaml}
+ COMMAND
+ ${PYTHON_EXECUTABLE} -mfpga_interchange.convert
+ --schema_dir ${INTERCHANGE_SCHEMA_PATH}
+ --schema logical
+ --input_format capnp
+ --output_format yaml
+ ${netlist}
+ ${netlist_yaml}
+ DEPENDS
+ ${netlist}
+ )
+
+ add_custom_target(test-${family}-${name}-netlist-yaml DEPENDS ${netlist_yaml})
# Physical Netlist
+ get_property(chipdb_bin_target TARGET device-${device} PROPERTY CHIPDB_BIN_TARGET)
+ get_property(chipdb_bin_loc TARGET device-${device} PROPERTY CHIPDB_BIN_LOC)
+
set(phys ${CMAKE_CURRENT_BINARY_DIR}/${name}.phys)
add_custom_command(
OUTPUT ${phys}
COMMAND
nextpnr-fpga_interchange
- --chipdb ${chipdb_dir}/chipdb-${device}.bin
+ --chipdb ${chipdb_bin_loc}
--xdc ${xdc}
--netlist ${netlist}
--phys ${phys}
--package ${package}
DEPENDS
${netlist}
- ${chipdb_target}
- ${chipdb_dir}/chipdb-${device}.bin
+ ${chipdb_bin_target}
+ ${chipdb_bin_loc}
)
add_custom_target(test-${family}-${name}-phys DEPENDS ${phys})
+ # Physical Netlist YAML
+ set(phys_yaml ${CMAKE_CURRENT_BINARY_DIR}/${name}.phys.yaml)
+ add_custom_command(
+ OUTPUT ${phys_yaml}
+ COMMAND
+ ${PYTHON_EXECUTABLE} -mfpga_interchange.convert
+ --schema_dir ${INTERCHANGE_SCHEMA_PATH}
+ --schema physical
+ --input_format capnp
+ --output_format yaml
+ ${phys}
+ ${phys_yaml}
+ DEPENDS
+ ${phys}
+ )
+
+ add_custom_target(test-${family}-${name}-phys-yaml DEPENDS ${phys_yaml})
+
set(dcp ${CMAKE_CURRENT_BINARY_DIR}/${name}.dcp)
add_custom_command(
OUTPUT ${dcp}