Reorganize the AMACv2 register map.
Overall Organization
The AMACv2RegMap
class contains all of the address/bit mappings for all registers and fields. This used to be called AMACv2Reg
class reviously. Added the Map
to the end as it is more descriptive of its purpose.
The AMACv2Field
class contains the bit mapping for each field in a register. This class existed before, but has been moved to its own file.
The AMACv2Register
class contains the description of a register. A register is a collection of 32 bits stored at a given address. This class also caches the current register value. Previously, this was stored a a dictionary of address
=> value
. The motivation for a dedicated class is to add meta-data like value and RW definition.
AMACv2RegMap
Reorganization
The functionality of the AMACv2RegMap
class is still the same. However the way that the register/field maps are stored has changed.
- All registers/field maps are initialized in the header.
- Create a member variable for all registers of type
AMACv2Register
. - Available register/field refinitions are defined in a list called
m_registers
/m_field
. - Maps of name/address to object are automatically generated from the
m_registers
/m_field
lists.
AMACv2
Changes to -
init/loadRegisters
now checks the RW definition of a register before loadingq it. - Add
read_reg
that updates the cached value in addition to performing read operation from AMAC.
PBv3ConfigTools
Changes to -
configAMAC
now checks whether a field exists and prints a warning if it does not.