[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gEDA-user: Icarus Verilog: selecting parts of an array



>integer i;
>for (i = 0; i < 64; i = i + 8) begin
>    @posedge(clk);
>    data = test[i:(i+8)];
>end


brendan.simon@bigpond.com said:
> Is the above a valid Verilog code snippet (ignoring the erroneous
> posedge statement) ??? 

No, non-constant part selects are not allowed in Verilog-1995.
In Verilog 2001, The syntax you are looking for is the indexed
part select:

	data = test[i +: 8];

Icarus Verilog doesn't yet support the -2001 indexed part select
syntax, although some commercial simulators might.
-- 
Steve Williams                "The woods are lovely, dark and deep.
steve at icarus.com           But I have promises to keep,
steve at picturel.com         and lines to code before I sleep,
http://www.picturel.com       And lines to code before I sleep."