From: Paul Graham (email@example.com)
Date: Tue Jun 25 2002 - 19:21:37 PDT
> Actually, a range type declaration would not have allowed things like
> triangular arrays of interconnected modules:
> genvar gv_i, gv_j;
> parameter TSIZE=16;
> for (gv_i =0; gv_i < TSIZE; gv_i = gv_i + 1) begin: idim
> for (gv_j = 0; gv_j < gv_i; gv_j = gv_j + 1) begin: jdim
> mod m(a[gv+i], b[gv_j], c[gv_i][gv_j]);
Couldn't you have written:
You might argue that [0:gv_i-1] is not a constant range, but since it
consists of constant expressions (treating a genvar as a constant) then it
is a constant range. It just gets reevaluated each time through the gv_i
Anyway, it was probably easiest to follow VHDL's example and base for
generates on for loops. Except in VHDL a for loop _is_ defined in terms of
a range. Compare
y := x(7 downto 0);
for i in 7 downto 0 loop ...
g1: for i in 7 downto 0 generate ...
This archive was generated by hypermail 2.1.4
: Mon Jul 08 2002 - 12:55:38 PDT
sponsored by Boyd Technology, Inc.