Jim, We could add that ternary expressions also require parentheses if used in conditional assignment statements, case target expressions and exit statements. (are there any other uses of "when"?) Your last example is especially telling: Y <= (A when C else B) after 4 ns ; -- simple assignment w/ ternary expression & 1 delay Y <= A when C else B after 4 ns; -- conditional assignment w/1 delay (not the same) Y <= A after 4 ns when C else B after 4 ns; -- conditional assignment w/2 delays (same as 1st) Some other ugly ("evil") examples: when (A when C else B) => -- A, B and C must be locally static exit when (A when C else B); I much prefer the 'when' operator over the 'if' operator for a ternary expression, because 'when' in an expression still works similarly to the well-understood conditional assignment, albeit with some additional restrictions. Both 'if' and 'when' are equally confusing in different uses. I'm not opposed to anonymous ports on subprograms (I think it would be an incredibly useful feature), but to be a useful replacement for a ternary operator, a standard select function would have to be declared in a standard package. And then, signature collisions with existing subprograms will likely be a BIG problem. I disagree about the '2' suffix. With anonymous types, default arguments on a "sel()" function would be difficult to specify/use, so the number of arguments would provide the same information. My biggest issue with a sel() or similar function would be the order of the arguments. I would want to use named association, which would then be worse on many fronts than (A when C else B). "The only time it would be an issue is if the signal is declared in a package - which most designs do not do since there has been no historical support by synthesis tools." Synplify supports package-declared global signals. We use them for test/debug interfaces on FPGAs to avoid disrupting the hierarchical interfaces. And there are plenty of existing simulation applications... Andy D Jones Electrical Engineering Lockheed Martin Missiles and Fire Control Dallas TX -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Thu Apr 4 11:03:56 2013
This archive was generated by hypermail 2.1.8 : Thu Apr 04 2013 - 11:04:17 PDT