Commit graph

67 commits

Author SHA1 Message Date
Martin Braun
ebd5dd03cf Apply clang-formatting to all C/C++ files
- Used clang-format version 14
- Ran ./tools/clang-formatter.sh apply
2023-08-07 15:35:56 -05:00
Martin Anderseck
55fd43cc27 SelfCal: Add startup_tile() for cal_mode selection
To follow Xilinx' recommendations for self-cal usage this adds
startup_tile() to the cal_mode selection and we query if the cal_mode
was set properly. Since we do this, on the host side we allow the full
first Nyquist zone to be used for self-cal.
2023-07-07 12:35:55 -07:00
Martin Braun
c45efbd57d mpm: x4xx: Add logging for metal and rfdc versions 2023-05-26 16:26:12 -05:00
Martin Braun
62eb62c781 mpm: rfdc: Remove set_sample_rate() API call
This API call is superseded by configure_pll(), and now we match the
RFDC API more closely.
2023-05-16 09:12:29 -05:00
Martin Braun
af586c92bc mpm: rfdc_ctrl: Change latency argument to signed
The underlying xrfdc API takes an int, not an uint32_t, and uses the
value "-1" as a special purpose.
2023-04-04 09:06:42 -05:00
Lars Amsel
045bede8a0 MPM: enable Xilinx API for PLL config
This adds calls to the Xilinx API to configure the PLL and to query PLL
settings.
2023-04-04 09:06:42 -05:00
Lars Amsel
ab1ed11b0e MPM: Add ability to query enabled state of ADC/DAC blocks
This adds to new methods to the RFdc class as well as the Python
interface to be able to query the enabled state of an ADC or DAC block.
2023-04-04 09:06:42 -05:00
mattprost
b8acf58798 n310: Add Filter API to n310
Add the Filter API to n3xx specifically for the AD937x device.  The TX
filter is limited to 32 taps, and the RX filter is limited to 48 taps.

This feature requires MPM version 4.2 or later on the device.

Co-authored-by: bpadalino <bpadalino@gmail.com>
Signed-off-by: mattprost <matt.prost@ni.com>
2022-04-07 13:28:02 -07:00
mattprost
a8ad4917d3 n310: Add frontend bandwidth control
Allow users to control the Mykonos frontend bandwidth settings for
Rx and Tx. Note that this operation requires the daughterboard to
re-initialize, so it may take some time. Values for frontend filter
settings were derived using ADI's AD9371 Filter Wizard.

This feature requires MPM version 4.1 or later on the device.

Co-authored-by: bpadalino <bpadalino@gmail.com>
Signed-off-by: mattprost <matt.prost@ni.com>
2022-04-07 13:28:02 -07:00
Lars Amsel
2a575bf9b5 uhd: Add support for the USRP X410
Co-authored-by: Lars Amsel <lars.amsel@ni.com>
Co-authored-by: Michael Auchter <michael.auchter@ni.com>
Co-authored-by: Martin Braun <martin.braun@ettus.com>
Co-authored-by: Paul Butler <paul.butler@ni.com>
Co-authored-by: Cristina Fuentes <cristina.fuentes-curiel@ni.com>
Co-authored-by: Humberto Jimenez <humberto.jimenez@ni.com>
Co-authored-by: Virendra Kakade <virendra.kakade@ni.com>
Co-authored-by: Lane Kolbly <lane.kolbly@ni.com>
Co-authored-by: Max Köhler <max.koehler@ni.com>
Co-authored-by: Andrew Lynch <andrew.lynch@ni.com>
Co-authored-by: Grant Meyerhoff <grant.meyerhoff@ni.com>
Co-authored-by: Ciro Nishiguchi <ciro.nishiguchi@ni.com>
Co-authored-by: Thomas Vogel <thomas.vogel@ni.com>
2021-06-10 12:01:53 -05:00
Toni Jones
136214240e mpm: Implement 32 bit register interface with SPI
Implement SPI transfers which are 12 bytes in length to support
access for 32 bit register interfaces. 12 byte transactions are
necessary for Titanium MB PS CPLD SPI transactions. This implementation
supports 48 bits of TX data per transfer and offsets all flags and
data shifts from the end of the TX data portion of the transfer buffer
rather than the end of the entire transfer buffer.
2021-03-04 12:09:52 -06:00
Martin Braun
476dccd6c3 mpm: Apply clang-format against all .cpp and .hpp files 2020-03-03 08:51:32 -06:00
Martin Braun
1c3c7bddff mpm: mg: Make set_master_clock_rate() an async call
The ad9371 call set_master_clock_rate() can take a while depending on
the rate change, so make it asynchronous in order not to lock out the
reclaimer loop.
2019-11-26 12:21:35 -08:00
Martin Braun
14fb3cc6f4 e310: Fix issues in MPM and UHD
- Remove superfluous INFO logging
- Improve formatting in many places
- Improve Pylint score in various places
- Add tear_down to DB object
- Simplify custom EEPROM code for E310
- Fix time source selection code
- Remove references to GPS_CTRL and GPS_STATUS (are E320 only)
- Move clock source control out of MboardRegs object
2019-11-26 12:21:33 -08:00
Martin Braun
7d69dcdcc3 Remove proto-RFNoC files
This commit removes all files and parts of files that are used by
proto-RFNoC only.

