Giter Site home page Giter Site logo

Atomic instruction emulation about mini-rv32ima HOT 6 OPEN

cnlohr avatar cnlohr commented on July 18, 2024
Atomic instruction emulation

from mini-rv32ima.

Comments (6)

cnlohr avatar cnlohr commented on July 18, 2024

Is this to be done on an individual instruction basis? I have to admit I don't fully understand the timing on when things are allowed to happen between loads and stores.

from mini-rv32ima.

cnlohr avatar cnlohr commented on July 18, 2024

Can this be done by just having a global flag of "I have a reservation!" and clearing it if there's an interrupt, and reporting failure to sc?

from mini-rv32ima.

misterjdrg avatar misterjdrg commented on July 18, 2024

Can this be done by just having a global flag of "I have a reservation!" and clearing it if there's an interrupt, and reporting failure to sc?

Yes, and them implement amo*_[w|d] instructions in terms of lr/sc loops.
From spec:

We provided fetch-and-op style atomic primitives as they scale to highly parallel systems better
than LR/SC or CAS. A simple microarchitecture can implement AMOs using the LR/SC primi-
tives, provided the implementation can guarantee the AMO eventually completes.

from mini-rv32ima.

cnlohr avatar cnlohr commented on July 18, 2024

I don't need to do that. Because it's just one core (or we can control atomicity with an actual semaphore).

from mini-rv32ima.

cnlohr avatar cnlohr commented on July 18, 2024

Second question: No other memory accesses need to obey this, correct? So if I do have a global memory semaphore, it only needs to be used on RV32A?

from mini-rv32ima.

cnlohr avatar cnlohr commented on July 18, 2024

Just pasting this here:

i=1
while [ $i -le 10000 ]
do
  echo "Running 'ls' in the background, iteration $i"
  ls >/dev/null 2>&1 &
  i=$((i + 1))
done

from mini-rv32ima.

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.