aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine/peripheral.cpp
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-08 10:47:27 +0100
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-08 10:47:27 +0100
commit6b639c50c93e4a682b15dcdf20f3d46a47d68a64 (patch)
tree631b71bf5d1125297918c1f73a680fe738e3cbd9 /qtmips_machine/peripheral.cpp
parent0137207cb51ef3dd8b097d6cf88fd627fc468af2 (diff)
downloadqtmips-6b639c50c93e4a682b15dcdf20f3d46a47d68a64.tar.gz
qtmips-6b639c50c93e4a682b15dcdf20f3d46a47d68a64.tar.bz2
qtmips-6b639c50c93e4a682b15dcdf20f3d46a47d68a64.zip
Add write and read notification to the simple peripheral component.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_machine/peripheral.cpp')
-rw-r--r--qtmips_machine/peripheral.cpp8
1 files changed, 7 insertions, 1 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;
}