Skip to content

Commit a6e9673

Browse files
[dv] Improve UART randomisability
- Fix `kUartIdxDv` capitalisation error. - Allow `uart_idx` to randomise. - Prepare for future baud rate randomisation.
1 parent 261d4b3 commit a6e9673

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

hw/top_chip/dv/env/seq_lib/top_chip_dv_uart_base_vseq.sv

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ class top_chip_dv_uart_base_vseq extends top_chip_dv_base_vseq;
66
`uvm_object_utils(top_chip_dv_uart_base_vseq)
77
`uvm_object_new
88

9-
int uart_idx;
9+
uart_agent_pkg::baud_rate_e uart_baud_rate = uart_agent_pkg::BaudRate1p5Mbps;
10+
11+
rand int uart_idx;
12+
13+
constraint uart_idx_c {
14+
uart_idx inside {[0:NUarts-1]};
15+
}
1016

1117
// Local queue for holding received UART TX data.
1218
byte uart_tx_data_q[$];
@@ -35,7 +41,7 @@ class top_chip_dv_uart_base_vseq extends top_chip_dv_base_vseq;
3541
bit enable_rx_monitor = 1'b0,
3642
bit en_parity = 1'b0,
3743
bit odd_parity = 1'b0,
38-
baud_rate_e baud_rate = BaudRate1Mbps);
44+
baud_rate_e baud_rate = uart_baud_rate);
3945
if (enable) begin
4046
`uvm_info(`gfn, $sformatf("Configuring and connecting UART%0d", uart_idx), UVM_LOW)
4147
p_sequencer.cfg.m_uart_agent_cfgs[uart_idx].set_parity(en_parity, odd_parity);

hw/top_chip/dv/env/seq_lib/top_chip_dv_uart_tx_rx_vseq.sv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class top_chip_dv_uart_tx_rx_vseq extends top_chip_dv_uart_base_vseq;
2727
super.body();
2828

2929
// Override software constants with randomised data
30-
sw_symbol_backdoor_overwrite("kUartIdxDV", uart_idx_data);
30+
sw_symbol_backdoor_overwrite("kUartIdxDv", uart_idx_data);
3131
sw_symbol_backdoor_overwrite("kUartTxData", exp_uart_tx_data);
3232
sw_symbol_backdoor_overwrite("kExpUartRxData", uart_rx_data);
3333

0 commit comments

Comments
 (0)