aboutsummaryrefslogtreecommitdiffstats
path: root/fpga_interchange/examples/boards.cmake
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-03-25 16:03:22 +0000
committerGitHub <noreply@github.com>2021-03-25 16:03:22 +0000
commitf233bee9701ea191862d26616d68dab08ba7d2b0 (patch)
treea23f37b687bffa78976d39df4c212407e539732c /fpga_interchange/examples/boards.cmake
parent3cc50a5744beeae63ffb9ecd2064666e90d26be4 (diff)
parentc4cb86efe9dece4a837bdd490f5d7f78d2b4480f (diff)
downloadnextpnr-f233bee9701ea191862d26616d68dab08ba7d2b0.tar.gz
nextpnr-f233bee9701ea191862d26616d68dab08ba7d2b0.tar.bz2
nextpnr-f233bee9701ea191862d26616d68dab08ba7d2b0.zip
Merge pull request #628 from acomodi/add-interchange-devices
fpga_interchange: add more devices
Diffstat (limited to 'fpga_interchange/examples/boards.cmake')
-rw-r--r--fpga_interchange/examples/boards.cmake45
1 files changed, 45 insertions, 0 deletions
diff --git a/fpga_interchange/examples/boards.cmake b/fpga_interchange/examples/boards.cmake
new file mode 100644
index 00000000..c44ab930
--- /dev/null
+++ b/fpga_interchange/examples/boards.cmake
@@ -0,0 +1,45 @@
+function(add_board)
+ # ~~~
+ # add_board(
+ # name <board name>
+ # device <common device>
+ # package <package>
+ # )
+ # ~~~
+ #
+ # Generates a board target containing information on the common device and package
+ # of the board.
+ #
+ # Arguments:
+ # - name: name of the board. E.g. arty
+ # - device: common device name of a set of parts. E.g. xc7a35tcsg324-1 and xc7a35tcpg236-1
+ # share the same xc7a35t device prefix
+ # - package: one of the packages available for a given device. E.g. cpg236
+ #
+ # Targets generated:
+ # - board-<name>
+
+ set(options)
+ set(oneValueArgs name device package)
+ set(multiValueArgs)
+
+ cmake_parse_arguments(
+ add_board
+ "${options}"
+ "${oneValueArgs}"
+ "${multiValueArgs}"
+ ${ARGN}
+ )
+
+ set(name ${add_board_name})
+ set(device ${add_board_device})
+ set(package ${add_board_package})
+
+ add_custom_target(board-${name} DEPENDS device-${device})
+ set_target_properties(
+ board-${name}
+ PROPERTIES
+ DEVICE ${device}
+ PACKAGE ${package}
+ )
+endfunction()