Commit ddd7bd52 authored by Georg Auzinger's avatar Georg Auzinger
Browse files

merged Dev Branch with all CBC3 features

parents a552f4dc 54a34755
......@@ -12,11 +12,14 @@ logs/*
*.bin
*.raw
Results/
Results/**
Results
tags
# just for G. Auzingers sanity
Calibrations
.run_number.txt
settings/connections_186.xml
.ycm_extra_conf.py
.ycm_extra_conf.pyc
consoledump.log
src/test.cc
......@@ -18,13 +18,16 @@ before_script:
- yum -y -q install root
- yum -y -q install root-net-http root-montecarlo-eg root-graf3d-eve root-geom root-physics root-graf3d-gl
- yum -y -q install zeromq
- yum -y -q install cmake
build_Ph2_ACF:
script:
- source setup.sh
- cd build/
- cmake ..
- make
- cd ..
only:
- Dev
- master
after_script:
- source setup.sh
......
#ifndef _AMC13_CONTROLLER_H__
#define _AMC13_CONTROLLER_H__
#include "../Utils/pugixml.hpp"
#include "pugixml/pugixml.hpp"
#include "../Utils/ConsoleColor.h"
#include "Amc13Interface.h"
#include "Amc13Description.h"
......@@ -30,13 +30,13 @@ class Amc13Controller
// low level helpers to parse specific xml TAGS
std::vector<int> parseAMCMask (pugi::xml_node pNode, std::ostream& os);
BGO* parseBGO (pugi::xml_node pNode, std::ostream& os);
Trigger* parseTrigger ( pugi::xml_node pNode , std::ostream& os);
Trigger* parseTrigger ( pugi::xml_node pNode, std::ostream& os);
// a little helper to deal with strings
uint32_t convertAnyInt ( const char* pRegValue )
{
if ( std::string ( pRegValue ).find ( "0x" ) != std::string::npos ) return static_cast<uint32_t> ( strtoul ( pRegValue , 0, 16 ) );
else return static_cast<uint32_t> ( strtoul ( pRegValue , 0, 10 ) );
if ( std::string ( pRegValue ).find ( "0x" ) != std::string::npos ) return static_cast<uint32_t> ( strtoul ( pRegValue, 0, 16 ) );
else return static_cast<uint32_t> ( strtoul ( pRegValue, 0, 10 ) );
}
};
......
......@@ -270,20 +270,20 @@ void Amc13Interface::SendBGO()
void Amc13Interface::enableBGO (int pChan)
{
//char tmp[32];
char tmp[32];
//if ( pChan < 0 || pChan > 3)
//{
//amc13::Exception::UnexpectedRange e;
//e.Append ("AMC13::enableBGO() - channel must be in range 0 to 3");
//throw e;
//}
if ( pChan < 0 || pChan > 3)
{
amc13::Exception::UnexpectedRange e;
e.Append ("AMC13::enableBGO() - channel must be in range 0 to 3");
throw e;
}
//snprintf ( tmp, sizeof (tmp), "CONF.TTC.BGO%d.%s", pChan, "ENABLE");
//fAMC13->write ( amc13::AMC13Simple::T1, tmp, 1);
snprintf ( tmp, sizeof (tmp), "CONF.TTC.BGO%d.%s", pChan, "ENABLE");
fAMC13->write ( amc13::AMC13Simple::T1, tmp, 1);
//Edit GA: updated AMC13 core libraries and this should work now!
fAMC13->enableBGO (pChan);
//fAMC13->enableBGO (pChan);
// Edit by Georg Auzinger, not in official AMC13 SW package but required
fAMC13->write ( amc13::AMC13Simple::T1, "CONF.TTC.ENABLE_BGO", 1);
......
#includes
include_directories(${UHAL_UHAL_INCLUDE_PREFIX})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${PROJECT_SOURCE_DIR})
include_directories(${UHAL_AMC13_INCLUDE_PREFIX})
#library directory
link_directories(${UHAL_AMC13_LIB_PREFIX})
set(LIBS ${LIBS} cactus_amc13_amc13)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__AMC13__")
#find source files
file(GLOB HEADERS *.h)
file(GLOB SOURCES *.cc)
#add the library
add_library(Ph2_Amc13 SHARED ${SOURCES} ${HEADERS})
TARGET_LINK_LIBRARIES(Ph2_Amc13 ${LIBS})
Objs = Amc13Description.o Amc13Interface.o Amc13Controller.o
CC = g++
CXX = g++
CCFlags = -g -O1 -w -Wall -pedantic -fPIC -Wcpp
#DevFlags = -D__CBCDAQ_DEV__
AMC13DIR=/opt/cactus/include/amc13
IncludeDirs = /opt/cactus/include ../ ../lib
IncludePaths = $(IncludeDirs:%=-I%)
LibraryDirs = /opt/cactus/lib ../ ../lib
LibraryPaths = $(LibraryDirs:%=-L%)
ExternalObjects = $(LibraryPaths) -lcactus_amc13_amc13
ifneq ("$(wildcard $(AMC13DIR))","")
AMC13INSTALLED = 'Building AMC13 related Objects'
else
AMC13INSTALLED = 'This feature can only be built if the AMC13 libraries are installed with cactus!'
endif
.PHONY: clean print
%.o: %.cc %.h
$(CXX) -std=c++0x $(DevFlags) $(CCFlags) $(UserCCFlags) $(CCDefines) $(IncludePaths) $(ExternalObjects) -c -o $@ $<
all:print $(Objs)
$(CC) -std=c++0x -shared -o libPh2_Amc13.so $(Objs)
mv libPh2_Amc13.so ../lib
print:
@echo '****************************************'
@echo $(AMC13INSTALLED)
@echo '****************************************'
clean:
rm -f *.o
......@@ -36,8 +36,8 @@
- added a CMD line option: g for GUI, should only be used by the latter
- SystemController class can now parse .json files in addition to .xml
- 04/03/15: added GUI (v1-10)
- 05/03/15 : New FpgaConfig object in HWInterface to manage firmware uploading.
- added WriteBlockAtAddress and ReadAtAddress functions in RegManager used by the upload dialog.
- 05/03/15 : New FpgaConfig object in HWInterface to manage firmware uploading.
- added WriteBlockAtAddress and ReadAtAddress functions in RegManager used by the upload dialog.
- BeBoardInterface::FlashProm(...) uploads an MCS file into the FPGA
- 15/04/15 : Acquisition in a separate thread (v1-11)
- Start() should be called when acquisition begins, Stop() when it ends and ReadData(...) at each iteration.
......@@ -50,7 +50,7 @@
- added a stub bit method to the Event class
- restructured the ostream operator of the Event class
- 05/06/2015: minor modifications
- BeBoardFWInterface::ReadData() now returns the number of packets read during the acquisition for faster event counter checks.
- BeBoardFWInterface::ReadData() now returns the number of packets read during the acquisition for faster event counter checks.
- 11/06/2015: merging a new design for Data and Event classes (v1-20)
- Data class now holds a vector of Events and the events are directly decoded after acquisition - the char* databuffer does not exist any longer
- added methods: std::vector<Event*> GetEvents(); Event* GetEvent()
......@@ -86,7 +86,7 @@
- iterative readback-error correction (SW tries to write every register agin that produced an error for 5 times)
- simplified FastCalibration
- removed old Calibration algorithm
- introduced new, bitwise and super-fast calibration algorithm
- introduced new, bitwise and super-fast calibration algorithm
- 11/12/2015: new uHAL connection configuration:
- added new Constructors to RegManager, BeBoardFWInterface, GlibFWInterface, CtaFWInterface that take uhal connection: id, uri, address_table
- modified system controller accordingly so these strings are passed to the constructor
......@@ -109,7 +109,7 @@
- added ReadNEvents() method to BeBoardInterface that allows to read a given number of events from FW as 1 packet
- changed signatures of ReadData / Stop and remove the NthAcquisition parameter for simplicity
- simplified the iterative error correction features in both FW Interfaces
- implemented broadcast I2C write operations in both FW Interfaces
- implemented broadcast I2C write operations in both FW Interfaces
- added Support for AMC13
- included TDC aware Trigger latency scan in Commissioning
- adapted FW aware commissioning procedures & tools to check the beBoardFWVersion (GLIB vs ICGLIB)
......@@ -148,5 +148,51 @@
- 28.10.2016: merged recent changes for HybridTesting (integratedtester)
- new binary: integratedtester
- support for exernal USB instruments (HMP4040, Ke2110, TCP sockets via ZEROMQ)
- 31.10.2016: v1.40
- 31.10.2016: v1-40
- changed makefiles to use environment variables exported in setup.sh
- 15.11.2016: adding modifications for CBC3 usage:
- new Cbc3Fc7FWInterface and address tabel
- FileParser in System/ can now handle nested BeBoardRegisters like in uHAL address tables in HWDescription.xml config files
- new Cbc3 FW (K.Uchida) HWDescription file
- re-structured Data handling in the guts: Data object is now member of the SystemController and all methods like getting events etc are wrapped in system controller
- ReadData() and ReadNEvents() are now wrapped in SystemController and should thus only be used from there!
- FWInterfaces: ReadData() and ReadNEvents() now take a reference to std::vector<uint32_t>& to pass the data upwards to the Data object in SystemController
- re-structured the Data object internals: Data::Set() now decides the manipulation algorithm based on BoardType Enum class in Definition.h - no more set of boolean flags
- introduced an Event class Polymorphism: normal Event class is now the almost virtual base class and Cbc2/3Event inherit from it.
- Updated the Cbc class to handle comments in CbcConigFiles better and re-produce them in eventual output files
- harmonized the use of BoardType: now FWInterfaces and BeBoard classes use the same enum BoardType defined in Definition.h
- implemented GetNHits() and GetHits() methods in both Cbc2/3Event::print() which is used by the Event friend operator <<
- 25.11.2016:
- introduced a ChipType enum to identify CBC version. Each CBC and Module object has this identifier set and this can be used to adapt commissioning procedures accordingly
- introduces 2 new Visitors (ThresholdVisitor, LatencyVisitor) that take the different behavior of CBC2/3 into account (8 vs 10 bit Vcth register, 8 vs 9 bit Trg Latency)
- updated commissioning procedures accordingly to use the new Visitors
- 11.01.2017:
- added a new Settings node in the HWDescription.xml file to set up the CBC test pulse and most common settings without having to manually set bits in individual registers
- Cbc Registers nodes take precedence over Cbc Setting nodes, Global settings take precedence over individual CBC settins and Global CBC Registers take precedence over everything else - this is supposed to be the expert mode
- 17.01.2017:
- added and Debugged BiasSweep Tool class that should work with both versions of the CBC - in addition to TGraphs, a TTree with the bias sweep data is stored (biasname, FeId, CbcId, Timestamp, vectors of x and y data)
- implemented full functionality to sweep biases with external instruments: HMP4040, Ke2110, ArduinoNano
- Calibration et al work
- added StubSweep tool to check Stub addresses
- 07.02.2017:
- cleaned up root file handling
- cleaned up histogram binning in Calibration, PedeNoise and Channel classes
- added cbc3irrad binary to run the complete radiation test cycle
- added UsbUtilities helper functions to launch and query Ke2110 and HMP4040 servers running in Tmux
- renamed Vth to VCth for CBC3 too
- 22.06.2017:
- new D19C FW Interface and D19C CBC3 Event classes to handle D19C
- new implementation of SLink 64 bit event data format for downstream DAQ chain - see example in datatest and miniDAQ
- with this comes new GenericPayload container that stores data internally as 64 bits but can return them in vectors of any wordsize < 64 - the data is always padded to 64 bits
- ability to parse a SLink node with all the condition data and debug level from the config file (Cbc3HWDescription.xml) - this ConditionDataSet object belongs to BeBoard pointers as this makes it easier to update I2C values for every event
- added "eventType" attribute to BeBoard node to indicate either ZeroSupressed or VirginRaw mode - even if the attribute is missing this will always be assumed VR unless ZS is explicitly specified - this is now also a member of BeBoard including setters and getters
- removed NCbcDataSize and corresponding nodes in HWDescription.xml files. only for GLIB and CTA, if the number of CBCs is smaller than 4, 4 is assumed, if the number is between 4 and 8, 8 is assumed and if the number is greater than 8, 16 is assumed
- 21.07.2017
- merged changes required for OTSDAQ
- migrated project to CMAKE: instructions: cd build/ cmake .. make
- 17.11.2017 major cleanup of project repository and many added features related to CBC3
- dropped normal makefiles - project builds only with cmake
- signal scans added
- some minor bug fixes
- new DQM code based on SLink Data format to avoid having to read HWDescription files
- 13.02.2018 Latest Release (v1-50): merging the latest D19CFwInterface class to go along with the latest D19C FW compatible with CBC3
if(NOT DEFINED ENV{OTSDAQ_CMSOUTERTRACKER_DIR})
cmake_minimum_required(VERSION 2.8)
project(Ph2_ACF)
#set the output directory
if ( ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR} )
message( FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there. You may need to remove CMakeCache.txt." )
endif()
# ---------- Setup output Directories -------------------------
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY
${PROJECT_SOURCE_DIR}/lib
CACHE PATH
"Single Directory for all Libraries")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY
${PROJECT_SOURCE_DIR}/bin
CACHE PATH
"Single Directory for all Executables."
)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY
${PROJECT_SOURCE_DIR}/bin
CACHE PATH
"Single Directory for all static libraries."
)
# ---------- Setup output Directories -------------------------
#set the cmakeL module path
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
# compiler flags
set (CMAKE_CXX_FLAGS "-std=c++11 -O3 -Wcpp -pthread -pedantic -Wall -w -g -fPIC ${CMAKE_CXX_FLAGS}")
#check for external dependences
message("#### Checking for external Dependencies ####")
#ROOT
find_package(ROOT COMPONENTS RHTTP)
if(ROOT_FOUND)
#check for THttpServer
if(EXISTS ${ROOT_RHTTP_LIBRARY})
message(STATUS "Found THttp Server support - enabling compiler flags")
set(ROOT_HAS_HTTP TRUE)
elseif()
message(STATUS "ROOT built without THttp Server - disabling compiler flags")
endif()
message(STATUS "Using ROOT version ${ROOT_VERSION}")
endif(ROOT_FOUND)
find_package(CACTUS)
if(${CACTUS_AMC13_FOUND})
message(STATUS " enabling AMC13 component")
else(${CACTUS_AMC13_FOUND})
message(STATUS " continuing without AMC13 components")
endif(${CACTUS_AMC13_FOUND})
find_package(PH2_ANTENNA)
if(PH2_ANTENNA_FOUND)
message(STATUS " building the Antenna components")
else(PH2_ANTENNA_FOUND)
message(STATUS " continuing without Antenna components")
endif(PH2_ANTENNA_FOUND)
#ZeroMQ optional
find_package(ZMQ)
if(ZMQ_FOUND)
#message(STATUS "Found ZMQ Library - checking for Ph2_UsbInstLib")
#libPh2_UsbInstLib
find_package(PH2_USBINSTLIB)
if(PH2_USBINSTLIB_FOUND)
#message(STATUS "Found Ph2_UsbInstLib - enabling support")
endif(PH2_USBINSTLIB_FOUND)
endif(ZMQ_FOUND)
#Boost
file(GLOB_RECURSE uhal_boost /opt/cactus/*version.hpp)
if(uhal_boost)
MESSAGE(STATUS "Found boost installation that comes with uHAL, using this version")
set(Boost_NO_SYSTEM_PATHS TRUE)
if(Boost_NO_SYSTEM_PATHS)
if(${CACTUS_FOUND})
set(BOOST_ROOT ${CACTUS_ROOT})
else(${CACTUS_FOUND})
set(BOOST_ROOT /opt/cactus)
endif(${CACTUS_FOUND})
set(BOOST_INCLUDE_DIRS ${BOOST_ROOT}/include)
set(BOOST_LIBRARY_DIRS ${BOOST_ROOT}/lib)
endif(Boost_NO_SYSTEM_PATHS)
else(uhal_boost)
MESSAGE(STATUS "No boost headers found with uHAL (you are most likely using CC7) - make sure to install boost 1.53 (default version on CC7)")
endif(uhal_boost)
find_package(Boost 1.53 REQUIRED system filesystem thread program_options)
#find_package(Boost 1.53 REQUIRED filesystem system-mt )
message("#### Done ####")
#all the subdirs
if(${CACTUS_AMC13_FOUND})
add_subdirectory(AMC13)
endif()
add_subdirectory(tools)
add_subdirectory(RootWeb)
add_subdirectory(src)
add_subdirectory(miniDAQ)
add_subdirectory(Utils)
add_subdirectory(HWDescription)
add_subdirectory(HWInterface)
add_subdirectory(System)
message("#### Don't forget to set the path and ld_library_path by sourcing setup.sh before running")
#set(ENV{PATH} "$ENV{PATH}:${PROJECT_SOURCE_DIR}/bin")
#set(ENV{LD_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/lib:$ENV(LD_LIBRARY_PATH)")
else()
add_subdirectory(Utils)
add_subdirectory(HWDescription)
add_subdirectory(HWInterface)
add_subdirectory(System)
add_subdirectory(tools)
endif()
......@@ -20,15 +20,22 @@ namespace Ph2_HwDescription {
// Constructors
BeBoard::BeBoard() :
fBeId ( 0 ) {}
fBeId ( 0 ),
fEventType (EventType::VR),
fCondDataSet (nullptr)
{}
BeBoard::BeBoard ( uint8_t pBeId ) :
fBeId ( pBeId )
fBeId ( pBeId ),
fEventType (EventType::VR),
fCondDataSet (nullptr)
{
}
BeBoard::BeBoard ( uint8_t pBeId, const std::string& filename ) :
fBeId ( pBeId )
fBeId ( pBeId ),
fEventType (EventType::VR),
fCondDataSet (nullptr)
{
loadConfigFile ( filename );
}
......@@ -95,6 +102,38 @@ namespace Ph2_HwDescription {
return nullptr;
}
void BeBoard::updateCondData (uint32_t& pTDCVal)
{
if (fCondDataSet == nullptr) return;
else if (fCondDataSet->fCondDataVector.size() == 0 ) return;
else if (!fCondDataSet->testEffort() ) return;
else
{
for (auto& cCondItem : this->fCondDataSet->fCondDataVector)
{
// if it is the TDC item, save it in fValue
if (cCondItem.fUID == 3 ) cCondItem.fValue = pTDCVal;
else if (cCondItem.fUID == 1 )
{
for (auto cFe : this->fModuleVector)
{
if (cCondItem.fFeId != cFe->getFeId() ) continue;
for (auto cCbc : cFe->fCbcVector )
{
if (cCondItem.fCbcId != cCbc->getCbcId() ) continue;
else if (cCbc->getFeId() == cCondItem.fFeId && cCbc->getCbcId() == cCondItem.fCbcId)
{
CbcRegItem cRegItem = cCbc->getRegItem ( cCondItem.fRegName );
cCondItem.fValue = cRegItem.fValue;
}
}
}
}
}
}
}
// Private Members:
void BeBoard::loadConfigFile ( const std::string& filename )
......
......@@ -16,6 +16,7 @@
#include "Module.h"
#include "../Utils/Visitor.h"
#include "../Utils/easylogging++.h"
#include "../Utils/ConditionDataSet.h"
#include <vector>
#include <map>
#include <stdint.h>
......@@ -37,7 +38,6 @@ namespace Ph2_HwDescription {
{
public:
// C'tors: the BeBoard only needs to know about which BE it is
/*!
* \brief Default C'tor
......@@ -63,7 +63,7 @@ namespace Ph2_HwDescription {
~BeBoard()
{
for ( auto& pModule : fModuleVector )
delete pModule;
if (pModule) delete pModule;
fModuleVector.clear();
}
......@@ -171,39 +171,61 @@ namespace Ph2_HwDescription {
* \brief Set the Number of CBCs that are used to compute the data blob size of the BeBoard (according to FW version)
* \param pNCbcDataSize
*/
void setNCbcDataSize ( uint16_t pNCbcDataSize )
{
fNCbcDataSize = pNCbcDataSize;
};
//void setNCbcDataSize ( uint16_t pNCbcDataSize )
//{
//fNCbcDataSize = pNCbcDataSize;
//};
/*!
* \brief Get the Number of CBCs that are used to compute the data blob size of the BeBoard (according to FW version)
*/
uint16_t getNCbcDataSize() const
{
return fNCbcDataSize;
};
//uint16_t getNCbcDataSize() const
//{
//return fNCbcDataSize;
//};
void setBoardType (const std::string& pBoardType)
void setBoardType (const BoardType pBoardType)
{
fBoardType = pBoardType;
}
std::string getBoardType() const
BoardType getBoardType() const
{
return fBoardType;
}
void setEventType (const EventType pEventType)
{
fEventType = pEventType;
}
EventType getEventType() const
{
return fEventType;
}
void addConditionDataSet (ConditionDataSet* pSet)
{
if (pSet != nullptr)
fCondDataSet = pSet;
}
ConditionDataSet* getConditionDataSet() const
{
return fCondDataSet;
}
void updateCondData (uint32_t& pTDCVal);
// Vector of FEModules, each module is supposed to know which FMC slot it is connected to...
std::vector< Module* > fModuleVector;
protected:
//Connection Members
uint8_t fBeId;
uint16_t fNCbcDataSize;
std::string fBoardType;
//uint16_t fNCbcDataSize;
BoardType fBoardType;
EventType fEventType;
BeBoardRegMap fRegMap; /*!< Map of BeBoard Register Names vs. Register Values */
ConditionDataSet* fCondDataSet;
private:
......
if(NOT DEFINED ENV{OTSDAQ_CMSOUTERTRACKER_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
#find source files
file(GLOB SOURCES *.cc)
add_library(Ph2_Description SHARED ${SOURCES})
else()
#include_directories($ENV{OTSDAQ_CMSOUTERTRACKER_DIR}/uhal/uhal_2_4_2/cactuscore/uhal/uhal/include)
#include_directories($ENV{OTSDAQ_CMSOUTERTRACKER_DIR}/uhal/uhal_2_4_2/cactuscore/uhal/log/include)
#include_directories($ENV{OTSDAQ_CMSOUTERTRACKER_DIR}/uhal/uhal_2_4_2/cactuscore/uhal/grammars/include)
include_directories($ENV{OTSDAQ_CMSOUTERTRACKER_DIR}/otsdaq-cmsoutertracker/Ph2_ACF)
#include_directories($ENV{OTSDAQ_CMSOUTERTRACKER_DIR}/uhal/uhal_2_4_2/cactuscore/extern/pugixml/RPMBUILD/SOURCES/include/)
cet_set_compiler_flags(
EXTRA_FLAGS -Wno-reorder -Wl,--undefined
)
cet_make(LIBRARY_NAME Ph2_Description
LIBRARIES
Ph2_Utils
pthread
)
install_headers()
install_source()
endif()
......@@ -27,6 +27,10 @@ namespace Ph2_HwDescription {
{
loadfRegMap ( filename );
// determine the chip type by checking for existence of VCth register (CBC2 only, called VCth1 & VCth2 for CBC3)
if (fRegMap.find ("VCth2") != std::end (fRegMap) ) this->setChipType ( ChipType::CBC3);
else this->setChipType ( ChipType::CBC2);
}
// C'tors which take BeId, FMCId, FeID, CbcId
......@@ -35,13 +39,26 @@ namespace Ph2_HwDescription {
{
loadfRegMap ( filename );
// determine the chip type by checking for existence of VCth register (CBC2 only, called VCth1 & VCth2 for CBC3)
if (fRegMap.find ("VCth2") != std::end (fRegMap) ) this->setChipType ( ChipType::CBC3);
else this->setChipType ( ChipType::CBC2);
}
Cbc::Cbc ( uint8_t pBeId, uint8_t pFMCId, uint8_t pFeId, uint8_t pCbcId, const std::string& filename, ChipType pType ) : FrontEndDescription ( pBeId, pFMCId, pFeId ), fCbcId ( pCbcId )
{
loadfRegMap ( filename );
this->setChipType (pType);
}
// Copy C'tor
Cbc::Cbc ( const Cbc& cbcobj ) : FrontEndDescription ( cbcobj ),
fCbcId ( cbcobj.fCbcId ),
fRegMap ( cbcobj.fRegMap )
fRegMap ( cbcobj.fRegMap ),
fCommentMap (cbcobj.fCommentMap)
{
}
......@@ -62,23 +79,38 @@ namespace Ph2_HwDescription {
if ( file )
{
std::string line, fName, fPage_str, fAddress_str, fDefValue_str, fValue_str;
int cLineCounter = 0;
CbcRegItem fRegItem;
while ( getline ( file, line ) )
{
if ( line.find_first_not_of ( " \t" ) == std::string::npos ) continue;
if ( line.at ( 0 ) == '#' || line.at ( 0 ) == '*' ) continue;
std::istringstream input ( line );
input >> fName >> fPage_str >> fAddress_str >> fDefValue_str >> fValue_str;
fRegItem.fPage = strtoul ( fPage_str.c_str(), 0, 16 );
fRegItem.fAddress = strtoul ( fAddress_str.c_str(), 0, 16 );
fRegItem.fDefValue = strtoul ( fDefValue_str.c_str(), 0, 16 );
fRegItem.fValue = strtoul ( fValue_str.c_str(), 0, 16 );
fRegMap[fName] = fRegItem;
if ( line.find_first_not_of ( " \t" ) == std::string::npos )
{
fCommentMap[cLineCounter] = line;
cLineCounter++;
//continue;
}