Main Page | Class List | Class Members

hcalDCC::Programmer Class Reference

Utility class for reprogramming of the DCC flash sector and JTAG reprogramming of PCI devices. More...

#include <programmer.hh>

List of all members.

Public Member Functions

 Programmer (VMEBusAdapterInterface &busAdapter, VMEAddressTable *dccAddressTable, unsigned long vmeBase, Logger logger, int debug) throw (hcalDCC::Exception)
 Programmer (VMEBusAdapterInterface &busAdapter, VMEAddressTable *dccAddressTable, unsigned long vmeBase, int debug) throw (hcalDCC::Exception)
 ~Programmer ()
int checkAccessToFlash () throw (hcalDCC::Exception)
void eraseFlashSector (std::string deviceName) throw (hcalDCC::Exception)
void eraseFlash () throw (hcalDCC::Exception)
void programFlashSector (std::string deviceName, char *dataFileName, bool compare) throw (hcalDCC::Exception)
void programFlashSector (std::string deviceName, std::vector< std::string > &firmware, bool compare) throw (hcalDCC::Exception)
void loadConfiguration (std::string deviceName) throw (hcalDCC::Exception)
void setSerialNumber (unsigned int serial_num) throw (hcalDCC::Exception)
unsigned int getSerialNumber () throw (hcalDCC::Exception)
unsigned long getFwRevision (std::string deviceName) const throw (hcalDCC::Exception)
int getFlashSectorNumber (std::string deviceName)
int JTAGProgramming (char *filename, char *action, int reset_jtag=1, long workspace_size=0, char *init_list[10]=NULL)
int configureJTAG (string devName, int nBit=0, int tckFreq=-1)


Detailed Description

Utility class for reprogramming of the DCC flash sector and JTAG reprogramming of PCI devices.

Author:
Fernando Varela (Boston University)
Revision
1.3

Date
2005/07/07 19:52:42

The funcitonality of hte Programmer class is two-fold.

New in revision 1.3:


Constructor & Destructor Documentation

hcalDCC::Programmer::Programmer VMEBusAdapterInterface &  busAdapter,
VMEAddressTable *  dccAddressTable,
unsigned long  vmeBase,
Logger  logger,
int  debug
throw (hcalDCC::Exception)
 

Class constructor

Parameters:
busAdapter HAL bus interface
dccAddressTable DCC main HAL address table
vmeBase VME base address
logger C++ logger
debug debugging flag. If set to 1 prints out debuggin information

hcalDCC::Programmer::Programmer VMEBusAdapterInterface &  busAdapter,
VMEAddressTable *  dccAddressTable,
unsigned long  vmeBase,
int  debug
throw (hcalDCC::Exception)
 

Class constructor

Parameters:
busAdapter HAL bus interface
dccAddressTable DCC main HAL address table
vmeBase VME base address
debug debugging flag. If set to 1 prints out debuggin information

hcalDCC::Programmer::~Programmer  ) 
 

Clas destructor


Member Function Documentation

int hcalDCC::Programmer::checkAccessToFlash  )  throw (hcalDCC::Exception)
 

Checks access to the flash memory and weather dealing with a DCC v4

Returns:
error code. O success, -1 error

int hcalDCC::Programmer::configureJTAG string  devName,
int  nBit = 0,
int  tckFreq = -1
 

Configure the JTAG reprogramming

Parameters:
devName Name of the device to be reprogrammed, e.g.
nBit number of bits in the JTAG transfer. Default value is 0, i.e. 1 single bit transfer
tckFreq clock frequency. Default value is -1, i.e default frequency value
Returns:
error code, 0 succes, 1 error

void hcalDCC::Programmer::eraseFlash  )  throw (hcalDCC::Exception)
 

Erases and configures flash memory

void hcalDCC::Programmer::eraseFlashSector std::string  deviceName  )  throw (hcalDCC::Exception)
 

Erases and configures a sector of the flash memory

Parameters:
deviceName Name of the device to erase the flash for

int hcalDCC::Programmer::getFlashSectorNumber std::string  deviceName  ) 
 

Returns the device number, i.e. flash memory sector

Parameters:
deviceName Name of the device to be reprogrammed
Returns:
flash sector number associated with the device

unsigned long hcalDCC::Programmer::getFwRevision std::string  deviceName  )  const throw (hcalDCC::Exception)
 

Reads DCC firmware revision

Parameters:
deviceName Name of the device to be reprogrammed
Returns:
device firmware revision

unsigned int hcalDCC::Programmer::getSerialNumber  )  throw (hcalDCC::Exception)
 

Reads DCC board serial number

Returns:
serial_num New serial number

int hcalDCC::Programmer::JTAGProgramming char *  filename,
char *  action,
int  reset_jtag = 1,
long  workspace_size = 0,
char *  init_list[10] = NULL
 

JTAG reprogramming of a PCI device

Parameters:
filename Name of the JAM file containing the new firmware
action action to be execute by the JAM player, e.g. read_idcode, verify, program, etc.
reset_jtag flag to indicate wheather the JTAG chain is reset after reprogramming or not. Default value is 1
workspace_size size of the workspace if memory is allocated manually. Default value is 0
init_list array of JAM instructions to be executed by the player. Default value is NULL
Returns:
error code, 0 succes, 1 error

void hcalDCC::Programmer::loadConfiguration std::string  deviceName  )  throw (hcalDCC::Exception)
 

Loads the configuration data from the onboard flash memory. There are 2 possible configurations stored in the flash (sectors 4-5)

Parameters:
deviceName Name of the device to be reprogrammed

void hcalDCC::Programmer::programFlashSector std::string  deviceName,
std::vector< std::string > &  firmware,
bool  compare
throw (hcalDCC::Exception)
 

Programs or compare a sector of the configure flash memory from a std::vector<std::string>

Parameters:
deviceName Name of the device to be reprogrammed
firmware Array of std::vector<string> containing the new firmware
compare Compare flag. If set to 1 the contents of the flash memory are verified.

void hcalDCC::Programmer::programFlashSector std::string  deviceName,
char *  dataFileName,
bool  compare
throw (hcalDCC::Exception)
 

Programs or compare a sector of the configure flash memory from a file

Parameters:
deviceName Name of the device to be reprogrammed
dataFileName File with the new contents of the flash for the device
compare Compare flag. If set to 1 the contents of the flash memory are verified.

void hcalDCC::Programmer::setSerialNumber unsigned int  serial_num  )  throw (hcalDCC::Exception)
 

Writes DCC board serial number

Parameters:
serial_num New serial number


The documentation for this class was generated from the following files:
Generated on Fri Jul 8 20:52:05 2005 for HCAL Data Concentrator Card by  doxygen 1.3.9.1