C++ Tool 9 May 2012 (1.44)

cout << "commands:" << endl; cout << " (.)q quit" << endl;

cout << " fv get firmware version" << endl;

cout << " i init (reset spartan and virtex and enable TTC)" << endl;

cout << " res reset spartan" << endl; cout << " rev reset virtex" << endl; cout << " v virtex voltages" << endl; cout << " t virtex die temperature" << endl; cout << "__________________________________________________________________" << endl; cout << " enT enable TTC" << endl; cout << " erT TTC error counts" << endl; cout << " s(v)T n -> read spartan (virtex) TTC n times" << endl; cout << "__________________________________________________________________" << endl; cout << "ras(v) read all spartan (virtex) registers" << endl; cout << " rs(v) add n -> single read spartan (virtex) n words from add" << endl; cout << "rrs(v) -> read spartan (virtex) by register name" << endl; cout << "brs(v) add n -> block read spartan (virtex) n words from add" << endl; cout << "frs(v) add n -> read spartan (virtex) fifo" << endl; cout << " ws(v) add data n -> single write spartan (virtex) " << endl; cout << "wrs(v) -> write spartan (virtex) by register name" << endl; cout << "bws(v) add data n -> block write spartan (virtex) " << endl; cout << "qws(v) add data n -> queued write spartan (virtex) data" << endl; cout << "fws(v) add data n -> write spartan (virtex) fifo" << endl; cout << "__________________________________________________________________" << endl; cout << " rf add -> read 256 bytes from flash at add" << endl; cout << " vfh verify flash header" << endl; cout << " vs(v) verify spartan (virtex) flash" << endl; cout << " vbs verify backup spartan flash" << endl; cout << " PFH program flash header" << endl; cout << " PBS program spartan backup flash" << endl; cout << " PS(V) program spartan (virtex) flash" << endl; cout << " L load (both spartan and virtex) firmware from flash" << endl;

C++ class 17 May 2012 (1.50) //************ single read functions *************************** rv AMC13::read(int chip, const std::string& reg) rv AMC13::readAddress(int chip, uint32_t add) //************ single write functions *************************** void AMC13::write(int chip, const std::string& reg, rv value) void AMC13::writeAddress(int chip, uint32_t add, uint32_t value) // firmware version rv AMC13::firmware(int chip) // TTC data void AMC13::printTtcBcnEvnOrn(int chip, int nTimes) void AMC13::printTtcErrorCounts() //Read all named registers std::map<std::string, rv> AMC13::readAllReadable(int chip) void AMC13::printRegisterValues(int chip) //Block read std::vector AMC13::readBlockAddress(int chip, uint32_t add, size_t nWords) //Block write void AMC13::writeBlockAddress(int chip, uint32_t add, std::vector data, size_t nWords) //Queued write void AMC13::writeQueueAddress(int chip, uint32_t add, std::vector data, size_t nWords) //String manipulation uint32_t intFromString(const std::string& s, unsigned int pos, unsigned int n) //***** Flash programming ************************************************************ void AMC13::programFlash(const std::string& mcsFileName, uint32_t add) //*** execute flash command void AMC13::flashDoCommand(int parameter) // ensure previous write has finished before continuing void AMC13::waitForWriteDone() // enable flash for writing void AMC13::enableFlashWrite() //*** erase one sector of the flash void AMC13::eraseFlashSector(uint32_t s) // verify flash programming void AMC13::verifyFlash(const std::string& mcsFileName, uint32_t add) // read one page from flash starting at byte address add std::vector AMC13::readFlashPage(uint32_t add) // print one page from the flash starting at address add void AMC13::printFlashPage(uint32_t add) // read entire flash contents into vector std::vector AMC13::firmwareFromFlash(uint32_t add, int pages) //read firmware from MCS file into vector std::vector AMC13::firmwareFromMcs(const std::string& mcsFileName)

AMC13.hh contents 20 April 2012 (1.28) //control void reset(int chip); void enableTTC(); void flashDoCommand(int length); void enableFlashWrite(); void waitForWriteDone(); void eraseFlashSector(uint32_t s);

//general read/write rv read(int chip, const std::string& reg); rv readAddress(int chip, uint32_t add); void write(int chip, const std::string& reg, rv value); void writeAddress(int chip, rv add, rv value); std::map<std::string, uint32_t> readAllReadable(int chip); std::vector readBlock(int chip, const std::string& reg, size_t nWords); std::vector readBlockAddress(int chip, uint32_t add, size_t nWords); void writeBlockAddress(int chip, uint32_t add, std::vector data, size_t nWords); void writeQueueAddress(int chip, uint32_t add, std::vector data, size_t nWords); void writeTest(int chip);

//flash read/write std::vector readFlashPage(uint32_t add); void programFlash(const std::string& mcsFileName, uint32_t add); void writeFlashPage(uint32_t wadd, std::vector data); void verifyFlash(const std::string& mcsFileName, uint32_t add); std::vector firmwareFromFlash(uint32_t add, int pages);

//firmware mcs file read std::vector firmwareFromMcs(const std::string& mcsFileName);

//specific reads rv firmware(int chip); void ttcErrorCounts(int chip, rv& singleBit, rv& multiBit, rv& bunchCount); void ttcBcnEvnOrn(int chip, rv& bunchNumber, rv& eventNumber, rv& orbitNumber);

//printing void printTtcErrorCounts(); void printTtcBcnEvnOrn(int chip, int nTimes); void printRegisterValues(int chip); void printFlashPage(uint32_t add);

-- JimRohlf - 24 May 2012

Topic revision: r1 - 24 May 2012 - JimRohlf
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback