Code Monkey home page Code Monkey logo

Comments (11)

rod-chapman avatar rod-chapman commented on July 27, 2024

It may also be possible to directly insert an assembler directive in the generated code for the packages that require the CSRR and CSRW instructions. I think you need to add
.option arch,+zicsr

near the top of the generated .s file. Can this be done with package Machine_Code?

Details in the RISC-V specific section of the most recent GNU as manual.

from ada_drivers_library.

rod-chapman avatar rod-chapman commented on July 27, 2024

For reference, my local changes to SPARKNaCl to get GNAT 12.1.1 working are here:
rod-chapman/SPARKNaCl#28

from ada_drivers_library.

Fabien-Chouteau avatar Fabien-Chouteau commented on July 27, 2024

.option arch,+zicsr in inlined machine code would be the best option in my opinion. Did you try it?

from ada_drivers_library.

rod-chapman avatar rod-chapman commented on July 27, 2024

Yes... but I couldn't work out the exact syntax required...

See https://sourceware.org/binutils/docs/as/RISC_002dV_002dDirectives.html#RISC_002dV_002dDirectives

from ada_drivers_library.

Fabien-Chouteau avatar Fabien-Chouteau commented on July 27, 2024

Might be because we don't have the latest binutils: enjoy-digital/litex@91d79ae

I will build a toolchain with the latest and try again.

from ada_drivers_library.

Fabien-Chouteau avatar Fabien-Chouteau commented on July 27, 2024

Confirmed, I started build for a new release of the toolchains with binutils 2.38.

from ada_drivers_library.

rod-chapman avatar rod-chapman commented on July 27, 2024

OK... let me know when it's ready (and how to get it) and I will give it a try...

from ada_drivers_library.

rod-chapman avatar rod-chapman commented on July 27, 2024

Reading the ISA spec more carefully, I think you actually should generate

.option push
.option arch,+zicsr
# do stuff with CSRs or whatever...
.option pop

so that the existing state of the "arch" setting is saved and restored properly.

from ada_drivers_library.

rod-chapman avatar rod-chapman commented on July 27, 2024

The SPARKNaCl performance test program now seems to build OK with the new GNAT 12.1.2 with no modification to the assembly language component(s), so looking good.

from ada_drivers_library.

Fabien-Chouteau avatar Fabien-Chouteau commented on July 27, 2024

Without the .option arch,+zicsr?

Thanks for the update,

from ada_drivers_library.

rod-chapman avatar rod-chapman commented on July 27, 2024

Yes... my sources (see SPARKNaCl/perf/csrs.s) are unmodified and it builds OK...

from ada_drivers_library.

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.