template class xf::dsp::aie::fir::sr_asym::fir_sr_asym_graph¶
#include "fir_sr_asym_graph.hpp"
Overview¶
fir_sr_asym is a Asymmetric Single Rate FIR filter
These are the templates to configure the Asymmetric Single Rate FIR class.
Parameters:
TT_DATA | describes the type of individual data samples input to and output from the filter function. This is a typename and must be one of the following: int16, cint16, int32, cint32, float, cfloat. |
TT_COEFF | describes the type of individual coefficients of the filter taps. It must be one of the same set of types listed for TT_DATA and must also satisfy the following rules:
|
TP_FIR_LEN | is an unsigned integer which describes the number of taps in the filter. |
TP_SHIFT | describes power of 2 shift down applied to the accumulation of FIR terms before output. TP_SHIFT must be in the range 0 to 61. |
TP_RND | describes the selection of rounding to be applied during the shift down stage of processing. TP_RND must be in the range 0 to 7 where
|
TP_INPUT_WINDOW_VSIZE | describes the number of samples to process in one simulation iteration of the filter function. The number of samples on the output will be TP_INPUT_WINDOW_VSIZE also by virtue the single rate nature of this function. When TP_DUAL_IP is used and PORT_API is streaming (1), this defines the the number of samples in total (spread over two ports) to process in one iteration. Note: Margin size should not be included in TP_INPUT_WINDOW_VSIZE. |
TP_CASC_LEN | describes the number of AIE processors to split the operation over. This allows resource to be traded for higher performance. TP_CASC_LEN must be in the range 1 (default) to 9. |
TP_USE_COEFF_RELOAD | allows the user to select if runtime coefficient reloading should be used. When defining the parameter:
|
TP_NUM_OUTPUTS | sets the number of ports to broadcast the output to. Note: when used, optional port: Note: For Windows API, additional output an exact copy of the data. Stream API interleaves the output data with a 128-bit pattern, e.g.:
|
TP_DUAL_IP | allows 2 stream inputs to be connected to FIR, increasing available throughput. When set to 0, single stream will be connected as FIRs input. When set to 1, two stream inputs will be connected. In such case data should be organized in 128-bit interleaved pattern, e.g.:
|
TP_API | specifies if the input/output interface should be window-based or stream-based. The values supported are 0 (window API) or 1 (stream API). |
TP_SSR | specifies the number of parallel input/output paths where samples are interleaved between paths, giving an overall higher throughput. An SSR of 1 means just one output leg, and is the backwards compatible option. The number of AIEs used is given by SSR^2*CASC_LEN. |
template < typename TT_DATA, typename TT_COEFF, unsigned int TP_FIR_LEN, unsigned int TP_SHIFT, unsigned int TP_RND, unsigned int TP_INPUT_WINDOW_VSIZE, unsigned int TP_CASC_LEN = 1, unsigned int TP_USE_COEFF_RELOAD = 0, unsigned int TP_NUM_OUTPUTS = 1, unsigned int TP_DUAL_IP = 0, unsigned int TP_API = 0, unsigned int TP_SSR = 1 > class fir_sr_asym_graph: public graph // fields port_array <input, TP_SSR> in port_array <output, TP_SSR> out port_conditional_array <input, (TP_DUAL_IP==1), TP_SSR> in2 port_conditional_array <input, (TP_USE_COEFF_RELOAD==1), TP_SSR> coeff port_conditional_array <output, (TP_NUM_OUTPUTS==2), TP_SSR> out2 port_conditional_array <output, (TP_CASC_IN==CASC_IN_TRUE), TP_SSR> casc_in
Fields¶
port_array <input, TP_SSR> in
The input data array to the function. This input array is either a window API of samples of TT_DATA type or stream API (depending on TP_API). Note: Margin is added internally to the graph, when connecting input port with kernel port. Therefore, margin should not be added when connecting graph to a higher level design unit. Margin size (in Bytes) equals to TP_FIR_LEN rounded up to a nearest multiple of 32 bytes.
port_array <output, TP_SSR> out
The output data array from the function. This output is either a window API of samples of TT_DATA type or stream API (depending on TP_API). Number of output samples is determined by interpolation & decimation factors (if present).
port_conditional_array <input, (TP_DUAL_IP==1), TP_SSR> in2
The conditional input array data to the function. This input is (generated when TP_DUAL_IP == 1) either a window API of samples of TT_DATA type or stream API (depending on TP_API).
port_conditional_array <input, (TP_USE_COEFF_RELOAD==1), TP_SSR> coeff
The conditional coefficient array data to the function. This port is (generated when TP_USE_COEFF_RELOAD == 1) an array of coefficients of TT_COEFF type.
port_conditional_array <output, (TP_NUM_OUTPUTS==2), TP_SSR> out2
The output data array from the function. This output is (generated when TP_NUM_OUTPUTS == 2) either a window API of samples of TT_DATA type or stream API (depending on TP_API). Number of output samples is determined by interpolation & decimation factors (if present).
port_conditional_array <output, (TP_CASC_IN==CASC_IN_TRUE), TP_SSR> casc_in
The conditional input array data to the function. This input is (generated when TP_CASC_IN == CASC_IN_TRUE) either a cascade input.
Methods¶
getKernels¶
getKernels overload (1)¶
kernel* getKernels ()
Access function to get pointer to kernel (or first kernel in a chained and/or SSR configurations). No arguments required.
getKernels overload (2)¶
kernel* getKernels ( int ssrOutPathIndex, int ssrInPhaseIndex, int cascadePosition )
Access function to get pointer to an indexed kernel.
Parameters:
ssrOutPathIndex | an index to the output data Path. |
ssrInPhaseIndex | an index to the input data Phase |
cascadePosition | an index to the kernel’s position in the cascade. |
getInNet¶
connect <stream, stream>* getInNet ( int ssrOutPathIndex, int ssrInPhaseIndex, int cascadePosition )
Access function to get pointer to net of the in
port. Nets only get assigned when streaming interface is being broadcast, i.e. nets only get used when TP_API == 1 and TP_CASC_LEN > 1 or TP_SSR > 1
Parameters:
ssrOutPathIndex | an index to the output data Path. |
ssrInPhaseIndex | an index to the input data Phase |
cascadePosition | an index to the kernel’s position in the cascade. |
getIn2Net¶
connect <stream, stream>* getIn2Net ( int ssrOutPathIndex, int ssrInPhaseIndex, int cascadePosition )
Access function to get pointer to net of the in2
port, when port is being generated, i.e. when TP_DUAL_IP == 1. Nets only get assigned when streaming interface is being broadcast, i.e. nets only get used when TP_API == 1 and TP_CASC_LEN > 1 or TP_SSR > 1
Parameters:
ssrOutPathIndex | an index to the output data Path. |
ssrInPhaseIndex | an index to the input data Phase |
cascadePosition | an index to the kernel’s position in the cascade. |
getKernelArchs¶
unsigned int getKernelArchs ()
Access function to get kernel’s architecture (or first kernel’s architecture in a chained configuration).
fir_sr_asym_graph¶
fir_sr_asym_graph overload (1)¶
fir_sr_asym_graph ()
This is the constructor function for the FIR graph with reloadable coefficients.
Constructor has no args. To be used with TP_USE_COEFF_RELOAD=1, taps needs to be passed through RTP.
fir_sr_asym_graph overload (2)¶
fir_sr_asym_graph (const std::vector <TT_COEFF>& taps)
This is the constructor function for the FIR graph with static coefficients.
Parameters:
taps | a reference to the std::vector array of taps values of type TT_COEFF. |