示例#1
0
   /**
    * Load a shared library module
    *
    * @param {string} name, with path, to our module.
    */
   Handle<Value> Module::loadDsoModule(string filename)
   {
      HandleScope scope;
      
      // Create our exports object to use with the module.
      Local<Object> exports = Object::New();

      // Open our shared module.
      void *handle = dlopen(filename.c_str(), RTLD_LAZY);
      
      // If we can't open it, throw an error
      if(handle == NULL)
      {
         string loadError = "Failed to load module";
         loadError += ": " + filename;
         
         scope.Close(THROW_ERROR(loadError.c_str()));
      }
         

      // Setup our init method (init method is standard for all modules)
      void *initMethod = dlsym(handle, "CoreInit");
      
      // Fail if we have no init method.
      if(initMethod == NULL)
      {
         dlclose(handle);
         printf("\nError loading module, could not locate CoreInit method.\n");
         exit(0);
      }

      // Grab our Init method, formally and execute it passing it our exports object.
      void (*moduleFunction)(Handle<Object> exports) = (CoreModule)(initMethod);
      moduleFunction(exports);

      // Return our exports object with loaded module methods/classes.
      return scope.Close(exports);
   }
示例#2
0
void cg_edge_writer::operator()(std::ostream& out, const EdgeDescriptor& e) const
{
   const cg_edge_info * edge_info = Cget_edge_info<cg_edge_info>(e, *g);
   bool is_critical = false;
   if (edge_info) is_critical = edge_info->is_critical;
   if (is_critical)
      out << "[color=red, ";
   else if (DATA_SELECTOR & g->GetSelector(e))
      out << "[color=blue, ";
   else if (CLOCK_SELECTOR & g->GetSelector(e))
      out << "[color=yellow, ";
   else if (CHANNEL_SELECTOR & g->GetSelector(e))
      out << "[color=green, ";
   else
      THROW_ERROR(std::string("InconsistentDataStructure"));
   if ( edge_info )
   {
      out << "label=\"";
      edge_info->print(out);
      out << "\"";
   }
   out << "]";
}
示例#3
0
文件: osal.cpp 项目: antonte/coddle
void makeDir(const std::string &dir)
{
  std::istringstream strm(dir);
  std::string subDir;
  std::string tmp;
  auto dirCreated{false};
  while (std::getline(strm, tmp, '/'))
  {
    subDir += tmp;
    subDir += "/";
    auto res = mkdir(subDir.c_str(), 0777);
    if (res != 0)
    {
      auto err = errno;
      if (err != EEXIST)
        THROW_ERROR("makeDir(" << dir << "): " << strerror(err));
    }
    else
      dirCreated = true;
  }
  if (dirCreated)
    std::cout << "Make directory: " << dir << "\n";
}
示例#4
0
文件: osal.cpp 项目: antonte/coddle
void makeDir(const std::string &dir)
{
  std::cout << "Make directory: " << dir << "\n";
  std::istringstream strm(dir);
  std::string subDir;
  std::string tmp;
  auto dirCreated{false};
  while (std::getline(strm, tmp, '/'))
  {
    subDir += tmp;
    auto res = CreateDirectory(subDir.c_str(), nullptr);
    if (!res)
    {
      if (GetLastError() == ERROR_PATH_NOT_FOUND)
        THROW_ERROR("makeDir(" << dir << "): path not found");
    }
    else
      dirCreated = true;
    subDir += "\\";
  }
  if (dirCreated)
    std::cout << "Make directory: " << dir << "\n";
}
Structure *RbClassFactory::CreateStructure(std::string strType, bool bThrowError)
{
	Structure *lpStructure=NULL;

try
{
	strType = Std_ToUpper(Std_Trim(strType));

	if(strType == "BASIC")
		lpStructure = new RbOrganism;
	else if(strType == "ORGANISM")
		lpStructure = new RbOrganism;
	else if(strType == "STRUCTURE")
		lpStructure = new RbStructure;
	else
	{
		lpStructure = NULL;
		if(bThrowError)
			THROW_PARAM_ERROR(Al_Err_lInvalidOrganismType, Al_Err_strInvalidOrganismType, "OrganismType", strType);
	}

	return lpStructure;
}
catch(CStdErrorInfo oError)
{
	if(lpStructure) delete lpStructure;
	RELAY_ERROR(oError); 
	return NULL;
}
catch(...)
{
	if(lpStructure) delete lpStructure;
	THROW_ERROR(Std_Err_lUnspecifiedError, Std_Err_strUnspecifiedError);
	return NULL;
}
}
示例#6
0
ASICBackendFlow::ASICBackendFlow(const ParameterConstRef _Param, const std::string & _flow_name, const target_managerRef _target) :
   BackendFlow(_Param, _flow_name, _target)
{
   PRINT_OUT_MEX(OUTPUT_LEVEL_VERBOSE, output_level, " .:: Creating ASIC Backend Flow ::.");

   default_data["Nangate"] =
      #include "Nangate.data"
         ;

   XMLDomParserRef parser;
   if (Param->isOption(OPT_target_device_script))
   {
      std::string xml_file_path = Param->getOption<std::string>(OPT_target_device_script);
      if (!boost::filesystem::exists(xml_file_path)) THROW_ERROR("File \"" + xml_file_path + "\" does not exist!");
      PRINT_OUT_MEX(OUTPUT_LEVEL_VERBOSE, output_level, "Importing scripts from file: " + xml_file_path);
      parser = XMLDomParserRef(new XMLDomParser(xml_file_path));
   }
   else
   {
      PRINT_OUT_MEX(OUTPUT_LEVEL_VERBOSE, output_level, "Importing default scripts for target technology: \"Nangate\"");
      parser = XMLDomParserRef(new XMLDomParser("Nangate", default_data["Nangate"]));
   }
   parse_flow(parser);
}
SimulationThread *SimulationMgr::CreateSimulation(std::string strSimFile, bool bForceNoWindows)
{
	SimulationThread *lpThread = NULL;
	
	try
	{
		lpThread = new SimulationThread();
		lpThread->StartSimulation(strSimFile, bForceNoWindows);
		m_arySimThreads.Add(lpThread);
		return lpThread;
	}
	catch(CStdErrorInfo oError)
	{
		if(lpThread) delete lpThread;
		RELAY_ERROR(oError);
		return NULL;
	}
	catch(...)
	{
		if(lpThread) delete lpThread;
		THROW_ERROR(Al_Err_lUnknownError, Al_Err_strUnknownError);
		return NULL;
	}
}
SynapseType *ClassFactory::CreateSynapseType(std::string strType, bool bThrowError)
{
	SynapseType *lpSynapseType=NULL;

try
{
	strType = Std_ToUpper(Std_Trim(strType));

	if(strType == "SPIKINGCHEMICAL")
		lpSynapseType = new SpikingChemicalSynapse;
	else if(strType == "NONSPIKINGCHEMICAL")
		lpSynapseType = new NonSpikingChemicalSynapse;
	else if(strType == "ELECTRICAL")
		lpSynapseType = new ElectricalSynapse;
	else
	{
		lpSynapseType = NULL;
		if(bThrowError)
			THROW_PARAM_ERROR(Rn_Err_lInvalidSynapseType, Rn_Err_strInvalidSynapseType, "SynapseType", strType);
	}

	return lpSynapseType;
}
catch(CStdErrorInfo oError)
{
	if(lpSynapseType) delete lpSynapseType;
	RELAY_ERROR(oError); 
	return NULL;
}
catch(...)
{
	if(lpSynapseType) delete lpSynapseType;
	THROW_ERROR(Std_Err_lUnspecifiedError, Std_Err_strUnspecifiedError);
	return NULL;
}
}
Adapter *PhysicsNeuralModule::LoadAdapter(CStdXml &oXml)
{
    Adapter *lpAdapter = NULL;
    std::string strModuleName, strType;

    try
    {
        oXml.IntoElem(); //Into Child Element
        strModuleName = oXml.GetChildString("ModuleName", "");
        strType = oXml.GetChildString("Type");
        oXml.OutOfElem(); //OutOf Child Element

        lpAdapter = dynamic_cast<Adapter *>(m_lpSim->CreateObject(strModuleName, "Adapter", strType));
        if(!lpAdapter)
            THROW_TEXT_ERROR(Al_Err_lConvertingClassToType, Al_Err_strConvertingClassToType, "Adapter");

        lpAdapter->SetSystemPointers(m_lpSim, m_lpStructure, NULL, NULL, true);
        lpAdapter->Load(oXml);

        m_aryAdapters.Add(lpAdapter);

        return lpAdapter;
    }
    catch(CStdErrorInfo oError)
    {
        if(lpAdapter) delete lpAdapter;
        RELAY_ERROR(oError);
        return NULL;
    }
    catch(...)
    {
        if(lpAdapter) delete lpAdapter;
        THROW_ERROR(Std_Err_lUnspecifiedError, Std_Err_strUnspecifiedError);
        return NULL;
    }
}
/**
\brief	Loads a data column.

\author	dcofer
\date	3/18/2011

\param [in,out]	oXml	The xml to use when loading the data column. 

\return	Pointer to the new DataColumn.
\exception Throws an exception if there is an error creating or loading the DataColumn.
**/
DataColumn *DataChart::LoadDataColumn(CStdXml &oXml)
{
	DataColumn *lpColumn=NULL;
	std::string strModuleName, strType;

try
{
	oXml.IntoElem();  //Into Column Element
	strModuleName = oXml.GetChildString("ModuleName", "");
	strType = oXml.GetChildString("Type");
	oXml.OutOfElem();  //OutOf Column Element

	lpColumn = dynamic_cast<DataColumn *>(m_lpSim->CreateObject(strModuleName, "DataColumn", strType));
	if(!lpColumn)
		THROW_TEXT_ERROR(Al_Err_lConvertingClassToType, Al_Err_strConvertingClassToType, "DataColumn");

	lpColumn->SetSystemPointers(m_lpSim, NULL, NULL, NULL, this, true);
	lpColumn->Load(oXml);

	AddColumn(lpColumn);

	return lpColumn;
}
catch(CStdErrorInfo oError)
{
	if(lpColumn) delete lpColumn;
	RELAY_ERROR(oError);
	return NULL;
}
catch(...)
{
	if(lpColumn) delete lpColumn;
	THROW_ERROR(Std_Err_lUnspecifiedError, Std_Err_strUnspecifiedError);
	return NULL;
}
}
示例#11
0
void FPGA_device::load_devices(const target_deviceRef device)
{
   ///map between the default device string and the corresponding configuration stream
   std::map<std::string, std::string> default_device_data;
   /// Load default device options
   default_device_data["xc4vlx100-10ff1513"] =
      #include "xc4vlx100-10ff1513.data"
         ;
   default_device_data["xc5vlx50-3ff1153"] =
      #include "xc5vlx50-3ff1153.data"
         ;
   default_device_data["xc5vlx110t-1ff1136"] =
      #include "xc5vlx110t-1ff1136.data"
         ;
   default_device_data["xc5vlx330t-2ff1738"] =
      #include "xc5vlx330t-2ff1738.data"
         ;
   default_device_data["xc6vlx240t-1ff1156"] =
      #include "xc6vlx240t-1ff1156.data"
         ;
   default_device_data["xc7z020-1clg484"] =
      #include "xc7z020-1clg484.data"
         ;
   default_device_data["xc7z020-1clg484-VVD"] =
      #include "xc7z020-1clg484-VVD.data"
         ;
   default_device_data["xc7z020-1clg484-YOSYS-VVD"] =
      #include "xc7z020-1clg484-YOSYS-VVD.data"
         ;
   default_device_data["xc7vx485t-2ffg1761-VVD"] =
      #include "xc7vx485t-2ffg1761-VVD.data"
         ;
   default_device_data["xc7vx690t-3ffg1930-VVD"] =
      #include "xc7vx690t-3ffg1930-VVD.data"
         ;
   default_device_data["xc7vx330t-1ffg1157"] =
      #include "xc7vx330t-1ffg1157.data"
         ;
   default_device_data["xc7a100t-1csg324-VVD"] =
      #include "xc7a100t-1csg324-VVD.data"
         ;

#if (0 && HAVE_EXPERIMENTAL)
   default_device_data["xc3s1500l-4fg676"] =
      #include "Spartan-3-xc3s1500l-4fg676.data"
         ;
#endif


   default_device_data["EP2C70F896C6"] =
      #include "EP2C70F896C6.data"
         ;
   default_device_data["EP2C70F896C6-R"] =
      #include "EP2C70F896C6-R.data"
         ;
   default_device_data["5CSEMA5F31C6"] =
      #include "5CSEMA5F31C6.data"
         ;
   default_device_data["EP4SGX530KH40C2"] =
        #include "EP4SGX530KH40C2.data"
         ;
   default_device_data["5SGXEA7N2F45C1"] =
      #include "5SGXEA7N2F45C1.data"
         ;
   default_device_data["LFE335EA8FN484C"] =
      #include "LFE335EA8FN484C.data"
         ;

   unsigned int output_level = Param->getOption<unsigned int>(OPT_output_level);

   try
   {
      PRINT_OUT_MEX(OUTPUT_LEVEL_VERBOSE, output_level, "Available devices:");
      for (std::map<std::string, std::string>::const_iterator d = default_device_data.begin(); d != default_device_data.end(); d++)
      {
         PRINT_OUT_MEX(OUTPUT_LEVEL_VERBOSE, output_level, " - " + d->first);
      }


      const CustomSet<XMLDomParserRef> parsers = [&] () -> CustomSet<XMLDomParserRef>
      {
         CustomSet<XMLDomParserRef> ret;
         if (Param->isOption(OPT_target_device_file))
         {
            const auto file_devices = Param->getOption<const std::list<std::string> >(OPT_target_device_file);
            for(const auto file_device : file_devices)
            {
               PRINT_OUT_MEX(OUTPUT_LEVEL_MINIMUM, output_level, "Imported user data from file " + file_device);
               ret.insert(XMLDomParserRef(new XMLDomParser(file_device)));
            }
         }
         else
         {
            std::string device_string = Param->getOption<std::string>(OPT_device_string);

            if (default_device_data.find(device_string) != default_device_data.end())
            {
               INDENT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "---Loading " + device_string);
               ret.insert(XMLDomParserRef(new XMLDomParser(device_string, default_device_data[device_string])));
            }
            else
               THROW_ERROR("Target device not supported: " + device_string);
         }
         return ret;
      }();

      for(const auto parser : parsers)
      {
         parser->Exec();
         if (parser and *parser)
         {
            const xml_element* node = parser->get_document()->get_root_node(); //deleted by DomParser.
            xload(device, node);
         }
      }

      return;
   }
   catch (const char * msg)
   {
      std::cerr << msg << std::endl;
   }
   catch (const std::string & msg)
   {
      std::cerr << msg << std::endl;
   }
   catch (const std::exception& ex)
   {
      std::cout << "Exception caught: " << ex.what() << std::endl;
   }
   catch ( ... )
   {
      std::cerr << "unknown exception" << std::endl;
   }
   THROW_ERROR("Error during XML parsing of device files");

}
示例#12
0
Handle<Value> MSRect::New(const Arguments &args) {
  HandleScope scope;
  MSRect *obj;
  double t;

  if (!args.IsConstructCall()) {
    return ThrowException(String::New("Cannot call constructor as function, you need to use 'new' keyword"));
  }

  if (args[0]->IsExternal()) {
    Local<External> ext = Local<External>::Cast(args[0]);
    void* ptr = ext->Value();
    obj = static_cast<MSRect*>(ptr);
    obj->Wrap(args.This());
    return args.This();
  }

  rectObj *rect = (rectObj *)calloc(1, sizeof(rectObj));
  if(!rect) {
    return args.This();
  }

  if (args.Length() == 0) {
    rect->minx = -1;
    rect->miny = -1;
    rect->maxx = -1;
    rect->maxy = -1;
  } else if (args.Length() == 1) {
    Local<Object> argObj;
    if (!args[0]->IsObject()) {
      THROW_ERROR(TypeError, "single argument constructor requires a Rect object");
    }

    argObj = args[0]->ToObject();

    if (argObj->IsNull() || argObj->IsUndefined() || !MSRect::constructor->HasInstance(argObj)) {
      THROW_ERROR(TypeError, "single argument to Rect constructor must be a Rect object");
    }

    MSRect *inRect = ObjectWrap::Unwrap<MSRect>(argObj);

    memcpy(rect, inRect->this_, sizeof(rectObj));

  } else if (args.Length() == 4) {
    REQ_DOUBLE_ARG(0, minx);
    REQ_DOUBLE_ARG(1, miny);
    REQ_DOUBLE_ARG(2, maxx);
    REQ_DOUBLE_ARG(3, maxy);
    /* coerce correct extent */
    if (minx > maxx) {
      t = maxx;
      maxx = minx;
      minx = t;
    }
    if (miny > maxy) {
      t = maxy;
      maxy = miny;
      miny = t;
    }
    rect->minx = minx;
    rect->miny = miny;
    rect->maxx = maxx;
    rect->maxy = maxy;
  } else {
    THROW_ERROR(Error, "Rect objects take 0, 1 or 4 arguments.");
  }

  obj = new MSRect(rect);
  obj->owner = true;
  obj->Wrap(args.This());
  return args.This();
}
示例#13
0
/// Returns the start address of the program being loaded (the lowest address of
/// the program).
unsigned trap::ExecLoader::get_data_start() {
  if (this->exec_image == NULL && !this->plain_file) {
    THROW_ERROR("Binary parser was not created correctly.");
  }
  return this->data_start;
} // ExecLoader::get_data_start()
示例#14
0
void IC_device::load_devices(const target_deviceRef device)
{
   /// Load default resources
   const char * builtin_technology = {
   #include "Nangate.data"
   };

   int output_level = Param->getOption<int>(OPT_output_level);

   ///creating the datastructure representing the target technology
   target = target_technology::create_technology(target_technology::CMOS, Param);

   try
   {
      XMLDomParser parser("builtin_technology", builtin_technology);
      parser.Exec();
      if (parser)
      {
         //Walk the tree:
         const xml_element* node = parser.get_document()->get_root_node(); //deleted by DomParser.
         xload(device, node);
      }

      ///update with specified device information
      if (Param->isOption(OPT_target_device_file))
      {
         const auto file_name = Param->getOption<std::string>(OPT_target_device_file);
         if (!boost::filesystem::exists(file_name))
         {
            THROW_ERROR("Device information file " + file_name + " does not exist!");
         }

         PRINT_OUT_MEX(OUTPUT_LEVEL_MINIMUM, output_level, "(target device) Loading information about the target device from file \"" + file_name + "\"");
         XMLDomParser parser1(file_name);
         parser1.Exec();
         if (parser1)
         {
            //Walk the tree:
            const xml_element* node = parser1.get_document()->get_root_node(); //deleted by DomParser.
            xload(device, node);
         }
      }

   }
   catch (const char * msg)
   {
      std::cerr << msg << std::endl;
      THROW_ERROR("Error during parsing of technology file");
   }
   catch (const std::string & msg)
   {
      std::cerr << msg << std::endl;
      THROW_ERROR("Error during parsing of technology file");
   }
   catch (const std::exception& ex)
   {
      std::cout << "Exception caught: " << ex.what() << std::endl;
      THROW_ERROR("Error during parsing of technology file");
   }
   catch ( ... )
   {
      std::cerr << "unknown exception" << std::endl;
      THROW_ERROR("Error during parsing of technology file");
   }
}
示例#15
0
//---
//Copies sizeBytes from src to dst, using either a copy to a staging buffer or a staged pin-in-place strategy
//IN: dst - dest pointer - must be accessible from agent this buffer is associated with (via _hsaAgent).
//IN: src - src pointer for copy.  Must be accessible from host CPU.
//IN: waitFor - hsaSignal to wait for - the copy will begin only when the specified dependency is resolved.  May be NULL indicating no dependency.
void UnpinnedCopyEngine::CopyPeerToPeer(void* dst, hsa_agent_t dstAgent, const void* src, hsa_agent_t srcAgent, size_t sizeBytes, hsa_signal_t *waitFor)
{
    std::lock_guard<std::mutex> l (_copyLock);

    const char *srcp0 = static_cast<const char*> (src);
    char *dstp1 = static_cast<char*> (dst);

    for (int i=0; i<_numBuffers; i++) {
        hsa_signal_store_relaxed(_completionSignal[i], 0);
        hsa_signal_store_relaxed(_completionSignal2[i], 0);
    }

    if (sizeBytes >= UINT64_MAX/2) {
        THROW_ERROR (hipErrorInvalidValue, HSA_STATUS_ERROR_INVALID_ARGUMENT);
    }

    int64_t bytesRemaining0 = sizeBytes; // bytes to copy from dest into staging buffer.
    int64_t bytesRemaining1 = sizeBytes; // bytes to copy from staging buffer into final dest

    while (bytesRemaining1 > 0) {
        // First launch the async copies to copy from dest to host
        for (int bufferIndex = 0; (bytesRemaining0>0) && (bufferIndex < _numBuffers);  bytesRemaining0 -= _bufferSize, bufferIndex++) {

            size_t theseBytes = (bytesRemaining0 > _bufferSize) ? _bufferSize : bytesRemaining0;

            // Wait to make sure we are not overwriting a buffer before it has been drained:
            hsa_signal_wait_acquire(_completionSignal2[bufferIndex], HSA_SIGNAL_CONDITION_LT, 1, UINT64_MAX, HSA_WAIT_STATE_ACTIVE);

            tprintf (DB_COPY2, "P2P: bytesRemaining0=%zu  async_copy %zu bytes src:%p to staging:%p\n", bytesRemaining0, theseBytes, srcp0, _pinnedStagingBuffer[bufferIndex]);
            hsa_signal_store_relaxed(_completionSignal[bufferIndex], 1);
            hsa_status_t hsa_status = hsa_amd_memory_async_copy(_pinnedStagingBuffer[bufferIndex], _cpuAgent, srcp0, srcAgent, theseBytes, waitFor ? 1:0, waitFor, _completionSignal[bufferIndex]);
            if (hsa_status != HSA_STATUS_SUCCESS) {
                THROW_ERROR (hipErrorRuntimeMemory, hsa_status);
            }

            srcp0 += theseBytes;


            // Assume subsequent commands are dependent on previous and don't need dependency after first copy submitted, HIP_ONESHOT_COPY_DEP=1
            waitFor = NULL;
        }

        // Now unload the staging buffers:
        for (int bufferIndex=0; (bytesRemaining1>0) && (bufferIndex < _numBuffers);  bytesRemaining1 -= _bufferSize, bufferIndex++) {

            size_t theseBytes = (bytesRemaining1 > _bufferSize) ? _bufferSize : bytesRemaining1;

            tprintf (DB_COPY2, "P2P: wait_completion[%d] bytesRemaining=%zu\n", bufferIndex, bytesRemaining1);

            bool hostWait = 0; // TODO - remove me

            if (hostWait) {
                // Host-side wait, should not be necessary:
                hsa_signal_wait_acquire(_completionSignal[bufferIndex], HSA_SIGNAL_CONDITION_LT, 1, UINT64_MAX, HSA_WAIT_STATE_ACTIVE);
            }

            tprintf (DB_COPY2, "P2P: bytesRemaining1=%zu copy %zu bytes stagingBuf[%d]:%p to device:%p\n", bytesRemaining1, theseBytes, bufferIndex, _pinnedStagingBuffer[bufferIndex], dstp1);
            hsa_signal_store_relaxed(_completionSignal2[bufferIndex], 1);
            hsa_status_t hsa_status = hsa_amd_memory_async_copy(dstp1, dstAgent, _pinnedStagingBuffer[bufferIndex], _cpuAgent /*not used*/, theseBytes,
                                      hostWait ? 0:1, hostWait ? NULL : &_completionSignal[bufferIndex],
                                      _completionSignal2[bufferIndex]);

            dstp1 += theseBytes;
        }
    }


    // Wait for the staging-buffer to dest copies to complete:
    for (int i=0; i<_numBuffers; i++) {
        hsa_signal_wait_acquire(_completionSignal2[i], HSA_SIGNAL_CONDITION_LT, 1, UINT64_MAX, HSA_WAIT_STATE_ACTIVE);
    }
}
示例#16
0
文件: ABIIf.hpp 项目: socrocket/core
 virtual regWidth readFP() const throw() {
     THROW_ERROR("The FP register is not defined in the processor ABI");
     return 0;
 }
