This repository has been 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
/
cDevice.h
57 lines (49 loc) · 1.98 KB
/
cDevice.h
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
/******************************************************************************
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/>.
******************************************************************************/
/******************************************************************************
A device contains
- a database of named cPrimDefs
******************************************************************************/
class cProto;
class cDevice{
//DATA
private:
cCollection protos;
int lineno;
char* buf;
FILE* f;
char* designator; //device name and speed
//CODE
public:
cDevice();
~cDevice();
void initialize();
void parse_xdlrc(const char* fname);
char* place(const char* key);
void addProto(char* key,int len,cProto* proto); //add a prim or module
cProto* findProto(char*str,int len); //find a prim or module
int idxFindProto(char*str,int len); //find index or -1
void listProtos();
const char* tileFor( char* primsite); //like SLICE_XY or IOB
const char* getDesignator(); //device name and speed grade for output
private:
bool readline();
void parse_tile(char* buf);
void parse_defs(char* buf);
cCollection sites; //map sitename like SLICE_X?Y? to tilename R?C?
//GHashTable *htPrims; // map primnames like IOB to cPrim objects
void errorIn(const char* function);
void error(U32 xerrno);
};