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

Update tests for B extension #427

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open

Conversation

ved-rivos
Copy link
Contributor

@ved-rivos ved-rivos commented Jan 14, 2024

Description

Add B extension to ISA strings
B == Zba + Zbb + Zbs

Related Issues

N/A

Ratified/Unratified Extensions

  • Ratified
  • [] Unratified

List Extensions

https://github.com/riscv/riscv-b

Reference Model Used

  • SAIL
  • Spike
  • Other - < SPECIFY HERE >

Mandatory Checklist:

  • All tests are compliant with the test-format spec present in this repo ?
  • Ran the new tests on RISCOF with SAIL/Spike as reference model successfully ?
  • [] Ran the new tests on RISCOF in coverage mode
  • Link to Google-Drive folder containing the new coverage reports (See this for more info): < SPECIFY HERE >
  • Link to PR in RISCV-ISAC from which the reports were generated : < SPECIFY HERE >
  • Changelog entry created with a minor patch

Optional Checklist:

  • RISCV-V CTG PR link if tests were generated using it : Add unratified B extension riscv-software-src/riscv-ctg#100
  • Were the tests hand-written/modified ?
  • Have you run these on any hard DUT model ? Please specify name and provide link if possible in the description
  • If you have modified arch_test.h Please provide a detailed description of the changes in the Description section above.

@davidharrishmc
Copy link
Contributor

davidharrishmc commented Jan 29, 2024

For reasons Allen and I don't entirely understand, some riscof installations require XLEN in the RVTEST_CASE macro to select the correct set of tests to build. Some tests such as the I suite already have this, but I've been having to add the XLEN check to many of the newer test suites. Would it be possible to modify your script to generate tests that include the XLEN check?

For example, in rv32i_m/B/src/andn-01.S

please change

RVTEST_CASE(0,"//check ISA:=regex(.*I.B.);def TEST_CASE_1=True;",andn)
to
RVTEST_CASE(0,"//check ISA:=regex(.32.);check ISA:=regex(.*I.B.);def TEST_CASE_1=True;",andn)

@allenjbaum
Copy link
Collaborator

allenjbaum commented Jan 29, 2024 via email

@ved-rivos
Copy link
Contributor Author

This gets generated from the string in the cgf - "check ISA:=regex(.*I.B.)". Fixing this will need the cgf file to be updated to add the xlen filter and then regenerate the files. My PR to add B just got merged into dev branch of CTG so I cannot update that PR unfortunately. A new PR would be needed.

require XLEN in the RVTEST_CASE macro to select the correct set of tests to build

I have noticed it will generate a warning of by selecting more tests into the test data base but nothing bad besides that. I am not sure why we cannot just fix riscof to look at both the test ISA and the ISA string for doing the test selection.

But seems like Allen has a better fix in mind.

@davidharrishmc
Copy link
Contributor

Thank you. Let's defer to Allen's recommendation.

@allenjbaum
Copy link
Collaborator

  1. I guess I don't understand why earlier tests were generated "correctly," and these new ones weren't.
    That's the first step - I don't want this to happen again.

  2. David: is this actually an issue? The report says he tested it with Spike vs. Sail, and it passed.
    IS this necessary (in this case) or just nice to have?
    Presumably the tests won't be run if the RVTEST_ISA string doesn't match

  3. As far as I can tell, the changes to this test were only in those boilerplate macros; the tests themselves haven't changed.
    It's really hard to review this when all the diffs have a "Large diffs are not rendered by default" message.
    The shouldn't be for a change like this.
    The right way to do this (IMHO, of course) is to use sed to just replace/add the change comments and RVTEST_ISA/RVTEST_CASE macros.

I think we need a "best practices" document...
If this is actually a functional problem, then let's fix it by doing what I suggest above, either by taking the current tests in the repo and running sed of them, replacing this PR, or by a new commit using sed on this PR.

@jamesbeyond jamesbeyond changed the base branch from main to dev May 28, 2024 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants