aboutsummaryrefslogtreecommitdiff
path: root/src/simulator.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/simulator.rs')
-rw-r--r--src/simulator.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/simulator.rs b/src/simulator.rs
index 006244a..073de67 100644
--- a/src/simulator.rs
+++ b/src/simulator.rs
@@ -105,6 +105,13 @@ impl<'a> Core<'a> {
}
match inst.opcode() {
+ isa::opcodes::LUI => {
+ self.registers.write_word(inst.rd(), inst.u_imm() as isa::Word)
+ },
+ isa::opcodes::AUIPC => {
+ let result = (pc as isa::SignedWord) + inst.u_imm();
+ self.registers.write_word(inst.rd(), result as isa::Word);
+ },
isa::opcodes::JALR => {
// TODO: assert funct3 is 0
let base = self.registers.read_word(inst.rs1())