This change fixes issues with the reset strategy for devices that don't
use default clocking parameters. That used to cause issues when
restarting the tiles and made those devices have some bigger variations
in power measurements. For X410 this should not change the behavior
compared to uhd master.
This adds X4xxRfdcCtrl.reset_tiles(), which resets all enabled tiles and
sets their registers and settings back to initial defaults. The same
functionality was previously implemented in reset_rfdc(), but we want to
be able to reset the RFDC clocks without clearing all registers.
During device initialization, however, we retain this reset of all tiles
by modifying the initialization sequence.
Before this change, we indiscriminately first set the sync source in
init(), then the master clock rate again (it is already set in
set_sync_source(), albeit to a potentially older value).
This adds checks to the args to see if things have actually changed, and
sets all settings in one go.
FPGA:
- Split up MB registers that control daughterboard specific settings so
that daughterboards 0 and 1 could have different setings, in
preparation for future devices that require different settings.
This requires a compat number bump to 8.0.
- Add registers for additional RFDC information, including the
block/tile mapping of the individual channels, and information about
resampling capabilities
- Identify sections of code that would be specific to X410/ZBX and move
them to their own headers, so it's trivial to add device-specific
sections of code instead for other devices in the future.
- This includes constraints for clocks and I/O pins.
- Remove ability to do timed ctrlport transactions to the MB CPLD, this
was unused and possibly broken.
- Move daughterboard-specific code into its own code location
(dboards/zbx)
- Move X410-specific register documentation to its own location
(doc/X410)
- Refactor Makefiles to split out X410/ZBX specific components and allow
switching between device types
- Add 512-bit AXI interconnects
- Make number of timekeepers configurable (X410 keeps the single
timekeeper)
MPM:
- Required compat is bumped to 8.0
- Now supports new registers for detecting DSP capabilities and
multi-rate settings for the daughterboards
- Adds MMCM controls (currently unused)
Co-authored-by: Wade Fife <wade.fife@ni.com>
Co-authored-by: Ryan Marlow <ryan@lmarlow.com>
Co-authored-by: Martin Braun <martin.braun@ettus.com>
Co-authored-by: Humberto Jimenez <humberto.jimenez@ni.com>
Resetting MMCM and RFDC separately will become a requirement once we
start to also program the MMCM. As of now, it is merely a refactoring,
and we continue to use default MMCM settings.
- Adds startup_tiles() and shutdown_tiles()
- The latter is called on tear_down() to be compliant with Xilinx'
documentation on bitstream reconfiguration
This is a debugging utility for MPM, where gdb-based debugging sometimes
leads to issues with timing. To use it, replace class instantiations
such as:
```python
c = SomeClass(arg1, arg2)
```
with
```python
c = LogWrapper(
parent_log.getChild("SomeClass"), "info", SomeClass(arg1, arg2))
```
The class can be used as before, but the MPM log will include calls with
arguments, return values, and execution times, like this:
```
[MPM.PeriphManager.rfdcctl] [INFO] set_if(1, 0, True, 1058240000.0)
[MPM.PeriphManager.rfdcctl] [INFO] --> True [Execution time: 0.108 ms]
```
This change adds a flag to the clock policy that tells the sample PLL to
enable or disable the PLL ref clock (PRC) that goes to the
daughterboards. While for X410 the PRC is required, future USRPs may not
want the clock signal to propagate to the board.
This by itself does not enable dual-rate (or multi-mcr), but it
refactors the code to enable it in the future. Additional changes may be
required.
X4xxClockMgr is renamed to X4xxClockManager.
Before this change, x4xx_rfdc_ctrl.py had various backdoors to read out
required settings. Now that we have the clock policy object, we can
simply read them out from there.
This obviates some code paths (get_rfdc_resampling_factor(),
get_default_mcr(), set_rfdc_reset_cb()).
On tear_down() (this is most commonly seen by users when updating the
FPGA image), we add a check to verify that subcomponents of the X4xx are
actually initialized, to avoid displaying a non-fatal error message that
looks like this:
[ERROR] [MPM.RPCServer] Error in update_component while resetting:
'NoneType' object has no attribute 'tear_down'
The most common/easy way to trigger this error is by loading MPM with
a bitfile that has an invalid compat number (which would stop MPM from
initializing the RFDC controls) and then running `uhd_image_loader`
(which would force a tear_down()). In that circumstance, MPM would try
to call tear_down() on an uninitialized object.
In 01ccb69, changes to the MB CPLD code were made which caused the
following issue when updating the CPLD:
root@ni-x4xx-xxxxxxx:~# zbx_update_cpld --dboards 0
Traceback (most recent call last):
File "/usr/bin/zbx_update_cpld", line 22, in <module>
from usrp_mpm.periph_manager.x4xx_mb_cpld import MboardCPLD
ImportError: cannot import name 'MboardCPLD' from
'usrp_mpm.periph_manager.x4xx_mb_cpld'
(/usr/lib/python3.7/site-packages/usrp_mpm/periph_manager/x4xx_mb_cpld.py)
This fixes this bug.
This fixes two issues:
- RfdcRegsControl.enable_iq_swap() now is consistent with other APIs in
that it takes a channel number, not a block ID
- X4xxDboardIface.enable_iq_swap() doesn't use a backdoor API call to
fish the enable_iq_swap() API out of the _rfdc_regs object that it
doesn't own
- Add class-level attributes to store constants on the chips
- LMK04832X4xx.config() is changed use a SpllConfig object, which is
temporarily defined in x4xx_clk_mgr.py before calling config()
This change updates the call to the MB CPLD CTRL and adds logic to
distinguish between X410 and other USRPs, so that we can only force a
wrong CPLD image on a given device.
These APIs are not used, and are implemented by accessing private
members of child attributes, which is not a good style. Since they are
not used or needed, they can be removed without substitute.
ZBX has a daughterboard flash memory, but other daughterboards for X4xx
do not. We therefore add a flag to class ZBX that declares its usage of
a DB flash memory, and X4xxDboardIface uses that flag to conditionally
initialize the DB flash.
This adds a new synchronization step in the MPMD device initialization.
- Add API calls to PeriphManagerBase and rpc.py (synchronize() and
aggregate_sync_data())
- Add sane default implementations to PeriphManagerBase
Note: This adds new APIs to MPM, but we won't change the compat number
in this commit, since the new API is not yet being used.
The X4x0 device is an outlier with respect to all other MPM devices when
it comes to this API. All other MPM-devices define this API on the
daughterboard, not the motherboard.
For all the reasons laid out in dboard_manager/base.py, we move this API
call for X4x0 also into the daughterboard RPC space.
Both get_master_clock_rate() and set_master_clock_rate() are explicitly
declared @no_rpc in MPM.
This is an API breakage in the UHD/MPM communication API.
The classes E31x_db and Neon were importing the AD936xDboard mixin class
after their parent class, not before. This means the mixin couldn't be
used to override classes from the parent class, because Python's MRO
will go to the first class in the inheritance list.
Because there is no use of super() in these classes, the reordering has
no other effect than prioritize AD936xDboard over DboardManagerBase when
it comes to resolving parent methods.
Main changes:
- x4xx_mb_cpld.MboardCPLD is renamed to X4xxMboardCPLD and is now a base
class. Specific implementations of the MB CPLD require derived classes
and have to provide their corresponding signature.
- In x4xx.py, we don't init the MB CPLD and then assert we have
a specific signature. Instead, we init the MB CPLD, and choose
a derived class based on the signature. If there is no such class,
then the same error is generated as before (by itself, this means
there is no behavioural change).
- The MB CPLD image for the X410 (ZBX daughterboards) is moved to
a derived class X410MboardCPLD.
- New: The ZBX daughterboard driver verifies that the MB CPLD image is
in fact compatible with the daughterboard. For this, the MB CPLD
control classes require a COMPATIBLE_DB_PIDS attribute.
By itself, this change has no behavioural- or API changes. However, it
allows easily slotting in new CPLD images with different signatures.
Without further modifications, it does not allow *any* CPLD image
though: The PS API (e.g., enable/disable daughterboards, CMI status,
etc.) remain the same.
For the sake of completeness, the bitfields and register offsets defined
for interacting with the MB CPLD are matched with the HDL definitions,
even for registers that aren't being used by MPM at this moment.
This adds a new class, X4xxDbMixin, which can be used for daughterboards
that are installed into an X4xx motherboard. It collects all the common
tasks between such daughterboards.
The mixin is also mixed into the ZBX daughterboard class. The other
dboards (IF test CCA, Debug DB) are not modified.