示例#17
0
int main() {
  std::string dll_name = "sniffer.dll";
  std::string exe_name = "process.exe";

  if(!CheckWindowsVersion()) {
    THROW_ERROR("The system does not meet the requirements (should be XP or later)!");
    ps::Error::Print();
    system("PAUSE");
    return EXIT_FAILURE;
  }

  DWORD process_id = GetProcessIdFromExe(exe_name);
  if(process_id == 0) {
    THROW_ERROR("Could not find process if by the name of the executable!");
    ps::Error::Print();
    system("PAUSE");
    return EXIT_FAILURE;
  }
  printf("Process id: %u\n", process_id);

  HMODULE module = NULL;
  if(!InjectDLL(process_id, dll_name, &module)) {
    THROW_ERROR("DLL injection failed!\n");
    ps::Error::Print();
    system("PAUSE");
    return EXIT_FAILURE;
  }

  printf("DLL successfully injected!\n");

  ps::Pipe client;
  bool rv = client.InitializeClient("packet_sniffer_pipe_42");
  CHECK(rv == true);

  rv = client.Connect();
  CHECK(rv == true);

  printf("Connected to server via pipe!\n");

  std::vector<char> message;
  rv = client.ReadMessage(&message);
  if(rv == false) {
    ps::Error::Print();
    system("PAUSE");
    return EXIT_FAILURE;
  }
  //printf("%u\n", message.size());
  CHECK(message.size() == 1);
  CHECK(message[0] == 0);

  /*client.ReadMessage(&message);
  std::string packet(message.begin(), message.end());
  printf("Received: '%s'\n", packet.c_str());*/

  rv = client.FinalizeClient();
  CHECK(rv == true);

  system("PAUSE");

  if(!EjectDLL(process_id, module)) {
    THROW_ERROR("DLL ejection failed!\n");
    ps::Error::Print();
    system("PAUSE");
    return EXIT_FAILURE;
  }

  printf("DLL successfully ejected!\n");

  system("PAUSE");
  return EXIT_SUCCESS;
}
示例#18
0
 //Method used to directly write a word into memory; it is mainly used to load the
 //application program into memory
 inline void write_byte_dbg(const unsigned int & address, const unsigned char & datum) throw(){
     if(address >= this->size){
         THROW_ERROR("Address " << std::hex << std::showbase << address << " out of memory");
     }
     this->mem[address] = datum;
 }
