Skip to content

[chip, gpio, dv] Renaming GPIO's smoketest.c to reg_access_test.c#406

Open
KinzaQamar wants to merge 1 commit intolowRISC:mainfrom
KinzaQamar:gpio_smoke_verilator
Open

[chip, gpio, dv] Renaming GPIO's smoketest.c to reg_access_test.c#406
KinzaQamar wants to merge 1 commit intolowRISC:mainfrom
KinzaQamar:gpio_smoke_verilator

Conversation

@KinzaQamar
Copy link
Copy Markdown

@KinzaQamar KinzaQamar commented Apr 8, 2026

Merge this PR first as a dependency on #382

The motivation of this PR comes from #382 which is adding a chip level GPIO test for Xcelium. That test fails on verilator. The reason being different tops used for both of the tools. For Xcelium, an interface is connecting the UVM to the GPIO. The UVM have the control to drive GPIOs inputs. In #382, the SW waits for a specific pattern driven by UVM to appear in data_in reg. If we run the exact test with the verilator top, which is using GPIO DPI, then the abilty to drive the inputs depends on a host SW infrastructure which is currently missing.

With the above context, the best way forward is to separate the GPIO smoketest for both of the simulators for now to make the CI happy.

Renaming the gpio/smoketest.c to gpio/reg_access_test.c

mocha_add_test(NAME test_framework_test SOURCES test_framework/smoketest.c LIBRARIES ${LIBS} FPGA)
mocha_add_test(NAME test_framework_exception_test SOURCES test_framework/exception.c LIBRARIES ${LIBS})
mocha_add_test(NAME gpio_smoketest SOURCES gpio/smoketest.c LIBRARIES ${LIBS} FPGA)
mocha_add_test(NAME gpio_smoketest_verilator SOURCES gpio/smoketest_verilator.c LIBRARIES ${LIBS} FPGA)
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 am unsure about this modification, as the mocha_add_test will call this other macro mocha_add_verilator_test and thus create a test with _sim_verilator suffix.

@engdoreis, how to handle this kind of situation?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Hi Martin,

My idea was to create another gpio_smoketest_xcelium and ask the build system to stop making FPGA and Verialtor images if the target name contains xcelium in it. So, we don't get gpio_smoketest_xcelium_sim_verilator. I am not sure if there is a better way to doing thing but that is making the CI happy on #382

Copy link
Copy Markdown
Collaborator

@engdoreis engdoreis Apr 9, 2026

Choose a reason for hiding this comment

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

In my understanding this test can run in any platform (FPGA, VERILATOR and DV_SIM) right? So, we should not name it after verilator.

I suggest keeping this tests exactly the same. Then copy it to another file, extend it with the features that's create another test only supported by DV_SIM (xcelium), then name it <feature_tested>.c, then adapt cmake to mark this new test as not runnable in verilator.

Does that make sense?

KinzaQamar added a commit to KinzaQamar/mocha that referenced this pull request Apr 8, 2026
Since we are using UVM, we have the control to drive the GPIOs
inputs and hence can wait in SW for the driven pattern to
appear. This will hang forever in case of verilator top. That
is why two tests are required to be able to work on their
corresponding top. For more context: visit lowRISC#406.

Signed-off-by: Kinza Qamar <kqzaman@lowrisc.org>
KinzaQamar added a commit to KinzaQamar/mocha that referenced this pull request Apr 8, 2026
Since we are using UVM, we have the control to drive the GPIOs
inputs and hence can wait in SW for the driven pattern to
appear. This will hang forever in case of verilator top. That
is why two tests are required to be able to work on their
corresponding top. For more context: visit lowRISC#406.

Signed-off-by: Kinza Qamar <kqzaman@lowrisc.org>
KinzaQamar added a commit to KinzaQamar/mocha that referenced this pull request Apr 8, 2026
Since we are using UVM, we have the control to drive the GPIOs
inputs and hence can wait in SW for the driven pattern to
appear. This will hang forever in case of verilator top. That
is why two tests are required to be able to work on their
corresponding top. For more context: visit lowRISC#406.

