Initialization - Initialization - 2.0 English - PG391

RFSoC DFE PRACH LogiCORE IP Product Guide (PG391)

Document ID
PG391
Release Date
2025-11-26
Version
2.0 English

The DFE PRACH software API uses the libmetal abstraction layer. This allows it to provide a consistent interface and to use models independent of any operating system in use.

Each instance of the DFE PRACH core in the design requires a corresponding instance of an XDfePrach API object in the software

Initialize the API Object

  1. Declare a pointer for the API object.
  2. Initialize the PRACH driver instance.
    • The argument to XDfePrach_InstanceInit is the device ID.
    • It binds the API to the core instance, sourced from the device tree (embedded Linux) or xparameters.h (bare-metal).
    • A successful function call moves InstancePtr.StateId to "XDFEPRACH_STATE_READY". InstancePtr.StateId is set to "XDFEPRACH_STATE_NOT_READY" otherwise.
/* Declare an instance pointer for the API object */
XDfePrach *InstancePtr = NULL;

/* Initialize an instance of the PRACH driver */
InstancePtr = XDfePrach_InstanceInit(XDFEPRACH_NODE_NAME);

Reset Core

Reset the DFE PRACH core to halt data processing and move InstancePtr.StateId to "XDFEPRACH_STATE_RESET".

/* Reset the PRACH core */

XDfePrach_Reset(InstancePtr);            

Confirm Version Numbers (Optional)

  1. Declare version number objects:
    XDfePrach_Version SwVersion; XDfePrach_Version HwVersion;
  2. Retrieve software and hardware version numbers:
    XDfePrach_GetVersions(InstancePtr, &SwVersion, &HwVersion);
  3. Print version numbers to console and confirm versions are as expected.
/* Declare version number objects */
XDfePrach_Version SwVersion;
XDfePrach_Version HwVersion;

/* Get software and hardware version numbers */
XDfePrach_GetVersions(InstancePtr, &SwVersion, &HwVersion);

/* Print the version numbers to the console*/
printf("SW Version: Major %d, Minor %d\n", SwVersion.Major, SwVersion.Minor);
printf("HW Version: Major %d, Minor %d, Revision %d, Patch %d\n", HwVersion.Major, HwVersion.Minor, HwVersion.Revision, HwVersion.Patch);

Create Configuration

  1. Declare a configuration object: XDfePrach_Cfg Cfg
  2. Extract the IP Core configuration and use it to populate the configuration object:XDfePrach_Configure(InstancePtr, &Cfg);
    • Extracts the DFE PRACH core parameters from the IP core instance.
    • Checks the extracted parameters against the device tree (when embedded Linux is used) or xparameters.h file (when a bare metal system is used).
    • Uses the parameters to set the parameters inside Cfg to match the DFE PRACH core parameters.
    • Releases the software reset and moves the InstancePtr.StateId to "XDFEPRACH_STATE_CONFIGURED."
/* Declare a configuration object */
XDfePrach_Cfg Cfg;

/* Configure the IP instance */
XDfePrach_Configure(InstancePtr, &Cfg);        

Initialize Core

  1. Declare an initialization object: XDfePrach_Init Init;
  2. Set values in the initialization object which correspond to desired core operation.
    • Values which must be set here:
      • CC Sequence Length for bands 0-2. Only required for bands which were enabled in the GUI.
      • Enables or disables Static Scheduler. This option is valid only if "Enable Dynamic Scheduling" is selected in the GUI at core generation.
    Note: Values set here remain fixed while the core is operating.
  3. Send initialization object to the DFE PRACH IP core instance: XDfePrach_Initialize(InstancePtr, &Init)
    • Writes initialization register settings to DFE PRACH IP core registers.
    • Moves the InstancePtr.StateId to "XDFEPRACH_STATE_INITIALISED."
/* Declare and populate the initialization parameters object */

XDfePrach_Init Init;
Init.Sequence[0].Length = 16; // CCID sequence length for band 0 (must be a power of 2 and length * antenna interleave factor must be <16)
Init.Sequence[1].Length = 8; // CCID sequence length for band 1, if enabled (must be a power of 2 and length * antenna interleave factor must be <16)
Init.Sequence[2].Length = 8; // CCID sequence length for band 2, if enabled (must be a power of 2 and length * antenna interleave factor must be <16)
Init.EnableStaticSchedule = 1;  // Enable static RACH scheduler

/* Initialize the IP core */

XDfePrach_Initialize(InstancePtr, &Init);

Activate Core

  1. Declare the activate trigger configuration: XDfePrach_TriggerCfg TriggerCfg.
  2. Configure the desired trigger operation.
    • For activation, an immediate trigger is recommended: TriggerCfg.Mode=0.
  3. Set trigger configuration in software and IP cores registers: XDfePrach_SetTriggersCfg(InstancePtr, &TriggerCfg).
    • Writes Trigger settings (except Enable) to the IP core's registers.
    • All triggers are disabled after call. 
  4. Enable the trigger in the registers:XDfePrach_Activate(InstancePtr, false).
    • Sets "Enable" for the Activate trigger in the IP core's registers.
    • Activate trigger should be set to "immediate", therefore trigger fires as soon as register write completes.
    • The function's second parameter activates Low Power Mode. It is recommended that this is set FALSE.
    • Moves InstancePtr.StateId to "XDFEPRACH_STATE_OPERATIONAL".
Note: The start position of the component carrier sequence for each band is set by the FrameInit triggers. This differs from the other DFE cores, which use activation to set the CC sequence alignment.
/* Declare and populate a trigger configuration object */

XDfePrach_TriggerCfg TriggerCfg;
TriggerCfg.Activate.Mode = 0;           // immediate trigger

/* Set the trigger configuration */
XDfePrach_SetTriggersCfg(InstancePtr, &TriggerCfg);

/* Activate the IP core (disabling the low power mode) */
XDfePrach_Activate(InstancePtr, false);

Confirm Activation Status (optional)

  • Poll the Operational State register to ensure activation.
    • Direct read of the "Operational" status bit confirms IP core has been activated.
    • Recommended for debug, but can be omitted after software is stable.
while (XDfePrach_ReadReg(InstancePtr, XDFEPRACH_STATE_OPERATIONAL_OFFSET) == 0) {}