/**
\brief	Gets a synapse by its index in the array.

\author	dcofer
\date	3/29/2011

\param	iIndex	Zero-based index of the synaspe to return. 

\return	null if it fails, else the synapse.
**/
Synapse *Neuron::GetSynapse(int iIndex)
{
	if( iIndex<0 || iIndex>=m_arySynapses.GetSize() ) 
		THROW_ERROR(Std_Err_lInvalidIndex, Std_Err_strInvalidIndex);
	return m_arySynapses[iIndex];
}
void Neuron::AddSynapse(Synapse *lpSynapse)
{
	if(!lpSynapse) 
		THROW_ERROR(Nl_Err_lSynapseToAddNull, Nl_Err_strSynapseToAddNull);
	m_arySynapses.Add(lpSynapse);
}
/**
\brief	Removes the synapse described by iIndex.

\author	dcofer
\date	3/29/2011

\param	iIndex	Zero-based index of the synapse in the array. 
**/
void Neuron::RemoveSynapse(int iIndex)
{
	if( iIndex<0 || iIndex>=m_arySynapses.GetSize() ) 
		THROW_ERROR(Std_Err_lInvalidIndex, Std_Err_strInvalidIndex);
	m_arySynapses.RemoveAt(iIndex);
}
示例#22
0
void VIVADO_xsim_wrapper::CheckExecution()
{
#if !HAVE_XILINX_VIVADO
   THROW_ERROR("Xilinx tools not correctly configured!");
#endif
}
示例#23
0
bool PragmaParser::recognize_omp_pragma(std::string & line)
{
   INDENT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "---Looking for openmp pragma in " + line);
   std::string original_line = line;
   const pragma_manager::OmpPragmaType omp_pragma_type = pragma_manager::GetOmpPragmaType(line);
   if(omp_pragma_type == pragma_manager::OMP_UNKNOWN)
      THROW_ERROR("Unsupported openmp directive in line " + line);
   bool single_line_pragma = false;
   INDENT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "---Found directive " + pragma_manager::omp_directive_keywords[omp_pragma_type]);
   switch(omp_pragma_type)
   {
      case(pragma_manager::OMP_ATOMIC):
      case(pragma_manager::OMP_FOR):
      case(pragma_manager::OMP_PARALLEL_FOR):
      case(pragma_manager::OMP_SIMD):
      case(pragma_manager::OMP_TARGET):
         {
            search_function = true;
            single_line_pragma = true;
            line = std::string(STR_CST_pragma_function_single_line_one_argument) + "(\"" STR_CST_pragma_keyword_omp "\", ";
            break;
         }
      case(pragma_manager::OMP_DECLARE_SIMD):
         {
            FunctionPragmas.insert(line);
            search_function = true;
            return true;
         }
      case(pragma_manager::OMP_BARRIER):
      case(pragma_manager::OMP_CRITICAL):
      case(pragma_manager::OMP_PARALLEL):
      case(pragma_manager::OMP_PARALLEL_SECTIONS):
      case(pragma_manager::OMP_SECTION):
      case(pragma_manager::OMP_SECTIONS):
      case(pragma_manager::OMP_TASK):
         {
            line = std::string(STR_CST_pragma_function_start) + "(\"" STR_CST_pragma_keyword_omp "\", ";
            break;
         }
      case(pragma_manager::OMP_UNKNOWN):
         {
            THROW_UNREACHABLE("Unsupported openmp directive in line " + line);
            break;
         }
      default:
         {
            THROW_UNREACHABLE("");
         }
   }
   const std::string omp_pragma_directive = pragma_manager::omp_directive_keywords[omp_pragma_type];
   line += "\"" + omp_pragma_directive + "\"";
