src/runtime_src/driver/hw_em/generic_pcie_hal2/shim.cxx
//TODO::SPECIFIC TO LINUX
//Need to modify for windows
:SPECIFIC TO LINUX
Need to modify for windows
: SPECIFIC TO LINUX Need to modify for windows
void HwEmShim::xclOpen(const char* logfileName)
  {
    xclemulation::config::getInstance()->populateEnvironmentSetup(mEnvironmentNameValueMap);
    char path[FILENAME_MAX];
    size_t size = MAXPATHLEN;
    char* pPath = GetCurrentDir(path,size);
    if(pPath)
    {
      std::string sdxProfileKernelFile = std::string(path) + "/profile_kernels.csv";
      systemUtil::makeSystemCall(sdxProfileKernelFile, systemUtil::systemOperation::REMOVE);
      std::string sdxTraceKernelFile = std::string(path) + "/timeline_kernels.csv";
      systemUtil::makeSystemCall(sdxTraceKernelFile, systemUtil::systemOperation::REMOVE);
    }
    if ( logfileName && (logfileName[0] != '\0'))
    {
      mLogStream.open(logfileName);
      mLogStream << "FUNCTION, THREAD ID, ARG..."  << std::endl;
      mLogStream << __func__ << ", " << std::this_thread::get_id() << std::endl;
    }
    if (xclemulation::config::getInstance()->isMemLogsEnabled())
    {
      mGlobalInMemStream.open("global_in.mem");
      mGlobalOutMemStream.open("global_out.mem");
    }
  }
void HwEmShim :: xclOpen ( const char * logfileName ) { xclemulation :: config :: getInstance ( ) -> populateEnvironmentSetup ( mEnvironmentNameValueMap ) ; char path [ FILENAME_MAX ] ; size_t size = MAXPATHLEN ; char * pPath = GetCurrentDir ( path , size ) ; if ( pPath ) { std :: string sdxProfileKernelFile = std :: string ( path ) + " " ; systemUtil :: makeSystemCall ( sdxProfileKernelFile , systemUtil :: systemOperation :: REMOVE ) ; std :: string sdxTraceKernelFile = std :: string ( path ) + " " ; systemUtil :: makeSystemCall ( sdxTraceKernelFile , systemUtil :: systemOperation :: REMOVE ) ; } if ( logfileName && ( logfileName [ 0 ] != ' \0 ' ) ) { mLogStream . open ( logfileName ) ; mLogStream << " " << std :: endl ; mLogStream << __func__ << " " << std :: this_thread :: get_id ( ) << std :: endl ; } if ( xclemulation :: config :: getInstance ( ) -> isMemLogsEnabled ( ) ) { mGlobalInMemStream . open ( " " ) ; mGlobalOutMemStream . open ( " " ) ; } }
TODO::SPECIFIC TO LINUX
Need to modify for windows
TODO :: SPECIFIC TO LINUX Need to modify for windows
//populate environment information in driver