-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
36 lines (29 loc) · 1.28 KB
/
Copy pathmain.cpp
File metadata and controls
36 lines (29 loc) · 1.28 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
/**************************************************************************
* File [ main.cpp ]
* Author [ wlkb83 ]
* Synopsis [ demonstration for the usage of parser.h ]
* Usage [ ./parser [inputfileName] ]
* Date [ 2014/12/28 created ]
/**************************************************************************/
#include "parser.h"
int main(int argc, char **argv)
{
if( argc < 2 ){ cout << "Usage: ./parser [input_file_name]" << endl; return 1; }
AlgParser parser;
// read the file in the first argument
if( ! parser.read( argv[1] ) ) { return 1; }
// show the information of the input
cout << "grid " << parser.gNumHTiles() << " " << parser.gNumVTiles() << endl;
cout << "capacity " << parser.gCapacity() << endl;
cout << "num net " << parser.gNumNets() << endl;
for (int idNet = 0; idNet < parser.gNumNets(); ++idNet){
pair<int, int> posS = parser.gNetStart( idNet );
pair<int, int> posE = parser.gNetEnd( idNet );
cout << idNet << " " << posS.first << " " << posS.second << " "
<< posE.first << " " << posE.second << endl;
}
cout << "----------------------" << endl;
cout << "-- Complete parsing --" << endl;
cout << "----------------------" << endl;
return 0;
}