#if 0
   std::string::size_type notwhite = original_line.find(omp_pragma_directive);
#endif
   original_line.erase(0, original_line.find(omp_pragma_directive) + omp_pragma_directive.size());
   if(not single_line_pragma)
   {
      FloatingPragmas.push_back(STR_CST_pragma_keyword_omp"\", \"" + omp_pragma_directive + (original_line.size() ?  "\", \"" + original_line.substr(1, original_line.size() - 1) : ""));
   }

   if (original_line.size())
      line += ", \"" + original_line.substr(1, original_line.size() - 1) + "\"";
   line += ");";
   return true;
}
示例#24
0
int main(int argc, char *argv[])
{
   // Program name

   ParameterRef parameters;

   try
   {
      // ---------- General options ------------ //
      // Synthesis cpu time
      long total_time;
      START_TIME(total_time);
      // General options register

      // ---------- Initialization ------------ //

      // ---------- Parameter parsing ------------ //
      long cpu_time;
      START_TIME(cpu_time);
      parameters = ParameterRef(new EucalyptusParameter(argv[0], argc, argv));

      switch(parameters->Exec())
      {
         case PARAMETER_NOTPARSED:
         {
            exit_code = PARAMETER_NOTPARSED;
            throw "Bad Parameters format";
         }
         case EXIT_SUCCESS:
         {
            if(not (parameters->getOption<bool>(OPT_no_clean)))
            {
               boost::filesystem::remove_all(parameters->getOption<std::string>(OPT_output_temporary_directory));
            }
            return EXIT_SUCCESS;
         }
         case PARAMETER_PARSED:
         {
            exit_code = EXIT_FAILURE;
            break;
         }
         default:
         {
            THROW_ERROR("Bad Parameters parsing");
         }
      }

      int output_level = parameters->getOption<int>(OPT_output_level);
      STOP_TIME(cpu_time);
      if(output_level >= OUTPUT_LEVEL_MINIMUM)
         parameters->PrintFullHeader(std::cerr);

      /// eucalyptus does not perform a clock constrained synthesis
      if(!parameters->isOption(OPT_clock_period))
         parameters->setOption(OPT_clock_period, 0.0);

      // Technology library manager
      technology_managerRef TM = technology_managerRef(new technology_manager(parameters));


      ///creating the datastructure representing the target device
      const auto target_device = static_cast<TargetDevice_Type>(parameters->getOption<unsigned int>(OPT_target_device_type));
      target_deviceRef device = target_device::create_device(target_device, parameters, TM);
      device->set_parameter("clock_period", parameters->getOption<double>(OPT_clock_period));
      target_managerRef target = target_managerRef(new target_manager(parameters, TM, device));

      const DesignFlowManagerRef design_flow_manager(new DesignFlowManager(parameters));
      const DesignFlowGraphConstRef design_flow_graph = design_flow_manager->CGetDesignFlowGraph();

      const DesignFlowStepFactoryConstRef technology_flow_step_factory(new TechnologyFlowStepFactory(TM, device, design_flow_manager, parameters));
      design_flow_manager->RegisterFactory(technology_flow_step_factory);

      const std::string technology_flow_signature = TechnologyFlowStep::ComputeSignature(TechnologyFlowStep_Type::LOAD_TECHNOLOGY);
      const vertex technology_flow_step = design_flow_manager->GetDesignFlowStep(technology_flow_signature);
      const DesignFlowStepRef technology_design_flow_step = technology_flow_step ? design_flow_graph->CGetDesignFlowStepInfo(technology_flow_step)->design_flow_step : GetPointer<const TechnologyFlowStepFactory>(technology_flow_step_factory)->CreateTechnologyFlowStep(TechnologyFlowStep_Type::LOAD_TECHNOLOGY);
      design_flow_manager->AddStep(technology_design_flow_step);


#if HAVE_XILINX || HAVE_ALTERA || HAVE_LATTICE || HAVE_DESIGN_COMPILER
      if(parameters->isOption(OPT_component_name))
      {
         const DesignFlowStepRef design_flow_step(new RTLCharacterization(target, parameters->getOption<std::string>(OPT_component_name), design_flow_manager, parameters));
         design_flow_manager->AddStep(design_flow_step);
      }
#endif
      design_flow_manager->Exec();

#if HAVE_EXPERIMENTAL
      if (parameters->isOption(OPT_import_ip_core))
      {
         START_TIME(cpu_time);
         std::string core_hdl = parameters->getOption<std::string>(OPT_import_ip_core);
         core_generationRef core_gen = core_generationRef(new core_generation(parameters));
         core_gen->convert_to_XML(core_hdl, device->get_type());
         STOP_TIME(cpu_time);
         PRINT_OUT_MEX(DEBUG_LEVEL_MINIMUM, output_level, " ==== Core generation performed in " + print_cpu_time(cpu_time) + " seconds; ====\n");
      }

      if (parameters->isOption(OPT_export_ip_core))
      {
         START_TIME(cpu_time);
         std::string core_name = parameters->getOption<std::string>(OPT_export_ip_core);
         core_generationRef core_gen = core_generationRef(new core_generation(parameters));
         core_gen->export_core(TM, core_name);
         STOP_TIME(cpu_time);
         PRINT_OUT_MEX(DEBUG_LEVEL_MINIMUM, output_level, " ==== Core exported in " + print_cpu_time(cpu_time) + " seconds; ====\n");
      }
#endif
      STOP_TIME(total_time);
      PRINT_MSG(" ==== Total Execution Time: " + print_cpu_time(total_time) + " seconds; ====\n");

      if(not (parameters->getOption<bool>(OPT_no_clean)))
      {
         boost::filesystem::remove_all(parameters->getOption<std::string>(OPT_output_temporary_directory));
      }
      return EXIT_SUCCESS; // Eucalyptus tool has completed execution without errors
   }

   // exception catching
   catch (const char * str)
   {
      std::cerr << str << std::endl;
   }
   catch (const std::string& str)
   {
      std::cerr << str << std::endl;
   }
   catch (std::exception &e)
   {
      std::cerr << e.what() << std::endl;
   }
   catch (...)
   {
      std::cerr << "Unknown error type" << std::endl;
   }

   switch(exit_code)
   {
      case PARAMETER_NOTPARSED:
      {
         parameters->PrintUsage(std::cout);
         break;
      }
      case EXIT_FAILURE:
      {
         parameters->PrintBugReport(std::cout);
         break;
      }
      default:
      {

      }
   }
   if(parameters and not (parameters->getOption<bool>(OPT_no_clean)))
   {
      boost::filesystem::remove_all(parameters->getOption<std::string>(OPT_output_temporary_directory));
   }
   return exit_code;

}
示例#25
0
// Returns 'false' on failure, returns 'true' on success.
// Handle to the module is stored in '*output'.
bool InjectDLL(DWORD process_id, const std::string& dll_name, HMODULE* output) {
  CHECK(process_id != 0);

  ScopedHandle process(OpenProcess(CREATE_THREAD_ACCESS, FALSE, process_id));
  if(process.handle == NULL) {
    THROW_ERROR("Unable to open process!");
    return false;
  }

  HMODULE kernel32 = GetModuleHandle("kernel32.dll");
  if(kernel32 == NULL) {
    THROW_ERROR("Unable to get 'kernel32.dll' handle!");
    return false;
  }

  // Adding DLL search path.

  // XXX: hardcoded max buffer size.
  const SIZE_T buffer_size = 256;
  TCHAR buffer[buffer_size];
  DWORD path_size = GetCurrentDirectory(buffer_size, buffer);
  if(path_size == 0 || path_size >= buffer_size) {
    THROW_ERROR("Unable to get current directory!");
    return false;
  }

  LPVOID path_pointer = RemoteAllocateAndCopy(process.handle, buffer, path_size + 1);
  ScopedMemory path_memory(process.handle, path_pointer);
  if(path_memory.pointer == NULL) {
    THROW_ERROR("Unable to allocate memory in the remote process!");
    return false;
  }

  FARPROC setdlldir_address = GetProcAddress(kernel32, "SetDllDirectoryA");
  if(setdlldir_address == NULL) {
    THROW_ERROR("Unable to get 'SetDllDirectory()' address!");
    return false;
  }

  DWORD exit_code;
  BOOL rv = RemoteSynchronousCall(process.handle, setdlldir_address, path_memory.pointer, &exit_code);
  if(rv == FALSE) {
    THROW_ERROR("'RemoteSynchronousCall()' failed!");
    return false;
  }

  rv = static_cast<BOOL>(exit_code);
  if(rv == FALSE) {
    THROW_ERROR("'SetDllDirectory()' failed!");
    return false;
  }

  // Loading sniffer.dll.

  LPVOID pointer = RemoteAllocateAndCopy(process.handle, dll_name.c_str(), dll_name.size() + 1);
  ScopedMemory memory(process.handle, pointer);
  if(memory.pointer == NULL) {
    THROW_ERROR("Unable to allocate memory in the remote process!");
    return false;
  }

  FARPROC loadlib_address = GetProcAddress(kernel32, "LoadLibraryA");
  if(loadlib_address == NULL) {
    THROW_ERROR("Unable to get 'LoadLibraryA()' address!");
    return false;
  }

  rv = RemoteSynchronousCall(process.handle, loadlib_address, memory.pointer, &exit_code);
  if(rv == FALSE) {
    THROW_ERROR("'RemoteSynchronousCall()' failed!");
  }

  HMODULE module = reinterpret_cast<HMODULE>(exit_code);
  if(module == NULL) {
    THROW_ERROR("'LoadLibraryA()' failed!");
    return false;
  }

  // Cleaning up.

  if(!path_memory.Free()) {
    THROW_ERROR("Unable to free memory in the remote process!");
    return false;
  }

  if(!memory.Free()) {
    THROW_ERROR("Unable to free memory in the remote process!");
    return false;
  }

  if(!process.Close()) {
    THROW_ERROR("Unable to close remote process!");
    return false;
  }

  *output = module;
  return true;
}
void VsVideoKeyFrame::MakeCurrentFrame(Simulator *lpSim)
{
	THROW_ERROR(Vs_Err_lMoveToKeyFrameNotSupported, Vs_Err_strMoveToKeyFrameNotSupported);
}
示例#27
0
/*------------------------------------------------------------------------------
 * Purpose: Read data from file 
 * Parameters: H5Dataset* d -- The dataset whose value to be retrieved from file
 *     to server: { opID, fid, fullpath, type, space }                      *
 *     to client: { value, error }                                          *
 * Return:  Returns a non-negative value if successful; otherwise returns a negative value.
 *------------------------------------------------------------------------------
 */
