CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/L1Trigger/CSCTrackFinder/src/core_2012_03_13/vpp_lib.h

Go to the documentation of this file.
00001 
00002 void readmemh(std::string fname, ULLONG* mem, ULLONG astart, ULLONG afinish)
00003 {
00004         std::ifstream ifs (fname.c_str() , std::ifstream::in);
00005         ULLONG val;
00006         for (ULLONG i = astart; i <= afinish; i++)
00007         {
00008                 if (ifs >> std::hex >> val)
00009                 {
00010                         mem[i] = val;   
00011                 }
00012                 else
00013                 {
00014                         std::cerr << "Cannot read file: " << fname << ", addr: " << i << std::endl;
00015                         ifs.close();
00016                         return;
00017                 }
00018         }
00019         ifs.close();
00020         //std::cout << "LUT file: " << fname << " read out successfully." << std::endl;
00021 }