summaryrefslogtreecommitdiffstats
path: root/utils/regtools/qeditor/std_analysers.h
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-08-21 20:16:26 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-08-21 20:18:37 +0200
commitc323381f0b3ee68b0093442335e8e7cbb112858a (patch)
treeac27964bd0da6bc56f05ad965ce4de957ef22d59 /utils/regtools/qeditor/std_analysers.h
parent902306378e38ce571f4595ae8dabb2acd2412faa (diff)
downloadrockbox-c323381f0b3ee68b0093442335e8e7cbb112858a.tar.gz
rockbox-c323381f0b3ee68b0093442335e8e7cbb112858a.zip
regtools: add graphical register explorer + analyser
This tool allows one to explore any register map. Register dumps (like produced by hwstub tools) can be loaded and decoded by the tool. Finally some analysers are provided for specific soc analysis like clock tree and emi on imx233 for example. Change-Id: Iaf81bd52d15f3e44ab4fe9bc039153fcf60cf92a
Diffstat (limited to 'utils/regtools/qeditor/std_analysers.h')
-rw-r--r--utils/regtools/qeditor/std_analysers.h95
1 files changed, 95 insertions, 0 deletions
diff --git a/utils/regtools/qeditor/std_analysers.h b/utils/regtools/qeditor/std_analysers.h
new file mode 100644
index 0000000000..98c5fa0f98
--- /dev/null
+++ b/utils/regtools/qeditor/std_analysers.h
@@ -0,0 +1,95 @@
+#ifndef _STDANALYSER_H_
+#define _STDANALYSER_H_
+
+#include "analyser.h"
+
+#include <QGroupBox>
+#include <QTreeWidget>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QTableWidget>
+#include <QHeaderView>
+#include <QToolBox>
+#include <QComboBox>
+#include <QLabel>
+#include <QLineEdit>
+#include "analyser.h"
+#include "collapsiblepanel.h"
+
+/**
+ * Clock analyser
+ */
+
+class ClockAnalyser : public Analyser
+{
+ Q_OBJECT
+public:
+ ClockAnalyser(const soc_t& soc, IoBackend *backend);
+ virtual ~ClockAnalyser();
+ virtual QWidget *GetWidget();
+ static bool SupportSoc(const QString& soc_name);
+
+private:
+ QString GetFreq(unsigned freq);
+
+ enum
+ {
+ DISABLED = 0,
+ INVALID = -1,
+ FROM_PARENT = -2,
+ };
+
+ QTreeWidgetItem *AddClock(QTreeWidgetItem *parent, const QString& name, int freq, int mul = 1, int div = 1);
+ int GetClockFreq(QTreeWidgetItem *item);
+ void FillTree();
+
+private:
+ QGroupBox *m_group;
+ QTreeWidget *m_tree_widget;
+};
+
+/**
+ * EMI analyser
+ */
+class EmiAnalyser : public Analyser
+{
+ Q_OBJECT
+public:
+ EmiAnalyser(const soc_t& soc, IoBackend *backend);
+ virtual ~EmiAnalyser();
+ virtual QWidget *GetWidget();
+
+ static bool SupportSoc(const QString& soc_name);
+
+private slots:
+ void OnChangeDisplayMode(int index);
+
+private:
+ enum DisplayMode
+ {
+ DisplayCycles,
+ DisplayRawHex,
+ DisplayTime,
+ };
+
+ enum
+ {
+ NONE = -999999,
+ INVALID = -1000000
+ };
+
+ void NewGroup(const QString& name);
+ void AddLine(const QString& name, int value, const QString& unit, const QString& comment = "");
+ void AddCycleLine(const QString& name, unsigned raw_val, float val, int digits, const QString& comment = "");
+ void FillTable();
+
+private:
+ QGroupBox *m_group;
+ QComboBox *m_display_selector;
+ QToolBox *m_panel;
+ DisplayMode m_display_mode;
+ unsigned m_emi_freq;
+ QLineEdit *m_emi_freq_label;
+};
+
+#endif /* _STDANALYSER_H_ */