int H5Dataset_read(H5Dataset* ind, H5Dataset* outd)
{
    int ret_value=0, i=0;
    hid_t did=-1, sid=-1, tid=-1, msid=-1, ftid=-1;
    unsigned int npoints=1;
    hsize_t start[H5S_MAX_RANK], stride[H5S_MAX_RANK], count[H5S_MAX_RANK], mdims[1];
    time_t t0=0, t1=0;
    H5Eclear();

    if (ind->space.rank <=0 )
        H5Dataset_init(ind);

    t0 = time(NULL);

    if ( (did = H5Dopen(ind->fid, ind->fullpath)) < 0)
        THROW_H5LIBRARY_ERROR(ind->error,ret_value, done);

    /* TODO at H5Dataset -- we need to convert the datatype to the datatype which is passed 
     *  from client machine so that the data reading from file will be right for 
     *  the client. The byte order of the client machine, server machine, and data
     *  in the file can be all different.
     * 
     *  For the first version, we assume the server machine and client machine
     *  have the same byte order.
     */ 
    ftid = H5Dget_type(did);
    tid = H5Tget_native_type(ftid, H5T_DIR_ASCEND);
    H5Tclose(ftid);

    /* TODO at H5Dataset -- to support different byte order between the server and client */
    if (ind->type.order != get_machine_endian())
        THROW_ERROR(ind->error,
            "H5Dataset_read", "The byte order is different between the server and client",
            ret_value, done);


    sid = msid = H5S_ALL;
    npoints = 1;
    for (i=0; i<ind->space.rank; i++)
        npoints *= ind->space.count[i];
    ind->space.npoints = npoints;
    mdims[0] = npoints;
    
    /* cannot select hyperslab for scalar data point or 
       1D array with a single data point 
     */
    if ( (ind->space.rank>0) && (ind->space.rank * ind->space.dims[0]>1) )
    {
        sid = H5Dget_space(did);
        for (i=0; i<ind->space.rank; i++)
        {
            start[i] = ind->space.start[i];
            stride[i] = ind->space.stride[i];
            count[i] = ind->space.count[i];
        }
        if (H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, stride, count, NULL)<0)
            THROW_H5LIBRARY_ERROR(ind->error,ret_value, done);

        msid = H5Screate_simple(1, mdims, NULL);
    }

    if (ind->value)
        H5Dataset_freeBuffer(ind->value, ind->space, ind->type, ind->nvalue);

    if (NULL == (ind->value = malloc(npoints*ind->type.size)) )
        THROW_ERROR(ind->error, "H5Dataset_read",
            "unable to allocate memory to read data from file",
            ret_value, done);
   
    ind->nvalue = npoints*ind->type.size; 
    ind->tclass = ind->type.tclass; 
    if ( H5Dread(did, tid, msid, sid, H5P_DEFAULT, ind->value) < 0)
    {
        free (ind->value);
        ind->value = NULL;
        THROW_H5LIBRARY_ERROR(ind->error,ret_value, done);
    } 
  
    /* convert compound and variable length data into strings
     * so that the client application is able to display it
     */ 
    if ( (H5DATATYPE_VLEN == ind->type.tclass )
         || (H5DATATYPE_COMPOUND == ind->type.tclass)
         || (H5DATATYPE_STRING == ind->type.tclass )
       )
    {
        H5Dataset_value_to_string(ind, tid, msid);
    }

