Struct rvsim::SimpleClock[][src]

pub struct SimpleClock {
    pub instret: u64,
}

A simple implementation of the Clock trait.

This implementation only counts instructions. The CSRs cycle, time, and instret all return the same counter to create a very basic simulation of time.

With the serialize crate feature, this structure is serializable using Serde.

Fields

instret: u64

Instruction counter CSR.

Implementations

impl SimpleClock[src]

pub fn new() -> Self[src]

Create an instance with the counter starting at 0.

Trait Implementations

impl Clock for SimpleClock[src]

impl Clone for SimpleClock[src]

impl Copy for SimpleClock[src]

impl Debug for SimpleClock[src]

impl<'de> Deserialize<'de> for SimpleClock[src]

impl Serialize for SimpleClock[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.