fpga: Add BUILD_SEED variable

Adds a BUILD_SEED make variable that can be set to a 32-bit integer,
and adds an FPGA read-only register initialized by this variable.
Changing this variable will randomly affect the FPGA build results.
This can be useful when your build fails timing by a small amount,
allowing you to build again and get different results with the same
code.

For example, you could run the following to produce an FPGA build with
different timing results from the default build:

make X310_XG BUILD_SEED=123


Original-commit: 3a3a03486f9221c2e59fa6d0826c23d17730956d
This commit is contained in:
Wade Fife
2023-02-07 23:04:12 -06:00
parent 2c0fea5d1e
commit ab63d78a6c
15 changed files with 221 additions and 61 deletions
+9 -1
View File
@@ -175,11 +175,12 @@ module bus_int #(
localparam RB_NUM_TIMEKEEPERS = 8'd12;
localparam RB_FP_GPIO_SRC = 8'd13;
localparam RB_DEVICE_ID = 8'd14;
localparam RB_BUILD_SEED = 8'd15;
localparam RB_TA_SFP0_BASE = SR_TA_SFP0_BASE;
localparam RB_TA_SFP1_BASE = SR_TA_SFP1_BASE;
localparam COMPAT_MAJOR = 16'h0027;
localparam COMPAT_MINOR = 16'h0001;
localparam COMPAT_MINOR = 16'h0002;
localparam NUM_TIMEKEEPERS = 1;
// Include the RFNoC image core header file
@@ -457,8 +458,15 @@ module bus_int #(
`else
RB_ETH_TYPE1: rb_data = {32'h0};
`endif
`endif
`ifndef GIT_HASH
`define GIT_HASH 32'h0BADC0DE
`endif
RB_GIT_HASH: rb_data = `GIT_HASH;
`ifndef BUILD_SEED
`define BUILD_SEED 32'b0
`endif
RB_BUILD_SEED: rb_data = `BUILD_SEED;
RB_XADC_VALS: rb_data = xadc_readback;
RB_FP_GPIO_SRC: rb_data = fp_gpio_src;
SR_BASE_TIME: begin