Communication with the RFSoC
Python class that implements all functionality for the communication between a host computer (client) and the RFSoC (server) connected through Ethernet to it.
Configures the antenna front end (Sivers EVK) parameters. The antenna front end is responsible for upconverting the frequency, beamforming and providing the physical interface with the air.
Implements the client side (host computer) functionality of the TCP connection.
Most of the methods of this class were developed by Panagiotis Skrimponis. They were integrated in a class and extended by Julian D. Villegas G.
Source code in a2gmeasurements.py
3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 | |
__init__(radio_control_port=8080, radio_data_port=8081, rfsoc_static_ip_address='10.1.1.40', filename='PDAPs', operating_freq=57510000000.0)
Creates two sockets: one for control commands and another for transfer data.
Establish the connection between the client and the RFSoC.
Some important attributes of this class are:
-
beam_idx_for_vis: this attribute sets the index of the beams of the measured Channel Impulse Response (CIR) that are sent from the drone node to the ground node to be displayed in the GUI. -
TIME_SNAPS_TO_SAVE: number of CIR snapshots to collect before save them on disk. -
TIME_SNAPS_TO_VIS: number of CIR snapshots to be displayed. This value is set depending on the max bytes that can be send through Ethernet in a single message (i.e. 22 time snaps * 16 beams * 4 bytes-per-PAP-entry = 1408 bytes) -
nbeams: number of beams of the CIR to be retrieved from the server. -
nread: number of delay taps of the CIR to be retrieved from the server. -
nbytes: number of bytes of a full CIR (1 time snapshot, 64 beams, 1024 delay taps) -
beam_angles: list of beam angles used in beamforming. Beam angle at index 0 corresponds to the omnidirectional case.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
radio_control_port |
int
|
port for "control socket". Defaults to 8080. |
8080
|
radio_data_port |
int
|
port for "data socket". Defaults to 8081. |
8081
|
rfsoc_static_ip_address |
str
|
static IP address of the rfsoc ethernet interface. Defaults to '10.1.1.40'. |
'10.1.1.40'
|
filename |
str
|
name to be used when saving the CIRs. Defaults to 'PDAPs'. |
'PDAPs'
|
operating_freq |
_type_
|
operating frequency for the antenna array front end. Defaults to 57.51e9. |
57510000000.0
|
Source code in a2gmeasurements.py
3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 | |
finish_measurement()
Kills the rfsoc if it is still alive and saves the remaining CIRs.
Source code in a2gmeasurements.py
maximum_power_direction(array)
Computes the beamforming angle (azimuth) of maximum power at the receiver.
The time under consideration should be short or less than the inverse of the rate of change of the direction of maximum power.
The rate of change of the direction of maximum power is not easy to compute or assume, but we can restrict the computation of the direction to a window of a given ms.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
array |
ndarray
|
this is the array having the IRFs. Its dimensionality is Time x 64 x 2044. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
angleMaxPower |
list
|
contains the (azimuth) angles for maximum power across all the time snapshots considered. Has 64 entries. |
Source code in a2gmeasurements.py
pipeline_operations_rfsoc_rx_ndarray(array, axis, each_n_beams=4)
Computes the PAP for a single snapshot CIR (64 beams * 1024 delay taps) or the PAPs of multiple snapshots CIR (snaps * 64 beams * 1024 delay taps).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
array |
ndarray
|
CIRs. If it has 2 dimensions the CIR correspond to a single snapshot, if it has 3 dimensions, the CIR correspond to multiple snapshots. |
required |
axis |
int
|
delay tap axis, either 0, 1 and 2. |
required |
each_n_beams |
int
|
subsample the 64 beams by this value. Defaults to 4. |
4
|
Returns:
| Name | Type | Description |
|---|---|---|
aux |
ndarray
|
computed PAP "subsampled" version. |
Source code in a2gmeasurements.py
receive_signal_async(stop_event)
Callback for the thread responsible for retrieving CIRs from RFSoC server (rfsoc thread).
When enough (self.TIME_SNAPS_TO_VIS) CIR time snapshots are available, computes the Power Angular Profile to be sent to the ground node for displaying it in the GUI.
When enough (self.TIME_SNAPS_TO_SAVE) CIR time snapshots are available, saves the CIRs on disk.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stop_event |
Event
|
when set, this function does nothing (the thread can be alived but does nothing) |
required |
Source code in a2gmeasurements.py
save_hest_buffer(register_time=True)
Saves the raw (time-snaps, n_beams, n_delay_taps) CIR array.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
register_time |
bool
|
parameter used for debugging purposes. Defaults to True. |
True
|
Source code in a2gmeasurements.py
send_cmd(cmd, cmd_arg=None)
Sends a command to the RFSoC server.
These commands control the Sivers EVK mode, carrier frequncy, tx gain and rx gain.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cmd |
str
|
available commands are: |
required |
cmd_arg |
str | float | dict
|
supported parameters for 'setModeSivers' are 'RXen_0_TXen1', 'RXen1_TXen0', 'RXen0_TXen0'; supported parameters for 'setCarrierFrequencySivers' are float number, i.e.: 57.51e9; supported parameters for 'setGainTxSivers' are dict with this structure {'tx_bb_gain': 0x00, 'tx_bb_phase': 0x00, 'tx_bb_iq_gain': 0x00, 'tx_bfrf_gain': 0x00}; supported parameters for 'setGainRxSivers' are dict with this structure {'rx_gain_ctrl_bb1':0x00, 'rx_gain_ctrl_bb2':0x00, 'rx_gain_ctrl_bb3':0x00, 'rx_gain_ctrl_bfrf':0x00}. Defaults to None. |
None
|
Source code in a2gmeasurements.py
set_rx_rf(rx_gain_ctrl_bb1=119, rx_gain_ctrl_bb2=0, rx_gain_ctrl_bb3=153, rx_gain_ctrl_bfrf=255, carrier_freq=57510000000.0)
Sets rx gains and frequency of operation. Wrapper function of send_cmd.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rx_gain_ctrl_bb1 |
hexadecimal
|
sets the first rx gain for the I,Q according to: I[0:3]:[0,1,3,7,F]:-6:0 dB, 4 steps; Q[0:3]:[0,1,3,7,F]:-6:0 dB, 4 steps. Defaults to 0x77. |
119
|
rx_gain_ctrl_bb2 |
hexadecimal
|
sets the second rx gain for the I,Q according to: I[0:3]:[0,1,3,7,F]:-6:0 dB, 4 steps; Q[0:3]:[0,1,3,7,F]:-6:0 dB, 4 steps. Defaults to 0x00. |
0
|
rx_gain_ctrl_bb3 |
hexadecimal
|
sets the third rx gain for the I,Q according to: I[0:3]:[0,1,3,7,F]:-6:0 dB, 4 steps; Q[0:3]:[0,1,3,7,F]:-6:0 dB, 4 steps. Defaults to 0x99. |
153
|
rx_gain_ctrl_bfrf |
_type_
|
sets gain after the mixer according to; [0:3,RF gain]: 0-15 dB, 16 steps; [4:7, BF gain]: 0-15 dB, 16 steps. Defaults to 0xFF. |
255
|
carrier_freq |
_type_
|
carrier frequency from the available frequency range for the Sivers EVK 06002/3 (in this case: 57-71 GHz). Defaults to 57.51e9. |
57510000000.0
|
Source code in a2gmeasurements.py
start_thread_receive_meas_data(msg_data)
Creates and starts the rfsoc thread.
A thread -instead of a subprocess- is good enough since the computational expense of the task is not donde in the host computer but in the RFSoC. The host just reads the data through Ethernet.
A new thread is started each time this function is called. It is required for the developer to call 'stop_thread_receive_meas_data' before calling again this function in order to close the actual thread before creating a new one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
msg_data |
dict
|
dictionary containing the parameters required by |
required |
Source code in a2gmeasurements.py
stop_thread_receive_meas_data()
Stops the rfsoc thread and saves remaining CIRs.
Source code in a2gmeasurements.py
transmit_signal(tx_bb_gain=3, tx_bb_phase=0, tx_bb_iq_gain=119, tx_bfrf_gain=64, carrier_freq=57510000000.0)
Sets Tx gains and frequency of operation. Wrapper function of send_cmd.
More about TX gains is found in the Sivers EVK manual/reference guides.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tx_bb_gain |
hexadecimal
|
sets baseband gain according to: 0x00 = 0 dB, 0x01 = 3.5 dB, 0x02 = 3.5 dB, 0x03 = 6 dB (when sivers register tx_ctrl bit 3 (BB Ibias set) = 1). Defaults to 0x3. |
3
|
tx_bb_phase |
int
|
description. Defaults to 0. |
0
|
tx_bb_iq_gain |
hexadecimal
|
sets baseband I, Q gain according to: [0:3, I gain]: 0-6 dB, 16 steps; [4:7, Q gain]: 0-6 dB, 16 steps. Defaults to 0x77. |
119
|
tx_bfrf_gain |
hexadecimal
|
sets gain after RF mixer according to: [0:3, RF gain]: 0-15 dB, 16 steps; [4:7, BF gain]: 0-15 dB, 16 steps. Defaults to 0x40. |
64
|
carrier_freq |
_type_
|
carrier frequency from the available frequency range for the Sivers EVK 06002/3 (in this case: 57-71 GHz). Defaults to 57.51e9. |
57510000000.0
|