GithubHelp home page GithubHelp logo

Comments (4)

ultraembedded avatar ultraembedded commented on June 28, 2024

I guess this is effectively a duplicate of issue #26 so Iโ€™ll guess it will get same response!

from riscv-formal.

cliffordwolf avatar cliffordwolf commented on June 28, 2024

This appears to be not what the RVFI checkers are expecting when rvfi_trap is raised on an unaligned branch, as they barf on mismatching rd_addr/rd_wdata (if the DUT has indeed squashed the writeback to RD of the faulting JAL/JALR instructions).

I don't think this is a dup of #26 because in #26 the core said it wrote a register when it should not, but you are saying the core reports that it does not write the destination register for a misaligned branch (as is the correct behavior) and the check is still complaining? That is weird.

Are you sure the riscv-formal spec agrees that the instruction should trap, i.e. is spec_trap high? Because from the little information you provided I would guess you have configured riscv-formal for a core with support for compressed instructions (RISCV_FORMAL_COMPRESSED), and then the core should never encounter an instruction address misaligned trap.

from riscv-formal.

ultraembedded avatar ultraembedded commented on June 28, 2024

The checker was in agreement that the trap should happen (spec_trap was high), however it also expects that the core continues to writeback to RD.
This is not the case with my core or the spike reference model, as the faulting instruction (a branch to a misaligned destination) should be stopped from causing architectural side effects and should fault instead (effectively the instruction would be left un-executed).
This would make it a precise fault, e.g. like a recoverable fault like a page fault.

I am not using compressed instructions.

I canโ€™t see that the checker has enough information to disambiguate what to do on the various fault causes.

from riscv-formal.

cliffordwolf avatar cliffordwolf commented on June 28, 2024

The checker was in agreement that the trap should happen (spec_trap was high), however it also expects that the core continues to writeback to RD.

I don't think this is true. Currently the insn checker only checks rd writeback when spec_trap is low:

if (!spec_trap) begin
if (spec_rs1_addr != 0)
assert(spec_rs1_addr == rs1_addr);
if (spec_rs2_addr != 0)
assert(spec_rs2_addr == rs2_addr);
assert(spec_rd_addr == rd_addr);
assert(spec_rd_wdata == rd_wdata);
assert(`rvformal_addr_eq(spec_pc_wdata, pc_wdata));

Arguably it should check that rd_addr = 0 and rd_wdata = 0 when spec_trap is high, but right now it doesn't check rd writeback at all in case of a trap.

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.