Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
resources:fpga:docs:axi_tdd [27 Sep 2021 16:01] – [Linux IIO Driver] David Winterresources:fpga:docs:axi_tdd [07 Oct 2022 06:48] – [Theory of Operation] Ionut Podgoreanu
Line 1: Line 1:
-====== Timing-Division Duplexing (TDD) Controller ======+====== Generic Time-Division Duplexing Controller ====== 
 + 
 +TDD (Time-Division Duplex) mode allows the user to control the time period of the receive and transmit bursts.  
 + 
 +The generic TDD controller is in essence a waveform generator capable of addressing RF applications which require Time Division Duplexing, as well as controlling other modules of general applications through its dedicated 32 channel outputs. 
 + 
 +The reason of creating the generic TDD controller was to reduce the naming confusion around the existing repurposed [[resources:eval:user-guides:ad-pzsdr2400tdd-eb:reference_hdl#TDD Controller|TDD core]] built for AD9361, as well as expanding its number of output channels for systems which require more than six controlling signals.
  
-The AXI TDD engine is a relatively simple peripheral originally intended to be used for TDD (wireless) communication systems. 
  
 ===== Features ===== ===== Features =====
  
-  * independent output channels +  * Up to 32 independent output channels 
-  * Primary and secondary timing per channel  +  * Start/stop time values per channel 
-  * 24 bit accumulator +  * Enable and polarity bit values per channel  
-  * External (1 PPS, shared or from GPSDO, etc.) synchronization to work with multiple devices+  * 32 bit-max internal reference counter 
 +  * Initial startup delay before waveform generation 
 +  * Configurable frame length and number of frames per burst 
 +  * 3 sources of synchronization: external, internal and software generated 
  
 ===== Utilization ===== ===== Utilization =====
Line 19: Line 28:
  
 ^ Name ^ Description ^ ^ Name ^ Description ^
-| [[https://github.com/analogdevicesinc/hdl/blob/master/library/axi_tdd/axi_tdd.v|axi_tdd.v]] | Verilog source for the peripheral. | +| [[https://github.com/analogdevicesinc/hdl/blob/dev_tdd_pr/library/axi_tdd/axi_tdd.sv|axi_tdd.sv]] | Top module | 
-| [[https://github.com/analogdevicesinc/hdl/blob/master/library/common/ad_tdd_control.v|ad_tdd_control.v]] | Main TDD controller - manages the signals +| [[https://github.com/analogdevicesinc/hdl/blob/dev_tdd_pr/library/axi_tdd/axi_tdd_pkg.sv|axi_tdd_pkg.sv]] | SystemVerilog Package 
-| [[https://github.com/analogdevicesinc/hdl/blob/master/library/common/up_tdd_cntrl.v|up_tdd_cntrl.v]] | ''up'' interface (Later bridged to AXIL) |+| [[https://github.com/analogdevicesinc/hdl/blob/dev_tdd_pr/library/axi_tdd/axi_tdd_regmap.sv|axi_tdd_regmap.sv]] | Register Map with CDC synchronizers | 
 +| [[https://github.com/analogdevicesinc/hdl/blob/dev_tdd_pr/library/axi_tdd/axi_tdd_counter.sv|axi_tdd_counter.sv]] | Internal counters and FSM logic | 
 +| [[https://github.com/analogdevicesinc/hdl/blob/dev_tdd_pr/library/axi_tdd/axi_tdd_channel.sv|axi_tdd_channel.sv]] | Channel waveform generator | 
 +| [[https://github.com/analogdevicesinc/hdl/blob/dev_tdd_pr/library/axi_tdd/axi_tdd_sync_gen.sv|axi_tdd_sync_gen.sv]] | Synchronization pulse generator | 
 +| [[https://github.com/analogdevicesinc/hdl/blob/dev_tdd_pr/library/axi_tdd/axi_tdd_ip.tcl|axi_tdd_ip.tcl]] | TCL script to generate the Vivado IP-integrator project 
 +| [[https://github.com/analogdevicesinc/hdl/blob/dev_tdd_pr/library/axi_tdd/axi_tdd_hw.tcl|axi_tdd_hw.tcl]] | TCL script to generate the Quartus IP-integrator project |
 | [[https://github.com/analogdevicesinc/linux/blob/master/drivers/iio/adc/cf_axi_tdd.c|cf_axi_tdd.c]] | TDD Linux Driver | | [[https://github.com/analogdevicesinc/linux/blob/master/drivers/iio/adc/cf_axi_tdd.c|cf_axi_tdd.c]] | TDD Linux Driver |
 | [[https://github.com/analogdevicesinc/linux/blob/master/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-rev10-ad9081-m8-l4-tdd.dts|zynqmp-zcu102-rev10-ad9081-m8-l4-tdd.dts]] | Device tree using TDD | | [[https://github.com/analogdevicesinc/linux/blob/master/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-rev10-ad9081-m8-l4-tdd.dts|zynqmp-zcu102-rev10-ad9081-m8-l4-tdd.dts]] | Device tree using TDD |
  
 +
 +===== Synthesis Configuration Parameters =====
 +
 +^ Name ^ Description ^ Max value ^ Default ^
 +| ''ID'' | Instance identification number | - | 0 |
 +| ''CHANNEL_COUNT'' | Number of channels | 32 | 8 |
 +| ''DEFAULT_POLARITY'' | Initial channel polarity | 32'hFFFFFFFF | 8'h00 |
 +| ''REGISTER_WIDTH'' | Internal counter and register width | 32 | 32 |
 +| ''BURST_COUNT_WIDTH'' | Burst counter width | 32 | 32 |
 +| ''SYNC_INTERNAL'' | Enable support for internal sync signal | 1 | 1 |
 +| ''SYNC_EXTERNAL'' | Enable support for external sync signal | 1 | 0 |
 +| ''SYNC_EXTERNAL_CDC'' | Enable synchronization of external sync signal | 1 | 0 |
 +| ''SYNC_COUNT_WIDTH'' | Sync generator counter width | 64 | 64 |
 +===== Signal and Interface Pins =====
 +
 +{{:resources:fpga:docs:axi_tdd:axi_tdd_vivado.png|}}
 +
 +^ Name ^ Type ^ Description ^
 +| ''s_axi_aclk''   | Clock  | System clock |
 +| ''s_axi_aresetn''   | Synchronous active low reset | System reset |
 +| ''s_axi'' | AXI-Lite bus slave | Memory mapped AXI-Lite bus that provides access to module's register map |
 +| ''clk''   | Clock  | Core clock |
 +| ''resetn''   | Synchronous active low reset | Core reset |
 +| ''sync_in'' | ''input'' | External synchronization input signal |
 +| ''sync_out'' | ''output'' | Module synchronization output signal |
 +| ''tdd_channel'' | ''output'' | Channels output |
 +===== Register Map =====
 +
 +{{page>:resources:fpga:docs:hdl:regmap##generic_tdd_control_axi_tdd&nofooter&noeditbtn}}
 +
 +|< 100% 10em 10em >|
 +^ Access Type ^ Name ^ Description ^
 +| HR | Hardware-reset | Register field is reset by hardware. |
 +| R | Read-only | Reads will return the current register value. Writes have no effect. |
 +| RW | Read-write | Reads will return the current register value. Writes will change the current register value. |
 +| U | Unimplemented | Register field is unimplemented. |
 ===== Theory of Operation ===== ===== Theory of Operation =====
  
-The central idea of the TDD engine is "frame"-based operation, i.e. all the timing defined for the individual channels is relative to the beginning of a frame. The ''frame_length'' parameter controls the length of a single frame, while the ''burst_count'' parameter controls how many frames should be played after enabling the device (value of 0 means frames will be repeated indefinitely). Another important aspect of the peripheral is the external synchronization capabilitywhich allows the alignment of frames between multiple devices in different locations for example using a GPSDO 1 PPS output.+The central idea of the TDD controller is frame-based operation, i.e. all the timing defined for the individual channels is relative to the beginning of a frame. The ''FRAME_LENGTH'' value controls the length of a single frame, while the ''BURST_COUNT'' value controls how many frames should be played after enabling the device (value of 0 means frames will be repeated indefinitely). Before the start of a burst, an optional startup delay is inserteddefined by the ''STARTUP_DELAY'' value in clock cycles.
  
 {{:resources:fpga:docs:axi_tdd:axi_tdd_diagram.png|}} {{:resources:fpga:docs:axi_tdd:axi_tdd_diagram.png|}}
Line 35: Line 85:
 <note tip>While the above graphic shows all channels being enabled in a stacked manner, they are completely independent of each other!</note> <note tip>While the above graphic shows all channels being enabled in a stacked manner, they are completely independent of each other!</note>
  
-===== Connectivity ===== 
  
-{{:resources:fpga:docs:axi_tdd:axi_tdd_vivado.png|}}+==== Detailed description ====
  
-  * Sample ''clk'' & ''rst'' +In order to begin its operationthe peripheral must be enabled. This is done by setting the ''ENABLE'' bit. Nextthe peripheral waits to receive a sync signal. There are 3 possible sync sourceswhich can be independently activated through their corresponding enabling bits: ''SYNC_INT'', ''SYNC_EXT'' and ''SYNC_SOFT'' can all be active at the same time. 
-  * AXI4-Lite (Interface, ''s_axi_aclk'', ''s_axi_aresetn''+
-  * 6 TDD output channels ( ''tdd_{rx,tx}_{vco,rf}_en''''tdd_{rx,tx}_valid'' +
-  * 1 PPS TDD synchronization input: ''tdd_sync'' +
-  * Status output: ''tdd_enabled''+
  
 +The external synchronization capability allows the alignment of frames between multiple devices in different locations, for example using a GPSDO 1 PPS output. The internal sync signal is generated based on a dedicated counter, when its value matches the one defined in ''SYNC_COUNTER_LOW'' / ''SYNC_COUNTER_HIGH''. The software generated sync pulse is triggered at an arbitrary point in time when writing a ‘1’ value in ''SYNC_SOFT''.
  
-===== Register Map =====+The next diagram shows the peripheral’s FSM, which transitions between 4 states: IDLE, ARMED, WAITING and RUNNING. 
 + 
 +{{:resources:fpga:docs:axi_tdd:axi_tdd_fsm.png?500|}} 
 + 
 +In case a synchronization signal is received while the TDD core is running, the signal can reset the internal counter to zero by setting ''SYNC_RST'' to ‘1’. This can alter the counter value in both WAITING or RUNNING states. 
 + 
 +The generic TDD controller can have up to 32 output channels, each of them having its unique values when the channel is set/reset under ''CHX_ON'' / ''CHX_OFF''. They are continuously compared to internal counter’s value while the core is RUNNING. 
 + 
 +Every bit in ''CHANNEL_ENABLE'' / ''CHANNEL_POLARITY'' corresponds to a specific channel. The bit position is correlated to the channel index, so the LSB will always be associated with CH0 and the MSB with CH31. 
 + 
 +The following registers will not be updated unless the peripheral is disabled: 
 +  * ''BURST_COUNT'' 
 +  * ''STARTUP_DELAY'' 
 +  * ''FRAME_LENGTH'' 
 +  * ''CHANNEL_POLARITY'' 
 +  * ''SYNC_COUNTER_LOW'' 
 +  * ''SYNC_COUNTER_HIGH'' 
 +  * ''CHX_ON'' 
 +  * ''CHX_OFF'' 
 + 
 +The user should configure them before enabling the peripheral. Any subsequent write while the peripheral is enabled will be ignored.
  
-<hidden>+An exception to this rule is ''CHANNEL_ENABLE'', which allows enabling / disabling independent channels on-the-fly. The new value will come into effect only when in ARMED state or at the end of a frame. ''CONTROL'' can also be modified on-the-fly with immediate effect (after going through the synchronization stage).
  
-|< 100% 5% 5% 5% 25% 5% 5% 50% >| +''STATUS'' can be used for debugging purposesreflecting the current peripheral state.
-|Address ||Bits |Name |Type |Default |Description | +
-|DWORD |BYTE |::: |::: |::: |::: |::: | +
-^0x0010 ^0x0040 ^REG_TDD_CONTROL_0 ^^^^TDD Control & Status ^ +
-| | |[5] |TDD_GATED_TX_DMAPATH |RW |0x0 |If this bit is set, the core requests data from the TX DMA, just when the data path is active. Otherwise will requests continuously on the adjusted rate. The purpose of this feature is to facilitate debug. This bit must be SET to preserve data integrity. | +
-|::: |::: |[4] |TDD_GATED_RX_DMAPATH |RW |0x0 |If this bit is set, the core provides data for the RX DMAjust when the data path is active. Otherwise will provides continuously on the adjusted rate. The purpose of this feature is to facilitate debug. This bit must be SET to preserve data integrity. | +
-|::: |::: |[3] |TDD_TXONLY |RW |0x0 |If this bit is set- the TDD controller ignores all the TX_* timing registers  below and assumes continuous receive operation within a frame. +
-|::: |::: |[2] |TDD_RXONLY |RW |0x0 |If this bit is set- the TDD controller ignores all the RX_* timing registers  below and assumes continuous transmit operation within a frame. | +
-|::: |::: |[1] |TDD_SECONDARY |RW |0x0 |Enable the secondary transmit/receive on the active frame. If this bit is clear the controller only uses the _1 timing registers below. If this bit is set -  the controller uses the _1 and _2 timing registers below. | +
-|::: |::: |[0] |TDD_ENABLE |RW |0x0 |If set, enables the TDD controller- software must set this bit after programming  all the registers that controls the tdd timing. Any device settings needs to be  done (for example bring the AD9361 to the alert state) prior to to setting this  bit. The controller keeps the frame counters in reset if this bit is reset.  A 0 to 1 transition in this bit starts the frame counter and tdd mode of operation. | +
-^0x0011 ^0x0044 ^REG_TDD_CONTROL_1 ^^^^TDD Control & Status ^ +
-| | |[7:0] |TDD_BURST_COUNT |RW |0x00 |If set to 0x0 and enabled (TDD_ENABLE is set) - the controller operates in TDD mode as long as the TDD_ENABLE bit is set. If set to a non-zero value, the controller operates for the set number of frames and stops. | +
-^0x0012 ^0x0048 ^REG_TDD_CONTROL_2 ^^^^TDD Control & Status ^ +
-| | |[23:0] |TDD_COUNTER_INIT |RW |0x000000 |The controller sets the frame counter to this value when starting TDD operation.  This is the starting offset value for the TDD frame counter. | +
-^0x0013 ^0x004c ^REG_TDD_FRAME_LENGTH ^^^^TDD Control & Status ^ +
-| | |[23:0] |TDD_FRAME_LENGTH |RW |0x000000 |The frame length is the terminal count for the 10ms counter running at the digital  interface clock- as an example for a 245.76MHz clock it is 0x258000. | +
-^0x0014 ^0x0050 ^REG_TDD_SYNC_TERMINAL_TYPE ^^^^TDD Control & Status ^ +
-| | |[0] |TDD_SYNC_TERMINAL_TYPE |RW |0x0 |Set this bit, if the current terminal will generate the syncronization pulse, reset otherwise. | +
-^0x0018 ^0x0060 ^REG_TDD_STATUS ^^^^TDD Control & Status ^ +
-| | |[0] |TDD_RXTX_VCO_OVERLAP |RO |0x0 |This bit is asserted, if exist a time interval when both the TX and RX VCOs are powered up. | +
-|::: |::: |[1] |TDD_RXTX_RF_OVERLAP |RO |0x0 |This bit is asserted, if exist a time interval when both the TX and RX RF datapath are powered up. | +
-^0x0020 ^0x0080 ^REG_TDD_VCO_RX_ON_1 ^^^^TDD Control & Status ^ +
-| | |[23:0] |TDD_VCO_RX_ON_1 |RW |0x000000 |Defines the offset (from frame count equal zero), when the RX VCO powers up at the first time.  The controller enables the receive VCO, when the frame count reaches this value.  The VCO may have to be enabled before data can be received. The user needs to make sure,  that the RF device is in a state, from where this operation is valid. +
-^0x0021 ^0x0084 ^REG_TDD_VCO_RX_OFF_1 ^^^^TDD Control & Status ^ +
-| | |[23:0] |TDD_VCO_RX_OFF_1 |RW |0x000000 |Defines the offset (from frame count equal zero), when the RX VCO powers down at the first  time. The controller disables the receive VCO, when the frame count reaches this value.  The user needs to make sure, that the RF device is in a state, from where this operation  is valid. | +
-^0x0022 ^0x0088 ^REG_TDD_VCO_TX_ON_1 ^^^^TDD Control & Status ^ +
-| | |[23:0] |TDD_VCO_TX_ON_1 |RW |0x000000 |Defines the offset (from frame count equal zero), when the TX VCO powers up at the first time.  The controller enables the transmit VCO, when the frame count reaches this value. The user  needs to make sure, that the RF device is in a state, from where this operation is valid. | +
-^0x0023 ^0x008c ^REG_TDD_VCO_TX_OFF_1 ^^^^TDD Control & Status ^ +
-| | |[23:0] |TDD_VCO_TX_OFF_1 |RW |0x000000 |Defines the offset (from frame count equal zero), when the TX VCO powers down at the first  time. The controller disables the transmit VCO when the frame count reaches this value.  The user needs to make sure, that the RF device is in a state, from where this operation  is valid. | +
-^0x0024 ^0x0090 ^REG_TDD_RX_ON_1 ^^^^TDD Control & Status ^ +
-| | |[23:0] |TDD_RX_ON_1 |RW |0x000000 |Defines the offset (from frame count equal zero), when the RX data path is activated at the  first time. The controller enables the receive chain when the frame count reaches this value.  The user needs to make sure, that the RF device is in a state, from where this operation is valid. | +
-^0x0025 ^0x0094 ^REG_TDD_RX_OFF_1 ^^^^TDD Control & Status ^ +
-| | |[23:0] |TDD_RX_OFF_1 |RW |0x000000 |Defines the offset (from frame count equal zero), when the RX data path is deactivated the  first time. The controller disables the receive chain when the frame  count reaches this value. The user needs to make sure, that the RF device is in  a state, from where this operation is valid. +
-^0x0026 ^0x0098 ^REG_TDD_TX_ON_1 ^^^^TDD Control & Status ^ +
-| | |[23:0] |TDD_TX_ON_1 |RW |0x000000 |Defines the offset (from frame count equal zero), when the TX data path is activated at the  first time. The controller enables the transmit chain, when the frame  count reaches this value. This register and the TX_DP_ON register controls the delay between the data path being activated and the time to actually push the  transmit data through the transmit chain in the device. | +
-^0x0027 ^0x009c ^REG_TDD_TX_OFF_1 ^^^^TDD Control & Status ^ +
-| | |[23:0] |TDD_TX_OFF_1 |RW |0x000000 |Defines the offset (from frame count equal zero), when the TX data path is deactivated at the  first time. The controller disables the transmit chain, when the frame  count reaches this value. This register and the TX_DP_OFF register controls the  delay between the data path being deactivated and the time to actually stop  transmitting data through the transmit chain in the device. | +
-^0x0028 ^0x00a0 ^REG_TDD_RX_DP_ON_1 ^^^^TDD Control & Status ^ +
-| | |[23:0] |TDD_RX_DP_ON_1 |RW |0x000000 |Defines the offset (from frame count equal zero), when the controller starts to accept data from  the digital interface for receive. | +
-^0x0029 ^0x00a4 ^REG_TDD_RX_DP_OFF_1 ^^^^TDD Control & Status ^ +
-| | |[23:0] |TDD_RX_DP_OFF_1 |RW |0x000000 |Defines the offset (from frame count equal zero), when the controller stops to accept data from  the digital interface for receive. | +
-^0x002A ^0x00a8 ^REG_TDD_TX_DP_ON_1 ^^^^TDD Control & Status ^ +
-| | |[23:0] |TDD_TX_DP_ON_1 |RW |0x000000 |Defines the offset (from frame count equal zero), when the controller starts to request data from the system memory for transmit. The data rate is controlled by the TDD controller. | +
-^0x002B ^0x00ac ^REG_TDD_TX_DP_OFF_1 ^^^^TDD Control & Status ^ +
-| | |[23:0] |TDD_TX_DP_OFF_1 |RW |0x000000 |Defines the offset (from frame count equal zero), when the controller stop requesting data from the system memory for transmit. | +
-^0x0030 ^0x00c0 ^REG_TDD_VCO_RX_ON_2 ^^^^TDD Control & Status ^ +
-| | |[23:0] |TDD_VCO_RX_ON_2 |RW |0x000000 |The secondary pointer for VCO_RX_ON. +
-^0x0031 ^0x00c4 ^REG_TDD_VCO_RX_OFF_2 ^^^^TDD Control & Status ^ +
-| | |[23:0] |TDD_VCO_RX_OFF_2 |RW |0x000000 |The secondary pointer for VCO_RX_OFF. | +
-^0x0032 ^0x00c8 ^REG_TDD_VCO_TX_ON_2 ^^^^TDD Control & Status ^ +
-| | |[23:0] |TDD_VCO_TX_ON_2 |RW |0x000000 |The secondary pointer for VCO_TX_ON. | +
-^0x0033 ^0x00cc ^REG_TDD_VCO_TX_OFF_2 ^^^^TDD Control & Status ^ +
-| | |[23:0] |TDD_VCO_TX_OFF_2 |RW |0x000000 |The secondary pointer for VCO_TX_OFF. | +
-^0x0034 ^0x00d0 ^REG_TDD_RX_ON_2 ^^^^TDD Control & Status ^ +
-| | |[23:0] |TDD_RX_ON_2 |RW |0x000000 |The secondary pointer for RX_ON. | +
-^0x0035 ^0x00d4 ^REG_TDD_RX_OFF_2 ^^^^TDD Control & Status ^ +
-| | |[23:0] |TDD_RX_OFF_2 |RW |0x000000 |The secondary pointer for RX_OFF. | +
-^0x0036 ^0x00d8 ^REG_TDD_TX_ON_2 ^^^^TDD Control & Status ^ +
-| | |[23:0] |TDD_TX_ON_2 |RW |0x000000 |The secondary pointer for TX_ON. | +
-^0x0037 ^0x00dc ^REG_TDD_TX_OFF_2 ^^^^TDD Control & Status ^ +
-| | |[23:0] |TDD_TX_OFF_2 |RW |0x000000 |The secondary pointer for TX_OFF. | +
-^0x0038 ^0x00e0 ^REG_TDD_RX_DP_ON_2 ^^^^TDD Control & Status ^ +
-| | |[23:0] |TDD_RX_DP_ON_2 |RW |0x000000 |The secondary pointer for RX_DP_ON. | +
-^0x0039 ^0x00e4 ^REG_TDD_RX_DP_OFF_2 ^^^^TDD Control & Status ^ +
-| | |[23:0] |TDD_RX_DP_OFF_2 |RW |0x000000 |The secondary pointer for RX_DP_OFF. | +
-^0x003A ^0x00e8 ^REG_TDD_TX_DP_ON_2 ^^^^TDD Control & Status ^ +
-| | |[23:0] |TDD_TX_DP_ON_2 |RW |0x000000 |The secondary pointer for TX_DP_ON. | +
-^0x003B ^0x00ec ^REG_TDD_TX_DP_OFF_2 ^^^^TDD Control & Status ^ +
-| | |[23:0] |TDD_TX_DP_OFF_2 |RW |0x000000 |The secondary pointer for TX_DP_OFF|+
  
-</hidden>+By adapting the synthesis parameters to the application requirements, the module is highly flexible and can substantially reduce resource utilization.
  
 ===== Linux IIO Driver ===== ===== Linux IIO Driver =====
Line 194: Line 192:
  
  
 +{{navigation HDL User Guide#ip_cores|IP cores#hdl|Main page#tips|Using and modifying the HDL design}}
resources/fpga/docs/axi_tdd.txt · Last modified: 27 Jul 2023 21:56 by Ionut Podgoreanu