Signed-off-by: Kinza Qamar <kqzaman@lowrisc.org>
KinzaQamar added a commit to KinzaQamar/mocha that referenced this pull request Apr 9, 2026
Since we are using UVM, we have the control to drive the GPIOs
inputs and hence can wait in SW for the driven pattern to
appear. This will hang forever in case of verilator top. That
is why two tests are required to be able to work on their
corresponding top. For more context: visit lowRISC#406.

Signed-off-by: Kinza Qamar <kqzaman@lowrisc.org>
KinzaQamar added a commit to KinzaQamar/mocha that referenced this pull request Apr 9, 2026
Since we are using UVM, we have the control to drive the GPIOs
inputs and hence can wait in SW for the driven pattern to
appear. This will hang forever in case of verilator top. That
is why two tests are required to be able to work on their
corresponding top. For more context: visit lowRISC#406.

Signed-off-by: Kinza Qamar <kqzaman@lowrisc.org>
KinzaQamar added a commit to KinzaQamar/mocha that referenced this pull request Apr 9, 2026
Since we are using UVM, we have the control to drive the GPIOs
inputs and hence can wait in SW for the driven pattern to
appear. This will hang forever in case of verilator top. That
is why two tests are required to be able to work on their
corresponding top. For more context: visit lowRISC#406.

Signed-off-by: Kinza Qamar <kqzaman@lowrisc.org>
KinzaQamar added a commit to KinzaQamar/mocha that referenced this pull request Apr 9, 2026
Since we are using UVM, we have the control to drive the GPIOs
inputs and hence can wait in SW for the driven pattern to
appear. This will hang forever in case of verilator top. That
is why two tests are required to be able to work on their
corresponding top. For more context: visit lowRISC#406.

Signed-off-by: Kinza Qamar <kqzaman@lowrisc.org>
@KinzaQamar KinzaQamar requested a review from engdoreis April 9, 2026 13:54
KinzaQamar added a commit to KinzaQamar/mocha that referenced this pull request Apr 11, 2026
Since we are using UVM, we have the control to drive the GPIOs
inputs and hence can wait in SW for the driven pattern to
appear. This will hang forever in case of verilator top. That
is why two tests are required to be able to work on their
corresponding top. For more context: visit lowRISC#406.

Signed-off-by: Kinza Qamar <kqzaman@lowrisc.org>
@KinzaQamar KinzaQamar force-pushed the gpio_smoke_verilator branch 2 times, most recently from e91857b to 87d9dd8 Compare April 11, 2026 10:55
KinzaQamar added a commit to KinzaQamar/mocha that referenced this pull request Apr 11, 2026
Since we are using UVM, we have the control to drive the GPIOs
inputs and hence can wait in SW for the driven pattern to
appear. This will hang forever in case of verilator top. That
is why two tests are required to be able to work on their
corresponding top. For more context: visit lowRISC#406.

Signed-off-by: Kinza Qamar <kqzaman@lowrisc.org>
KinzaQamar added a commit to KinzaQamar/mocha that referenced this pull request Apr 11, 2026
Since we are using UVM, we have the control to drive the GPIOs
inputs and hence can wait in SW for the driven pattern to
appear. This will hang forever in case of verilator top. That
is why two tests are required to be able to work on their
corresponding top. For more context: visit lowRISC#406.

Signed-off-by: Kinza Qamar <kqzaman@lowrisc.org>
@KinzaQamar KinzaQamar changed the title [chip, gpio, dv] Separating the GPIO smoke test for verilator [chip, gpio, dv] Renaming GPIO's smoketest.c to reg_access_test.c Apr 11, 2026
Signed-off-by: Kinza Qamar <kqzaman@lowrisc.org>
@KinzaQamar KinzaQamar force-pushed the gpio_smoke_verilator branch from 87d9dd8 to be8db1e Compare April 11, 2026 13:19
KinzaQamar added a commit to KinzaQamar/mocha that referenced this pull request Apr 11, 2026
Since we are using UVM, we have the control to drive the GPIOs
inputs and hence can wait in SW for the driven pattern to
appear. This will hang forever in case of verilator top. That
is why two tests are required to be able to work on their
corresponding top. For more context: visit lowRISC#406.

Signed-off-by: Kinza Qamar <kqzaman@lowrisc.org>
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