pub struct RvCore {
pub memory: Memory,
pub instructions: Vec<Instruction>,
pub registers: Registers,
pub vec_engine: VectorEngine,
}Fields§
§memory: Memory§instructions: Vec<Instruction>§registers: Registers§vec_engine: VectorEngineImplementations§
Source§impl RvCore
impl RvCore
pub fn step(&mut self) -> Option<Result<(), String>>
Sourcepub fn run(&mut self) -> RunningRvCore<'_>
pub fn run(&mut self) -> RunningRvCore<'_>
Examples found in repository?
examples/memcpy/main.rs (line 76)
18fn main() {
19 // Important note: eeric as low-level back-end abstraction layer does not support pseudo-instructions
20 // Burden of decoding pseudo-instructions is on the front-end layer
21 // E.G: ret == I::Jalr (F::I { rd: ZERO, rs1: RA, imm: 0 }),
22
23 use alias::*;
24
25 let mut core = RvCoreBuilder::default()
26 .instructions(vec![
27 I::Vsetvli(F::Vsetvli {
28 rd: T0,
29 rs1: A2,
30 vtypei: vtype!(e8, m8, ta, ma),
31 }),
32 I::Vlv {
33 eew: BaseSew::E8,
34 data: F::Vl {
35 vd: 0,
36 rs1: A1,
37 vm: false,
38 },
39 },
40 I::Add(F::R {
41 rd: A1,
42 rs1: A1,
43 rs2: T0,
44 }),
45 I::Sub(F::R {
46 rd: A2,
47 rs1: A2,
48 rs2: T0,
49 }),
50 I::Vsv {
51 eew: BaseSew::E8,
52 data: F::Vs {
53 vs3: 0,
54 rs1: A3,
55 vm: false,
56 },
57 },
58 I::Add(F::R {
59 rd: A3,
60 rs1: A3,
61 rs2: T0,
62 }),
63 I::Bne(F::S {
64 rs1: A2,
65 rs2: ZERO,
66 imm12: -24,
67 }),
68 I::Jalr(F::I {
69 rd: ZERO,
70 rs1: RA,
71 imm12: 0,
72 }),
73 ])
74 .build();
75
76 for machine_state in core.run() {
77 println!("{:?}", machine_state);
78 }
79}Trait Implementations§
impl StructuralPartialEq for RvCore
Auto Trait Implementations§
impl Freeze for RvCore
impl RefUnwindSafe for RvCore
impl Send for RvCore
impl Sync for RvCore
impl Unpin for RvCore
impl UnwindSafe for RvCore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more