Changes between Version 4 and Version 5 of WARPLab/Reference/TriggerManager


Ignore:
Timestamp:
May 15, 2013, 5:44:12 PM (11 years ago)
Author:
chunter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WARPLab/Reference/TriggerManager

    v4 v5  
    11[[TracNav(WARPLab/TOC)]]
    22
    3 = Trigger Manager =
     3= Reference Design Trigger Manager Modules =
    44
    5 == System Requirements ==
    6  * Review the [wiki:../../Requirements WARPLab 7 System Requirements]
     5== [wiki:./TriggerProcessor Trigger Processor] ==
    76
    8 == Overview ==
    9 
    10 The Trigger Manager was designed to allow flexible coordination and communication between nodes.  Each trigger is assigned an ID and then all configuration of the trigger manager is based on these IDs.  By default, WARPLab has the following triggers:
    11 
    12 * Input Triggers
    13   * External Pins (For example:  D0 - D3, pins 12 - 15 on the [wiki:WARPLab/HardwareConfiguration#DebugHeader debug header] in the WARPLab reference design)
    14   * Ethernet Packets
    15   * Register writes (used for WARP v2 compatibility)
    16   * Input Energy
    17   * Automatic Gain Control (AGC) Done
    18 
    19 [[Image(Trigger_Input_Configuration.png)]]
    20 
    21   '''NOTE:''' Each input has configuration options that can be found in the [wiki:WARPLab/Reference/Commands/TriggerManager Trigger Manager Command Reference].
    22 
    23 
    24 * Output Triggers
    25   * External Pins (For example:  D0 - D3, pins 8 - 11 on the [wiki:WARPLab/HardwareConfiguration#DebugHeader debug header] in the WARPLab reference design)
    26   * Baseband
    27   * Automatic Gain Control (AGC) Start
    28 
    29 [[Image(Trigger_Output_Configuration.png)]]
    30 
    31   '''NOTE:''' Each output can be based on a configurable set of inputs as well as a logical combination of inputs.  The above diagram is replicated per trigger output, so that each one can have its own, independent configuration.
    32 
    33 
    34 == Hardware Setup ==
    35 
    36 The Trigger Manager consists of both a hardware block that runs within the FPGA and a [wiki:WARPLab/Reference/Commands/TriggerManager software framework] to configure and use the Trigger Manager.  You can see the instantiation of the Trigger Manager block as well as the default connections within the system.mhs file:
    37 
    38 {{{
    39 # Default configuration of the Trigger Manager in system.mhs
    40 
    41 BEGIN w3_warplab_trigger_proc_axiw
    42  PARAMETER INSTANCE   = warplab_trigger_proc
    43  PARAMETER HW_VER     = 1.01.a
    44  PARAMETER C_BASEADDR = 0x77800000
    45  PARAMETER C_HIGHADDR = 0x7780ffff
    46  BUS_INTERFACE S_AXI  = axi4lite_1
    47  BUS_INTERFACE AXI_STR_ETH_RXD = ETH_A_AXI_STR_RXD
    48  PORT axi_aclk        = clk_160MHz
    49  PORT sysgen_clk      = clk_160MHz
    50  # Triggers
    51  PORT agc_done_in = agc_is_done
    52  PORT debug_0_in  = trig_0_in
    53  PORT debug_1_in  = trig_1_in
    54  PORT debug_2_in  = trig_2_in
    55  PORT debug_3_in  = trig_3_in
    56  PORT rfa_rssi    = warplab_rfa_rssi
    57  PORT rfb_rssi    = warplab_rfb_rssi
    58  PORT rfc_rssi    = net_gnd
    59  PORT rfd_rssi    = net_gnd
    60  PORT rssi_clk    = warplab_rssi_clk
    61  PORT trig_0_out  = baseband_trigger
    62  PORT trig_1_out  = agc_start
    63  PORT trig_2_out  = trig_2_out
    64  PORT trig_3_out  = trig_3_out
    65  PORT trig_4_out  = trig_4_out
    66  PORT trig_5_out  = trig_5_out
    67 END
    68 }}}
    69 
    70 The ''trig_*_in'' and ''trig_*_out'' signals are connected to the [wiki:WARPLab/HardwareConfiguration#DebugHeader debug header] and can be used to externally trigger events.
    71 
    72 
    73 
    74 == Examples ==
    75 
    76 In our examples, we have two nodes, a transmitter ( nodes(1) ) and a receiver ( nodes(2) ):
    77 
    78 * Create a UDP broadcast trigger and trigger the transmitting node with the Ethernet packet
    79 {{{
    80 eth_trig = wl_trigger_eth_udp_broadcast;
    81 nodes(1).wl_triggerManagerCmd('add_ethernet_trigger',[eth_trig]);
    82 }}}
    83   '''NOTE:'''  This will allow a host, like Matlab, to create an Ethernet packet to begin transmission 
    84 
    85 * Read Trigger IDs into workspace
    86 {{{
    87 [T_IN_ETH,T_IN_ENERGY,T_IN_AGCDONE,T_IN_REG,T_IN_D0,T_IN_D1,T_IN_D2,T_IN_D3] =  wl_getTriggerInputIDs(nodes(1));
    88 [T_OUT_BASEBAND, T_OUT_AGC, T_OUT_D0, T_OUT_D1, T_OUT_D2, T_OUT_D3] = wl_getTriggerOutputIDs(nodes(1));
    89 }}}
    90   '''NOTE:'''  These trigger IDs will be the same for all nodes in the system and should not be modified by the user.
    91 
    92 * For the transmit node, allow Ethernet to trigger the buffer baseband, the AGC, and Trigger output 0 (which is mapped by default in the WARPLab reference design to pin 8 on the [wiki:WARPLab/HardwareConfiguration#DebugHeader debug header])
    93 {{{
    94 nodes(1).wl_triggerManagerCmd('output_config_input_selection',[T_OUT_BASEBAND,T_OUT_AGC,T_OUT_D0],[T_IN_ETH,T_IN_REG]);
    95 }}}
    96   '''NOTE:'''  We use both {{{T_IN_ETH}}} and {{{T_IN_REG}}} so this example is compatible with both WARP v2 and WARP v3 hardware.  If using WARP v3 hardware, only {{{T_IN_ETH}}} is needed as the source of the trigger.
    97 
    98 
    99 * For the receive node, allow the energy detector to trigger the buffer baseband and AGC core:
    100 {{{
    101 nodes(2).wl_triggerManagerCmd('output_config_input_selection',[T_OUT_BASEBAND,T_OUT_AGC],[T_IN_ENERGY]);
    102 }}}
    103   Then enable the hold mode for the triggers driven by energy detection. This will prevent the buffer from being overwritten before we have a chance to read it:
    104 {{{
    105 nodes(2).wl_triggerManagerCmd('output_config_hold_mode',[T_OUT_BASEBAND,T_OUT_AGC],'enable');
    106 }}}
    107   Then get the IDs for the interfaces on the board and setup the configuration of the energy monitoring:
    108 {{{
    109 [RFA,RFB] = wl_getInterfaceIDs(nodes(2));
    110 
    111 rssi_sum_len = 15;
    112 
    113 nodes(2).wl_triggerManagerCmd('energy_config_average_length',rssi_sum_len);
    114 nodes(2).wl_triggerManagerCmd('energy_config_busy_threshold',rssi_sum_len*500);
    115 nodes(2).wl_triggerManagerCmd('energy_config_busy_minlength',10);
    116 nodes(2).wl_triggerManagerCmd('energy_config_interface_selection',RFA+RFB);
    117 }}}
    118   Finally, when done processing, we can clear the energy detection trigger since it is holding the output due to setting the {{{'output_config_hold_mode'}}}
    119 {{{
    120 nodes(2).wl_triggerManagerCmd('output_state_clear',[T_OUT_BASEBAND,T_OUT_AGC]);
    121 }}}
    122 
    123 * For the receive node, allow trigger input to trigger the buffer baseband and the AGC (this example assumes the WARPLab reference design configuration where we should connect trigger output 0, pin 8 of the [wiki:WARPLab/HardwareConfiguration#DebugHeader debug header], of the transmit node to trigger input 3, pin 15 of the [wiki:WARPLab/HardwareConfiguration#DebugHeader debug header], of the receive node):
    124 {{{
    125 nodes(2).wl_triggerManagerCmd('output_config_input_selection',[T_OUT_BASEBAND,T_OUT_AGC],[T_IN_D3]);
    126 }}}
    127   We will also enable the debounce circuitry on the trigger input to help with noise on the signal line:
    128 {{{
    129 nodes(2).wl_triggerManagerCmd('input_config_debounce_mode',[T_IN_D3],'enable');
    130 }}}
    131   Since the debounce circuitry is enabled, there will be a delay at the receiver node for its input trigger. To better align the transmitter and receiver, we can artifically delay the transmitters trigger outputs that drive the buffer baseband and the AGC:
    132 {{{
    133 nodes(1).wl_triggerManagerCmd('output_config_delay',[T_OUT_BASEBAND,T_OUT_AGC],[50]); %50ns delay
    134 }}}
    135   '''NOTE:''' The 50 ns delay was measured using the oscilloscope.  The procedure can be found here (Coming soon ...). 
    136 
    137 
    138 == Getting Help ==
    139 
    140 If you have any additional questions, please post to the [http://warp.rice.edu/forums/ WARP Forums].
    141 
    142 
    143 
    144 
    145 
    146 
    147 
     7This module handles the synchronization of actions across many nodes.