summaryrefslogtreecommitdiffstats
path: root/utils/regtools/qeditor/analyser.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/analyser.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/analyser.h')
-rw-r--r--utils/regtools/qeditor/analyser.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/utils/regtools/qeditor/analyser.h b/utils/regtools/qeditor/analyser.h
new file mode 100644
index 0000000000..33094574c1
--- /dev/null
+++ b/utils/regtools/qeditor/analyser.h
@@ -0,0 +1,64 @@
+#ifndef _ANALYSER_H_
+#define _ANALYSER_H_
+
+#include <QObject>
+#include <QVector>
+#include <QString>
+#include "backend.h"
+
+class Analyser : public QObject
+{
+ Q_OBJECT
+public:
+ Analyser(const soc_t& soc, IoBackend *backend);
+ virtual ~Analyser();
+ virtual QWidget *GetWidget() = 0;
+
+protected:
+ soc_t m_soc;
+ IoBackend *m_io_backend;
+};
+
+class AnalyserFactory
+{
+public:
+ AnalyserFactory(bool _register);
+ virtual ~AnalyserFactory();
+
+ virtual QString GetName() = 0;
+ virtual bool SupportSoc(const QString& soc_name) = 0;
+ // return NULL of soc is not handled by the analyser
+ virtual Analyser *Create(const soc_t& soc, IoBackend *backend) = 0;
+private:
+ QString m_name;
+
+public:
+ static QStringList GetAnalysersForSoc(const QString& soc_name);
+ static AnalyserFactory *GetAnalyserByName(const QString& name);
+ static void RegisterAnalyser(AnalyserFactory *factory);
+
+private:
+ static QVector< AnalyserFactory * > m_factories;
+};
+
+template< typename T >
+class TmplAnalyserFactory : public AnalyserFactory
+{
+public:
+ TmplAnalyserFactory(bool _register, const QString& name) :AnalyserFactory(_register) { m_name = name; }
+ virtual ~TmplAnalyserFactory() {}
+
+ virtual QString GetName() { return m_name; }
+ virtual bool SupportSoc(const QString& soc_name) { return T::SupportSoc(soc_name); }
+ // return NULL of soc is not handled by the analyser
+ virtual T *Create(const soc_t& soc, IoBackend *backend)
+ {
+ if(!T::SupportSoc(soc.name.c_str()))
+ return 0;
+ return new T(soc, backend);
+ }
+private:
+ QString m_name;
+};
+
+#endif /* _ANALYSER_H_ */