fpga: sim: Update struct enum initialization

In Vivado 2021.1, it is no longer allowed to use "default: 0" to
initialize an enum within a packed struct. So we must initalize enum
data members explicitly now.


Original-commit: 8007b6b4dff5b64d476b2e3ccb68a777c2f02c8b
This commit is contained in:
Wade Fife
2022-08-25 13:55:30 -05:00
committed by skooNI
parent dd1e980463
commit 3fc345d3ae
4 changed files with 8 additions and 3 deletions
@@ -310,6 +310,7 @@ module chdr_stream_endpoint_tb#(
// Iterate over stream commands to test // Iterate over stream commands to test
foreach (op[i]) begin foreach (op[i]) begin
chdr_hdr = '{ chdr_hdr = '{
pkt_type : CHDR_STRM_CMD,
dst_epid : dst_epid, dst_epid : dst_epid,
seq_num : seq_num, seq_num : seq_num,
default : 0 default : 0
@@ -480,6 +481,7 @@ module chdr_stream_endpoint_tb#(
ctrl_ts = $urandom(); ctrl_ts = $urandom();
ctrl_op = '{ ctrl_op = '{
default : '0, default : '0,
status : CTRL_STS_OKAY,
op_code : ctrl_opcode_t'($urandom_range(9)), op_code : ctrl_opcode_t'($urandom_range(9)),
byte_enable : $urandom_range(15), byte_enable : $urandom_range(15),
address : $urandom() address : $urandom()
@@ -305,6 +305,7 @@ module ctrlport_endpoint_tb;
}; };
op_word = '{ op_word = '{
default : '0, default : '0,
status : CTRL_STS_OKAY,
op_code : ctrl_opcode_t'(opcode), op_code : ctrl_opcode_t'(opcode),
byte_enable : byte_en, byte_enable : byte_en,
address : addr address : addr
@@ -153,7 +153,7 @@ module axi_rate_change_tb();
while (words_left_to_send > 0) begin while (words_left_to_send > 0) begin
// Setup header // Setup header
send_header = '{default:0}; send_header = '0;
send_header.has_time = 1; send_header.has_time = 1;
send_header.timestamp = longint'(timestamp); send_header.timestamp = longint'(timestamp);
send_header.eob = (words_left_to_send <= spp); send_header.eob = (words_left_to_send <= spp);
+4 -2
View File
@@ -61,8 +61,9 @@ package PkgCtrlIfaceBfm;
default : 0 default : 0
}; };
ctrl_packet.op_word = '{ ctrl_packet.op_word = '{
status : CTRL_STS_OKAY,
op_code : CTRL_OP_READ, op_code : CTRL_OP_READ,
byte_enable : ~0, byte_enable : '1,
address : addr, address : addr,
default : 0 default : 0
}; };
@@ -101,8 +102,9 @@ package PkgCtrlIfaceBfm;
default : 0 default : 0
}; };
ctrl_packet.op_word = '{ ctrl_packet.op_word = '{
status : CTRL_STS_OKAY,
op_code : CTRL_OP_WRITE, op_code : CTRL_OP_WRITE,
byte_enable : ~0, byte_enable : '1,
address : addr, address : addr,
default : 0 default : 0
}; };