This is done by using the templated connect<> object. For our cascaded chain, the first FIR filter must have its input connected to the subgraph input in
, and the last FIR filter must have its output connected to the subgraph output out
. If there is more than one FIR filter, their inputs and outputs must be daisy chained together:
connect<>(in.out[0], FIR_ARRAY[0].in[0]);
if (N_FIR_FILTERS > 1) {
for (ix = 1; ix < N_FIR_FILTERS; ix++) {
connect<>(FIR_ARRAY[ix-1].out[0], FIR_ARRAY[ix].in[0]);
}
}
connect<>(FIR_ARRAY[N_FIR_FILTERS-1].out[0], out.in[0]);