diff options
| author | Julian Blake Kongslie | 2022-10-29 18:18:26 -0700 |
|---|---|---|
| committer | Julian Blake Kongslie | 2022-10-29 18:18:26 -0700 |
| commit | 9f4aa97822adc791f700670ef0fc7636849563b7 (patch) | |
| tree | 0b9d6c1bb1d7d596501df3b77ab3d7b9f191aa4f /isa/isa.h | |
| parent | Control register values should not be "unsigned int" (diff) | |
| download | biggolf-9f4aa97822adc791f700670ef0fc7636849563b7.tar.xz | |
Understanding interrupt handling within SIMH (see echo_int.pal)
Add list of Bugs
Add event log file parser
More changes associated with widening the ctlregs (FIXME add a typedef)
Add some keyboard instructions
Diffstat (limited to '')
| -rw-r--r-- | isa/isa.h | 37 |
1 files changed, 23 insertions, 14 deletions
| @@ -2,30 +2,39 @@ | |||
| 2 | 2 | ||
| 3 | #include <cstdint> | 3 | #include <cstdint> |
| 4 | #include <functional> | 4 | #include <functional> |
| 5 | #include <map> | ||
| 5 | #include <optional> | 6 | #include <optional> |
| 7 | #include <string> | ||
| 6 | 8 | ||
| 7 | enum ctlreg { | 9 | enum ctlreg { |
| 8 | DATA_INSTRUCTION_FIELD_BUFFER, // (df << 3) | if_buffer | 10 | #define REG(N) N, |
| 9 | DATA_INSTRUCTION_FIELD_SAVED, // (df_saved << 3) | if_saved | 11 | #include "ctlreg.def" |
| 10 | HALTED, | 12 | #undef REG |
| 11 | INT_ENABLE, // (int_enable_delay << 1) | int_enable | ||
| 12 | INT_PENDING, // only meaningful if interrupts disabled | ||
| 13 | TT_BITS, // see below TT[IO]_* consts | ||
| 14 | TT_INPUT_INT_ENABLE, | ||
| 15 | TT_OUTPUT_INT_ENABLE, | ||
| 16 | 13 | ||
| 17 | NUM_CTLREGS, | 14 | NUM_CTLREGS, |
| 18 | }; | 15 | }; |
| 19 | 16 | ||
| 17 | const char * const ctlreg_names[] = { | ||
| 18 | #define REG(N) #N, | ||
| 19 | #include "ctlreg.def" | ||
| 20 | #undef REG | ||
| 21 | }; | ||
| 22 | |||
| 23 | const std::map<std::string, ctlreg> ctlreg_map = { | ||
| 24 | #define REG(N) { #N, N }, | ||
| 25 | #include "ctlreg.def" | ||
| 26 | #undef REG | ||
| 27 | }; | ||
| 28 | |||
| 20 | // TT_BITS | 29 | // TT_BITS |
| 21 | static constexpr unsigned int TTI_FLAG = 1 << 0; | 30 | static constexpr std::uint_fast32_t TTI_FLAG = 1 << 0; |
| 22 | static constexpr unsigned int TTO_TX = 1 << 1; | 31 | static constexpr std::uint_fast32_t TTO_TX = 1 << 1; |
| 23 | static constexpr unsigned int TTO_FLAG = 1 << 2; | 32 | static constexpr std::uint_fast32_t TTO_FLAG = 1 << 2; |
| 24 | static constexpr unsigned int TTO_FLAG_OLD = 1 << 3; | 33 | static constexpr std::uint_fast32_t TTO_FLAG_OLD = 1 << 3; |
| 25 | static constexpr unsigned int TTI_DATA_SHIFT = 8; | 34 | static constexpr unsigned int TTI_DATA_SHIFT = 8; |
| 26 | static constexpr unsigned int TTO_DATA_SHIFT = 16; | 35 | static constexpr unsigned int TTO_DATA_SHIFT = 16; |
| 27 | static constexpr unsigned int TTI_DATA = 0xff << TTI_DATA_SHIFT; | 36 | static constexpr std::uint_fast32_t TTI_DATA = 0xff << TTI_DATA_SHIFT; |
| 28 | static constexpr unsigned int TTO_DATA = 0xff << TTO_DATA_SHIFT; | 37 | static constexpr std::uint_fast32_t TTO_DATA = 0xff << TTO_DATA_SHIFT; |
| 29 | 38 | ||
| 30 | struct instruction_context { | 39 | struct instruction_context { |
| 31 | // Known statically at decode time | 40 | // Known statically at decode time |
