Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPIO straps verif #25868

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

marcelocarvalhoLowRisc
Copy link

New sequence to verify the straps feature and some additional description of the behaviour of this feature in the register document.

@marcelocarvalhoLowRisc marcelocarvalhoLowRisc requested a review from a team as a code owner January 14, 2025 15:59
@marcelocarvalhoLowRisc marcelocarvalhoLowRisc requested review from rswarbrick and martin-velay and removed request for a team January 14, 2025 15:59
@marcelocarvalhoLowRisc marcelocarvalhoLowRisc force-pushed the gpio_straps_verif branch 3 times, most recently from 74b9fcd to 7921fc9 Compare January 14, 2025 16:20
Copy link
Contributor

@martin-velay martin-velay left a comment

Choose a reason for hiding this comment

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

I think this PR still requires some changes.

hw/ip/gpio/dv/tb/tb.sv Outdated Show resolved Hide resolved
hw/ip/gpio/data/gpio_testplan.hjson Outdated Show resolved Hide resolved
hw/ip/gpio/dv/tb/tb.sv Outdated Show resolved Hide resolved
hw/ip/gpio/dv/env/gpio_env_cfg.sv Outdated Show resolved Hide resolved
hw/ip/gpio/dv/env/gpio_scoreboard.sv Outdated Show resolved Hide resolved
hw/ip/gpio/dv/env/seq_lib/gpio_rand_straps_vseq.sv Outdated Show resolved Hide resolved
hw/ip/gpio/dv/env/seq_lib/gpio_rand_straps_vseq.sv Outdated Show resolved Hide resolved
hw/ip/gpio/dv/env/seq_lib/gpio_rand_straps_vseq.sv Outdated Show resolved Hide resolved
hw/ip/gpio/dv/env/seq_lib/gpio_rand_straps_vseq.sv Outdated Show resolved Hide resolved
hw/ip/gpio/doc/registers.md Outdated Show resolved Hide resolved
@marcelocarvalhoLowRisc marcelocarvalhoLowRisc force-pushed the gpio_straps_verif branch 4 times, most recently from 05e6443 to 2e49144 Compare January 15, 2025 14:21
hw/ip/gpio/data/gpio.hjson Outdated Show resolved Hide resolved
hw/ip/gpio/data/gpio_testplan.hjson Outdated Show resolved Hide resolved
hw/ip/gpio/data/gpio_testplan.hjson Outdated Show resolved Hide resolved
hw/ip/gpio/data/gpio_testplan.hjson Outdated Show resolved Hide resolved
hw/ip/gpio/dv/env/gpio_scoreboard.sv Outdated Show resolved Hide resolved
hw/ip/gpio/dv/interfaces/gpio_straps_if.sv Outdated Show resolved Hide resolved
hw/ip/gpio/dv/interfaces/gpio_straps_if.sv Outdated Show resolved Hide resolved
Comment on lines 16 to 17
logic strap_en;
assign strap_en_i = strap_en;
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, I'm not sure about the way this is using ports. Can't we just have an internal variable called strap_en and wire that up?

Choose a reason for hiding this comment

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

In this case I am using the gpio_strap_en variable to initialise the strap_en_i with zero after the reset, otherwise I will have spreading X's to the input, so look at the gpio_base_test.sv

Copy link
Contributor

@rswarbrick rswarbrick Jan 20, 2025

Choose a reason for hiding this comment

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

Can't gpio_base_test drive the internal value directly?

Choose a reason for hiding this comment

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

Yes it's possible, I removed the input/outputs and it's working fine. In my mind I always though like using interface, we are required to declare input/output ports, that is the interface by definition. In this case the interface behavior more like a wrapper for these signals to be used in the testbench, instead of driving directly from the testbench top level or some other way.

Copy link
Contributor

Choose a reason for hiding this comment

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

You're right (it's basically now just a struct, which is pretty standard for OT DV so far). The "proper" way to do it is probably to use a modport. See IEEE 1800 section 25.5 for a description of how to use them.

hw/ip/gpio/dv/tb/tb.sv Outdated Show resolved Hide resolved
hw/ip/gpio/dv/tb/tb.sv Outdated Show resolved Hide resolved
@marcelocarvalhoLowRisc marcelocarvalhoLowRisc force-pushed the gpio_straps_verif branch 17 times, most recently from 49e465c to fdfba6b Compare January 21, 2025 11:15
@marcelocarvalhoLowRisc marcelocarvalhoLowRisc force-pushed the gpio_straps_verif branch 2 times, most recently from f97049f to 4e03142 Compare January 21, 2025 17:50
Removed the assumption StrapSampleOnce_A, that does not work
for cases that sample_trigger never fell or if we have more than one
reset operation happening during the simulation.

Signed-off-by: Marcelo Carvalho Faleiro de Almeida <[email protected]>
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