Commit Graph

10516 Commits

Author SHA1 Message Date
Grant Meyerhoff
8ebb33f723 ci: add step for x440 embedded runs 2023-07-11 11:45:39 -05:00
Martin Braun
659d7179ae ci: Disable PR runs for draft PRs 2023-07-10 15:08:35 -05:00
Phil Crump
1a6b554c0e host: Add cstdint include to fix gcc-13 compile.
In GCC 13 release some C++ Standard Library headers no longer
include other headers that were being used internally.
This means some headers that were implicit, now need to be included
in C++ programs explicitly.
This includes <cstdint>, and therefore compile of uhd host with
 gcc-13 is broken without explicitly including this header.
2023-07-10 12:39:37 -05:00
Mark Eid
367adaa35e fpga: x400: Fix PRC divider register map 2023-07-10 10:45:09 -06:00
Grant Meyerhoff
9c4f2f2319 devtest: remove benchmark_rate test for x440
The benchmark_rate test for x440 would require more than the 1GbE connection at the minimum rate

Since devtests cannot require special cabling, skip this devtest on x440
2023-07-10 09:53:30 -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 Anderseck
b4c24091ed SelfCal: Expose config parameters
Exposes the following ADC self-cal parameters on X4xx devices to be used
in the argument string:
-cal_freq
-cal_dac_mux_i
-cal_dac_mux_q
-cal_tone_duration
-cal_ch_list
-cal_delay
2023-07-07 12:35:55 -07:00
Martin Braun
51c1a74eee examples: Amend tx_waveforms.py to use DramTransmitter
When calling tx_waveforms.py with the --dram option, it will internally
use DramTransmitter and first upload the signal before transmitting it
from DRAM.
2023-07-07 12:35:55 -07:00
Martin Braun
73fd6f8c0d python: Add 'const' to get_continuous_tone(); improve sanity-checks
- 'const' is now a valid waveform
- Fixes an issue with generating ramps and handling floating-point
  inputs
2023-07-07 12:35:55 -07:00
Martin Braun
c42cd3617c python: multi_usrp: Remove spurious print 2023-07-07 12:35:55 -07:00
Martin Braun
55379ae7fe mpm: x440: Move clock info logging out of policy
The logging of the final clock settings object is moved into
X4xxClockManager so that no intermediate clock objects are logged.
2023-07-07 12:35:55 -07:00
Javier Valenzuela
ff722cb9c8 mpm: x4xx: add intermediate clocking setting
- Move the configuration of SPLL and MMCM into its own method
- In set_master_clock_rate(), call this with intermediate clock settings
  if we decide that going direct from one clock setting to another would
  cause harm/failures

Co-authored-by: Martin Braun <martin.braun@ettus.com>
2023-07-07 12:35:55 -07:00
Martin Braun
8acae88919 mpm: x4xx: Explicitly pass MCR values to set_sync_source()
Before this commit, set_sync_source() would require the master clock
rate to be set after reclocking, but would pull it out of the
X4xxClockManager object (using the _master_clock_rates attribute). Now,
the new master clock rate is passed to set_sync_source() via the args
argument.

Note that it is still possible (for backward compat) to not provide
a new MCR, in which case the assumption is that the current MCR still
remains valid.
2023-07-07 12:35:55 -07:00
Martin Braun
b6ef88e534 mpm: x4xx: Add master_clock_rates argument to _set_ref_clock_freq()
This avoids unnecessary statefulness of this function and fixes an issue
where during init(), external reference clock frequencies would be
validated against the wrong master clock rates.
2023-07-07 12:35:55 -07:00
Martin Braun
eaba13f86b mpm: x4xx: Add intermediate clock settings to clock policy
This allows the clock policy to determine intermediate clock settings
when going from one MCR setting to another. This can avoid MMCM lock
issues.
2023-07-07 12:35:55 -07:00
Martin Braun
8c108418c9 python: Add DramTransmitter class
This class is a utility to more easily using an available replay block as
a transmitter.
2023-07-07 12:35:55 -07:00
Martin Braun
5100c6e01f mpm: x4xx: Add rfdc rate as a sensor to X4xx dboards
This enables querying the converter rate through the sensor API:

