summaryrefslogtreecommitdiff
path: root/src/gpuwattch/main.cc
diff options
context:
space:
mode:
authorMahmoud <[email protected]>2019-09-16 10:47:08 -0400
committerMahmoud <[email protected]>2019-09-16 10:47:08 -0400
commit0785ce7c9471bf1a0c70500eb60cb293fb5aa2fa (patch)
tree15dcaeaf1b1e0e9e3c04af74e72545854793d244 /src/gpuwattch/main.cc
parent688044e9f7a9aef0a63a9610b496baafd886c556 (diff)
parentdba877b45fe11187d56904bbd169f4e0a5ad0586 (diff)
Merge branch 'dev' of https://github.com/purdue-aalp/gpgpu-sim_distribution into dev-private
Diffstat (limited to 'src/gpuwattch/main.cc')
-rw-r--r--src/gpuwattch/main.cc104
1 files changed, 49 insertions, 55 deletions
diff --git a/src/gpuwattch/main.cc b/src/gpuwattch/main.cc
index c370e32..03d3e7c 100644
--- a/src/gpuwattch/main.cc
+++ b/src/gpuwattch/main.cc
@@ -28,74 +28,68 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.”
*
***************************************************************************/
-#include "io.h"
#include <iostream>
-#include "xmlParser.h"
#include "XML_Parse.h"
-#include "processor.h"
#include "globalvar.h"
+#include "io.h"
+#include "processor.h"
#include "version.h"
-
+#include "xmlParser.h"
using namespace std;
-void print_usage(char * argv0);
-
-int main(int argc,char *argv[])
-{
- char * fb ;
- bool infile_specified = false;
- int plevel = 2;
- opt_for_clk =true;
- //cout.precision(10);
- if (argc <= 1 || argv[1] == string("-h") || argv[1] == string("--help"))
- {
- print_usage(argv[0]);
- }
+void print_usage(char *argv0);
- for (int32_t i = 0; i < argc; i++)
- {
- if (argv[i] == string("-infile"))
- {
- infile_specified = true;
- i++;
- fb = argv[ i];
- }
+int main(int argc, char *argv[]) {
+ char *fb;
+ bool infile_specified = false;
+ int plevel = 2;
+ opt_for_clk = true;
+ // cout.precision(10);
+ if (argc <= 1 || argv[1] == string("-h") || argv[1] == string("--help")) {
+ print_usage(argv[0]);
+ }
- if (argv[i] == string("-print_level"))
- {
- i++;
- plevel = atoi(argv[i]);
- }
+ for (int32_t i = 0; i < argc; i++) {
+ if (argv[i] == string("-infile")) {
+ infile_specified = true;
+ i++;
+ fb = argv[i];
+ }
- if (argv[i] == string("-opt_for_clk"))
- {
- i++;
- opt_for_clk = (bool)atoi(argv[i]);
- }
- }
- if (infile_specified == false)
- {
- print_usage(argv[0]);
- }
+ if (argv[i] == string("-print_level")) {
+ i++;
+ plevel = atoi(argv[i]);
+ }
+ if (argv[i] == string("-opt_for_clk")) {
+ i++;
+ opt_for_clk = (bool)atoi(argv[i]);
+ }
+ }
+ if (infile_specified == false) {
+ print_usage(argv[0]);
+ }
- cout<<"McPAT (version "<< VER_MAJOR <<"."<< VER_MINOR
- << " of " << VER_UPDATE << ") is computing the target processor...\n "<<endl;
+ cout << "McPAT (version " << VER_MAJOR << "." << VER_MINOR << " of "
+ << VER_UPDATE << ") is computing the target processor...\n " << endl;
- //parse XML-based interface
- ParseXML *p1= new ParseXML();
- p1->parse(fb);
- Processor proc(p1);
- proc.displayEnergy(2, plevel);
- delete p1;
- return 0;
+ // parse XML-based interface
+ ParseXML *p1 = new ParseXML();
+ p1->parse(fb);
+ Processor proc(p1);
+ proc.displayEnergy(2, plevel);
+ delete p1;
+ return 0;
}
-void print_usage(char * argv0)
-{
- cerr << "How to use McPAT:" << endl;
- cerr << " mcpat -infile <input file name> -print_level < level of details 0~5 > -opt_for_clk < 0 (optimize for ED^2P only)/1 (optimzed for target clock rate)>"<< endl;
- //cerr << " Note:default print level is at processor level, please increase it to see the details" << endl;
- exit(1);
+void print_usage(char *argv0) {
+ cerr << "How to use McPAT:" << endl;
+ cerr << " mcpat -infile <input file name> -print_level < level of details "
+ "0~5 > -opt_for_clk < 0 (optimize for ED^2P only)/1 (optimzed for "
+ "target clock rate)>"
+ << endl;
+ // cerr << " Note:default print level is at processor level, please
+ // increase it to see the details" << endl;
+ exit(1);
}