This repository was archived by the owner on Jul 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathcParse.h
More file actions
61 lines (50 loc) · 1.99 KB
/
cParse.h
File metadata and controls
61 lines (50 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/******************************************************************************
Copyright 2012 Victor Yurkovsky
This file is part of FPGAsm
FPGAsm 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 3 of the License, or
(at your option) any later version.
FPGAsm is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with FPGAsm. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
#pragma once
#include "cParseStream.h"
class cModule;
class cMultiWireBuilder;
class cSub;
/* While parsing wiring, we generate endpoints. */
struct sWireEndpoint {
U16 inst; //index of the instance
U8 pindex; //index of the pin
U8 busid1; //start bus index
U8 busid2; //end bus index
};
class cParse: public cParseStream {
public:
cParse();
~cParse();
void parse(FILE*f);
//data
cModule* topModule; //keep track of the last module - it is top.
protected:
void parseModules();
bool handleInclude(int len);
void validateName(const char* func,int len,cModule* module);
void parsePins(cCollection*pins,int dir);
void parseParamNames(cModule* module);
cDatum* parseParamData(cModule*module,const char* prepend);
sWireEndpoint parseWireEndpoint(cModule* module,int idxInst,cSub*pinst);
void parseWire(cModule* module,int idxInst,cSub*pinst,cMultiWireBuilder* xwire);
void parseMergeQuark(cModule* module);
cSub* parseSub(cModule* module,int len);
void parseMerge(cModule* module,cSub* pinst);
void parsePairs(cModule* module,cSub* sub);
cModule* parseModule();
bool parseQuark();
//data
};