2014-09-26 08:46:48 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Copyright (C) 2014 by Amaury Pouly
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
2013-08-21 18:16:26 +00:00
|
|
|
#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"
|
|
|
|
|
2016-02-06 15:08:43 +00:00
|
|
|
class AnalyserEx : public Analyser
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
AnalyserEx(const soc_desc::soc_ref_t& soc, IoBackend *backend);
|
|
|
|
protected:
|
|
|
|
bool ReadRegister(const QString& path, soc_word_t& val);
|
|
|
|
bool ReadRegisterOld(const QString& dev, const QString& reg, soc_word_t& val);
|
|
|
|
bool ReadField(const QString& path, const QString& field, soc_word_t& val);
|
|
|
|
bool ReadFieldOld(const QString& dev, const QString& reg, const QString& field,
|
|
|
|
soc_word_t& val);
|
|
|
|
|
|
|
|
BackendHelper m_helper;
|
|
|
|
};
|
|
|
|
|
2013-08-21 18:16:26 +00:00
|
|
|
/**
|
|
|
|
* Clock analyser
|
|
|
|
*/
|
|
|
|
|
2016-02-06 15:08:43 +00:00
|
|
|
class ClockAnalyser : public AnalyserEx
|
2013-08-21 18:16:26 +00:00
|
|
|
{
|
|
|
|
public:
|
2016-02-06 15:08:43 +00:00
|
|
|
ClockAnalyser(const soc_desc::soc_ref_t& soc, IoBackend *backend);
|
2013-08-21 18:16:26 +00:00
|
|
|
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();
|
2014-09-18 08:04:14 +00:00
|
|
|
void FillTreeIMX233();
|
|
|
|
void FillTreeRK27XX();
|
2014-11-27 23:18:02 +00:00
|
|
|
void FillTreeATJ213X();
|
2016-08-02 14:47:09 +00:00
|
|
|
void FillTreeJZ4760B();
|
2013-08-21 18:16:26 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
QGroupBox *m_group;
|
|
|
|
QTreeWidget *m_tree_widget;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* EMI analyser
|
|
|
|
*/
|
2016-02-06 15:08:43 +00:00
|
|
|
class EmiAnalyser : public QObject, public AnalyserEx
|
2013-08-21 18:16:26 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2016-02-06 15:08:43 +00:00
|
|
|
EmiAnalyser(const soc_desc::soc_ref_t& soc, IoBackend *backend);
|
2013-08-21 18:16:26 +00:00
|
|
|
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;
|
2017-01-26 20:54:12 +00:00
|
|
|
QLineEdit *m_emi_size_label;
|
2013-08-21 18:16:26 +00:00
|
|
|
};
|
|
|
|
|
2013-09-13 12:36:16 +00:00
|
|
|
/**
|
|
|
|
* PINCTRL analyzer
|
|
|
|
*/
|
2016-02-06 15:08:43 +00:00
|
|
|
class PinAnalyser : public AnalyserEx
|
2013-09-13 12:36:16 +00:00
|
|
|
{
|
|
|
|
public:
|
2016-02-06 15:08:43 +00:00
|
|
|
PinAnalyser(const soc_desc::soc_ref_t& soc, IoBackend *backend);
|
2013-09-13 12:36:16 +00:00
|
|
|
virtual ~PinAnalyser();
|
|
|
|
virtual QWidget *GetWidget();
|
|
|
|
|
|
|
|
static bool SupportSoc(const QString& soc_name);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void FillList();
|
|
|
|
|
|
|
|
private:
|
|
|
|
QGroupBox *m_group;
|
|
|
|
QLineEdit *m_package_edit;
|
|
|
|
QToolBox *m_panel;
|
|
|
|
};
|
|
|
|
|
2013-08-21 18:16:26 +00:00
|
|
|
#endif /* _STDANALYSER_H_ */
|