N
nachumk
Guest
In VHDL I can declare an integer with a range helping the compiler to
know if I'm out of bounds in an array access. For example:
signal enable : std_logic_vector(5 downto 0);
signal enable_index : integer range 0 to 5;
ei : in std_logic_vector(2 downto 0);
enable_index <= ei;
enable[ei] <= 1;
The compiler knows that ei won't be out of bounds from the range
declaration.
For Verilog I declare:
reg [5:0] enable;
reg [2:0] enable_index;
Is there anyway to tell Verilog the bounds of enable_index? Perhaps an
assert type statement? Would the best solution be a function that
limits top bound of reg array? Most synthesizers seem to be OK without
the bounds, but I've found that XST has some issues with this.
Thanx,
Nachum Kanovsky
know if I'm out of bounds in an array access. For example:
signal enable : std_logic_vector(5 downto 0);
signal enable_index : integer range 0 to 5;
ei : in std_logic_vector(2 downto 0);
enable_index <= ei;
enable[ei] <= 1;
The compiler knows that ei won't be out of bounds from the range
declaration.
For Verilog I declare:
reg [5:0] enable;
reg [2:0] enable_index;
Is there anyway to tell Verilog the bounds of enable_index? Perhaps an
assert type statement? Would the best solution be a function that
limits top bound of reg array? Most synthesizers seem to be OK without
the bounds, but I've found that XST has some issues with this.
Thanx,
Nachum Kanovsky