|
From: Martin W. <mai...@ma...> - 2015-03-22 11:45:26
|
ni...@ly... (Niels Möller) wrote:
> For the attached (broken) code, I get the following error, and a
> segmentation fault. I'm using iverilog compiled from the repo.
>
> $ iverilog ctz-reduced.vl
> ctz-reduced.vl:28: error: Scope index expression is not constant: ((n)-(k))-('sd1)
> ctz-reduced.vl:28: XXXXX: Errors evaluating scope index
> ctz-reduced.vl:28: error: Scope index expression is not constant: ((n)-(k))-('sd1)
> ctz-reduced.vl:28: XXXXX: Errors evaluating scope index
> ctz-reduced.vl:28: error: Unable to bind wire/reg/memory `REDUCE[((n)-(k))-('sd1)].r[('sd2)*(cnt[(n)-('sd1):((n)-(k))+('sd1)])]' in `ctz'
> Segmentation fault
>
> (I have a working version too, using a second generate block. I wasn't
> sure if that was necessary, but it seems one can't use regular variables
> (i.e., not params or genvar) when indexing generate blocks).
>
Yes, the index must be a constant expression. From the standard:
hierarchical_identifier ::=
{ identifier [ [ constant_expression ] ] . } identifier
The segfault is poor error recovery, so needs to be fixed.
Martin
|