pub trait Backend {
type Value: Debug + Copy + PartialEq + Eq;
Show 26 methods
// Required methods
fn get_reg(&mut self, index: u32) -> Self::Value;
fn set_reg(&mut self, index: u32, val: Self::Value);
fn get_pc(&mut self) -> u32;
fn set_next_pc(&mut self, pc: u32);
fn fetch_u32(&mut self, addr: u32) -> u32;
fn const_value(&mut self, val: u32) -> Self::Value;
fn load(
&mut self,
width: Width,
signed: Signed,
addr: Self::Value,
) -> Self::Value;
fn store(&mut self, width: Width, addr: Self::Value, val: Self::Value);
fn add(&mut self, a: Self::Value, b: Self::Value) -> Self::Value;
fn sub(&mut self, a: Self::Value, b: Self::Value) -> Self::Value;
fn and(&mut self, a: Self::Value, b: Self::Value) -> Self::Value;
fn or(&mut self, a: Self::Value, b: Self::Value) -> Self::Value;
fn xor(&mut self, a: Self::Value, b: Self::Value) -> Self::Value;
fn shift_left(
&mut self,
val: Self::Value,
shift: Self::Value,
) -> Self::Value;
fn shift_right(
&mut self,
signed: Signed,
val: Self::Value,
shift: Self::Value,
) -> Self::Value;
fn mul(&mut self, a: Self::Value, b: Self::Value) -> Self::Value;
fn mulh(
&mut self,
signed: Signed,
a: Self::Value,
b: Self::Value,
) -> Self::Value;
fn mulhsu(&mut self, a: Self::Value, b: Self::Value) -> Self::Value;
fn div(
&mut self,
signed: Signed,
a: Self::Value,
b: Self::Value,
) -> Self::Value;
fn rem(
&mut self,
signed: Signed,
a: Self::Value,
b: Self::Value,
) -> Self::Value;
fn jump(&mut self, target: Self::Value);
fn ecall(&mut self);
fn ebreak(&mut self);
fn undefined(&mut self, instr: u32);
fn if_else_val(
&mut self,
cond: Cond,
a: Self::Value,
b: Self::Value,
if_true: impl FnOnce(&mut Self) -> Self::Value,
if_false: impl FnOnce(&mut Self) -> Self::Value,
) -> Self::Value;
// Provided method
fn if_else(
&mut self,
cond: Cond,
a: Self::Value,
b: Self::Value,
if_true: impl FnOnce(&mut Self),
if_false: impl FnOnce(&mut Self),
) { ... }
}
Required Associated Types§
Required Methods§
fn get_reg(&mut self, index: u32) -> Self::Value
fn set_reg(&mut self, index: u32, val: Self::Value)
fn get_pc(&mut self) -> u32
fn set_next_pc(&mut self, pc: u32)
fn fetch_u32(&mut self, addr: u32) -> u32
fn const_value(&mut self, val: u32) -> Self::Value
fn load( &mut self, width: Width, signed: Signed, addr: Self::Value, ) -> Self::Value
fn store(&mut self, width: Width, addr: Self::Value, val: Self::Value)
fn add(&mut self, a: Self::Value, b: Self::Value) -> Self::Value
fn sub(&mut self, a: Self::Value, b: Self::Value) -> Self::Value
fn and(&mut self, a: Self::Value, b: Self::Value) -> Self::Value
fn or(&mut self, a: Self::Value, b: Self::Value) -> Self::Value
fn xor(&mut self, a: Self::Value, b: Self::Value) -> Self::Value
fn shift_left(&mut self, val: Self::Value, shift: Self::Value) -> Self::Value
fn shift_right( &mut self, signed: Signed, val: Self::Value, shift: Self::Value, ) -> Self::Value
fn mul(&mut self, a: Self::Value, b: Self::Value) -> Self::Value
fn mulh( &mut self, signed: Signed, a: Self::Value, b: Self::Value, ) -> Self::Value
fn mulhsu(&mut self, a: Self::Value, b: Self::Value) -> Self::Value
fn div(&mut self, signed: Signed, a: Self::Value, b: Self::Value) -> Self::Value
fn rem(&mut self, signed: Signed, a: Self::Value, b: Self::Value) -> Self::Value
fn jump(&mut self, target: Self::Value)
fn ecall(&mut self)
fn ebreak(&mut self)
fn undefined(&mut self, instr: u32)
fn if_else_val( &mut self, cond: Cond, a: Self::Value, b: Self::Value, if_true: impl FnOnce(&mut Self) -> Self::Value, if_false: impl FnOnce(&mut Self) -> Self::Value, ) -> Self::Value
Provided Methods§
fn if_else( &mut self, cond: Cond, a: Self::Value, b: Self::Value, if_true: impl FnOnce(&mut Self), if_false: impl FnOnce(&mut Self), )
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.