I'm not sure what Nicolas's problem actually was, but I assumed that he
wanted to surround some declaration at the start of a process - for example
the declaration of some unwieldy variable - with an IF... GENERATE block so
that it's only created under certain conditions. I can see how that might
make certain code more efficient.
However, I can't think of anything that you actually *cannot* do unless you
have that feature.
It's entirely possible that I've missed the point as well. Probably in the
opposite direction. So on average, the problem is solved
-Ben-
If there was a generate around the variable declaration, there would
also have to be one around the subsequent code that called it. Since
generate statements have their own declarative region, it would be
better to put the generate in the statement region, rather than one in
the declarative region and one in the statement region. Note that
generate statements are not currently allowed in ANY declarative
region either.
In sequential code there is very little need of a generate capability
that cannot be met with static conditions on if/case/loop statements,
that a decent optimizing compiler would not handle well anyway.
On the other hand, if a variable or constant had a complex, time-
consuming initialization (via a function call), compilers may not be
able to take that out just because it never gets used (due to static
conditions). In such a case, I'd be inclined to create separate
versions of the same process, each wrapped in a generate statement.
Perhaps through the use of common procedures and/or functions, the
amount of duplicate code in these process versions could be minimized.
Andy