This commit is contained in:
Benjamin Kyd
2023-07-04 19:32:58 +01:00
parent ce08ab6d06
commit 7fcc429612

View File

@@ -75,7 +75,6 @@ pub union GenInstruction {
trait Instruction {
fn match_inst(&self, inst: rv32::Word) -> bool;
fn decode(&self);
fn step(&self, inst: rv32::Word, state: &mut cpu::CPU);
}
@@ -83,40 +82,24 @@ type SomeInstruction = impl Instruction;
#[derive(Copy, Clone)]
struct ADDI;
impl ADDI {
fn new() -> ADDI {
ADDI
}
}
impl Instruction for ADDI {
fn match_inst(&self, inst: rv32::Word) -> bool {
match_mask!(inst, "xxxxxxxxxxxxxxxxxx000xxxx0010011")
}
fn decode(&self) {
}
fn step(&self, inst: rv32::Word, state: &mut cpu::CPU) {
}
}
#[derive(Copy, Clone)]
struct ADD;
impl ADD {
fn new() -> ADD {
ADD
}
}
impl Instruction for ADD {
fn match_inst(&self, inst: rv32::Word) -> bool {
match_mask!(inst, "0000000xxxxxxxxxxx000xxxx0110011")
}
fn decode(&self) {
}
fn step(&self, inst: rv32::Word, state: &mut cpu::CPU) {
}
}