Chris Frantz | 2f78a00 | 2022-04-15 14:45:54 -0700 | [diff] [blame] | 1 | # Copyright lowRISC contributors. |
| 2 | # Licensed under the Apache License, Version 2.0, see LICENSE for details. |
| 3 | # SPDX-License-Identifier: Apache-2.0 |
| 4 | |
| 5 | package(default_visibility = ["//visibility:public"]) |
| 6 | |
Chris Frantz | 2f78a00 | 2022-04-15 14:45:54 -0700 | [diff] [blame] | 7 | # Use a bitstream from the GCP bucket (this is also the default condition). |
| 8 | # You can control the GCP bitstream selection via the BITSTREAM environment |
| 9 | # variable. See //rules/bitstreams.bzl for more information. |
| 10 | # |
| 11 | # Example: |
| 12 | # bazel test //sw/device/silicon_creator/lib/drivers:fpga_cw310_hmac_functest --define bitstream=gcp |
| 13 | config_setting( |
| 14 | name = "bitstream_gcp", |
| 15 | define_values = { |
| 16 | "bitstream": "gcp", |
| 17 | }, |
| 18 | ) |
| 19 | |
| 20 | # Skip loading a bitstream in to the FPGA. This is useful if you already |
| 21 | # have a bitstream loaded into the FPGA and you don't want the GCP cache |
| 22 | # manager to do anything unexpected. |
| 23 | # |
| 24 | # Example: |
| 25 | # bazel test //sw/device/silicon_creator/lib/drivers:fpga_cw310_hmac_functest --define bitstream=skip |
| 26 | config_setting( |
| 27 | name = "bitstream_skip", |
| 28 | define_values = { |
| 29 | "bitstream": "skip", |
| 30 | }, |
| 31 | ) |
| 32 | |
Chris Frantz | 74f9095 | 2022-04-18 20:57:01 -0700 | [diff] [blame] | 33 | # Use a bitstream built by Vivado. You'll need to have Xilinx Vivado |
| 34 | # installed and have properly configured access to a license or license |
| 35 | # server. |
| 36 | # |
| 37 | # Example: |
| 38 | # bazel test //sw/device/silicon_creator/lib/drivers:fpga_cw310_hmac_functest --define bitstream=vivado |
| 39 | config_setting( |
| 40 | name = "bitstream_vivado", |
| 41 | define_values = { |
| 42 | "bitstream": "vivado", |
| 43 | }, |
| 44 | ) |
| 45 | |
Chris Frantz | 2f78a00 | 2022-04-15 14:45:54 -0700 | [diff] [blame] | 46 | filegroup( |
| 47 | name = "test_rom", |
| 48 | srcs = select({ |
| 49 | "bitstream_skip": ["skip.bit"], |
Chris Frantz | 74f9095 | 2022-04-18 20:57:01 -0700 | [diff] [blame] | 50 | "bitstream_vivado": ["//hw/bitstream/vivado:fpga_cw310_test_rom"], |
Chris Frantz | 2f78a00 | 2022-04-15 14:45:54 -0700 | [diff] [blame] | 51 | "bitstream_gcp": ["@bitstreams//:bitstream_test_rom"], |
| 52 | "//conditions:default": ["@bitstreams//:bitstream_test_rom"], |
| 53 | }), |
| 54 | ) |
| 55 | |
| 56 | filegroup( |
| 57 | name = "mask_rom", |
| 58 | srcs = select({ |
| 59 | "bitstream_skip": ["skip.bit"], |
Chris Frantz | 74f9095 | 2022-04-18 20:57:01 -0700 | [diff] [blame] | 60 | "bitstream_vivado": ["//hw/bitstream/vivado:fpga_cw310_mask_rom"], |
Chris Frantz | 2f78a00 | 2022-04-15 14:45:54 -0700 | [diff] [blame] | 61 | "bitstream_gcp": ["@bitstreams//:bitstream_mask_rom"], |
| 62 | "//conditions:default": ["@bitstreams//:bitstream_mask_rom"], |
| 63 | }), |
| 64 | ) |