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/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/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}) 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/features/lut/CMakeLists.txt b/tests/features/lut/CMakeLists.txt index c04fe98..e811281 100644 --- a/tests/features/lut/CMakeLists.txt +++ b/tests/features/lut/CMakeLists.txt @@ -5,9 +5,17 @@ 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 + generated_xdc ${CMAKE_CURRENT_SOURCE_DIR}/testboard.xdc +) + +add_generic_test( + name lut_routethru + board_list testboard_noffmux + sources lut_routethru.v + generated_xdc ${CMAKE_CURRENT_SOURCE_DIR}/lut_routethru.xdc ) 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..730eadc --- /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 +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]] diff --git a/tests/tests.cmake b/tests/tests.cmake index 13ca88c..a626a05 100644 --- a/tests/tests.cmake +++ b/tests/tests.cmake @@ -104,7 +104,7 @@ function(add_generic_test) 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( @@ -180,7 +180,6 @@ function(add_generic_test) ${netlist} DEPENDS ${arch}-${test_name}-json - chipdb-${device}-bin ${device_target} ${device_loc} ${synth_json} 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