summaryrefslogtreecommitdiff
path: root/isa/checker.cpp
diff options
context:
space:
mode:
authorJulian Blake Kongslie2022-10-07 19:24:27 -0700
committerJulian Blake Kongslie2022-10-07 19:24:27 -0700
commit2c13075cb50aaba5a6af0185b8f520347a8ab4b4 (patch)
tree900b8ca92095272408b4434313ba81fef11856c3 /isa/checker.cpp
parentInitial commit. (diff)
downloadbiggolf-2c13075cb50aaba5a6af0185b8f520347a8ab4b4.tar.xz
Minor cleanup and some compilation fixes.
Diffstat (limited to '')
-rw-r--r--isa/checker.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/isa/checker.cpp b/isa/checker.cpp
index cd802a8..604279a 100644
--- a/isa/checker.cpp
+++ b/isa/checker.cpp
@@ -1,15 +1,16 @@
1#include <cassert> 1#include <cassert>
2 2
3#include "isa/checker.h"
3#include "isa/isa.h" 4#include "isa/isa.h"
4 5
5void checker::execute() { 6void checker::execute() {
6 assert(!halt); 7 assert(!halted);
7 auto int_enable_delay = ctlregs[ctlreg::INT_ENABLE] >> 1; 8 auto int_enable_delay = ctlregs[INT_ENABLE] >> 1;
8 if (ctlregs[ctlreg::INT_ENABLE] & 1) { 9 if (ctlregs[INT_ENABLE] & 1) {
9 // check for interrupt 10 // check for interrupt
10 } 11 }
11 ctlregs[ctlreg::INT_ENABLE] = (int_enable_delay << 1) | int_enable_delay; 12 ctlregs[INT_ENABLE] = (int_enable_delay << 1) | int_enable_delay;
12 inst = decode(ctlregs[ctlreg::DATA_INSTRUCTION_FIELD_BUFFER], 13 auto inst = decode(ctlregs[DATA_INSTRUCTION_FIELD_BUFFER],
13 pc, 14 pc,
14 mem.fetch(pc)); 15 mem.fetch(pc));
15 auto next_pc = inst.next_pc; 16 auto next_pc = inst.next_pc;
@@ -40,5 +41,5 @@ void checker::execute() {
40 mem.store(inst.final_address.value(), inst.data.value()); 41 mem.store(inst.final_address.value(), inst.data.value());
41 assert(inst.next_pc == next_pc || inst.possibly_redirects); 42 assert(inst.next_pc == next_pc || inst.possibly_redirects);
42 pc = inst.next_pc; 43 pc = inst.next_pc;
43 halt = inst.halt; 44 halted = inst.halt;
44} 45}