aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui/mainwindow.cpp
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-13 18:37:51 +0100
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-13 18:37:51 +0100
commit93c5ade08250e419b7dbc3177db6fba93163fd34 (patch)
treeb28d4f1bb4c36edbd60bf634d0d71a6d880b592d /qtmips_gui/mainwindow.cpp
parent9f1ddc2b38469d5028aec5ba7b68131d711f2622 (diff)
downloadqtmips-93c5ade08250e419b7dbc3177db6fba93163fd34.tar.gz
qtmips-93c5ade08250e419b7dbc3177db6fba93163fd34.tar.bz2
qtmips-93c5ade08250e419b7dbc3177db6fba93163fd34.zip
Include simple serial port terminal and prepare empty peripheral dock.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_gui/mainwindow.cpp')
-rw-r--r--qtmips_gui/mainwindow.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/qtmips_gui/mainwindow.cpp b/qtmips_gui/mainwindow.cpp
index 4e716cb..b77d0d6 100644
--- a/qtmips_gui/mainwindow.cpp
+++ b/qtmips_gui/mainwindow.cpp
@@ -60,6 +60,10 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
cache_program->hide();
cache_data = new CacheDock(this, "Data");
cache_data->hide();
+ peripherals = new PeripheralsDock(this, settings);
+ peripherals->hide();
+ terminal = new TerminalDock(this, settings);
+ terminal->hide();
// Execution speed actions
speed_group = new QActionGroup(this);
@@ -80,6 +84,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
connect(ui->actionMemory, SIGNAL(triggered(bool)), this, SLOT(show_memory()));
connect(ui->actionProgram_Cache, SIGNAL(triggered(bool)), this, SLOT(show_cache_program()));
connect(ui->actionData_Cache, SIGNAL(triggered(bool)), this, SLOT(show_cache_data()));
+ connect(ui->actionPeripherals, SIGNAL(triggered(bool)), this, SLOT(show_peripherals()));
+ connect(ui->actionTerminal, SIGNAL(triggered(bool)), this, SLOT(show_terminal()));
connect(ui->actionAbout, SIGNAL(triggered(bool)), this, SLOT(about_qtmips()));
connect(ui->actionAboutQt, SIGNAL(triggered(bool)), this, SLOT(about_qt()));
connect(ui->ips1, SIGNAL(toggled(bool)), this, SLOT(set_speed()));
@@ -105,6 +111,8 @@ MainWindow::~MainWindow() {
delete memory;
delete cache_program;
delete cache_data;
+ delete peripherals;
+ delete terminal;
delete ui;
if (machine != nullptr)
delete machine;
@@ -153,6 +161,8 @@ void MainWindow::create_core(const machine::MachineConfig &config) {
connect(corescene, SIGNAL(request_jump_to_program_counter(std::uint32_t)), program, SIGNAL(jump_to_pc(std::uint32_t)));
connect(corescene, SIGNAL(request_cache_program()), this, SLOT(show_cache_program()));
connect(corescene, SIGNAL(request_cache_data()), this, SLOT(show_cache_data()));
+ connect(corescene, SIGNAL(request_peripherals()), this, SLOT(show_peripherals()));
+ connect(corescene, SIGNAL(request_terminal()), this, SLOT(show_terminal()));
// Connect signal from break to machine pause
connect(machine->core(), SIGNAL(stop_on_exception_reached()), machine, SLOT(pause()));
@@ -163,6 +173,7 @@ void MainWindow::create_core(const machine::MachineConfig &config) {
memory->setup(machine);
cache_program->setup(machine->cache_program());
cache_data->setup(machine->cache_data());
+ terminal->setup(machine->serial_port());
// Connect signals for instruction address followup
connect(machine->core(), SIGNAL(fetch_inst_addr_value(std::uint32_t)),
@@ -211,6 +222,8 @@ SHOW_HANDLER(program)
SHOW_HANDLER(memory)
SHOW_HANDLER(cache_program)
SHOW_HANDLER(cache_data)
+SHOW_HANDLER(peripherals)
+SHOW_HANDLER(terminal)
#undef SHOW_HANDLER
void MainWindow::about_qtmips()