GithubHelp home page GithubHelp logo

Comments (5)

cliffordwolf avatar cliffordwolf commented on July 30, 2024

Looking at the checks, it seems like rvfi_intr is ignored.

Yeah, that's because rocket doesn't really set it yet either and PicoRV32 is only verified in non-interrupt mode (because it's using a non-standard interrupt mechanism that pre-dates the priv spec).

This should be added to rvfi_pc_fwd_check and rvfi_pc_bwd_check. (Both checks could need some love in general.) I will fix this soon-ish.

My implementation sets rvfi_pc_wdata to the start of the trap handler for each instruction that causes a fault

That also works.

I tried keeping those values for rvfi_rs1_addr and rvfi_rs2_addr, but I failed checks for addi, lui, and other similar instructions

That's a bug in rvfi_insn_check.sv. What you are doing should work (as long as the value on rvfi_rs1_rdata/rvfi_rs2_rdata correctly represents the machine state). I will fix this some time this week.

from riscv-formal.

acw1251 avatar acw1251 commented on July 30, 2024

Thanks for the quick reply. As I said, I have all the checks passing without any changes to riscv-formal, so it's not urgent.

from riscv-formal.

cliffordwolf avatar cliffordwolf commented on July 30, 2024

The rs1/rs2 issue should be fixed now. (The intr issue is still open.)

from riscv-formal.

Wren6991 avatar Wren6991 commented on July 30, 2024

I have also encountered this, with the pc_fwd check. I update pc_wdata for instructions which retire as an interrupt is asserted, as suggested above. The solver immediately finds a loophole in this: it asserts an interrupt in a pipeline bubble between two instructions, which it creates by starving instruction fetch briefly.

The earlier instruction has already retired, so its pc_wdata points to the sequentially-next instruction. However, the next instruction to actually retire is the first instruction of the interrupt handler, which is nonsequential with the previous instruction. This fails the check.

I am trying to come up with a workaround for this, but all I can think of at the moment is "retiring" a dummy nop in the interrupted bubble to link up the pre-interrupt pc_wdata with the in-interrupt pc_rdata, which is a bit of a hack.

I am also playing with hacking my local copy of pc_fwd_ch0 to not check pc_rdata on cycles where rvfi_intr is asserted, but then I need additional properties to check that e.g. rvfi_intr is not just tied high.

As an aside, moving to the latest version of riscv-formal (I was around 40 commits behind) has found a lot of nasty bugs in my processor, so thank you for all the hard work there :)

from riscv-formal.

jerralph avatar jerralph commented on July 30, 2024

Had posted a message here about rs2_addr error getting flagged for ADDI but was wrong. I thought it was complaining about ADDI rs2_addr but it was actually rs1_addr. Nothing to see here :)

from riscv-formal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.