pub trait Hazard {
    type P: Copy;
    type R: Copy;

    // Required method
    fn ready(p: Self::P, r: Self::R) -> bool;
}
Expand description

A hazard protocol with given payload, resolver, and ready function.

A struct represents a hazard protocol when it implements this trait.

Required Associated Types§

source

type P: Copy

Payload type.

source

type R: Copy

Resolver type.

Required Methods§

source

fn ready(p: Self::P, r: Self::R) -> bool

Indicates whether the receiver of the payload is ready to receive the payload.

This ready condition is not automatically enforced by just using a hazard interface. If you want to enforce the condition, you may use Hazard::ready directly in the combinational logic. Note that all the std combinators already check the condition.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Hazard for DecH

§

type P = (FetEP, Instruction)

§

type R = ExeR

source§

impl<H1: Hazard, H2: Hazard> Hazard for ZipAnyH<H1, H2>

§

type P = (HOption<<H1 as Hazard>::P>, HOption<<H2 as Hazard>::P>)

§

type R = (<H1 as Hazard>::R, <H2 as Hazard>::R)

source§

impl<H1: Hazard, H2: Hazard, H3: Hazard> Hazard for ZipAny3H<H1, H2, H3>

§

type P = (HOption<<H1 as Hazard>::P>, HOption<<H2 as Hazard>::P>, HOption<<H3 as Hazard>::P>)

§

type R = (<H1 as Hazard>::R, <H2 as Hazard>::R, <H3 as Hazard>::R)

source§

impl<H: Hazard> Hazard for AndH<H>

§

type P = <H as Hazard>::P

§

type R = Ready<<H as Hazard>::R>

source§

impl<H: Hazard, const N: usize> Hazard for SelH<H, N>

§

type P = (<H as Hazard>::P, BoundedU<N>)

§

type R = <H as Hazard>::R

source§

impl<P: Copy, R: Copy> Hazard for ValidH<P, R>

§

type P = P

§

type R = R