1 |
2 |
EziDebug |
#ifndef EZIDEBUGVLGFILE_H
|
2 |
|
|
#define EZIDEBUGVLGFILE_H
|
3 |
|
|
#include "ezidebugfile.h"
|
4 |
|
|
#include "ezidebuginstancetreeitem.h"
|
5 |
|
|
#include "ezidebugmodule.h"
|
6 |
|
|
|
7 |
|
|
|
8 |
|
|
#define NO_STRING_FINDED -1
|
9 |
|
|
#define NO_COMMENTARY -1
|
10 |
|
|
#define EZI_MAX_INSTANCE_NUM 256
|
11 |
|
|
|
12 |
|
|
//class EziDebugFile ;
|
13 |
|
|
class QString ;
|
14 |
|
|
class EziDebugModule ;
|
15 |
|
|
class EziDebugInstanceTreeItem ;
|
16 |
|
|
class EziDebugFile ;
|
17 |
|
|
class EziDebugPrj ;
|
18 |
|
|
|
19 |
|
|
class EziDebugVlgFile:public EziDebugFile
|
20 |
|
|
{
|
21 |
|
|
//Q_OBJECT
|
22 |
|
|
public:
|
23 |
|
|
enum INSERT_TYPE
|
24 |
|
|
{
|
25 |
|
|
InsertTimer = 0 ,
|
26 |
|
|
InsertUserCore ,
|
27 |
|
|
InsertOther
|
28 |
|
|
};
|
29 |
|
|
|
30 |
|
|
enum SEARCH_TYPE
|
31 |
|
|
{
|
32 |
|
|
SearchModuleKeyWordPos = 1 ,
|
33 |
|
|
SearchPortKeyWord ,
|
34 |
|
|
SearchLastPortPos ,
|
35 |
|
|
SearchLastRegPos ,
|
36 |
|
|
SearchLastWirePos,
|
37 |
|
|
SearchModuleEndPos ,
|
38 |
|
|
SearchInstancePos ,
|
39 |
|
|
SearchLeftBracketPos ,
|
40 |
|
|
SearchRightBracketPos,
|
41 |
|
|
SearchSemicolonPos,
|
42 |
|
|
SearchOther
|
43 |
|
|
};
|
44 |
|
|
|
45 |
|
|
|
46 |
|
|
|
47 |
|
|
enum PORT_ANNOUNCE_FORMAT
|
48 |
|
|
{
|
49 |
|
|
AnsicFormat = 1,
|
50 |
|
|
NonAnsicFormat ,
|
51 |
|
|
PortOtherFormat
|
52 |
|
|
};
|
53 |
|
|
|
54 |
|
|
enum INSTANCE_FORMAT
|
55 |
|
|
{
|
56 |
|
|
StardardForamt = 1,
|
57 |
|
|
NonStardardFormat,
|
58 |
|
|
InstanceOtherFormat
|
59 |
|
|
};
|
60 |
|
|
|
61 |
|
|
struct SEARCH_MODULE_STRUCTURE
|
62 |
|
|
{
|
63 |
|
|
char m_amoduleName[128] ;
|
64 |
|
|
PORT_ANNOUNCE_FORMAT m_eportAnnounceFormat ;
|
65 |
|
|
};
|
66 |
|
|
|
67 |
|
|
struct SEARCH_STRING_STRUCTURE
|
68 |
|
|
{
|
69 |
|
|
SEARCH_TYPE m_etype ;
|
70 |
|
|
// char m_akeyWord[12] ;
|
71 |
|
|
union SEARCH_CONTENT
|
72 |
|
|
{
|
73 |
|
|
int m_nreserved ;
|
74 |
|
|
struct SEARCH_MODULE_STRUCTURE m_imodulest ;
|
75 |
|
|
INSTANCE_FORMAT m_eInstanceFormat ;
|
76 |
|
|
}m_icontent;
|
77 |
|
|
};
|
78 |
|
|
|
79 |
|
|
|
80 |
|
|
|
81 |
|
|
struct SEARCH_INSTANCE_POS_STRUCTURE
|
82 |
|
|
{
|
83 |
|
|
char m_amoduleName[128] ;
|
84 |
|
|
char m_ainstanceName[128] ;
|
85 |
|
|
INSTANCE_FORMAT m_einstanceFormat ;
|
86 |
|
|
int m_nnextRightBracketPos ;
|
87 |
|
|
int m_nstartPos ;
|
88 |
|
|
};
|
89 |
|
|
|
90 |
|
|
struct SEARCH_MODULE_POS_STRUCTURE
|
91 |
|
|
{
|
92 |
|
|
char m_amoduleName[128] ;
|
93 |
|
|
PORT_ANNOUNCE_FORMAT m_eportFormat ;
|
94 |
|
|
int m_nnextRightBracketPos ;
|
95 |
|
|
int m_nlastPortKeyWordPos ;
|
96 |
|
|
int m_nlastRegKeyWordPos ;
|
97 |
|
|
int m_nlastWireKeyWordPos ;
|
98 |
|
|
int m_nendModuleKeyWordPos ;
|
99 |
|
|
};
|
100 |
|
|
|
101 |
|
|
|
102 |
|
|
|
103 |
|
|
EziDebugVlgFile(const QString &filename);
|
104 |
|
|
EziDebugVlgFile(const QString &filename,const QDateTime &datetime,const QStringList &modulelist);
|
105 |
|
|
~EziDebugVlgFile();
|
106 |
|
|
|
107 |
|
|
int deleteScanChain(QStringList &ideletelinecodelist,const QStringList &ideleteblockcodelist,EziDebugScanChain *pchain,EziDebugPrj::OPERATE_TYPE type);
|
108 |
|
|
int addScanChain(INSERT_TYPE type,QMap<QString,EziDebugInstanceTreeItem::SCAN_CHAIN_STRUCTURE*> &chainStructuremap ,EziDebugScanChain* pchain, EziDebugInstanceTreeItem *pitem);
|
109 |
|
|
int skipCommentaryFind(const QString &rangestring,int startpos ,SEARCH_STRING_STRUCTURE &stringtype,int &targetpos);
|
110 |
|
|
int matchingTargetString(const QString &rangestring ,SEARCH_MODULE_POS_STRUCTURE &modulepos ,QMap<QString,SEARCH_INSTANCE_POS_STRUCTURE*> &instancepos) ;
|
111 |
|
|
int findOppositeBracket(const QString &rangestring,int startpos ,SEARCH_STRING_STRUCTURE &stringtype,int &targetpos);
|
112 |
|
|
QString getNoCommentaryString(const QString &rangestring,int &lastcommentaryend,int &nocommontaryflag) ;
|
113 |
|
|
QString replaceCommentaryByBlank(const QString &rangestring);
|
114 |
|
|
int isModuleInstance(const QString &rangestring,const QString &modulename , const QString& instancename ,INSTANCE_FORMAT &type,int &targetpos);
|
115 |
|
|
int isModuleDefinition(const QString &rangestring,const QString &modulename ,PORT_ANNOUNCE_FORMAT &type,int &targetpos);
|
116 |
|
|
int isStringReiteration(const QString &poolstring ,const QString& string);
|
117 |
|
|
QString constructChainRegString(EziDebugModule::RegStructure* reg,int regnum ,int startbit ,int endbit,EziDebugInstanceTreeItem *item);
|
118 |
|
|
|
119 |
|
|
|
120 |
|
|
int deleteEziDebugCode(void);
|
121 |
|
|
friend int EziDebugPrj::saveInfoToLogFile(QDomDocument &idoc, EziDebugPrj::LOG_FILE_INFO* loginfo) ;
|
122 |
|
|
|
123 |
|
|
|
124 |
|
|
int scanFile(EziDebugPrj* prj,EziDebugPrj::SCAN_TYPE type,QList<EziDebugPrj::LOG_FILE_INFO*> &infolist,QList<EziDebugPrj::LOG_FILE_INFO*> &deletedinfolist);
|
125 |
|
|
int checkedEziDebugCodeExist(EziDebugPrj* prj ,QString imoduleName ,QStringList &chainnamelist) ;
|
126 |
|
|
int createUserCoreFile(EziDebugPrj* prj);
|
127 |
|
|
int caculateExpression(QString string) ;
|
128 |
|
|
void addToMacroMap(const QString ¯ostring , const QString ¯ovalue);
|
129 |
|
|
void addToDefParameterMap(const QString &instancename ,const QString ¶meter ,const QString &value);
|
130 |
|
|
const QMap<QString,QString> & getMacroMap(void) const;
|
131 |
|
|
const QMap<QString,QMap<QString,QString> > & getDefParamMap(void) const ;
|
132 |
|
|
private:
|
133 |
|
|
|
134 |
|
|
QMap<QString,QString> m_imacro ; // 保存 defparameter 方便文件 更改时 同时更新 以及 保存到 ezi 文件中
|
135 |
|
|
QMap<QString,QMap<QString,QString> > m_idefparameter ; // 保存 define 方便文件 更改时 同时更新 以及 保存到 ezi 文件中
|
136 |
|
|
|
137 |
|
|
};
|
138 |
|
|
|
139 |
|
|
#endif // EZIDEBUGVLGFILE_H
|