Commit graph

173 commits

Author SHA1 Message Date
Samuel O'Brien
bfff8b79b9 sim: Add Daughterboard Methods
This commit adds daughterboard simulation to the simulator. There is a
sim_dboard class which registers it's methods with the rpc server. These
methods are visible over mpm as well as the mpm_shell.

Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
2020-10-07 15:29:19 -05:00
Martin Braun
31cafbb3ed rh: Enable inverse sinc filter for DAC37J82
This enables the inv_sinc_ab and inv_sinc_cd flags for the DAC,
turning on the inverse sinc filter.
2020-08-12 15:19:56 -05:00
Steven Koo
e244764ffa mpm: Look for pca953x based devices by device/name
The pca953x driver introduced a change for how the "label" property
populates. Instead of using the device model, it gives a device specific
name. As a replacement, use device/name. This affects the tca6424
and tca6408.

For the kernel change that causes this see:
5128f8d445
2020-06-11 10:39:05 -05: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
d60e4d87d8 mpm: Clean up code, improve Pylint score
Many small cleanups:
- Fix copyright headers
- Fix superfluous imports
- Pull some constants out of classes where appropriate
- Fix formatting
- Improve/fix some docstrings
- Disable specific Pylint warnings where appropriate
- Global catches use BaseException instead of Exception
- Don't use len() for empty checks
- Make sure to declare all self attributes in __init__ (note: this is
  particularly of interest for E310, becuase its regular init happens
  outside of __init__)
- Compacted some E310 code that had multi-DB checks
2019-11-26 12:21:33 -08:00
Martin Braun
c256b9df65 x300/mpmd: Port all RFNoC devices to the new RFNoC framework
Co-Authored-By: Alex Williams <alex.williams@ni.com>
Co-Authored-By: Sugandha Gupta <sugandha.gupta@ettus.com>
Co-Authored-By: Brent Stapleton <brent.stapleton@ettus.com>
Co-Authored-By: Ciro Nishiguchi <ciro.nishiguchi@ni.com>
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
Martin Braun
78f453f8b5 mpm: mg: Only import AD9371 API calls if not yet on Magnesium
This will avoid importing API calls from the self.mykonos object onto
the Magnesium class if the Magnesium class already has such a method.
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
2a4f196068 mpm: rhodium: Fix clock value log formatting
Before, the log messages would occasionally print 6 digits worth of
precision for sample clock values that only require 2.
2019-02-22 16:12:23 -08:00
Martin Braun
0c658067bd mpm: rhodium: Fix typo in log message 2019-02-22 09:20:10 -08:00
Martin Braun
94bc1897c9 mpm: n320: Properly check for the LO distribution board
Without this patch, the N320 code will rely on an error to occur to
determine the non-existence of the N321 LO distribution board. While
this works, it forces an error message where there's no error. This will
first check for the existence of the board before trying to initialize
it.
2019-02-19 15:33:05 -08:00
Alex Williams
10ad1a6626 mpm: Fix up Rhodium EEPROM handling for BfrfsEEPROM
Fixes Rhodium for changes introduced in b7bab6a. The constructor call
for BfrfsEEPROM didn't match the signature, and Rhodium's EEPROM map
referred to the wrong revision.
2019-01-23 13:21:15 -08:00
Martin Braun
9e14b14485 rhodium: Fix some Pylint warnings
Remove some semicolons and superfluous imports.
2019-01-21 13:41:22 -08:00
Mark Meserve
ec0b4dd127 rh: general code cleanup
- Add default bandwidth range
- Add default mash order constant
- Delete MPM todos
- Cleanup whitespace in MPM python code
- Add docstring for is_lo_dist_present
2019-01-10 09:50:16 -08:00
Martin Braun
b7bab6a44f mpm: Factor out user EEPROM code into own module
Affects Magnesium and Rhodium classes, which where duplicating this
code.
2018-12-20 14:57:54 -08:00
Ryan Marlow
5a5f604994 uhd/mpm: eiscat: Various changes
- correct lmk initialization parameters
- adding missing parameters and consts wrt clock synchronization.
- fixed default master clock rate
- eiscat, ddc: update xml.
 - remove references to CORDIC_FREQ in ddc_eiscat
 - update readback reg addr in radio_eiscat
 - set default spp from 3992 to 3968.
