This commit is contained in:
Folkert van Heusden 2025-04-02 23:04:05 +02:00
parent 70cc1e30ac
commit f1bcefe433
Signed by untrusted user who does not match committer: folkert
GPG key ID: 6B6455EDFEED3BD1
4 changed files with 11 additions and 11 deletions

2
benchmark.txt Normal file
View file

@ -0,0 +1,2 @@
41ef37ce6b7f13f1cc2df0e6ac570647fe07fe12:
MIPS: 0.74, relative speed: 33.23%, instructions executed: 3692600 in 5.00 seconds

View file

@ -702,7 +702,6 @@ bool cpu::double_operand_instructions(const uint16_t instr)
case 0b110: { // ADD/SUB Add/Subtract Word case 0b110: { // ADD/SUB Add/Subtract Word
auto g_ssrc = getGAM(src_mode, src_reg, wm_word); auto g_ssrc = getGAM(src_mode, src_reg, wm_word);
auto g_dst = getGAM(dst_mode, dst_reg, wm_word); auto g_dst = getGAM(dst_mode, dst_reg, wm_word);
addToMMR1(g_dst); addToMMR1(g_dst);

View file

@ -324,7 +324,7 @@ std::pair<trap_action_t, int> mmu::get_trap_action(const int run_mode, const boo
assert(map[1][false] == T_TRAP_250); assert(map[1][false] == T_TRAP_250);
assert(map[1][true ] == T_ABORT_4 ); assert(map[1][true ] == T_ABORT_4 );
return { map[access_control][is_write], access_control }; return { map[access_control][is_write], access_control };
} }
void mmu::mmudebug(const uint16_t a) void mmu::mmudebug(const uint16_t a)
@ -464,7 +464,6 @@ uint32_t mmu::calculate_physical_address(const int run_mode, const uint16_t a, c
bool d = space == d_space && get_use_data_space(run_mode); bool d = space == d_space && get_use_data_space(run_mode);
uint16_t p_offset = a & 8191; // page offset uint16_t p_offset = a & 8191; // page offset
uint8_t apf = a >> 13; // active page field uint8_t apf = a >> 13; // active page field
m_offset = get_physical_memory_offset(run_mode, d, apf); m_offset = get_physical_memory_offset(run_mode, d, apf);

16
mmu.h
View file

@ -47,16 +47,16 @@ private:
// 8 pages, D/I, 3 modes and 1 invalid mode // 8 pages, D/I, 3 modes and 1 invalid mode
page_t pages[4][2][8]; page_t pages[4][2][8];
uint16_t MMR0 { 0 }; uint16_t MMR0 { 0 };
uint16_t MMR1 { 0 }; uint16_t MMR1 { 0 };
uint16_t MMR2 { 0 }; uint16_t MMR2 { 0 };
uint16_t MMR3 { 0 }; uint16_t MMR3 { 0 };
uint16_t CPUERR { 0 }; uint16_t CPUERR { 0 };
uint16_t PIR { 0 }; uint16_t PIR { 0 };
uint16_t CSR { 0 }; uint16_t CSR { 0 };
memory *m { nullptr }; memory *m { nullptr };
cpu *c { nullptr }; cpu *c { nullptr };
JsonDocument add_par_pdr(const int run_mode, const bool is_d) const; JsonDocument add_par_pdr(const int run_mode, const bool is_d) const;
void set_par_pdr(const JsonVariantConst j_in, const int run_mode, const bool is_d); void set_par_pdr(const JsonVariantConst j_in, const int run_mode, const bool is_d);