From 5174697682b3ae2324ae44287a0e63ba97b7f704 Mon Sep 17 00:00:00 2001 From: Maciej Kurc Date: Mon, 29 Nov 2021 16:07:13 +0100 Subject: [PATCH 1/8] Removed unneeded dependency on chipdb BBA Signed-off-by: Maciej Kurc --- tests/tests.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/tests.cmake b/tests/tests.cmake index 13ca88c..2137e02 100644 --- a/tests/tests.cmake +++ b/tests/tests.cmake @@ -180,7 +180,6 @@ function(add_generic_test) ${netlist} DEPENDS ${arch}-${test_name}-json - chipdb-${device}-bin ${device_target} ${device_loc} ${synth_json} From f195d0f82df8e6593264dbcaff8dbc54b291985e Mon Sep 17 00:00:00 2001 From: Maciej Kurc Date: Mon, 29 Nov 2021 16:07:47 +0100 Subject: [PATCH 2/8] Added extra_args parameter to the testarch generation CMake function Signed-off-by: Maciej Kurc --- devices/chipdb_testarch.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/devices/chipdb_testarch.cmake b/devices/chipdb_testarch.cmake index 6224f66..4d3d37c 100644 --- a/devices/chipdb_testarch.cmake +++ b/devices/chipdb_testarch.cmake @@ -4,6 +4,7 @@ function(generate_testarch_device_db) # device # package # output_target + # [extra_args ] # ) # ~~~ # @@ -17,13 +18,14 @@ function(generate_testarch_device_db) # share the same xc7a35t device prefix # - package: one among the parts available for a given package # - output_target: variable name that will hold the output device target for the parent scope + # - extra_args: a list of extra arguments to be passed to the test architecture generator # # Targets generated: # - rapidwright--device set(options) set(oneValueArgs device package output_target) - set(multiValueArgs) + set(multiValueArgs extra_args) cmake_parse_arguments( create_testarch_device_db @@ -36,6 +38,7 @@ function(generate_testarch_device_db) set(device ${create_testarch_device_db_device}) set(package ${create_testarch_device_db_package}) set(output_target ${create_testarch_device_db_output_target}) + set(extra_args ${create_testarch_device_db_extra_args}) get_target_property(PYTHON3 programs PYTHON3) @@ -47,6 +50,7 @@ function(generate_testarch_device_db) --schema-dir ${INTERCHANGE_SCHEMA_PATH} --out-file ${out_file} --package ${package} + ${extra_args} ) add_custom_target(testarch-${device}-device DEPENDS ${out_file}) From a198d1c80385bc9e3a77d0e85400efa00eab37e7 Mon Sep 17 00:00:00 2001 From: Maciej Kurc Date: Mon, 29 Nov 2021 16:08:19 +0100 Subject: [PATCH 3/8] Added testarch with no FFMUX Signed-off-by: Maciej Kurc --- boards/CMakeLists.txt | 13 ++++++++++++- devices/CMakeLists.txt | 3 ++- devices/testarch-noffmux/CMakeLists.txt | 14 ++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 devices/testarch-noffmux/CMakeLists.txt diff --git a/boards/CMakeLists.txt b/boards/CMakeLists.txt index 0f4de57..73103ae 100644 --- a/boards/CMakeLists.txt +++ b/boards/CMakeLists.txt @@ -107,7 +107,7 @@ add_board( speedgrade -9 ) -# Fake board to test the test architecture +# Fake board to test test architecture(s) add_board( name testboard device_family test @@ -118,3 +118,14 @@ add_board( no_fasm no_bitstream ) + +add_board( + name testboard_noffmux + device_family test + device testarch-noffmux + arch testarch-noffmux + package test_package + speedgrade -1 + no_fasm + no_bitstream +) diff --git a/devices/CMakeLists.txt b/devices/CMakeLists.txt index 97aa699..875da74 100644 --- a/devices/CMakeLists.txt +++ b/devices/CMakeLists.txt @@ -26,5 +26,6 @@ add_subdirectory(xc7vx980t) add_subdirectory(LIFCL-17) add_subdirectory(LIFCL-40) -# Test architecture +# Test architectures add_subdirectory(testarch) +add_subdirectory(testarch-noffmux) diff --git a/devices/testarch-noffmux/CMakeLists.txt b/devices/testarch-noffmux/CMakeLists.txt new file mode 100644 index 0000000..7433ad2 --- /dev/null +++ b/devices/testarch-noffmux/CMakeLists.txt @@ -0,0 +1,14 @@ +generate_testarch_device_db( + device testarch-noffmux + package test_package + output_target test_arch_target + extra_args --no-ffmux +) + +generate_chipdb( + device testarch-noffmux + part testarch-test_package + device_target ${test_arch_target} + device_config ${PYTHON_INTERCHANGE_PATH}/test_data/gen_device_config.yaml + test_package test_package +) From f8d8f0c9c6c27c91030c1169baf67579cf08a45c Mon Sep 17 00:00:00 2001 From: Maciej Kurc Date: Mon, 29 Nov 2021 15:56:00 +0100 Subject: [PATCH 4/8] Updated LUT tests Signed-off-by: Maciej Kurc --- tests/features/lut/CMakeLists.txt | 12 ++++++-- .../features/lut/{lut_testarch.v => lut_ff.v} | 0 tests/features/lut/lut_routethru.v | 30 +++++++++++++++++++ 3 files changed, 39 insertions(+), 3 deletions(-) rename tests/features/lut/{lut_testarch.v => lut_ff.v} (100%) create mode 100644 tests/features/lut/lut_routethru.v diff --git a/tests/features/lut/CMakeLists.txt b/tests/features/lut/CMakeLists.txt index c04fe98..47b10fb 100644 --- a/tests/features/lut/CMakeLists.txt +++ b/tests/features/lut/CMakeLists.txt @@ -5,9 +5,15 @@ add_generic_test( ) add_generic_test( - name lut - board_list testboard - sources lut_testarch.v + name lut_ff + board_list testboard testboard_noffmux + sources lut_ff.v +) + +add_generic_test( + name lut_routethru + board_list testboard_noffmux + sources lut_routethru.v ) add_xc7_validation_test( diff --git a/tests/features/lut/lut_testarch.v b/tests/features/lut/lut_ff.v similarity index 100% rename from tests/features/lut/lut_testarch.v rename to tests/features/lut/lut_ff.v diff --git a/tests/features/lut/lut_routethru.v b/tests/features/lut/lut_routethru.v new file mode 100644 index 0000000..829a091 --- /dev/null +++ b/tests/features/lut/lut_routethru.v @@ -0,0 +1,30 @@ +// Copyright (C) 2021 The Symbiflow Authors. +// +// Use of this source code is governed by a ISC-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/ISC +// +// SPDX-License-Identifier: ISC + +module top(input [3:0] i, output [3:0] o); + +wire i0_wire, i1_wire, i2_wire, i3_wire; +wire o0_wire, o1_wire, o2_wire, o3_wire; + +IB ib_0(.I(i0_wire), .P(i[0])); +IB ib_1(.I(i1_wire), .P(i[1])); +IB ib_2(.I(i2_wire), .P(i[2])); +IB ib_3(.I(i3_wire), .P(i[3])); + +OB ob_0(.O(o0_wire), .P(o[0])); +OB ob_1(.O(o1_wire), .P(o[1])); +OB ob_2(.O(o2_wire), .P(o[2])); +OB ob_3(.O(o3_wire), .P(o[3])); + +// "Free" flip-flops. In the testarch with no FFMUX they require LUT-thrus +DFF ff_0(.D(i0_wire), .C(1'b1), .R(1'b0), .Q(o0_wire)); +DFF ff_1(.D(i1_wire), .C(1'b1), .R(1'b0), .Q(o1_wire)); +DFF ff_2(.D(i2_wire), .C(1'b1), .R(1'b0), .Q(o2_wire)); +DFF ff_3(.D(i3_wire), .C(1'b1), .R(1'b0), .Q(o3_wire)); + +endmodule From 03f1ded0b9619ff9909728d677d2bf97b97e7b06 Mon Sep 17 00:00:00 2001 From: Maciej Kurc Date: Thu, 2 Dec 2021 13:25:18 +0100 Subject: [PATCH 5/8] Moved the testarch-noffmux to the same folder as testarch Signed-off-by: Maciej Kurc --- devices/CMakeLists.txt | 3 +-- devices/chipdb.cmake | 3 ++- devices/testarch/CMakeLists.txt | 16 ++++++++++++++++ tests/tests.cmake | 4 ++-- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/devices/CMakeLists.txt b/devices/CMakeLists.txt index 875da74..97aa699 100644 --- a/devices/CMakeLists.txt +++ b/devices/CMakeLists.txt @@ -26,6 +26,5 @@ add_subdirectory(xc7vx980t) add_subdirectory(LIFCL-17) add_subdirectory(LIFCL-40) -# Test architectures +# Test architecture add_subdirectory(testarch) -add_subdirectory(testarch-noffmux) diff --git a/devices/chipdb.cmake b/devices/chipdb.cmake index 4d24fce..e6b4c94 100644 --- a/devices/chipdb.cmake +++ b/devices/chipdb.cmake @@ -250,13 +250,14 @@ function(generate_chipdb) get_target_property(BBASM programs BBASM) get_target_property(device_loc ${device_target} LOCATION) - set(chipdb_bba ${CMAKE_CURRENT_BINARY_DIR}/chipdb.bba) + set(chipdb_bba ${CMAKE_CURRENT_BINARY_DIR}/chipdb-${device}.bba) add_custom_command( OUTPUT ${chipdb_bba} COMMAND ${PYTHON3} -mfpga_interchange.nextpnr_emit --schema_dir ${INTERCHANGE_SCHEMA_PATH} --output_dir ${CMAKE_CURRENT_BINARY_DIR} + --suffix ${device} --device_config ${device_config} --device ${device_loc} DEPENDS diff --git a/devices/testarch/CMakeLists.txt b/devices/testarch/CMakeLists.txt index 4588bba..b2badd9 100644 --- a/devices/testarch/CMakeLists.txt +++ b/devices/testarch/CMakeLists.txt @@ -11,3 +11,19 @@ generate_chipdb( device_config ${PYTHON_INTERCHANGE_PATH}/test_data/gen_device_config.yaml test_package test_package ) + +# Testarch with FFMUX disabled +generate_testarch_device_db( + device testarch-noffmux + package test_package + output_target test_arch_target + extra_args --no-ffmux +) + +generate_chipdb( + device testarch-noffmux + part testarch-test_package + device_target ${test_arch_target} + device_config ${PYTHON_INTERCHANGE_PATH}/test_data/gen_device_config.yaml + test_package test_package +) diff --git a/tests/tests.cmake b/tests/tests.cmake index 2137e02..8f61b1d 100644 --- a/tests/tests.cmake +++ b/tests/tests.cmake @@ -98,13 +98,13 @@ function(add_generic_test) set(test_name "${name}-${board}") if(DEFINED generated_xdc) - set(xdc ${generated_xdc}) + set(xdc ${CMAKE_CURRENT_SOURCE_DIR}/${generated_xdc}) else() set(xdc ${CMAKE_CURRENT_SOURCE_DIR}/${prefix}${board}.xdc) endif() get_property(device_target TARGET device-${device} PROPERTY DEVICE_TARGET) get_property(device_loc TARGET device-${device} PROPERTY DEVICE_LOC) - set(chipdb_loc ${CMAKE_BINARY_DIR}/devices/${device}/${device}.bin) + get_property(chipdb_loc TARGET device-${device} PROPERTY CHIPDB_BIN_LOC) set(output_dir ${CMAKE_CURRENT_BINARY_DIR}/${board}) add_custom_command( From 1616a2f382fdfb964df1f752af14eebe93202efd Mon Sep 17 00:00:00 2001 From: Maciej Kurc Date: Thu, 2 Dec 2021 13:26:02 +0100 Subject: [PATCH 6/8] Updated the LUT routethru test Signed-off-by: Maciej Kurc --- tests/features/lut/CMakeLists.txt | 2 ++ tests/features/lut/lut_routethru.v | 8 ++++---- tests/features/lut/lut_routethru.xdc | 8 ++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 tests/features/lut/lut_routethru.xdc diff --git a/tests/features/lut/CMakeLists.txt b/tests/features/lut/CMakeLists.txt index 47b10fb..46036d7 100644 --- a/tests/features/lut/CMakeLists.txt +++ b/tests/features/lut/CMakeLists.txt @@ -8,12 +8,14 @@ add_generic_test( name lut_ff board_list testboard testboard_noffmux sources lut_ff.v + generated_xdc testboard.xdc ) add_generic_test( name lut_routethru board_list testboard_noffmux sources lut_routethru.v + generated_xdc lut_routethru.xdc ) add_xc7_validation_test( diff --git a/tests/features/lut/lut_routethru.v b/tests/features/lut/lut_routethru.v index 829a091..730eadc 100644 --- a/tests/features/lut/lut_routethru.v +++ b/tests/features/lut/lut_routethru.v @@ -22,9 +22,9 @@ OB ob_2(.O(o2_wire), .P(o[2])); OB ob_3(.O(o3_wire), .P(o[3])); // "Free" flip-flops. In the testarch with no FFMUX they require LUT-thrus -DFF ff_0(.D(i0_wire), .C(1'b1), .R(1'b0), .Q(o0_wire)); -DFF ff_1(.D(i1_wire), .C(1'b1), .R(1'b0), .Q(o1_wire)); -DFF ff_2(.D(i2_wire), .C(1'b1), .R(1'b0), .Q(o2_wire)); -DFF ff_3(.D(i3_wire), .C(1'b1), .R(1'b0), .Q(o3_wire)); +DFFR ff_0(.D(i0_wire), .C(1'b1), .R(1'b0), .Q(o0_wire)); +DFFR ff_1(.D(i1_wire), .C(1'b1), .R(1'b0), .Q(o1_wire)); +DFFR ff_2(.D(i2_wire), .C(1'b1), .R(1'b0), .Q(o2_wire)); +DFFR ff_3(.D(i3_wire), .C(1'b1), .R(1'b0), .Q(o3_wire)); endmodule diff --git a/tests/features/lut/lut_routethru.xdc b/tests/features/lut/lut_routethru.xdc new file mode 100644 index 0000000..5f4c841 --- /dev/null +++ b/tests/features/lut/lut_routethru.xdc @@ -0,0 +1,8 @@ +set_property PACKAGE_PIN A1 [get_ports i[0]] +set_property PACKAGE_PIN A2 [get_ports i[1]] +set_property PACKAGE_PIN A3 [get_ports i[2]] +set_property PACKAGE_PIN A4 [get_ports i[3]] +set_property PACKAGE_PIN A5 [get_ports o[0]] +set_property PACKAGE_PIN A6 [get_ports o[1]] +set_property PACKAGE_PIN A7 [get_ports o[2]] +set_property PACKAGE_PIN A8 [get_ports o[3]] From 593f01f09e4b8821ec0df99ff8cac8470f2dac2c Mon Sep 17 00:00:00 2001 From: Maciej Kurc Date: Thu, 2 Dec 2021 12:07:52 +0100 Subject: [PATCH 7/8] bump python-fpga-interchange Signed-off-by: Maciej Kurc --- devices/testarch-noffmux/CMakeLists.txt | 14 -------------- third_party/python-fpga-interchange | 2 +- 2 files changed, 1 insertion(+), 15 deletions(-) delete mode 100644 devices/testarch-noffmux/CMakeLists.txt diff --git a/devices/testarch-noffmux/CMakeLists.txt b/devices/testarch-noffmux/CMakeLists.txt deleted file mode 100644 index 7433ad2..0000000 --- a/devices/testarch-noffmux/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -generate_testarch_device_db( - device testarch-noffmux - package test_package - output_target test_arch_target - extra_args --no-ffmux -) - -generate_chipdb( - device testarch-noffmux - part testarch-test_package - device_target ${test_arch_target} - device_config ${PYTHON_INTERCHANGE_PATH}/test_data/gen_device_config.yaml - test_package test_package -) diff --git a/third_party/python-fpga-interchange b/third_party/python-fpga-interchange index 539d97e..6f93247 160000 --- a/third_party/python-fpga-interchange +++ b/third_party/python-fpga-interchange @@ -1 +1 @@ -Subproject commit 539d97ed15e72ef3dac9f2db5b8fd4287aaad2eb +Subproject commit 6f932475f68ddd65dcb0fa4dda64185948010435 From b02f22753d0edb804738042ca4b7267b54f5d425 Mon Sep 17 00:00:00 2001 From: Maciej Kurc Date: Fri, 3 Dec 2021 10:38:29 +0100 Subject: [PATCH 8/8] Removed prepending CMAKE_CURRENT_SOURCE_DIR to generated_xdc filename Signed-off-by: Maciej Kurc --- tests/features/lut/CMakeLists.txt | 4 ++-- tests/tests.cmake | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/features/lut/CMakeLists.txt b/tests/features/lut/CMakeLists.txt index 46036d7..e811281 100644 --- a/tests/features/lut/CMakeLists.txt +++ b/tests/features/lut/CMakeLists.txt @@ -8,14 +8,14 @@ add_generic_test( name lut_ff board_list testboard testboard_noffmux sources lut_ff.v - generated_xdc testboard.xdc + generated_xdc ${CMAKE_CURRENT_SOURCE_DIR}/testboard.xdc ) add_generic_test( name lut_routethru board_list testboard_noffmux sources lut_routethru.v - generated_xdc lut_routethru.xdc + generated_xdc ${CMAKE_CURRENT_SOURCE_DIR}/lut_routethru.xdc ) add_xc7_validation_test( diff --git a/tests/tests.cmake b/tests/tests.cmake index 8f61b1d..a626a05 100644 --- a/tests/tests.cmake +++ b/tests/tests.cmake @@ -98,7 +98,7 @@ function(add_generic_test) set(test_name "${name}-${board}") if(DEFINED generated_xdc) - set(xdc ${CMAKE_CURRENT_SOURCE_DIR}/${generated_xdc}) + set(xdc ${generated_xdc}) else() set(xdc ${CMAKE_CURRENT_SOURCE_DIR}/${prefix}${board}.xdc) endif()