Skip to content

tx_channel

rfsoc_rfdc.transmitter.tx_channel

Classes

TxChannel(dma_ip, fifo_count_ip, target_device, debug_mode=False)

Source code in rfsoc_rfdc/transmitter/tx_channel.py
def __init__(self, dma_ip, fifo_count_ip, target_device, debug_mode=False):
    self.tx_buff = None
    self.tx_dma = dma_ip
    self.warning_cnt = 0
    self.debug_mode = debug_mode
    self.target_device = target_device
    # Config FIFO count IP
    self.fifo_count = fifo_count_ip
    self.fifo_count.setdirection("in")
    self.fifo_count.setlength(32)
Attributes
tx_buff = None instance-attribute
tx_dma = dma_ip instance-attribute
warning_cnt = 0 instance-attribute
debug_mode = debug_mode instance-attribute
target_device = target_device instance-attribute
fifo_count = fifo_count_ip instance-attribute
Functions
data_type_check(buff)
Source code in rfsoc_rfdc/transmitter/tx_channel.py
def data_type_check(self, buff):
    # Validations for input buffers
    if not isinstance(buff, np.ndarray):
        raise TypeError("buff must be of type numpy.ndarray")
    if buff.dtype != MyRFdcType.DATA_PATH_DTYPE:
        raise TypeError("buff must be of data type numpy.int16")
data_copy(buff)
Source code in rfsoc_rfdc/transmitter/tx_channel.py
def data_copy(self, buff):
    self.data_type_check(buff)
    # Buffer copy
    self.tx_buff = allocate(shape=(buff.size,),
                            dtype=MyRFdcType.DATA_PATH_DTYPE, target=self.target_device)
    self.tx_buff[:] = buff[:]
transfer()
Source code in rfsoc_rfdc/transmitter/tx_channel.py
def transfer(self):
    # Monitor FIFO in debug mode
    self._monitor_fifo()
    # Trigger DMA transfer
    self.tx_dma.transfer(self.tx_buff)
stream(duty_cycle=100)
Source code in rfsoc_rfdc/transmitter/tx_channel.py
def stream(self, duty_cycle=100):
    # Monitor FIFO in debug mode
    self._monitor_fifo()
    # Trigger DMA transfer
    self.tx_dma.stream(self.tx_buff, duty_cycle=duty_cycle)