diff options
Diffstat (limited to 'qtmips_machine')
-rw-r--r-- | qtmips_machine/peripheral.cpp | 8 | ||||
-rw-r--r-- | qtmips_machine/peripheral.h | 5 | ||||
-rw-r--r-- | qtmips_machine/qtmipsexception.h | 3 |
3 files changed, 14 insertions, 2 deletions
diff --git a/qtmips_machine/peripheral.cpp b/qtmips_machine/peripheral.cpp index 161f760..ac74c2a 100644 --- a/qtmips_machine/peripheral.cpp +++ b/qtmips_machine/peripheral.cpp @@ -50,13 +50,19 @@ bool SimplePeripheral::wword(std::uint32_t address, std::uint32_t value) { printf("SimplePeripheral::wword address 0x%08lx data 0x%08lx\n", (unsigned long)address, (unsigned long)value); #endif + emit write_notification(address, value); + return true; } std::uint32_t SimplePeripheral::rword(std::uint32_t address) const { + std::uint32_t value = 0x12345678; #if 0 printf("SimplePeripheral::rword address 0x%08lx\n", (unsigned long)address); #endif - return 0x12345678; + + emit read_notification(address, &value); + + return value; } diff --git a/qtmips_machine/peripheral.h b/qtmips_machine/peripheral.h index dfc4db7..92df1d7 100644 --- a/qtmips_machine/peripheral.h +++ b/qtmips_machine/peripheral.h @@ -51,6 +51,11 @@ public: SimplePeripheral(); ~SimplePeripheral(); +signals: + void write_notification(std::uint32_t address, std::uint32_t value); + void read_notification(std::uint32_t address, std::uint32_t *value) const; + +public: bool wword(std::uint32_t address, std::uint32_t value); std::uint32_t rword(std::uint32_t address) const; }; diff --git a/qtmips_machine/qtmipsexception.h b/qtmips_machine/qtmipsexception.h index e48bf1c..e592ef0 100644 --- a/qtmips_machine/qtmipsexception.h +++ b/qtmips_machine/qtmipsexception.h @@ -90,7 +90,8 @@ protected: EXCEPTION(UnalignedJump, Runtime) \ EXCEPTION(UnknownMemoryControl, Runtime) \ EXCEPTION(OutOfMemoryAccess, Runtime) \ - EXCEPTION(Sanity,) + EXCEPTION(Sanity,) \ + EXCEPTION(SyscallUnknown, Runtime) \ #define EXCEPTION(NAME, PARENT) \ class QtMipsException##NAME : public QtMipsException##PARENT { \ |