- updated jesd mode sequence initialization
- updating eiscat_radio_ctrl_impl
 - add rx_codecs to property tree to display correct ADC chip.
 - updated issue_stream_cmd
2018-12-19 09:36:51 -08:00
Mark Meserve
22836d65e7 rh: remove polarity setting for sdclkout11
- output 11 is unused, a value of 0 will leave the polarity as normal
2018-12-12 16:27:25 -08:00
Mark Meserve
75ee8e0314 rh: add functions to toggle lowband lo 2018-12-12 16:27:25 -08:00
Humberto Jimenez
3c134a2941 rh: Enable clock synchronization error checking 2018-11-29 11:38:43 -08:00
Alex Williams
a8ae5d433b mpm: rh: Remove n321 overlay
The n321 overlay is no longer needed. The devices have been added to the
n320 overlay because the kernel cannot tear down multiple overlays
reliably.
2018-11-27 16:45:23 -08:00
Humberto Jimenez
f36a8dd853 rh: Fix update_ref_clock_freq() to update init args
The update_ref_clock_freq() procedure now updates the self._init_args
value of the Rhodium class daugtherboard objects in MPM to propagate
the latest user-selected arguments for future reference.
2018-11-26 13:34:01 -08:00
Mark Meserve
e8143acd3e rh: fix typo in set_clk_safe_state 2018-11-16 15:18:54 -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
Mark Meserve
930bd09457 rh: change uio access to utilize with-as 2018-11-12 16:08:34 -08:00
Alex Williams
2493f31820 mpm: rh: Add MAX 10 update script 2018-11-07 09:39:18 -08:00
Mark Meserve
728d9abfe7 rh: add lo distribution support
- This is a combination of 5 commits.
- rh: add lo distribution board gpio expander
- rh: add lo distribution mpm functions
- rh: add code to conditionally initialize lo distribution
- rh: change empty i2c device from exception to assertion
- rh: add lo distribution board control
2018-11-05 13:43:07 -08:00
Mark Meserve
77bd367016 rh: disable lmk test output
- Improves spur performance
2018-10-30 10:13:59 -07:00
Humberto Jimenez
5c9c7b3dd3 rh: Phase DAC configuration clean-up
- Confirmed the Phase DAC to be initialized at mid-scale.
- Confirmed the Phase DAC step resolution for fine clock shifting.

The clock synchronization algorithm relies on the Phase DAC to fine
shift the sampling clocks on each daughterboard.

Only a certain number of DAC codes are required for the actual clock
adjustment, thus a different range of codes may be chosen by
initializing the Phase DAC with a given value. With the selected range,
one may measure the Phase DAC's linearity and step resolution, which
defines how many steps are required when performing the fine shifting
of the clocks.

After initializing the 16-bit Phase DAC at 25%, 50% (mid-scale), and
75%; it was found that the clock distribution PLL locks relatively
faster when using mid-scale (2^15). By testing the Phase DAC's
linearity, it was confirmed that the circuit resolution is 1.11 ps per
code.
2018-10-30 09:57:55 -07:00
Humberto Jimenez
eb4a609ec8 rh: Deterministic latency optimization in JESD204B
- Optimized JESD204B RX/TX links' latency.
- Made JESD latency constant across supported frequencies.
- Checking RX SYSREF capture in the FPGA deframer block.

The JESD204B standard can be linked in such a way to produce a
repeatable, deterministic delay from the framer to deframer. This is
accomplished by setting up a LMFC (local multiframe clock) in both
devices.

The LMFCs are reset whenever a SYSREF edge is captured by the framer
and deframer. Therefore, it is simple to control the LMFC rising edges
in each device by implementing variable delay elements on the SYSREF
pulses to the framer and deframer.

Latency across the JESD204B TX/RX links should remain constant and
deterministic across the supported sampling_clock_rate values. By
testing the roundtrip latency (i.e. FPGA -> TX -> RX -> FPGA) with
different delay values in the FPGA, one may decrease the latency and
provide enough setup and hold margin for the data to be transfered
through each JESD link.

