summaryrefslogtreecommitdiff
path: root/isa
diff options
context:
space:
mode:
authorJulian Blake Kongslie2022-10-31 19:26:35 -0700
committerJulian Blake Kongslie2022-10-31 19:26:35 -0700
commit6ffe43a8ccee6f3e2d6fda5062901f16c54ddaad (patch)
tree5358c32b23130bd65ed191e3959c7ce7dd048f21 /isa
parentUnify TT_INPUT_INT_ENABLE and TT_OUTPUT_INT_ENABLE (diff)
downloadbiggolf-6ffe43a8ccee6f3e2d6fda5062901f16c54ddaad.tar.xz
Level-trigger on TTO_FLAG instead of edge-trigger.
Diffstat (limited to '')
-rw-r--r--isa/decode.cpp6
-rw-r--r--isa/isa.h1
2 files changed, 3 insertions, 4 deletions
diff --git a/isa/decode.cpp b/isa/decode.cpp
index c11679c..1496364 100644
--- a/isa/decode.cpp
+++ b/isa/decode.cpp
@@ -185,7 +185,7 @@ instruction_context decode(unsigned int dfifb, unsigned int pc, unsigned int bit
185 inst.read_ctlreg = TT_BITS; 185 inst.read_ctlreg = TT_BITS;
186 inst.write_ctlreg = TT_BITS; 186 inst.write_ctlreg = TT_BITS;
187 inst.ef = [](auto &ctx) { 187 inst.ef = [](auto &ctx) {
188 ctx.ctlval.value() |= TTO_FLAG | TTO_FLAG_OLD; 188 ctx.ctlval.value() |= TTO_FLAG;
189 }; 189 };
190 break; 190 break;
191 case 1: 191 case 1:
@@ -202,7 +202,7 @@ instruction_context decode(unsigned int dfifb, unsigned int pc, unsigned int bit
202 inst.read_ctlreg = TT_BITS; 202 inst.read_ctlreg = TT_BITS;
203 inst.write_ctlreg = TT_BITS; 203 inst.write_ctlreg = TT_BITS;
204 inst.ef = [](auto &ctx) { 204 inst.ef = [](auto &ctx) {
205 ctx.ctlval.value() &= ~TTO_FLAG & ~TTO_FLAG_OLD; 205 ctx.ctlval.value() &= ~TTO_FLAG;
206 }; 206 };
207 break; 207 break;
208 case 4: 208 case 4:
@@ -235,7 +235,7 @@ instruction_context decode(unsigned int dfifb, unsigned int pc, unsigned int bit
235 inst.ef = [](auto &ctx) { 235 inst.ef = [](auto &ctx) {
236 auto &x = ctx.ctlval.value(); 236 auto &x = ctx.ctlval.value();
237 auto chr = ctx.acc.value(); 237 auto chr = ctx.acc.value();
238 x &= ~TTO_FLAG & ~TTO_FLAG_OLD & ~TTO_DATA; 238 x &= ~TTO_FLAG & ~TTO_DATA;
239 x |= (chr << TTO_DATA_SHIFT) & TTO_DATA; 239 x |= (chr << TTO_DATA_SHIFT) & TTO_DATA;
240 x |= TTO_TX; 240 x |= TTO_TX;
241 }; 241 };
diff --git a/isa/isa.h b/isa/isa.h
index 6484cd8..69f8b2a 100644
--- a/isa/isa.h
+++ b/isa/isa.h
@@ -30,7 +30,6 @@ const std::map<std::string, ctlreg> ctlreg_map = {
30static constexpr std::uint_fast32_t TTI_FLAG = 1 << 0; 30static constexpr std::uint_fast32_t TTI_FLAG = 1 << 0;
31static constexpr std::uint_fast32_t TTO_TX = 1 << 1; 31static constexpr std::uint_fast32_t TTO_TX = 1 << 1;
32static constexpr std::uint_fast32_t TTO_FLAG = 1 << 2; 32static constexpr std::uint_fast32_t TTO_FLAG = 1 << 2;
33static constexpr std::uint_fast32_t TTO_FLAG_OLD = 1 << 3;
34static constexpr unsigned int TTI_DATA_SHIFT = 8; 33static constexpr unsigned int TTI_DATA_SHIFT = 8;
35static constexpr unsigned int TTO_DATA_SHIFT = 16; 34static constexpr unsigned int TTO_DATA_SHIFT = 16;
36static constexpr std::uint_fast32_t TTI_DATA = 0xff << TTI_DATA_SHIFT; 35static constexpr std::uint_fast32_t TTI_DATA = 0xff << TTI_DATA_SHIFT;