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

Added an apio test command. #352

Merged
merged 1 commit into from
Feb 23, 2024
Merged

Added an apio test command. #352

merged 1 commit into from
Feb 23, 2024

Conversation

zapta
Copy link
Collaborator

@zapta zapta commented Feb 23, 2024

This PR adds the apio test command to simulate all the testbenches.

Notes in an arbitrary order:

  • I didn't add the user documentation for that command so please add.
  • The --testbench flag allows to test just a single testbench.
  • Failed assertions in a testbench are expected to exist with an error. I am using $fatal.
  • The command fails on the first failed testbench rather than continues testing the rest of the testbenches.
  • The PR also changes the apio sim command, having it defining the macro INTERACTIVE_SIM. This allows test benches to ignore assertion failures and continue to generating the waves for diagnostics. I am using this assertion:
`define EXPECT(signal, value) \
    if (signal !== value) begin \
        $display("ASSERTION FAILED in %m: signal != value"); \
        `ifndef INTERACTIVE_SIM \
             $fatal; \
        `endif \
    end

EDIT: I am not familiar with verilog assertions. If there are more comment way to assert and to control assertions, please let me know and I will change the INTERACTIVE_SIM mechanism to something else in a followup PR.

… it founds without running gtkwave. Failing testbench assertions are expected to exit with $finish. The flag --testbench allows to

test just a single testbench. Also make the apio sim defining a macro called INTERACTIVE_SIM to allow testbench to continue silently and generate the waves for diagnostics.
@Obijuan Obijuan merged commit 1a26ea4 into FPGAwars:develop Feb 23, 2024
@Obijuan
Copy link
Member

Obijuan commented Feb 23, 2024

Thanks! You are on fire! 🔥🔥😃

@zapta
Copy link
Collaborator Author

zapta commented Feb 23, 2024 via email

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.

2 participants