summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2017-01-26 21:54:12 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2017-02-04 17:19:20 +0100
commit2a3a6bb4b343c95c2928dfa998c4edcf100774f9 (patch)
tree8c9a2f70cf4b6152602a6b4892b21a3ca9ed3ab2 /utils
parentfa5324bbbb77a445652d56c714a1d8f93ded61d5 (diff)
downloadrockbox-2a3a6bb4b343c95c2928dfa998c4edcf100774f9.tar.gz
rockbox-2a3a6bb4b343c95c2928dfa998c4edcf100774f9.tar.bz2
rockbox-2a3a6bb4b343c95c2928dfa998c4edcf100774f9.zip
regtools/qeditor: compute RAM size
Change-Id: I7bfb5cc25bc3dc55f379b2319b20dc9510434de0
Diffstat (limited to 'utils')
-rw-r--r--utils/regtools/qeditor/std_analysers.cpp22
-rw-r--r--utils/regtools/qeditor/std_analysers.h1
2 files changed, 23 insertions, 0 deletions
diff --git a/utils/regtools/qeditor/std_analysers.cpp b/utils/regtools/qeditor/std_analysers.cpp
index 1a504cd617..1acd25e7fc 100644
--- a/utils/regtools/qeditor/std_analysers.cpp
+++ b/utils/regtools/qeditor/std_analysers.cpp
@@ -870,6 +870,13 @@ EmiAnalyser::EmiAnalyser(const soc_desc::soc_ref_t& soc, IoBackend *backend)
m_emi_freq_label = new QLineEdit;
m_emi_freq_label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
m_emi_freq_label->setReadOnly(true);
+ m_emi_size_label = new QLineEdit;
+ m_emi_size_label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
+ m_emi_size_label->setReadOnly(true);
+ line_layout->addStretch();
+ line_layout->addWidget(new QLabel("Size:"));
+ line_layout->addWidget(m_emi_size_label);
+ line_layout->addWidget(new QLabel("MiB"));
line_layout->addStretch();
line_layout->addWidget(new QLabel("Frequency:"));
line_layout->addWidget(m_emi_freq_label);
@@ -1008,6 +1015,21 @@ void EmiAnalyser::FillTable()
m_emi_freq_label->setText(QString().sprintf("%.3f", m_emi_freq / 1000000.0));
+ soc_word_t rows, columns, cs_map;
+ if(ReadFieldOld("DRAM", "CTL14", "CS_MAP", cs_map) &&
+ ReadFieldOld("DRAM", "CTL10", "ADDR_PINS", rows) &&
+ ReadFieldOld("DRAM", "CTL11", "COLUMN_SIZE", columns))
+ {
+ rows = 13 - rows;
+ columns = 12 - columns;
+ soc_word_t banks = 4;
+ soc_word_t chips = __builtin_popcount(cs_map);
+ unsigned long size = 2 * (1 << (rows + columns)) * chips * banks;
+ m_emi_size_label->setText(QString().sprintf("%lu", (unsigned long)size / 1024 / 1024));
+ }
+ else
+ m_emi_size_label->setText("<invalid>");
+
NewGroup("Control Parameters");
if(ReadFieldOld("EMI", "CTRL", "PORT_PRIORITY_ORDER", value))
{
diff --git a/utils/regtools/qeditor/std_analysers.h b/utils/regtools/qeditor/std_analysers.h
index 3ab4735e0a..255ae283b8 100644
--- a/utils/regtools/qeditor/std_analysers.h
+++ b/utils/regtools/qeditor/std_analysers.h
@@ -126,6 +126,7 @@ private:
DisplayMode m_display_mode;
unsigned m_emi_freq;
QLineEdit *m_emi_freq_label;
+ QLineEdit *m_emi_size_label;
};
/**