wiki:WARPLab/Reference/Node

Node Module Implementation

The WARPLab Reference Design implements a Node module for brokering commands and responses to other modules in a WARP node.

Related Components:

Command List

Node commands are selected as string inputs to the wl_nodeCmd method in wl_node.m. These strings are each individual cases of the switch statement in procCmd method of wl_node.m.

Syntax

MATLAB allows two valid forms of syntax for calling methods

  • Let N be a scalar or vector of wl_node objects
  • Let command_string be a string containing a particular command
  • Let arg be an argument for that command (optional)

Syntax 1: wl_nodeCmd(N, command_string, arg1, arg2, ..., argN)

Syntax 2: N.wl_nodeCmd(command_string, arg1, arg2, ..., argN)

These two different forms of syntax are identical and either may be used for issuing commands to WARP nodes.

Command List and Documentation

get_hardware_info

Reads details from the WARP hardware and updates node object parameters

Arguments: none

Returns: none (access updated node parameters if needed)

Hardware support:

  • All Platforms:
    • WARPLab design version
    • Hardware version
    • Ethernet MAC Address
    • Number of Interface Groups
    • Number of Interfaces
  • WARP v3:
    • Serial number
    • Virtex-6 FPGA DNA

get_fpga_temperature

Reads the temperature (in Celsius) from the FPGA

Arguments: none

Returns: (double currTemp), (double minTemp), (double maxTemp) currTemp - current temperature of FPGA in degrees Celsius
minTemp - minimum recorded temperature of FPGA in degrees Celsius
maxTemp - maximum recorded temperature temperature of FPGA in degrees Celsius

initialize

Initializes the node; this must be called at least once per power cycle of the node

Arguments: none

Returns: none

identify

Blinks the user LEDs on the WARP node, to help identify MATLAB node-to-hardware node mapping

Arguments: none

Returns: none

node_config_reset

Resets the HW state of the node to accept a new node configuration

Arguments: none

Returns: none

node_mem_read

Read memory addresses in the node

Arguments: (uint32 ADDRESS), (uint32 LENGTH)

Returns: Vector of uint32 values read from the node

ADDRESS: Address to start the read

LENGTH: Number of uint32 words to read from the node

NOTE: The node enforces a maximum number of words that can be transferred for a given read. This is typically on the order of 350 words.

NOTE: Please use the C code files, such as xparameters.h and other header files, to understand the addresses of various registers in the system and the meaning of the bits within those registers.

node_mem_write

Write memory addresses in the node

Arguments: (uint32 ADDRESS), (uint32 VALUES)

Returns: none

ADDRESS: Address to start the write

VALUES: Vector of uint32 words to write to the node

NOTE: The node enforces a maximum number of words that can be transferred for a given write. This is typically on the order of 350 words.

NOTE: Please use the C code files, such as xparameters.h and other header files, to understand the addresses of various registers in the system and the meaning of the bits within those registers.

wl_getInterfaceIDs

Returns the interfaces IDs that can be used as inputs to all interface commands, some baseband commands and possibly some user extension commands.

The interface IDs are returned in a structure that contains fields for individual interfaces and combinations of interfaces. When a node only supports 2 interfaces, the fields for RFC and RFD (ie the fields specific to a 4 interface node) are not present in the structure.

The fields in the structure are:

  • Scalar fields:
    • RF_A
    • RF_B
    • RF_C
    • RF_D
    • RF_ON_BOARD (NOTE: RF_ON_BOARD = RF_A + RF_B)
    • RF_FMC (NOTE: RF_FMC = RF_C + RF_D)
    • RF_ALL (NOTE: 2RF: RF_ALL = RF_A + RF_B; 4RF: RF_ALL = RF_A + RF_B + RF_C + RF_D)
  • Vector fields:
    • RF_ON_BOARD_VEC (NOTE: RF_ON_BOARD_VEC = [RF_A, RF_B])
    • RF_FMC_VEC (NOTE: RF_FMC_VEC = [RF_C, RF_D])
    • RF_ALL_VEC (NOTE: 2RF: RF_ALL_VEC = [RF_A, RF_B]; 4RF: RF_ALL_VEC = [RF_A, RF_B, RF_C, RF_D])