uhd: Fix include CMakeLists.txt, add missing files
2019-11-26 12:16:25 -08:00
Martin Braun
227fe34217 n3xx: mg: Make set_freq() call asynchronous
This does not change the MPM/UHD API, but it makes the set_freq() call
asynchronous on the MPM side. The upside is that it will release the GIL
if the set_freq() call takes too long, e.g., because of MPM
calibrations.
2019-08-22 10:35:13 -07:00
Sugandha Gupta
178b35569b e310/e320: Move E310 to MPM architecture and refactor
- Turns the E310 into an MPM device (like N3xx, E320)
- Factor out common code between E320 and E310, maximize sharing between
  the two devices
- Remove all pre-MPM E310 code that is no longer needed
- Modify MPM to remove all existing overlays before applying new ones
  (this is necessary to enable idle image mode for E310)

Co-authored-by: Virendra Kakade <virendra.kakade@ni.com>
Signed-off-by: Virendra Kakade <virendra.kakade@ni.com>
2019-05-01 15:17:23 -07:00
Martin Braun
164d76dcfd mpm: python: Move from Boost.Python to PyBind11 2019-04-02 10:39:57 -07:00
Brent Stapleton
431deb855b uhd: mpm: update all license header w/ "-or-later"
Updating all SPDX license identifiers to include "-or-later"
2019-03-08 00:43:07 +01:00
Brent Stapleton
967be2a4e8 uhd: mpm: apply clang-format to all files
Applying formatting changes to all .cpp and .hpp files in the following
directories:
```
find host/examples/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/tests/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/dboard/neon/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/dboard/magnesium/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/device3/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/mpmd/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/x300/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/utils/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find mpm/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
```

Also formatted host/include/, except Cpp03 was used as a the language
standard instead of Cpp11.
```
sed -i 's/ Cpp11/ Cpp03/g' .clang-format
find host/include/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
```

Formatting style was designated by the .clang-format file.
2019-01-16 11:40:23 -08:00
Martin Braun
a69ab0c23a cmake: Update coding style to use lowercase commands
Also updates our coding style file.

Ancient CMake versions required upper-case commands.  Later command
names became case-insensitive.  Now the preferred style is lower-case.

Run the following shell code (with GNU compliant sed):

cmake --help-command-list | grep -v "cmake version" | while read c; do
  echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
done > convert.sed \
&& git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' \
'*CMakeLists.txt' | xargs -0 gsed -i -f convert.sed && rm convert.sed

