B
Bill Burris
Guest
What is the syntax for arrays as ports?
In the following code ModelSim says: Illegal reference to net array "dbin".
module Chan_MUX ( clk, select, dbin, dbout );
parameter db_width = 16;
parameter channels = 8;
input clk;
input [4:0] select;
input [db_width-1:0] dbin [channels-1:0];
output [db_width-1:0] dbout;
reg [db_width-1:0] dbout;
always @(posedge clk)
begin
dbout <= dbin[select];
end
endmodule
thanks
Bill
In the following code ModelSim says: Illegal reference to net array "dbin".
module Chan_MUX ( clk, select, dbin, dbout );
parameter db_width = 16;
parameter channels = 8;
input clk;
input [4:0] select;
input [db_width-1:0] dbin [channels-1:0];
output [db_width-1:0] dbout;
reg [db_width-1:0] dbout;
always @(posedge clk)
begin
dbout <= dbin[select];
end
endmodule
thanks
Bill