```python
>>> U = uhd.usrp.MultiUSRP("type=x4xx")
>>> print(U.get_tx_sensor('rfdc_rate').to_real())
3000000000.0
```
2023-07-07 12:35:55 -07:00
Javier Valenzuela
987f545d94 mpm: x4xx: filter MCR list 2023-07-07 12:35:55 -07:00
Martin Anderseck
b3b5e69b02 SelfCal: Trigger if clocking has changed
This change ensures that ADC selfcal is triggered during session start
if the clocking was reconfigured. So it saves time if several
consecutive sessions are opened with always the same settings.
It also makes the ADC self cal run if in an open session either
set_clock_source(), set_time_source() or set_sync_source() are called
and a clock reconfiguration was triggered by that.
2023-07-07 12:35:55 -07:00
Martin Braun
cd754412e7 mpm: x4xx: Remove internal_temp_sensor
This sensor is undefined and not connected. It probably got into the
codebase by accident or copy&paste.
2023-06-30 10:42:30 -05:00
Martin Braun
569572a58b tests: Fix Python warnings in parse_benchmark_rate.py
- Main fix: Append 'r' prefix to regex strings where necessary
- Fix some other linter issues that are considered poor practices
- Change line endings to unix
2023-06-29 10:55:36 -05:00
Martin Braun
e3b8e3b45c python: Fix subdev_spec_t wrapping
Subdev specs can now be iterated over in Python as in C++:

```python
specs = usrp.get_rx_subdev_spec(0)
for spec in specs:
    print(spec.to_string())
```

This would previously fail, because Pybind11 did not know that the
subdev spec was iterable.
2023-06-29 09:39:47 -05:00
Martin Braun
fc58ee343f python: Wrap direction_t 2023-06-29 09:39:47 -05:00
Martin Braun
def8f201a6 python: stream: Overload TxStreamer.recv_async_msg()
This allows TxStreamer.recv_async_msg() to return the metadata instead
of modifying it in-place. The old API is still available.

```python
md = tx_streamer.recv_async_msg(timeout) # Returns None or metadata
```
2023-06-29 09:39:33 -05:00
Martin Braun
33ab459cbd docs: Make X410 dboard a subpage of the X4xx page 2023-06-29 08:26:03 -05:00
Matthew Crymble
8af66cdbfb ci: update docker builds to run twice a week
This also removes uncessary schedule triggers for other branches. The triggers
for those branches are contained in the version of this file in those branches.
2023-06-28 10:50:38 -05:00
Martin Braun
2c057a37e9 python: signal: Add more waveforms to get_continuous_tone()
Still defaults to sine, can now also do square and ramp.
2023-06-28 10:45:39 -05:00
Martin Anderseck
7f62283fb4 MPM: Updated default MCR for X440
This changes the default master clock rate for X440 to 368.64 MHz which
results in a converter rate of 2.94912 GSps which is in line with what
X410 uses.
2023-06-27 15:35:39 -05:00
Martin Braun
d8aa3914df lib: rfnoc: Use device cache for rfnoc_graph::make()
The factory rfnoc_graph::make() did previously not make use of
rfnoc::detail::make_rfnoc_graph(), which it should have. The purpose of
make_rfnoc_graph() is to avoid creating the same rfnoc_graph twice, the
same way that uhd::device::make() avoids that.

For example, the following code would raise an exception:

```python
U1 = uhd.rfnoc.RfnocGraph("addr=192.168.10.2")
U2 = uhd.rfnoc.RfnocGraph("addr=192.168.10.2")
```

The reason is, it would try to create the same rfnoc_graph object twice,
but the underlying rfnoc_device would be shared between those graphs.

With this fix, UHD will identify the second call to rfnoc_graph::make()
as a duplicate, and return the same object from a cache of weak
pointers. This is the same mechanism that multi_usrp uses for the exact
same purpose. Note that multi_usrp, even with RFNoC devices, did not
suffer from this issue, because it always called directly into
make_rfnoc_graph().

As an advanced, and generally not recommended use case, this even allows
the following:

```python
U = uhd.usrp.MultiUSRP("addr=192.168.10.2")
G = uhd.rfnoc.RfnocGraph("addr=192.168.10.2")
```

