예제 #1
0
    void Options::dumpValue(const std::type_info &type, const std::string &name, std::ostream &output)
    {
        output << name << "=";
        TEST_AND_PRINT(type, name, std::string, output);
        TEST_AND_PRINT(type, name, int, output);
        TEST_AND_PRINT(type, name, float, output);
        TEST_AND_PRINT(type, name, bool, output);

        throw ExceptionTrace("Unknown type");
    }
예제 #2
0
파일: main.cpp 프로젝트: xjtunk/llvm-power
int main(int argc, char *argv[])
{
  unsigned long long now;
  unsigned long long latency;
  FunctionalUnitManager fum;
  fum.readFunctionalUnitFile("fu.txt");
  fum.dumpFunctionalUnits();

  // let's turn off the adder
  now = 100;
#define TEST_AND_PRINT(expr) {latency=expr; printf("%s returned: %lld\n", #expr, latency);printf("Total Power: %f\n", fum.getTotalPower());}
  TEST_AND_PRINT(fum.turnOff(0, 100));
  TEST_AND_PRINT(fum.turnOn(0, 118));
  TEST_AND_PRINT(fum.turnOff(0, 123));
  TEST_AND_PRINT(fum.turnOn(0, 125));
  TEST_AND_PRINT(fum.turnOff(0, 128));
  TEST_AND_PRINT(fum.turnOff(0, 160));
  TEST_AND_PRINT(fum.turnOn(0, 190));
#undef TEST_AND_PRINT
  return 0;
}