NOTE: Due to Matlab behavior, the scalar fields for RF_A, RF_B, RF_C, and RF_D can be used as vectors and therefore do not need separate vector fields in the structure

Examples:

  • Get the interface ID structure (let node be a wl_node object):
    ifc_ids = wl_getInterfaceIDs(node);
    ifc_ids = node.wl_getInterfaceIDs();
    
  • Use the trigger input ID structure:
    • Enable RF_A for transmit:
      wl_interfaceCmd(node, ifc_ids.RF_A, 'tx_en');
      
    • Get 1000 samples of Read IQ data from all interfaces:
      rx_IQ = wl_basebandCmd(node, ifc_ids.RF_ALL_VEC, 'read_IQ', 0, 1000);
      

Arguments: none

Returns: (struct interface_ids)

  • interface_ids - Interface ID structure

wl_getTriggerInputIDs

Returns the trigger input IDs that can be used as inputs to trigger manager commands

The trigger input IDs are returned in a structure that contains fields for individual triggers.

The fields in the structure are:

  • Scalar fields:
    • ETH_A - Ethernet Port A
    • ETH_B - Ethernet Port B
    • ENERGY_DET - Energy detection (See 'energy_config_*' commands in the Trigger Manager documentation)
    • AGC_DONE - Automatic Gain Controller complete
    • SW_REG - Software register (ie Memory mapped registers that can be triggered by a CPU write)
    • EXT_IN_P0 - External Input Pin 0
    • EXT_IN_P1 - External Input Pin 1
    • EXT_IN_P2 - External Input Pin 2
    • EXT_IN_P3 - External Input Pin 3

Examples:

  • Get the trigger input ID structure (let node be a wl_node object):
    trig_in_ids = wl_getTriggerInputIDs(node);
    trig_in_ids = node.wl_getTriggerInputIDs();
    
  • Use the trigger input ID structure:
    • Enable baseband and agc output triggers to be triggered on the Ethernet A input trigger:
      wl_triggerManagerCmd(nodes, 'output_config_input_selection', [trig_out_ids.BASEBAND, trig_out_ids.AGC], [trig_in_ids.ETH_A]);
      

Arguments: none

Returns: (struct trig_input_ids)

  • trig_input_ids - Trigger Input ID structure

wl_getTriggerOutputIDs

Returns the trigger output IDs that can be used as inputs to trigger manager commands

The trigger output IDs are returned in a structure that contains fields for individual triggers.

The fields in the structure are:

  • Scalar fields:
    • BASEBAND - Baseband buffers module
    • AGC - Automatic Gain Controller module
    • EXT_OUT_P0 - External Output Pin 0
    • EXT_OUT_P1 - External Output Pin 1
    • EXT_OUT_P2 - External Output Pin 2
    • EXT_OUT_P3 - External Output Pin 3

Examples:

  • Get the trigger output ID structure (let node be a wl_node object):
    trig_out_ids = wl_getTriggerInputIDs(node);
    trig_out_ids = node.wl_getTriggerInputIDs();
    
  • Use the trigger input ID structure:
    • Enable baseband and agc output triggers to be triggered on the Ethernet A input trigger:
      wl_triggerManagerCmd(node, 'output_config_input_selection', [trig_out_ids.BASEBAND, trig_out_ids.AGC], [trig_in_ids.ETH_A]);
      
    • Configure output delay for the baseband:
      wl_triggerManagerCmd(node, 'output_config_delay', [trig_out_ids.BASEBAND], 0);
      

Arguments: none

Returns: (struct trig_output_ids)

  • trig_output_ids - Trigger Output ID structure
Last modified 5 years ago Last modified on Dec 18, 2015, 10:47:30 AM