C++ Class 27 May 2012


  • void reset(int chip);
  • void enableTTC();
  • void flashDoCommand(int length);
  • void enableFlashWrite();
  • void waitForWriteDone();
  • void eraseFlashSector(uint32_t s);

Special reads

  • rv firmware(int chip);
    • get firmware versions of both FPGSs
  • void ttcErrorCounts(int chip, rv& singleBit, rv& multiBit, rv& bunchCount);
    • get TTC error counts
  • void ttcBcnEvnOrn(int chip, rv& bunchNumber, rv& eventNumber, rv& orbitNumber);
    • get TTC bunch, event, and orbit numbers

General read/write

  • rv read(int chip, const std::string& reg);
    • single word read by register name
  • rv readAddress(int chip, uint32_t add);
    • single word read by address
  • void write(int chip, const std::string& reg, rv value);
    • single word write by register name
  • void writeAddress(int chip, rv add, rv value);
    • single word write by address
  • std::map<std::string, uint32_t> readAllReadable(int chip);
    • read all readable registers in address table
  • std::vector readBlock(int chip, const std::string& reg, size_t nWords);
    • block read by register name
  • std::vector readBlockAddress(int chip, uint32_t add, size_t nWords);
    • block read by address
  • void writeBlockAddress(int chip, uint32_t add, std::vector data, size_t nWords);
    • block write by address
  • void writeQueueAddress(int chip, uint32_t add, std::vector data, size_t nWords);
    • queued write by address

Flash read/write

  • std::vector readFlashPage(uint32_t add);
    • read one page (0x100 bytes) from the flash memory
  • void programFlash(const std::string& mcsFileName, uint32_t add);
    • program the flash memory from an mcs file to specified byte address
  • void writeFlashPage(uint32_t wadd, std::vector data);
    • write one page of data to the flash
  • void verifyFlash(const std::string& mcsFileName, uint32_t add);
    • verify the contents of the flash memory at byte address against an mcs file
  • std::vector firmwareFromFlash(uint32_t add, int pages);
    • read specified number of pages from the flash at specified address into a vector
  • std::vector firmwareFromMcs(const std::string& mcsFileName);
    • read contenst of an mcs file (data bytes) into vector


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

-- JimRohlf - 27 May 2012

Edit | Attach | Watch | Print version | History: r10 | r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r1 - 27 May 2012 - JimRohlf
  • Edit
  • Attach
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback