ruby: Added error check for openning the ruby config file
authorBrad Beckmann <Brad.Beckmann@amd.com>
Wed, 18 Nov 2009 21:55:58 +0000 (13:55 -0800)
committerBrad Beckmann <Brad.Beckmann@amd.com>
Wed, 18 Nov 2009 21:55:58 +0000 (13:55 -0800)
src/mem/rubymem.cc

index 70077e7da5f5cdcef8f5c983a563a97e4e77201a..aecc0af32fbb5b2687a631e5b1efff9f64eb33a2 100644 (file)
@@ -58,8 +58,15 @@ RubyMemory::RubyMemory(const Params *p)
     ruby_clock = p->clock;
     ruby_phase = p->phase;
 
+    DPRINTF(Ruby, "creating Ruby Memory from file %s\n",
+            p->config_file.c_str());
+
     ifstream config(p->config_file.c_str());
 
+    if (config.good() == false) {
+        fatal("Did not successfully open %s.\n", p->config_file.c_str());
+    }
+
     vector<RubyObjConf> sys_conf;
     while (!config.eof()) {
         char buffer[65536];