Giter Site home page Giter Site logo

auipc instruction broken about riscv HOT 4 CLOSED

ataradov avatar ataradov commented on August 16, 2024
auipc instruction broken

from riscv.

Comments (4)

ataradov avatar ataradov commented on August 16, 2024

Thanks for reporting this. Is there a simplified C code that makes the compiler issue this instruction? I want to come up with a test. If not, I'll need to create a test case in assembly.

It look like a better way is to use the value jump_addr_w, which in case of AUIPC will be equal to the required result. This way case (id_alu_op_r) can be extended with one more operation ALU_AUIPC, which would be selected in id_alu_op_w assignment.

This will move the multiplexer out of the ID stage into the EX stage, and that adder is there already doing nothing for this instruction.

I will experiment with this later today, and see which version gives better results in terms of speed and resource utilization.

from riscv.

markusdd avatar markusdd commented on August 16, 2024

Man you're quick ;)

I came across this by accident, but as it happended when I pulled some functions in from a quite extensive library, I'm afraid I do not really have a 'minimal' example currently.
Anyway this instruction is rather rare it seems, so probably the easiest way is to really put in some inline assembler code.

I would need to do some digging as well to find out when the compiler is inclined to use this instruction.

I also very much like the idea of postponing the calculation into the ex stage, absolutely makes sense.

from riscv.

ataradov avatar ataradov commented on August 16, 2024

I've pushed the fix. Inline assembly is ugly, but at least it works.

from riscv.

markusdd avatar markusdd commented on August 16, 2024

Hi,

thank you very much, I think your solution in the execute stage is pretty elegant, makes use of existing resources without introducing more logic depth in the decode stage.

I incorporated your change and it works perfectly.

From my point of view this issue can be closed. (and the first one with the non-clocking assignments as well from a few weeks ago)

from riscv.

Related Issues (3)

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.