summaryrefslogtreecommitdiff
path: root/gui/gui.cc
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-04-26 03:39:28 -0400
committerbd <bdunahu@operationnull.com>2025-04-26 03:39:28 -0400
commita78163745b43a0c420ae4ea5792def30a94420eb (patch)
tree9cc23cfec1a7e524822d604e95e237034b31a95e /gui/gui.cc
parentc98a0c26c4ccb5c4ae0e9f5810be910a7b299037 (diff)
Partial cache size generation, full cache display
Diffstat (limited to 'gui/gui.cc')
-rw-r--r--gui/gui.cc26
1 files changed, 15 insertions, 11 deletions
diff --git a/gui/gui.cc b/gui/gui.cc
index 9baed38..ecdf9d3 100644
--- a/gui/gui.cc
+++ b/gui/gui.cc
@@ -20,10 +20,11 @@
#include "dynamicwaysentry.h"
#include "messages.h"
#include "storageview.h"
+#include "util.h"
+#include <QHeaderView>
#include <QPixmap>
#include <QString>
#include <QTableView>
-#include <QHeaderView>
GUI::GUI(QWidget *parent) : QMainWindow(parent), ui(new Ui::GUI)
{
@@ -332,6 +333,8 @@ void GUI::on_config_clicked()
else
this->set_status(get_initialize, "happy");
+ this->curr_cache_levels = ways.size();
+
emit sendConfigure(ways, this->p, is_pipelined);
make_tabs(2 + ways.size());
}
@@ -339,31 +342,32 @@ void GUI::on_config_clicked()
void GUI::make_tabs(int num)
{
int i;
- QStringList xTra;
StorageView *e;
QTableView *t;
QString n;
- xTra = {"Registers", "DRAM"};
-
ui->storage->clear();
this->tab_boxes.clear();
qDeleteAll(this->tab_boxes);
for (i = 0; i < num; ++i) {
- e = new StorageView(10, this);
+ // make the name
+ if (i == 0) {
+ n = "Registers";
+ e = new StorageView(0, this);
+ } else if (i == 1) {
+ n = "DRAM";
+ e = new StorageView(MEM_LINES, this);
+ } else {
+ n = QString("L%1").arg(i - 1);
+ e = new StorageView(cache_size_mapper(this->curr_cache_levels, i), this);
+ }
t = new QTableView;
t->setModel(e);
t->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
- // make the name
- if (i < xTra.size())
- n = xTra[i];
- else
- n = QString("L%1").arg(i - 1);
-
ui->storage->addTab(t, n);
this->tab_boxes.push_back(e);
}