(Make sure the backslashes don't get mangled!)
2018-11-14 14:10:09 -08:00
Alex Williams
d70298dcb5 mpm: i2c: Open and close i2c file descriptor on every access
This will release the i2c device when it's not in use. If MPM hangs on
to the i2c devices, we won't be able to cleanly change FPGA images--The
kernel hangs up the process until the refcount drops to zero.
2018-11-12 16:04:08 -08:00
Alex Williams
5e548c1a08 mpm: i2c: Add vector-based transfer function
This could lead to a less-restricted implementation for use in Python.
2018-10-19 10:17:08 -07:00
Alex Williams
a830fab2a0 mpm: Add i2c APIs for simple transfers 2018-10-19 10:17:08 -07:00
Brent Stapleton
300a5e3f6e mpm: initial commit of E320 code
Co-authored-by: Sugandha Gupta <sugandha.gupta@ettus.com>
2018-07-18 15:37:27 -07:00
Brent Stapleton
4f49b4a937 mpm: adding adf400x support to chips
Adding ADF400X driver to MPM. This uses the Boost.Python bound spidev,
and is largely a translation from the C++ driver in UHD.
2018-06-27 10:22:25 -07:00
Trung N Tran
546aa04355 mpm: replace long execution function with async call
- Replace mykonos finish_initialization with async version
- Replace myknonos setup_cal with async version
- Remove disable_timeout on rpc_server init()
2018-04-30 14:36:29 -07:00
Alex Williams
7dcd16f5a6 mpm: Use configurable components for build system
For a minimal build, default to off for components unless the MPM_DEVICE
or the user requests it specifically.
2018-04-18 15:34:51 -07:00
Martin Braun
e9288a439c mpm: Update all license headers
- Fix typo in company name (missing 'a')
- Updated SPDX license identifier to version 3.0
2018-02-19 16:55:08 -08:00
Martin Braun
3b080f7ff5 mpm: ad937x: Refactor
- No functional changes
- const-ify parameters and local variables where appropriate
- Fix long lines and inconsistent formatting
2018-01-22 14:57:23 -08:00
Trung N Tran
7ffea3746b mpm: mg: Pass deserializer_lane_xbar to ad937x_config
Slot A and Slot B are different in how the JESD lanes are connected.
We now pass in different deserializer_lane_xbar config values for each slot.

Reviewed-by: Martin Braun <martin.braun@ettus.com>
Reviewed-by: Daniel Jepson <daniel.jepson@ettus.com>
Reviewed-by: Mark Meserve <mark.meserve@ni.com>
2018-01-12 16:21:15 -08:00
Martin Braun
8815098747 mpm: Harmonize all license header
Now uses SPDX headers everywhere.
2017-12-22 15:05:58 -08:00
Martin Braun
3cff6298ce mpm: Add mmap_regs_iface
This is a C++-based peek/poke interface into mmaped objects. Useful for
better control over UIO devices.

Reviewed-By: Brent Stapleton <brent.stapleton@ettus.com>
2017-12-22 15:05:58 -08:00
Trung N Tran
b9a0cf1467 mpm: Enable TX external LO set through args, simplify code
Simplify the process of setting external LO without calling through many API
layers.

Reviewed-By: Martin Braun <martin.braun@ettus.com>
2017-12-22 15:05:57 -08:00
Trung N Tran
2467deeb17 mpm: mykonos: Add API to change master clock rate 2017-12-22 15:05:07 -08:00
Martin Braun
688247e545 mpm: ad937x: Add LO lock API
Reviewed-By: Steven Bingler <steven.bingler@ni.com>
Reviewed-By: Trung Tran <trung.tran@ettus.com>
2017-12-22 15:05:07 -08:00
Trung N Tran
db7039f8be mpm: enable RX external LO set through args
This change allow user to set RX LO of ad9371 to external or internal from args
constructor of usrp device.
 new args is rx_lo_source value can be either internal or external:
 If there's no rx_lo_source specified or invalid value, default rx_lo is used;  which is internal LO.
Usage example:
 usrp_application --args "rx_lo_source=external"
2017-12-22 15:05:06 -08:00
Trung Tran
9ea0d6da9e mg: enable init and track calibration API
Currently, AD9371 turned on most of the calibration and hard coding the turning
on process during bringup time.
This change enables users to pass in a mask field for init ARM calibration and
tracking arm calibration at the time creating USRP device reference.
This mask field can be passed through device arguments of:
 1/ init_cals : for init ARM  calibration masks. This is defined in AD9371 UG-992
table 65. Default to 0x4DFF
 2/ tracking_cals : for tracking calibration masks. This is defined in AD9371
UG-992 table 66. Default to 0xC3

Example of pasing in init calibration and tracking calibration mask
      usrp_application --args "init_cals=0x4f, tracking_cals=0xC3"
NOTE: UHD currently expect user to input the correct init_cals and
tracking_cals. There's no mechanism to check if init mask and tracking mask are
valid. For example if the init mask field not mask 0x4f, the AD9371 will failed
to setup.
2017-12-22 15:05:06 -08:00
Martin Braun
5c63a83d22 mpm: Add log_buf class
This is a buffer for log messages, designed for getting log messages
from C++ back into Python.

Reviewed-By: Mark Meserve <mark.meserve@ni.com>
2017-12-22 15:05:06 -08:00
Mark Meserve
f58a4f20c5 ad937x: address TODOs in adi_ctrl
change error outputs
add comments to some functions
2017-12-22 15:04:01 -08:00
Mark Meserve
64c5bdbc92 ad937x: add missing docstrings to ctrl 2017-12-22 15:04:01 -08:00
Mark Meserve
04b0f414b9 mpm: ad937x: Updated controls 2017-12-22 15:04:01 -08:00
Mark Meserve
01ddd50e55 mpm: spi: Added 16-bit SPI transactions
- Adds convenience method to read 16-bit SPI transactions
- Fixes peek16 in spi_regs_iface to actually use 16-bit transactions
2017-12-22 15:04:01 -08:00
Mark Meserve
309a2f04e3 mg: General fixes
- Make DB probe-able
- Add RPC client
2017-12-22 15:04:00 -08:00
Martin Braun
8ebd4d8e5f mpm: spi: Added 16-bit access to SPI regs 2017-12-22 15:03:53 -08:00
Martin Braun
b39dafa1ee mpm: Enabled selection of SPI mode 2017-12-22 15:03:53 -08:00
Martin Braun
df9ca47ed1 mpm: eiscat: magnesium: Removed C++-only SPI ifaces
- EISCAT is now Python only with the exception of the definition of the
  SPI ifaces
- Magnesium uses a Python-generated SPI iface
- Removed SPI lock from EISCAT dboard
2017-12-22 15:03:52 -08:00
Martin Braun
0e7fe25f42 mpm: eiscat: Added first pass at EISCAT dboard driver 2017-12-22 15:03:52 -08:00
Martin Braun
fcf8715eab mpm: Exposed spi regs iface factory to Python 2017-12-22 15:03:52 -08:00
Martin Braun
cf6619992a mpm: Added peek/poke interface to ad937x_ctrl 2017-12-22 15:03:52 -08:00