done:
    if (msid > 0) H5Sclose(msid);
    if (sid > 0 ) H5Sclose(sid);
    if (tid > 0 ) H5Tclose(tid);
    if (did > 0 ) H5Dclose(did);

    t1 = time(NULL);

#ifndef HDF5_LOCAL
    memset (outd, 0, sizeof (H5Dataset));

    /* pass on the value */
    outd->nvalue = ind->nvalue;
    outd->value = ind->value;
    outd->tclass = ind->tclass;
    outd->error = ind->error;
    outd->time = (long)(t1-t0);

    ind->value = NULL;
    ind->nvalue = 0;
#endif

    return ret_value;
}
tResult cJuryTransmitter::Run(tInt nActivationCode, const tVoid* pvUserData, tInt szUserDataSize, ucom::IException** __exception_ptr/* =NULL */)
{
    if (nActivationCode == IRunnable::RUN_TIMER)
    {
        
        //not aus timer
        if (pvUserData==&m_hTimerNotAusCounter)
        {
            m_hTimerNotAusCounter++;
            RETURN_IF_FAILED(sendEmergencyStop());

            // the signal was transmitted three times
            if (m_hTimerNotAusCounter >= 3 && m_hTimerNotAus)
            {
                __synchronized_obj(m_oCriticalSectionTimerNotAus);
                // Destroy the timer
                tResult nResult = _kernel->TimerDestroy(m_hTimerNotAus);
                if (IS_FAILED(nResult)) THROW_ERROR(nResult);
            }
        }
        
        //start event timer
        if (pvUserData==&m_hTimerStartCounter)
        {
            m_hTimerStartCounter++;
            RETURN_IF_FAILED(sendJuryStruct(action_START,m_Start_entry_id));

            // the signal was transmitted three times
            if (m_hTimerStartCounter >= 3 && m_hTimerStart)
            {
                __synchronized_obj(m_oCriticalSectionTimerStart);
                // Destroy the timer
                tResult nResult = _kernel->TimerDestroy(m_hTimerStart);
                if (IS_FAILED(nResult)) THROW_ERROR(nResult);
            }
        }
        //request ready event timer
        if (pvUserData==&m_hTimerRequestReadyCounter)
        {
            m_hTimerRequestReadyCounter++;
            RETURN_IF_FAILED(sendJuryStruct(action_GETREADY,m_Request_Ready_entry_id));

            // the signal was transmitted three times
            if (m_hTimerRequestReadyCounter >= 3 && m_hTimerRequestReady)
            {
                __synchronized_obj(m_oCriticalSectionTimerRequestReady);
                // Destroy the timer
                tResult nResult = _kernel->TimerDestroy(m_hTimerRequestReady);
                if (IS_FAILED(nResult)) THROW_ERROR(nResult);
            }
        }
        //stop event timer
        if (pvUserData==&m_hTimerStopCounter)
        {
            m_hTimerStopCounter++;
            RETURN_IF_FAILED(sendJuryStruct(action_STOP,m_Stop_entry_id));

            // the signal was transmitted three times
            if (m_hTimerStopCounter >= 3 && m_hTimerStop)
            {
                __synchronized_obj(m_oCriticalSectionTimerStop);
                // Destroy the timer
                tResult nResult = _kernel->TimerDestroy(m_hTimerStop);
                if (IS_FAILED(nResult)) THROW_ERROR(nResult);
            }
        }

    }
    return cBaseQtFilter::Run(nActivationCode, pvUserData, szUserDataSize, __exception_ptr);
}
示例#29
0
文件: ABIIf.hpp 项目: socrocket/core
 virtual void setFP(const regWidth &newValue) throw() {
     THROW_ERROR("The FP register is not defined in the processor ABI");
 }
