From e49b4bed74e4a3d16a9df5aa9f831822327155f2 Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Mon, 30 Sep 2024 16:29:17 +0200 Subject: [PATCH] GUI: switch "New" dialog page selection to tree widget, polishing required This is experiment to propose solution of hard to navigate list of tab topics. It is related to issue New dialog tab/page selection rework #150 Signed-off-by: Pavel Pisa --- src/gui/dialogs/new/NewDialog.ui | 1382 ++++++++++++++--------------- src/gui/dialogs/new/newdialog.cpp | 21 + src/gui/dialogs/new/newdialog.h | 1 + 3 files changed, 709 insertions(+), 695 deletions(-) diff --git a/src/gui/dialogs/new/NewDialog.ui b/src/gui/dialogs/new/NewDialog.ui index 336fb4b8..56934e4f 100644 --- a/src/gui/dialogs/new/NewDialog.ui +++ b/src/gui/dialogs/new/NewDialog.ui @@ -6,7 +6,7 @@ 0 0 - 574 + 667 472 @@ -27,267 +27,321 @@ 0 - - - 0 - - - - Basic - - - - - - Preset - - - - - - No pipeline no cache - - - - - - - No pipeline with cache - - - - - - - Pipelined without hazard unit and without cache - - - - - - - Pipelined with hazard unit and cache - - - - - - - Custom - - - - - - - - - - Reset at compile time (reload after make) - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Qt::Horizontal - - - - - + + + + + + Config Pages + + + + + + + + + Presets and ELF File + + - + + + Preset + + + + + + No pipeline no cache + + + + + + + No pipeline with cache + + + + + + + Pipelined without hazard unit and without cache + + + + + + + Pipelined with hazard unit and cache + + + + + + + Custom + + + + + + + + - Elf executable: + Reset at compile time (reload after make) - + + + Qt::Vertical + + + + 20 + 40 + + + - - - Browse + + + Qt::Horizontal - - - - - - - Core - - - - QLayout::SetDefaultConstraint - - - - - true - - - - - 0 - 0 - 536 - 519 - - - + + + + + + Elf executable: + + + - - - - - Pipelined - - - - - - - XLEN 64-bit - - - - - - - Atomic (A) - - - - - - - Delay slot - - - - - - - Multiply (M) - - - - + - - - Hazard unit + + + Browse - - true + + + + + + + + + Core ISA and Hazards + + + + + + + + Pipelined - - false + + + + + + XLEN 64-bit - + + + + + + Atomic (A) + + + + + + + Delay slot + + + + + + + Multiply (M) + + + + + + + + + Hazard unit + + + true + + + false + + + + + + Stall when hazard is detected + + + + + + + Stall or forward when hazard is detected + + + true + + + + + + + + + + + Branch Predictor + + + + + + Branch Predictor + + + true + + + true + + + + + + 0 + - + - Stall when hazard is detected + Predictor type: - - - Stall or forward when hazard is detected - - - true - - + - - - - - - Branch Predictor - - - true - - - true - - + + + + + 0 + - - - 0 + + + Initial state: - - - - Predictor type: - - - - - - - + - - - 0 - - - - - Initial state: - - - - - - - + - - - - Branch Target Buffer (BTB) - - - false - - - - - - Qt::Horizontal + + + + + + Branch Target Buffer (BTB) + + + false + + + + + + Qt::Horizontal + + + + + + + + 40 + 0 + + + + 0 + + + Qt::AlignCenter + + + + + + + PC - Program Counter register + + + Bits from PC address: + + + + + + + 8 + + + Qt::Horizontal + + + false + + + QSlider::TicksBothSides + + + + + + + + + + 140 + 0 + + + + Number of entries: - - + + 40 @@ -295,132 +349,48 @@ - 0 + 1 Qt::AlignCenter - - - - PC - Program Counter register + + + + Qt::Horizontal - - Bits from PC address: + + + 40 + 20 + - + - - - - 8 - + + - Qt::Horizontal + Qt::Vertical - - false + + + + + + + 140 + 0 + - - QSlider::TicksBothSides + + Number of bits: - - - - - - - 140 - 0 - - - - Number of entries: - - - - - - - - 40 - 0 - - - - 1 - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Vertical - - - - - - - - 140 - 0 - - - - Number of bits: - - - - - - - - 40 - 0 - - - - 0 - - - Qt::AlignCenter - - - - - - - - - - - - Branch History Table (BHT) - - - - + + 40 @@ -435,8 +405,131 @@ - - + + + + + + + + + Branch History Table (BHT) + + + + + + + 40 + 0 + + + + 0 + + + Qt::AlignCenter + + + + + + + + 40 + 0 + + + + 0 + + + Qt::AlignCenter + + + + + + + 8 + + + Qt::Horizontal + + + QSlider::TicksBothSides + + + + + + + 8 + + + Qt::Horizontal + + + QSlider::TicksBothSides + + + + + + + + 140 + 0 + + + + BHR - Branch History Register + + + Bits in BHR: + + + + + + + Qt::Horizontal + + + + + + + + 140 + 0 + + + + PC - Program Counter register + + + Bits from PC address: + + + + + + + + + + 140 + 0 + + + + Number of entries: + + + + + 40 @@ -444,407 +537,306 @@ - 0 + 1 Qt::AlignCenter - - - - 8 - + + Qt::Horizontal - - QSlider::TicksBothSides + + + 40 + 20 + - + - - - - 8 - + + - Qt::Horizontal - - - QSlider::TicksBothSides + Qt::Vertical - - + + 140 0 - - BHR - Branch History Register - - Bits in BHR: + Number of bits: - - - - Qt::Horizontal - - - - - + + - 140 + 40 0 - - PC - Program Counter register - - Bits from PC address: + 0 + + + Qt::AlignCenter - - - - - - - 140 - 0 - - - - Number of entries: - - - - - - - - 40 - 0 - - - - 1 - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Vertical - - - - - - - - 140 - 0 - - - - Number of bits: - - - - - - - - 40 - 0 - - - - 0 - - - Qt::AlignCenter - - - - - - - - - - - - - - - - - - - Memory - - - - - - Program memory write protection - - - - - - - Data memory executable protection - - - - - - - Access time (in cycles) - - - - - - Read: - - - - - - - 1 - - - 999999999 - - - - - - - Write: - - - - - - - 1 - - - 999999999 - - - - - - - Burst enable: - - - - - - - false - - - - - - - Burst: - - - - - - - 0 - - - 999999999 - - - - - - - L2 Access: - - - - - - - 0 - - - 999999999 - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - Program cache - - - - - Data cache - - - - - L2 cache - - - - - true - - - OS Emulation - - - - - - Enable emulation of operating system services - - - true - - - - - - - Stop on known system call - - - true - - - - - - - Stop on unknown system call - - - true - - - - - - - Stop on interrupt entry - - - true - - - - - - - Stop and step over exceptions (overflow, etc.) - - - true - - - - - + + + + + + + + + + + + Memory Timings + + + + + + Program memory write protection + + + - + - Filesystem root: + Data memory executable protection - + + + Access time (in cycles) + + + + + + Read: + + + + + + + 1 + + + 999999999 + + + + + + + Write: + + + + + + + 1 + + + 999999999 + + + + + + + Burst enable: + + + + + + + false + + + + + + + Burst: + + + + + + + 0 + + + 999999999 + + + + + + + L2 Access: + + + + + + + 0 + + + 999999999 + + + + + - + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + L1 Program Cache + + + + + L1 Data Cache + + + + + L2 Cache + + + + + System Emulation and IRQ + + + + + + Enable emulation of operating system services + + + true + + + + + + + Stop on known system call + + + true + + + + + + + Stop on unknown system call + + + true + + + + + + + Stop on interrupt entry + + + true + + + + + - Browse + Stop and step over exceptions (overflow, etc.) + + + true + + + + + + Filesystem root: + + + + + + + + + + Browse + + + + + + + + + Qt::Vertical + + + + 21 + 40 + + + + - - - - - Qt::Vertical - - - - 21 - 40 - - - - - - - + + + + diff --git a/src/gui/dialogs/new/newdialog.cpp b/src/gui/dialogs/new/newdialog.cpp index 8a128852..86e6bb2e 100644 --- a/src/gui/dialogs/new/newdialog.cpp +++ b/src/gui/dialogs/new/newdialog.cpp @@ -29,6 +29,19 @@ NewDialog::NewDialog(QWidget *parent, QSettings *settings) : QDialog(parent) { ui_cache_l2.reset(new Ui::NewDialogCache()); ui_cache_l2->setupUi(ui->tab_cache_level2); + QList items; + for (int i = 0; i < ui->config_pages->count(); ++i) { + QString page_id = ui->config_pages->widget(i)->objectName(); + QString page_name = ui->config_pages->widget(i)->accessibleName(); + items.append(new QTreeWidgetItem(static_cast(nullptr), + QStringList{page_name, page_id})); + } + ui->page_select_tree->insertTopLevelItems(0, items); + + connect( + ui->page_select_tree, &QTreeWidget::currentItemChanged, + this, &NewDialog::switch2page); + connect( ui->pushButton_example, &QAbstractButton::clicked, this, &NewDialog::create_example); @@ -159,6 +172,14 @@ NewDialog::NewDialog(QWidget *parent, QSettings *settings) : QDialog(parent) { load_settings(); // Also configures gui } +void NewDialog::switch2page(QTreeWidgetItem *current, QTreeWidgetItem *previous) { + (void)previous; + QWidget *page = ui->config_pages->findChild(current->text(1), + Qt::FindDirectChildrenOnly); + if (page != nullptr) + ui->config_pages->setCurrentWidget(page); +} + void NewDialog::switch2custom() { if (!ui->preset_custom->isChecked()) { ui->preset_custom->setChecked(true); diff --git a/src/gui/dialogs/new/newdialog.h b/src/gui/dialogs/new/newdialog.h index eb596ae0..c603c854 100644 --- a/src/gui/dialogs/new/newdialog.h +++ b/src/gui/dialogs/new/newdialog.h @@ -53,6 +53,7 @@ private slots: void browse_osemu_fs_root(); void osemu_fs_root_change(QString val); void reset_at_compile_change(bool); + void switch2page(QTreeWidgetItem *current, QTreeWidgetItem *previous); // Branch Predictor void bp_toggle_widgets();