Skip to content

Conversation

@rswarbrick
Copy link
Contributor

This was triggered by me trying to understand a test failure, but I realised that this sequence could be both simpler to understand and could run dramatically faster. These two commits are doing that.

This was a bit complicated: all it's really doing is to ask a couple
of existing sequences to set some variables in a series.

This patch simplifes things dramatically. For a start, it runs one
vseq per channel, which means the new adc_ctrl_channel_ramp_vseq can
be a bit simpler than adc_ctrl_random_ramp_vseq was.

It also avoids messing around with the "rising" flag: we can just use
a start and end value and have the direction implicit. Indeed, it
could have been even shorter(!), but I decided it was wiser not to rely
on unsigned wrapping in adc_ctrl_channel_ramp_vseq::body.

Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
This function is essentially counting slowly from 0 to 1024 and it was
previously doing so in randomised steps between 0 and 4. This takes a
long time! And it's not very likely that we really care about some
particular number on the way. Speed things up by a factor of 10 or so.

Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
@rswarbrick rswarbrick added the Component:DV DV issue: testbench, test case, etc. label Dec 23, 2025
@rswarbrick rswarbrick requested a review from a team as a code owner December 23, 2025 22:13
@rswarbrick rswarbrick requested review from alees24 and hcallahan-lowrisc and removed request for a team December 23, 2025 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component:DV DV issue: testbench, test case, etc. IP:adc_ctrl

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants