improve weight handling

Signed-off-by: Sergei Ianovich <ynvich@gmail.com>
prevent weight overflows

Signed-off-by: Sergei Ianovich <ynvich@gmail.com>
configure 'weighted sum' blocks

Signed-off-by: Sergei Ianovich <ynvich@gmail.com>