Skip to content

Made host_tx_rx_test randomized#634

Open
KinzaQamar wants to merge 2 commits into
lowRISC:mainfrom
KinzaQamar:i2c_host_test_modif
Open

Made host_tx_rx_test randomized#634
KinzaQamar wants to merge 2 commits into
lowRISC:mainfrom
KinzaQamar:i2c_host_test_modif

Conversation

@KinzaQamar

Copy link
Copy Markdown
Contributor

Now it can read / write multiple bytes on any 7-bit address

@elliotb-lowrisc elliotb-lowrisc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good to me, assuming that it has been tested. Just one minor typo

Comment thread hw/top_chip/dv/env/seq_lib/top_chip_dv_i2c_host_tx_rx_vseq.sv Outdated
Signed-off-by: Kinza Qamar <kqzaman@lowrisc.org>
@KinzaQamar KinzaQamar force-pushed the i2c_host_test_modif branch from babdfc5 to b05f671 Compare June 23, 2026 10:01
Signed-off-by: Kinza Qamar <kqzaman@lowrisc.org>
@KinzaQamar KinzaQamar force-pushed the i2c_host_test_modif branch from b05f671 to b0c08dd Compare June 23, 2026 10:46

// Declare the device_addr as a byte size array because sw_symbol_backdoor_overwrite() expects the
// data that is going to overwrite the SW symbol to be an array
local rand bit [7:0] device_addr[1];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think something can go wrong as the address here is 8 bits but the i2c expects 7 bits. Probably better to add a constraint to this variable?

constraint top_chip_dv_i2c_host_tx_rx_vseq::device_addr_c {
  device_addr[0] inside {[8'h00 : 8'h7F]};
}

extern function new(string name="");
extern task body();
extern virtual task dut_init(string reset_kind = "HARD");
extern task body();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this change isn't required and it was better before since new and body methods are part of the UVM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants