summaryrefslogtreecommitdiff
path: root/src/gpuwattch/main.cc
diff options
context:
space:
mode:
authorMahmoud <[email protected]>2020-05-23 20:06:25 -0400
committerMahmoud <[email protected]>2020-05-23 20:06:25 -0400
commitd610fd81420979e956bf37100f7e1c7f1d153831 (patch)
tree392a841f21fec5136339ff36ad9b5c7b1b4cb480 /src/gpuwattch/main.cc
parent6cedd3ef4973f3785757413db89a7c5d0ee2b58b (diff)
parente9e9fcf5957530ecb927aecb5ea238e4b78a4f45 (diff)
Merge branch 'dev' of https://github.com/purdue-aalp/gpgpu-sim_distribution into dev-traces
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);
}