Guest
I need a MUX that from an array of input interfaces has in output the interface of the array indicated from the two MSB of an address bus.
the number of interfaces of the array is a parameter: pNUM_IF.
interface my_if;
wire a;
wire b;
endinterface // my_if
parameter pNUM_IF= 4;
parameter pADDRESS_WIDTH=8;
parameter pDECODE_BITS=2;
module MUX
(
my_if if_BUS [pNUM_IF-1:0] ,
my_if out,
input [pADDRESS_WIDTH-1:0] iADDRESS
);
genvar i;
generate
for ( i=0;i<pNUM_IF-1;i++)
begin : genloop
always
begin
if(i==iADDRESS[pADDRESS_WIDTH-1 -: pDECODE_BITS])
begin
out=if_BUS;
end
end
end
endgenerate
endmodule
____________
Modelsim gives me an error I don't understand:
# ** Error: MUX_int.v(33): 'out' is not a variable
# ** Error: MUX_int.v(33): Illegal LHS of assignment.
can someone help me?
Thank you in advance
the number of interfaces of the array is a parameter: pNUM_IF.
interface my_if;
wire a;
wire b;
endinterface // my_if
parameter pNUM_IF= 4;
parameter pADDRESS_WIDTH=8;
parameter pDECODE_BITS=2;
module MUX
(
my_if if_BUS [pNUM_IF-1:0] ,
my_if out,
input [pADDRESS_WIDTH-1:0] iADDRESS
);
genvar i;
generate
for ( i=0;i<pNUM_IF-1;i++)
begin : genloop
always
begin
if(i==iADDRESS[pADDRESS_WIDTH-1 -: pDECODE_BITS])
begin
out=if_BUS;
end
end
end
endgenerate
endmodule
____________
Modelsim gives me an error I don't understand:
# ** Error: MUX_int.v(33): 'out' is not a variable
# ** Error: MUX_int.v(33): Illegal LHS of assignment.
can someone help me?
Thank you in advance