Git Product home page Git Product logo

Comments (6)

cebarobot avatar cebarobot commented on June 28, 2024

@poemonsense Do you have any idea about this?

from nemu.

poemonsense avatar poemonsense commented on June 28, 2024

I have never tested the nemu-diff-with-spike. However, I have a general concern of the position of wfi. Can you have a try moving wfi to the second instruction?

For example,

nop
wfi
li a1, 0x20240603
.word 0x6b # Hit Good Trap

from nemu.

cebarobot avatar cebarobot commented on June 28, 2024

I tried. But there is no difference.

This small program was extraced from a large program (xvisor). I think it is representative enough.

from nemu.

cebarobot avatar cebarobot commented on June 28, 2024

It seems that I found the problem.

The previous workable spike-so is built from pxk27/riscv-isa-sim and it removed some wfi logic at this commit.

      // debug mode wfis must nop
      if (unlikely(in_wfi && !state.debug_mode)) {
        throw wait_for_interrupt_t();
      }

But current spike-so is built from OpenXiangShan/riscv-isa-sim, which keeps the wfi logic.

This wfi code would throw an exception, skip pc+1 then quit step(), in order to handle interrupts outside. But for difftest ref so, there is no handler outside the step().

Now we have two way to solve this problem:

  • let dut (XiangShan and NEMU) require to skip wfi instruction on ref side.
  • remove wfi logic from spike step().

from nemu.

poemonsense avatar poemonsense commented on June 28, 2024

It seems that I found the problem.

The previous workable spike-so is built from pxk27/riscv-isa-sim and it removed some wfi logic at this commit.

      // debug mode wfis must nop
      if (unlikely(in_wfi && !state.debug_mode)) {
        throw wait_for_interrupt_t();
      }

But current spike-so is built from OpenXiangShan/riscv-isa-sim, which keeps the wfi logic.

This wfi code would throw an exception, skip pc+1 then quit step(), in order to handle interrupts outside. But for difftest ref so, there is no handler outside the step().

Now we have two way to solve this problem:

  • let dut (XiangShan and NEMU) require to skip wfi instruction on ref side.
  • remove wfi logic from spike step().

Use something like #ifdef CONFIG_DIFFTEST?

from nemu.

cebarobot avatar cebarobot commented on June 28, 2024

Use something like #ifdef CONFIG_DIFFTEST?

I agree. I will open a PR at spike repo.

from nemu.

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.