Model Operation Functions - 7.2 English - PG149

FIR Compiler LogiCORE IP Product Guide ( PG149)

Document ID
PG149
Release Date
2025-06-11
Version
7.2 English

Send CONFIG Packet

xip_status
xip_fir_v7_2_config_send(
    xip_fir_v7_2* model,
    const xip_fir_v7_2_cnfg_packet* cnfg_packet
)
This function passes a configuration packet, pointed to by cnfg_packet (see Table 2), to the model. The model implements an internal FIFO/queue. A configuration packet is consumed from the queue for every data packet processed, that is, every call to xip_fir_v7_2_data_send.
Note: If the fsel field of the cnfg_packet is not sized correctly the function returns XIP_STATUS_ERROR.

Send RELOAD Packet

xip_status
xip_fir_v7_2_reload_send(
    xip_fir_v7_2* model,
    const xip_fir_v7_2_rld_packet* rld_packet
)

This function passes a reload packet, pointed to by rld_packet (see Table 3), to the model.

Note: If the coeff field of the rld_packet is not sized correctly the function returns XIP_STATUS_ERROR.

Send DATA Packet

xip_status
xip_fir_v7_2_data_send(
    xip_fir_v7_2* model,
    const xip_array_real* data
);
void
xip_fir_v7_2_data_send_handler(
   const xip_array_real* data,
   void* model,
   void* dummy
);

This function sends a new data packet, pointed to by data, to the model for processing.

The second version of the function, xip_fir_v7_2_data_send_handler, is supplied to be used as a (*xip_array_real_handler) call back function, see Set Data Handler for further details.

Input data is provided using the xip_array_real structure pointed to by data and is expected to be sized:

Number of paths x Number of interleaved channels x number of input vectors.

Figure 1. Input and Output Data Packet Structure

The 3-D structure shown in the preceding figure is translated to the 1-D array of the xip_array_<type> data element in the order; Paths, Channels, Vectors. The helper functions, xip_array_<type>_set_chan ( Set Channel) and xip_array_<type>_get_chan (Get Channel) implement this translation.

The Advanced Channel implementation requires redundant channel positions to be remapped to higher rate channels. The helper functions, xip_array_<type>_set_chan (Set Channel) and xip_array_<type>_get_chan (Get Channel), simplify referencing each channel by presenting a flat index for each channel.

The preceding figure shows the remapping for three different pattern sequences:

  • P4_4 (4 channels x 1/4fs);
  • P4_3 (1 channel x 1/2fs and 2 channels x 1/4fs);
  • P4_2 (1 channel x 3/4fs and 1 channel x 1/4fs).
Figure 2. Advanced Channel Pattern Data Packet Remapping

Get DATA Packet

xip_status
xip_fir_v7_2_data_get(
     xip_fir_v7_2* model,
     xip_array_real* data,
     xip_array_complex* cmplx_data
);
xip_status
xip_fir_v7_2_data_get_mpz(
    xip_fir_v7_2* model,
    xip_array_mpz* data,
    xip_array_mpz_complex* cmplx_data
);

This function retrieves a filtered data packet from the model into the xip_array_<type> pointed to by data or cmplx_data. Only one of data or cmplx_data maybe set, the other should be set to NULL (or 0).

The size of the array dim[2] (Figure 1) determines how much data is fetched from the model. If the request is greater than available, then the array size is reduced to reflect this. The model does not modify the amount of space allocated. Both versions of the functions maybe used regardless of the internal implementation method of the model. If double data (xip_real) is requested when mpz_t (xip_mpz) has been used internally by the model the output data is truncated, as per the mpz_get_d function (see [Ref 15]).

mpz_t (xip_mpz) is an integer type so the model scales the input data and coefficients by their specified fractional width to use an integer representation. The output is also supplied as an integer value when mpz_t is requested. To correctly interpret the mpz_t output the model configuration, returned by the xip_fir_v7_2_get_config function (see Get Model Configuration), should be interrogated to determine the output fractional width.