示例#30
0
void AlteraBackendFlow::xparse_utilization(const std::string& fn)
{
   try
   {
      XMLDomParser parser(fn);
      parser.Exec();
      if (parser)
      {
         //Walk the tree:
         const xml_element* node = parser.get_document()->get_root_node(); //deleted by DomParser.
         THROW_ASSERT(node->get_name() == "document", "Wrong root name: " + node->get_name());

         const xml_node::node_list list_int = node->get_children();
         for (xml_node::node_list::const_iterator iter_int = list_int.begin(); iter_int != list_int.end(); ++iter_int)
         {
            const xml_element* EnodeC = GetPointer<const xml_element>(*iter_int);
            if(!EnodeC) continue;

            if (EnodeC->get_name() == "application")
            {
               const xml_node::node_list list_sec = EnodeC->get_children();
               for (xml_node::node_list::const_iterator iter_sec = list_sec.begin(); iter_sec != list_sec.end(); ++iter_sec)
               {
                  const xml_element* nodeS = GetPointer<const xml_element>(*iter_sec);
                  if(!nodeS) continue;

                  if (nodeS->get_name() == "section")
                  {
                     std::string stringID;
                     if(CE_XVM(stringID, nodeS)) LOAD_XVM(stringID, nodeS);
                     if (stringID == "QUARTUS_SYNTHESIS_SUMMARY")
                     {
                        const xml_node::node_list list_item = nodeS->get_children();
                        for (xml_node::node_list::const_iterator it_item = list_item.begin(); it_item != list_item.end(); ++it_item)
                        {
                           const xml_element* nodeIt = GetPointer<const xml_element>(*it_item);
                           if(!nodeIt or nodeIt->get_name() != "item") continue;

                           if(CE_XVM(stringID, nodeIt)) LOAD_XVM(stringID, nodeIt);

                           std::string value;
                           if(CE_XVM(value, nodeIt))
                           {
                              LOAD_XVM(value, nodeIt);
                              boost::replace_all(value, ",", "");
                              design_values[stringID] = boost::lexical_cast<double>(value);
                           }
                        }
                     }
                  }
               }
            }
         }
         return;
      }
   }
   catch (const char * msg)
   {
      std::cerr << msg << std::endl;
   }
   catch (const std::string & msg)
   {
      std::cerr << msg << std::endl;
   }
   catch (const std::exception& ex)
   {
      std::cout << "Exception caught: " << ex.what() << std::endl;
   }
   catch ( ... )
   {
      std::cerr << "unknown exception" << std::endl;
   }
   THROW_ERROR("Error during QUARTUS_SH report parsing: " + fn);
}