This is in general not recommended, because it is possible to get the
MultiUSRP and RfnocGraph objects out of sync (in a normal MultiUSRP
operation, the multi_usrp object owns the rfnoc_graph object to avoid
just that). However, there are some possibly interesting corner cases
where having direct access to the underlying rfnoc_graph object can be
useful. One such case could be to create faux multi_usrp like object
using Python's introspection features.
2023-06-27 11:06:02 -05:00
Grant Meyerhoff
797d093ea5 devtest: add exemptions for x440 python API test 2023-06-27 11:05:37 -05:00
Saarthak Mohan
996e7ab304 UBX: Initialize UBX set_tx_freq freq_lo variables to 0.0 2023-06-26 19:22:59 -05:00
Martin Braun
49a297efe4 docs: Update X4x0 manual
- Add X440 front panel and full-module renderings
- Add X440 FPGA section
- Update X4x0/X440 sections
- Add converter rate info
2023-06-26 19:22:29 -05:00
Wade Fife
c0504afce6 fpga: x400: Add X440 to default make targets 2023-06-26 10:45:10 -05:00
Wade Fife
e3794ba5ed python: Add X440 to image builder 2023-06-26 10:45:10 -05:00
Martin Braun
589b316433 python: rfnoc: Add radio_control.get_{ticks,time}_now 2023-06-23 11:00:19 -05:00
Martin Braun
6da6b5d246 python: Wrap stream_cmd_t::stream_mode
This attribute of a stream command was previously not exposed in Python,
probably due to an accidental omission.
2023-06-23 11:00:19 -05:00
Saarthak Mohan
b59f91aada host/docs: Fix link to MSVC Redistributable Package 2023-06-22 15:43:41 -05:00
Martin Braun
63a13c786c mpm: x4xx: Optimize clock configuration at init
Changes:
- X410 Honors the force_reinit flag now (like N310). When given, it will
  force a reinit of all clocking settings.
- When master_clock_rate is not given, and nothing else changes, then
  clocking configuration will be skipped. This shaves approx. 3s of
  startup time and avoids issues that can occur during clocking
  configuration.
- If anything changes, incl. clock/time source, then full clock
  configuration is still done.
- Multi-tile sync is done in all cases, as that happens outside of init()
2023-06-22 07:14:34 -05:00
Martin Braun
6478dcb7f3 ci: Enable X440 2023-06-21 09:22:41 -05:00
Martin Anderseck
dae45a7081 mpm: Update X440 clock policy
This adds all clocking restrictions that are necessary for a stable
operation of the flex-rate feature of X440.
2023-06-21 09:22:41 -05:00
Martin Braun
7968c50107 rfnoc: Allow interruption of streaming during overrun handling
Both stopping streams and overrun handling use the action interface of
RFNoC. This has the consequence/side effect that there can be scenarios
where attempts to stop a stream and overrun handling can interfere with
one another.

Consider the following scenario:

```python
stream_cmd = uhd.types.StreamCMD(uhd.types.StreamMode.start_cont)
stream_cmd.stream_now = True
rx_streamer.issue_stream_cmd(stream_cmd)
time.sleep(1) # Something slows down app, causes overrun
stream_cmd = uhd.types.StreamCMD(uhd.types.StreamMode.stop_cont)
rx_streamer.issue_stream_cmd(stream_cmd)
while metadata.error_code != uhd.types.RXMetadataErrorCode.timeout:
    samps_read = rx_streamer.recv(recv_buffer, metadata)
```

If the RX rate is too much for the system to handle, then the following
can happen:

Because something caused an overrun to happen, the streamer is in
overrun handling mode. There is now a back-and-forth between the
streamer and the radio to get continuous streaming up and running again.

The stop command is not properly executed, causing the final loop to
never terminate.

This fix modifies the RX streamer to stop any overrun handling
perations if a stop-command was issued.
2023-06-21 09:22:41 -05:00
Martin Braun
bfec8dd7fc docs: rfnoc: Document RFNoC overrun handling algorithm 2023-06-21 09:22:41 -05:00
Javier Valenzuela
f860b520a2 images: bump x4xx fpga images 2023-06-21 09:22:41 -05:00
Javier Valenzuela
d13d1fc0e6 fpga: x400: Fix DB1 timekeeper strobe 2023-06-16 12:36:40 -05:00
Humberto Jimenez
7c75777a7d fpga: ci: Enable publishing to internal server 2023-06-15 22:12:15 -05:00
Martin Anderseck
79ac3ee2b6 utils: Add X4xx ADC threshold query script
This script can be used to query which thresholds are seen as sufficient
for the ADC self-cal to work properly. Bigger deviations in these values
/may/ indicate problems with the device but should not be taken as the
ground truth.

Co-authored-by: Lars Amsel <lars.amsel@ni.com>
2023-06-15 10:21:58 -05:00
Wade Fife
47ea1f12ed fpga: ci: Fix branches 2023-06-15 08:11:48 -05:00
Javier Valenzuela
15b45dfc5b fixup! images: add X440 dependencies to manifest 2023-06-14 07:15:47 -05:00
Javier Valenzuela
bc8b671708 images: add X440 dependencies to manifest 2023-06-14 07:15:47 -05:00
Martin Anderseck
f5bb3e0275 lib: Add X440/FBX support
Co-authored-by: Lars Amsel <lars.amsel@ni.com>
Co-authored-by: Martin Braun <martin.braun@ettus.com>
2023-06-12 10:27:29 -05:00