Orion: Replace printf() with fatal()
authorNilay Vaish <nilay@cs.wisc.edu>
Mon, 7 Feb 2011 18:42:23 +0000 (12:42 -0600)
committerNilay Vaish <nilay@cs.wisc.edu>
Mon, 7 Feb 2011 18:42:23 +0000 (12:42 -0600)
The code for Orion 2.0 makes use of printf() at several places where there as
an error in configuration of the model. These have been replaced with fatal().

src/mem/ruby/network/orion/Buffer/BitlineUnit.cc
src/mem/ruby/network/orion/Buffer/OutdrvUnit.cc
src/mem/ruby/network/orion/Buffer/PrechargeUnit.cc
src/mem/ruby/network/orion/Buffer/SRAM.hh
src/mem/ruby/network/orion/Buffer/WordlineUnit.cc

index 05d0ae3821466f5c01c4dca6e7cea1288cb39af0..276e481c9f75a7b8386349d2b88c774b4ee7ee1d 100644 (file)
@@ -33,6 +33,7 @@
  *           Kambiz Samadi (Orion 2.0, UC San Diego)
  */
 
+#include "base/misc.hh"
 #include "mem/ruby/network/orion/Buffer/BitlineUnit.hh"
 #include "mem/ruby/network/orion/Buffer/SRAM.hh"
 #include "mem/ruby/network/orion/TechParameter.hh"
@@ -112,7 +113,7 @@ void BitlineUnit::init()
             //FIXME - no static power?
             break;
         default:
-            printf("error\n");
+            fatal("Error in BITLINE model.\n");
     }
     return;
 }
index 716fc18ee0cdc45e25c54ef1c81773e231b8027e..ce17074912218d25ba1c86887cd7274d7e9bbedf 100644 (file)
@@ -33,6 +33,7 @@
  *           Kambiz Samadi (Orion 2.0, UC San Diego)
  */
 
+#include "base/misc.hh"
 #include "mem/ruby/network/orion/Buffer/OutdrvUnit.hh"
 #include "mem/ruby/network/orion/TechParameter.hh"
 #include "mem/ruby/network/orion/Buffer/SRAM.hh"
@@ -91,7 +92,7 @@ void OutdrvUnit::init()
             m_e_chg_data = 0;
             break;
         default:
-            printf("error\n");
+            fatal("Incorrect OUTDRIVE model.\n");
     }
 
     m_i_static = calc_i_static();
index ac91edb437bad92f702d66d32b8e63f6ebd55dd6..480ebe82ca9771da5767bee0bd579269d1af658b 100644 (file)
@@ -33,6 +33,7 @@
  *           Kambiz Samadi (Orion 2.0, UC San Diego)
  */
 
+#include "base/misc.hh"
 #include "mem/ruby/network/orion/Buffer/PrechargeUnit.hh"
 #include "mem/ruby/network/orion/TechParameter.hh"
 #include "mem/ruby/network/orion/Buffer/SRAM.hh"
@@ -114,7 +115,7 @@ uint32_t PrechargeUnit::calc_num_pre_gate()
         case SINGLE_BITLINE: return 2;
         case EQU_BITLINE:    return 3;
         case SINGLE_OTHER:   return 1;
-        default: printf("error\n"); return 0;
+        default: fatal("Incorrect Precharge Unit model.\n");
     }
 }
 
@@ -125,7 +126,7 @@ uint32_t PrechargeUnit::calc_num_pre_drain()
         case SINGLE_BITLINE: return 1;
         case EQU_BITLINE:    return 2;
         case SINGLE_OTHER:   return 1;
-        default: printf("error\n"); return 0;
+        default: fatal("Incorrect Precharge Unit model.\n");
     }
 }
 
index f0b937963b8215f4acf59c34192ede5c5e90e395..7b3f4669834a0531683cd2f93a9fe1febc4bfd50 100644 (file)
@@ -39,7 +39,6 @@
 #include "mem/ruby/network/orion/Type.hh"
 #include "mem/ruby/network/orion/OrionConfig.hh"
 #include "mem/ruby/network/orion/TechParameter.hh"
-#include <stdio.h>
 
 class OutdrvUnit;
 class AmpUnit;
index bc28444e2cff8d150e482527e412dab1969eb405..3f2cdc34bc8e308f1913d7fe89d4c7f6a2e6941d 100644 (file)
@@ -33,6 +33,7 @@
  *           Kambiz Samadi (Orion 2.0, UC San Diego)
  */
 
+#include "base/misc.hh"
 #include "mem/ruby/network/orion/Buffer/WordlineUnit.hh"
 #include "mem/ruby/network/orion/Buffer/SRAM.hh"
 #include "mem/ruby/network/orion/TechParameter.hh"
@@ -118,7 +119,7 @@ void WordlineUnit::init()
             m_i_static = 0;
             break;
         default:
-            printf("error\n");
+            fatal("Incorrect Wordline model.\n");
     }
     return;
 }