aboutsummaryrefslogtreecommitdiffstats
path: root/host/python
Commit message (Collapse)AuthorAgeFilesLines
* python: Check rfnoc_version in rfnoc_image_builderWade Fife2022-06-102-1/+28
|
* rfnoc: Update image builder to check for deprecated blocksWade Fife2022-04-121-27/+49
| | | | | | | | | | Adds checks for deprecated blocks (e.g., radio_1x64.yml instead of radio.yml) as well as deprecated IO signature types (e.g., ctrl_port instead of ctrlport). Deprecated block descriptions are no longer parsed. Old IO signature types are automatically converted to the new type. Warnings are printed in both cases.
* n310: Add Filter API to n310mattprost2022-04-071-0/+1
| | | | | | | | | | 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>
* types: filters: Add python support for digital filtersmattprost2022-04-071-0/+2
| | | | Signed-off-by: mattprost <matt.prost@ni.com>
* rfnoc: Update image builder to check for deprecated port namesWade Fife2022-03-311-1/+50
|
* tools: Add general purpose tool for USRP configurationLars Amsel2022-03-236-0/+224
| | | | | | | | Over the years the UHD code base got a whole bunch of tools to control and configure devices. This is an attempt to unify these tools into one. Co-authored-by: Alexander Weber <alexander.weber@ni.com>
* python: Add __init__ to uhd.utilsMartin Braun2022-03-141-0/+0
| | | | | | | | | | | | | | | | | Without this, the following code fails: >>> import uhd >>> U = uhd.usrp.MultiUSRP("type=x4xx") >>> M = U.get_mpm_client() Traceback (most recent call last): File "<input>", line 1, in <module> M = U.get_mpm_client() File ".../uhd/usrp/multi_usrp.py", line 37, in <lambda> setattr(self, 'get_mpm_client', lambda: _get_mpm_client(token, mb_args)) File ".../uhd/usrp/multi_usrp.py", line 19, in _get_mpm_client from uhd.utils import mpmtools ModuleNotFoundError: No module named 'uhd.utils'
* python: rfnoc: Add connect_through_blocks() and get_block_chain()Martin Braun2022-02-241-0/+3
| | | | These RFNoC C++ API calls were previously not exported into Python.
* python: Read number of ports from grc file in image builderAndré Apitzsch2022-02-241-0/+4
|
* python: Fix RuntimeError: dictionary changed size during iterationAndré Apitzsch2022-02-241-1/+1
| | | | Iterate over copy and delete from original dictionary.
* fixup! cmake: Replace distutils.sysconfig with sysconfigSteven Koo2022-01-201-22/+8
| | | | | | | | The original commit incorrectly fails the build uhd in the meta-ettus context. This uses prefix instead to get the base path. Signed-off-by: Steven Koo <steven.koo@ni.com>
* cmake: Replace distutils.sysconfig with sysconfigAaron Rossetto2022-01-141-9/+13
| | | | | | | | | | | | | | | | | | | | This commit replaces uses of distutils.sysconfig's get_python_lib() function with sysconfig's near-equivalent get_path() function to get the directory for site-specific, platform-specific files. Unfortunately, get_path() does not have a way to easily modify or strip the prefix applied to the path like get_python_lib() does, so the code must manually modify the path to get the same effect: - First, the platlib path is retrieved from the get_path() call. - Next, the default base that is used to form the pathlib path is queried via the get_config_var('base') call. - Next, the portion of the platlib path that matches the default base is stripped, and any leading path separator remaining is stripped. This fundamentally replicates the behavior of get_python_lib() with an empty prefix (i.e., the prefix positional parameter is specified as ''). - If a different prefix is desired, then the os.path.join() function is used to combine the new prefix with the stripped pathlib path, ensuring that the platform-specific path separator is used in crafting the path.
* cmake: Replace distutils with CMake for version checksAaron Rossetto2022-01-141-1/+2
| | | | | | | This commit replaces the use of distutils.version.LooseVersion() with CMake's version comparison operator, which implements relational version string checking in the same manner (i.e., comparing numeric components of a version string numerically).
* fixup! uhd: Allow pass raw IQ data array to tone generatorLars Amsel2022-01-131-1/+1
|
* uhd: Allow pass raw IQ data array to tone generatorLars Amsel2022-01-101-4/+15
| | | | | | | | Instead of calculating a tone from its parameter it is also useful to pass an precalculated signal to be played. This change modifies the __init__ to take an iq_data as parameter for the internal buffer and moves the generation of the tone from rate, frequency and amplitude into a class method. The streamer parameter was deleted (never used).
* tools: Add check for SEP with ctrl enabled to rfnoc_image_builderLars Amsel2021-12-161-0/+13
| | | | | | | | | When creating RFNoC images at least one SEP needs to have ctrl enabled otherwise one will end up with a non-functional image. This commit adds a method to the image builder to do plausibility checks on the configuration. The only check done for now is to verify that there is at least one SEP with ctrl enabled.
* python: multi_usrp: Fix issues in send_waveform()Martin Braun2021-10-061-12/+29
| | | | | | | - Like with RX, this now allows passing in stream time and existing streamer - There was no EOB being sent at the end (now there is) - Fixed some linter issues
* python: multi_usrp: Fix issues with recv_num_samps()Martin Braun2021-10-061-24/+63
| | | | | | | | | - This function didn't set the time properly for multi-chan rx - There was no way to set a start time manually - It relied on garbage collection and correct destruction of streamers when being called multiple times. Addressed this by adding an option to pass in an existing streamer object. - Linter wasn't too happy with this function.
* cmake: Replace CMAKE_{SOURCE,BINARY}_DIR with UHD_*_DIRMartin Braun2021-09-101-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | See the CMake 3.8 documentation on these two variables: https://cmake.org/cmake/help/v3.8/variable/PROJECT-NAME_SOURCE_DIR.html https://cmake.org/cmake/help/v3.8/variable/CMAKE_SOURCE_DIR.html Under normal circumstances, these two are identical. For sub-projects (i.e., when building UHD as part of something else that is also a CMake project), only the former is useful. There is no discernible downside of using UHD_SOURCE_DIR over CMAKE_SOURCE_DIR. This was changed using sed: $ sed -i "s/CMAKE_SOURCE_DIR/UHD_SOURCE_DIR/g" \ `ag -l CMAKE_SOURCE_DIR **/{CMakeLists.txt,*.cmake}` $ sed -i "s/CMAKE_BINARY_DIR/UHD_BINARY_DIR/g" \ `ag -l CMAKE_BINARY_DIR **/{CMakeLists.txt,*.cmake}` At the same time, we also replace the CMake variable UHD_HOST_ROOT (used in MPM) with UHD_SOURCE_DIR. There's no reason to have two variables with the same meaning and different names, but more importantly, this means that UHD_SOURCE_DIR is defined even in those cases where MPM calls into CMake files from UHD without any additional patches. Shoutout to GitHub user marcobergamin for bringing this up.
* rfnoc: Add vivado-path to rfnoc_image_builderWade Fife2021-09-101-0/+2
| | | | | | | Adds a --vivado-path option to rfnoc_image_builder that, if present, gets passed to setupenv.sh for the target device. This can be used to specify the location of Vivado if it is not installed in one of the default search locations.
* cal: Add tune-settling timeMartin Braun2021-06-241-0/+5
| | | | | | This is a device-specific parameter to allow for the tune to settle before proceeding with the calibration. On X410, we set this time to 500 ms. On other devices, we leave it at 0.
* cal: ensure proper range handlingLars Amsel2021-06-231-5/+9
| | | | | | | | | | | * frequency range adapts the lower limit to align with the step size the lower limit will be set to step size if it s smaller than the step size and not explicitly set. This prevents uneven measurment spots * aranges upper limit is always increased by step size to ensure the upper limit is part of the range * rearranged gain range calculation, create the range once and reverse it for RX
* cal: Remove silent capture of TypeErrorLars Amsel2021-06-231-6/+4
| | | | | | | Remove the silent capture of TypeError because it would also catch TypeErrors is initilization errors in class creation. Instead check obj to be a class first to ensure issubclass wont throw a TypeError.
* cal: add more error number for ADC overloadLars Amsel2021-06-231-1/+5
| | | | also added short comment which erro originates from which driver
* cal: Add support for X410Martin Braun2021-06-231-0/+11
|
* uhd: Add support for the USRP X410Lars Amsel2021-06-105-30/+43
| | | | | | | | | | | | | | | | 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>
* cal: Add min_freq and max_freq attributes to USRPCalibratorBaseMartin Braun2021-06-101-2/+4
| | | | | | | These allow specifying a min/max frequency on a device basis, instead of querying those from get_?x_freq_range(). The trouble with those methods is, they include the tune range provided by DSP tuning, which is not what we want for this calibration.
* cal: Fix minor issues in the calibration utilitiesMartin Braun2021-06-103-12/+13
| | | | | | - Whitespace issues - Unclear help messages - Unnecessary derive-from-object
* fpga: Change RFNoC YAML version numbers to stringsWade Fife2021-06-081-2/+2
| | | | | Change version from a numeric to a string, in order to differentiate between versions like "1.1" and "1.10".
* python: Add graceful exit of claim loop on SIGTERMLars Amsel2021-06-031-19/+58
|
* rfnoc: Add image_core_name option to rfnoc_image_builderWade Fife2021-06-022-10/+16
| | | | | | This change adds the ability to specify in the YAML description for your RFNoC image what the rfnoc_image_core should be named. This allows you to have multiple RFNoC image cores generated for the same target.
* python: Add rfnoc_image_core.vh generationWade Fife2021-06-022-1/+87
| | | | | | This causes a header file, rfnoc_image_core.vh, to be generated along with rfnoc_image_core.v so that parameters like the CHDR width can be shared betweend RFNoC and the BSP.
* python: Update RFNoC image builder to use CHDR_W parameterWade Fife2021-06-022-10/+17
| | | | | | CHDR_W was previosly hard coded to be 64, regardless of what the YAML indicated. This updates to code to pull in the chdr_width from the YAML image configuration file.
* mpm: add unit tests for EEPROM readersLars Amsel2021-05-311-0/+1
|
* python: Add find() to the Python APIMartin Braun2020-12-073-0/+6
| | | | | | | | | | | | This a mapping of uhd::device::find() into uhd.find() on the Python side. The uhd::device is intentionally not mapped into Python (prefer MultiUSRP or RfnocGraph instead), so the namespace is moved up one level. Example: >>> import uhd >>> # Now print the device args for all found B200s: >>> for dev_args in uhd.find("type=b200")): print(dev_args.to_string())
* python: multi_usrp: Add get_mpm_client() API callMartin Braun2020-12-041-2/+17
| | | | | | | | | | | This is a new API call, only available on Python, and only available for MPM devices (it is added dynamically). It returns an object that allows calling RPC calls in a Pythonic manner. Example: >>> rpcc = usrp.get_mpm_client() >>> print(rpcc.get_device_info()) # Will print device info, as returned # by uhd_find_devices
* python: Add mpmtools moduleMartin Braun2020-12-041-0/+173
| | | | | This adds tools to create MPM clients and talk to MPM through Python scripts.
* python: Clean up image builder generated codeWade Fife2020-11-069-117/+142
| | | | | This updates the RFNoC image to generate code that's a bit more tidy, with consistent spacing and better alignment.
* python: Add access to the property_tree from PythonMartin Braun2020-10-164-0/+20
| | | | | | | Example: >>> usrp = uhd.usrp.multi_usrp("") >>> tree = usrp.get_tree() >>> print(tree.access_int("/name").get())
* python: Move multi_usrp_python to its own moduleMartin Braun2020-10-121-1/+4
| | | | | This helps with recompilation times of UHD. No functional changes.
* sim: Embed MPM into libpyuhdSamuel O'Brien2020-10-071-0/+57
| | | | | | | When ENABLE_SIM and ENABLE_PYTHON_API are set, this commit embeds MPM (Built with -DMPM_DEVICE=sim) into the pyuhd package. Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
* cmake: Use relative path to Python lib location for Windows installerAaron Rossetto2020-08-281-5/+17
|
* python: power cal: Minor fixes to power cal codeMartin Braun2020-08-171-4/+8
| | | | | | | | - Fix some typos - Fix incorrect arg name for RFSGPowerGenerator.enable() - Fix case where incorrect args would cause an uncaught TypeError. Now, if USRP is chose as signal generator, but fails to find one, a proper error is shown.
* python: Change default name for rfnoc_image_coreWade Fife2020-08-101-5/+11
| | | | | | | | This changes the default name of the image core file to <DEVICE>_rfnoc_image_core.v instead of naming it after the YAML file. This ensures that when you use a custom YAML file, the resulting FPGA build will use the generated rfnoc_image_core and static_router files, rather than just the generated static_router file.
* python: Add Keep One in N block controller bindingsAaron Rossetto2020-08-052-0/+3
|
* python: Add replay RFNoC block controller bindingsmattprost2020-08-042-0/+3
| | | | Signed-off-by: mattprost <matt.prost@ni.com>
* python: Fix pyuhd to include subpackagesSamuel O'Brien2020-08-041-2/+6
| | | | | | | | | | | | | | | | | Originally, the setup.py file for pyuhd listed only one package packages=['uhd'] the setuptools docs: https://setuptools.readthedocs.io/en/latest/setuptools.html#using-find-packages specify that this should also include subpackages, i.e uhd.dsp, uhd.usrp, etc. Currently, when packaging libpyuhd, we are not including the subpackages, and then when you run `import uhd`, it fails because uhd.usrp and uhd.dsp don't exist. This commit alleviates this issue by using setuptools.find_packages like the docs recommend. Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
* utils: Use absolute paths in image builder build()steviez2020-07-311-2/+2
| | | | | | | A segment of the build() function updates the working directory. This change converts several paths to absolute paths to avoid having a relative path (such as one containing up-level references) deviate from its' intended meaning after the directory change.
* python: Add siggen RFNoC block controller bindingsAaron Rossetto2020-07-302-0/+3
|
* python: Add Switchboard block python bindingsJesse Zhang2020-07-302-0/+3
|