Giter Club home page Giter Club logo

Comments (7)

aswaterman avatar aswaterman commented on July 25, 2024

I would favor not depending on the current time at all; it makes the simulator nondeterministic. Could just use an affine function of the instructions-retired counter.

from riscv-binutils-gdb.

sbeamer avatar sbeamer commented on July 25, 2024

Could it be the same as instructions-retired? Maybe just instructions-retired x 2?

from riscv-binutils-gdb.

aswaterman avatar aswaterman commented on July 25, 2024

something like that would probably be ok

from riscv-binutils-gdb.

aswaterman avatar aswaterman commented on July 25, 2024

(in spike, they are equal)

from riscv-binutils-gdb.

vapier avatar vapier commented on July 25, 2024

clock_gettime is not Linux specific. it's explicitly in POSIX:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_getres.html

we can fallback to CLOCK_MONOTONIC if CLOCK_BOOTTIME is not available. getimeofday is not appropriate as it's not monotonic -- it can be rewound. any C++ lib is not appropriate as the GNU sim is C only, and doesn't rely on external C++ libs.

if none of those are available because the OS is crap, we can fallback to csr.instret.

from riscv-binutils-gdb.

aswaterman avatar aswaterman commented on July 25, 2024

Trying all three is a reasonable approach, too... @vapier what do you think about the tradeoff between having an accurate time and having deterministic simulator runs?

from riscv-binutils-gdb.

palmer-dabbelt avatar palmer-dabbelt commented on July 25, 2024

This is fixed, CSR_TIME now returns the cycle count.

from riscv-binutils-gdb.

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.