|
pflib v3.9.0-rc3-11-g2537d8f
Pretty Fine HGCROC Interaction Library
|
Classes | |
| class | TestParameters |
| test certain parameters before setting them back to old values More... | |
Public Member Functions | |
| ROC (I2C &i2c, uint8_t roc_base_addr, const std::string &type_version) | |
| void | setRunMode (bool active=true) |
| bool | isRunMode () |
| const std::string & | type () const |
| std::vector< uint8_t > | readPage (int ipage, int len) |
| uint8_t | getValue (int page, int offset) |
| void | setValue (int page, int offset, uint8_t value) |
| std::vector< std::string > | getDirectAccessParameters () |
| bool | getDirectAccess (const std::string &name) |
| bool | getDirectAccess (int reg, int bit) |
| void | setDirectAccess (const std::string &name, bool val) |
| void | setDirectAccess (int reg, int bit, bool val) |
| void | setRegisters (const std::map< int, std::map< int, uint8_t > > ®isters) |
| set registers on the HGCROC to specific values | |
| std::map< int, std::map< int, uint8_t > > | getRegisters (const std::map< int, std::map< int, uint8_t > > &selected={}) |
| get registers from the HGCROC | |
| void | loadRegisters (const std::string &file_path) |
| set registers on the HGCROC to specific values | |
| std::map< std::string, uint64_t > | getParameters (const std::string &page) |
| Get the parameters for the input page. | |
| std::map< std::string, std::map< std::string, uint64_t > > | defaults () |
| Retrieve all of the manual-documented defaults for all parameters. | |
| std::map< int, std::map< int, uint8_t > > | applyParameters (const std::map< std::string, std::map< std::string, uint64_t > > ¶meters) |
| Apply the input parameter mapping onto the chip. | |
| void | loadParameters (const std::string &file_path, bool prepend_defaults) |
| Load the input parameters onto the chip. | |
| void | applyParameter (const std::string &page, const std::string ¶m, const uint64_t &val) |
| Short-hand for applying a single parameter. | |
| void | dumpSettings (const std::string &filepath, bool decompile) |
| Dump the settings of the HGCROC into the input filepath. | |
| TestParameters::Builder | testParameters () |
| start a set of test parameters | |
Private Attributes | |
| I2C & | i2c_ |
| uint8_t | roc_base_ |
| std::string | type_version_ |
| Compiler | compiler_ |
| mutable::pflib::logging::logger | the_log_ {::pflib::logging::get("roc")} |
Static Private Attributes | |
| static const int | N_REGISTERS_PER_PAGE = 32 |
| void pflib::ROC::applyParameter | ( | const std::string & | page, |
| const std::string & | param, | ||
| const uint64_t & | val ) |
Short-hand for applying a single parameter.
We construct a small std::map and use the applyParameters function above.
| [in] | page | name of page |
| [in] | param | name of parameter in that page |
| [in] | val | value to set parameter to |
| std::map< int, std::map< int, uint8_t > > pflib::ROC::applyParameters | ( | const std::map< std::string, std::map< std::string, uint64_t > > & | parameters | ) |
Apply the input parameter mapping onto the chip.
| [in] | parameters | mapping of parameters to apply where the first key is the page name, the second key is the parameter in that page and the value is the parameter value |
| std::map< std::string, std::map< std::string, uint64_t > > pflib::ROC::defaults | ( | ) |
Retrieve all of the manual-documented defaults for all parameters.
The values are not very interesting (they are all zero in v3 chips), but this can be helpful for looking through a parameter listing organized by page.
| void pflib::ROC::dumpSettings | ( | const std::string & | filepath, |
| bool | decompile ) |
Dump the settings of the HGCROC into the input filepath.
| [in] | filepath | file to which to dump settings into |
| [in] | decompile | if true, decompile the registers into parameters and write a YAML file, else just write a CSV file of the registers |
decompile while being careful since we knowingly are attempting to read ALL of the parameters on the chip
| std::map< std::string, uint64_t > pflib::ROC::getParameters | ( | const std::string & | page | ) |
Get the parameters for the input page.
| [in] | page | name of page to get parameters for |
get registers corresponding to a page
Get the values of these registers from the chip
De-compile the registers back into the parameter mapping
We don't be careful here since we are skipping pages
| std::map< int, std::map< int, uint8_t > > pflib::ROC::getRegisters | ( | const std::map< int, std::map< int, uint8_t > > & | selected = {} | ) |
get registers from the HGCROC
| [in] | selected | registers to get values for, all registers if empty |
When the input map is empty, then read all registers.
When the input map is not empty, only read the registers that are within that mapping.
| void pflib::ROC::loadParameters | ( | const std::string & | file_path, |
| bool | prepend_defaults ) |
Load the input parameters onto the chip.
| [in] | file_path | path to YAML file containing parameters to load |
| [in] | prepend_defaults | if true, use the default values for all parameters before applying the YAML file itself, else only apply the parameters contained in the YAML file |
If we prepend defaults, then ALL of the parameters will be touched and so we do need to bother reading the current values and overlaying the new ones, instead we jump straight to setting the registers.
If we don't prepend the defaults, then we use the other applyParameters function to overlay the parameters we passed on top of the ones currently on the chip after extracting them from the YAML file.
| void pflib::ROC::loadRegisters | ( | const std::string & | file_path | ) |
set registers on the HGCROC to specific values
| [in] | file_path | path to CSV file containing register values, the first column is the page, the second column is the register in that page, and then the last column is the value of the register |
set registers on the HGCROC to specific values
| [in] | registers | The input map has the page as the first key and the register in the page as the second key and then the 8-bit register value. |
| ROC::TestParameters::Builder pflib::ROC::testParameters | ( | ) |
start a set of test parameters
Use when you want to temporarily set parameters on the chip which will then be re-set back to their previous values later.
example