|
From: Larry D. <ldo...@re...> - 2015-03-06 20:58:52
|
Orson -
On Fri, Mar 06, 2015 at 08:57:35PM +0100, Maciej Sumiński wrote:
> I had to correct the previous implementation for accessing constant
> arrays of vectors. I did not realize that ranges in part selection have
> to be constant, and variables are simply forbidden even if the
> difference between indices is constant. This makes the solution useless
> if one wants to implement e.g. a multiplexer.
Maybe I don't fully understand the terminology, but I build
multiplexers "all the time" using indexed part select, e.g.,
module foo(
input clk,
input [3:0] ipn,
output reg [7:0] ip1
);
reg [127:0] local_data;
// stuff to set local_data not shown
always @(posedge clk) ip1 <= local_data[{ipn,3'b0}+:8];
endmodule
- Larry
|