It was found that a different set of SYSREF delay values are required
for sampling_clock_rate = 400 MSPS to match the latency of the other
supported rates.
2018-10-30 09:57:55 -07:00
Mark Meserve
d87ae61d04 rh: add support for rhodium devices
Co-authored-by: Humberto Jimenez <humberto.jimenez@ni.com>
Co-authored-by: Alex Williams <alex.williams@ni.com>
Co-authored-by: Derek Kozel <derek.kozel@ni.com>
2018-10-25 10:30:59 -07:00
Mark Meserve
fad36514e5 nijesdcore: add variable configuration support 2018-10-25 10:30:59 -07:00
Trung Tran
0e30a5ca08 mg: adding skip_rfic argument
This change to add skip_rfic as an device argument.
skip_rfic should be only used in ref_clock bist tests
to bring down the test time.
2018-10-18 18:20:14 -07:00
Mark Meserve
d0de7a5812 mpm: identify sysfs gpios more generically
- Allow generic path names to be given for each search parameter instead of
  only checking the label
2018-10-18 18:15:25 -07:00
Trung Tran
e0d4f92d05 N310: Clarify logging for when re-inits occur 2018-10-16 10:00:59 -07:00
Trung Tran
22ec3e4bd6 mpm: dboard_manager: add more args to update_ref_clock_freq
Summary:
This change will allow correct args to pass from mboard to dboards,
that in turn can be useful for dboard manager.

Details:
In N310, the dboard manager needs the  time source to be updated before
calling update_ref_clock_source(), because it will trigger a reinit of
the dboard, for which the time_source is essential to determine correct
clock synchronizer settings.
The special case is the white rabbit time source needs a different
internal ref_clock_frequency for the clock synchronizer than the passed
in ref_clock_freq.
2018-10-12 10:59:02 -07:00
Trung Tran
3b42e6f029 mpm: mg: move init_rf_cal before JESD de/framer bringup
This sequence is the one as described by the AD9371 user guide.
2018-08-16 13:02:38 -07:00
Sugandha Gupta
4683f0fa18 e320: Add all 5 temp sensors, fan sensor and rssi sensors per channel 2018-08-09 17:39:14 -07:00
Daniel Jepson
065740babd mpm: n3xx: clocking API changes for transitioning clock and time sources
Added set_sync_source method to set both the time and clock sources
without forcing a re-init twice. Modified the existing set_time_source
and set_clock_source methods to call into set_sync_source.
2018-08-02 12:37:34 -07:00
Martin Braun
5f624d6592 mpm: mg: periphs: Modify AD9361 reset function to keep it in reset 2018-08-02 12:37:34 -07:00
Brent Stapleton
5b18614d39 uio: mpm: Fixup for opening mboard-regs UIO
- Fix the syntax to open mboard-regs UIO objects, and change the open()
and close() functions to be private.
- We were calling open() twice in every context manager line- once
manually, and once in __enter__. This commit corrects those usages, and
allows the context manager to fully manage the opening and closing of
UIO objects.
2018-07-23 10:33:34 -07:00
Sugandha Gupta
1e4649ce29 e320: mpm: Add dboard and mboard sensors
Adding the following sensors:
- Catalina temperature, RSSI, and LO Lock sensors
- GPS lock, time, TPV, and SKY sensors

Co-authored-by: Brent Stapleton <brent.stapleton@ettus.com>
2018-07-18 15:37:27 -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
Martin Braun
2787e2dee4 mpm: mg: Adding fast-reinit mode
When a device is re-initialized without any changes (e.g.,
master_clock_rate, ref_clock_freq) then we can skip the initialization
sequence and move on. This shaves a significant amount of time from the
init sequence.

Fast re-init can be overridden by providing the `force_reinit=1` device
arg.
2018-07-17 10:49:21 -07:00
Martin Braun
4a4d1d797f mpm: mg: Move RF cal initialization after JESD init 2018-07-17 10:49:21 -07:00
Martin Braun
e364ad4281 mpm: mg: Store init args between runs 2018-07-17 10:49:21 -07:00
Martin Braun
8e02dec0fb mpm: n3xx: mg: Refactor init code
All code relevant to initializing an N310/N300 daughterboard is moved to
its own module (mg_init.py).

No functional changes.
2018-07-17 10:49:21 -07:00
Martin Braun
6c7a4193a3 mpm: mg: Print AD9371 info as debug message during init 2018-07-17 10:49:21 -07:00
Martin Braun
0935bf5c2a mpm: dboard_manager: Fix docstring for get_serial() 2018-06-18 17:37:11 -07:00