From: Dennis Marsa (drm@xilinx.com)
Date: Wed Feb 06 2002 - 09:44:32 PST
Precedence: bulk
Michael McNamara wrote:
>
> How would you propose to handle
>
> reg [31:0] mainmem [8*1024*1024:0];
> reg [31:0] R0,R1,R2,R3,R4; // memory mapped registers
>
> ...
> always @(*) R0 = mainmem[0];
> always @(*) R1 = mainmem[1];
> always @(*) R2 = mainmem[2];
> ...
>
> To my mind the above always lines are exactly equivalent to:
>
> assign R0 = mainmem[0],
> R1 = mainmem[1],
> R2 = mainmem[2]
> ...
> ;
> or to:
>
> always @(mainmem[0]) R0 = mainmem[0];
> always @(mainmem[1]) R1 = mainmem[1];
> always @(mainmem[2]) R2 = mainmem[2];
>
> and again each need only be executed if the particular memory cell
> on the rhs changes, rather than when any location in the 32
> megabyte main memory changes.
Your above example and in your previous mail show array selects
with constant indices. I agree with your interpretation in these
cases.
The original example Bhaskar and I were referring to was:
always @(*) begin : named
integer b;
b = <something>;
a = mem8x10[10] + mem8x10[b];
end
which has an array select with a variable index. The value
of b is not in general predictable, so the mem8x10[b] reference
might access any element of mem8x10; hence the sensitivity to
the whole array.
Bhaskar suggested @(*) in the above case could be interpreted as:
always @(mem8x10[10] or mem8x10[0] or mem8x10[1] or mem8x10[2] or mem8x10[3] or ....<list with all index values>)
I suggested shortening it to:
always @(mem8x10[10] or mem8x10)
with the same semantics.
Dennis Marsa
Xilinx, Inc.
This archive was generated by hypermail 2.1.4
: Mon Jul 08 2002 - 12:55:35 PDT
and
sponsored by Boyd Technology, Inc.