-
Notifications
You must be signed in to change notification settings - Fork 337
Open
Description
Let's say that I have a template like this:
template MUXOR(n) {
signal input {binary} in[n];
signal output {binary} out;
signal {binary} intermediate[n - 1];
for (var i = 0; i < n - 1; i++) {
intermediate[i] <== XOR() ([in[i], in[i + 1]]);
}
out <== intermediate[n - 2];
}
I might use it as an anonymous component like this:
signal {binary} result <== MUXOR(3) ([signal_one, signal_two, signal_three]);
However, I get error[T3001]: Invalid assignment: missing tags required by input signal.
, because the signal array is being instantiated without a {binary}
tag. In order to make this work, I would need to first create a signal array tagged binary, and then as that as the input. But, that largely defeats the brevity gained by using an anonymous component.
Input signals to an anonymous component should support tagging, such as MUXOR(3) ({binary} [...])
, or MUXOR(3) ({binary} in <== [...])
. Alternatively, where an array is used, the array should automatically inherit the tagging of the parameter it corresponds to.
Metadata
Metadata
Assignees
Labels
No labels