NAME
merger - create unit to merge separate input fields
merger1 - create unit to merge separate input fields
PROTOTYPES
unitptr merger( int n0)
unitptr merger1( int *fdesc, unitptr dest)
ARGUMENTS
- int n0
- number of pins of fields 0...k to be merged.
- int *fdesc
- array specifying argument parameters n, n0..nk
- unitptr dest
- host unit
RETURN VALUE:
- unitptr u:
- pointer to newly created unit
INTERFACE OF CREATED UNIT:
- Y_in[n]:
- output field 0
- in_0[n0]:
- input field 0 with n0 pins.
- ...
-
- in_k[nk]:
- input field k with nk pins.
DESCRIPTION:
Creates a unit with one output field of n pins and k+1 input
fields of n0,n1...nk fields, resp. The purpose of this
unit is to merge a single field into k+1 subfields with the
specified pin numbers n0..nk. The correspondence between
subfield pins and pins of the output field is such that the
sequence of pins of input fields 0,1..k in their natural
order corresponds with the sequence of pins of the merged
output field. For correct operation,
ABS(n)=ABS(n0)+ABS(n1)+...ABS(nk) must be obeyed. In
the first variant, the argument parameters n,n0..nk are
specified with a variable length argument list, in the
second variant, an integer array fdesc[]=(n,n0..nk) is
used.
A particular use of this unit is to provide connections
between packed and unpacked fields. To this end, the pin
numbers of those fields that later shall become connected to
packed fields must be given with an additional minus sign.
The created unit becomes a subunit of unit dest.
EXAMPLE:
u1 = merger(-1000,1000,ROOT);
u2 = merger(1000,-900,-50,50,ROOT);
The first call creates a unit with one packed output field
of 1000 pins (note that here the dimensionality of the out-
put field comes first -- this is opposite as for routine
splitter!), and one unpacked input field of 1000 pins, i.e.
this unit will transform the output of an unpacked output
field of 1000 pins into the output of a packed field of the
same number of pins. The second call creates a unit which
merges two packed fields of 900 and 50 pins, resp., and one
unpacked field of 50 pins to an unpacked field of 1000 pins.
FILE:
nst_util
SEE ALSO:
splitter, merger
FILE
/local/homes/rhaschke/nst7/man/../o.linx86//../nstsrc/nst_stdr.c