<##//////////////////////////////////////////////////////////////////
|
<##//////////////////////////////////////////////////////////////////
|
//// ////
|
//// ////
|
//// Author: Eyal Hochberg ////
|
//// Author: Eyal Hochberg ////
|
//// eyal@provartec.com ////
|
//// eyal@provartec.com ////
|
//// ////
|
//// ////
|
//// Downloaded from: http://www.opencores.org ////
|
//// Downloaded from: http://www.opencores.org ////
|
/////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////
|
//// ////
|
//// ////
|
//// Copyright (C) 2010 Provartec LTD ////
|
//// Copyright (C) 2010 Provartec LTD ////
|
//// www.provartec.com ////
|
//// www.provartec.com ////
|
//// info@provartec.com ////
|
//// info@provartec.com ////
|
//// ////
|
//// ////
|
//// This source file may be used and distributed without ////
|
//// This source file may be used and distributed without ////
|
//// restriction provided that this copyright statement is not ////
|
//// restriction provided that this copyright statement is not ////
|
//// removed from the file and that any derivative work contains ////
|
//// removed from the file and that any derivative work contains ////
|
//// the original copyright notice and the associated disclaimer.////
|
//// the original copyright notice and the associated disclaimer.////
|
//// ////
|
//// ////
|
//// This source file is free software; you can redistribute it ////
|
//// This source file is free software; you can redistribute it ////
|
//// and/or modify it under the terms of the GNU Lesser General ////
|
//// and/or modify it under the terms of the GNU Lesser General ////
|
//// Public License as published by the Free Software Foundation.////
|
//// Public License as published by the Free Software Foundation.////
|
//// ////
|
//// ////
|
//// This source is distributed in the hope that it will be ////
|
//// This source is distributed in the hope that it will be ////
|
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
|
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
|
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
|
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
|
//// PURPOSE. See the GNU Lesser General Public License for more////
|
//// PURPOSE. See the GNU Lesser General Public License for more////
|
//// details. http://www.gnu.org/licenses/lgpl.html ////
|
//// details. http://www.gnu.org/licenses/lgpl.html ////
|
//// ////
|
//// ////
|
//////////////////////////////////////////////////////////////////##>
|
//////////////////////////////////////////////////////////////////##>
|
|
|
OUTFILE PREFIX_ic_dec.v
|
OUTFILE PREFIX_ic_dec.v
|
|
|
ITER MX
|
ITER MX
|
ITER SX
|
ITER SX
|
|
|
module PREFIX_ic_dec (PORTS);
|
module PREFIX_ic_dec (PORTS);
|
|
|
input [ADDR_BITS-1:0] MMX_AADDR;
|
input [ADDR_BITS-1:0] MMX_AADDR;
|
input [ID_BITS-1:0] MMX_AID;
|
input [ID_BITS-1:0] MMX_AID;
|
output [SLV_BITS-1:0] MMX_ASLV;
|
output [SLV_BITS-1:0] MMX_ASLV;
|
output MMX_AIDOK;
|
output MMX_AIDOK;
|
|
|
parameter DEC_MSB = ADDR_BITS - 1;
|
parameter DEC_MSB = ADDR_BITS - 1;
|
parameter DEC_LSB = ADDR_BITS - SLV_BITS;
|
parameter DEC_LSB = ADDR_BITS - SLV_BITS;
|
|
|
reg [SLV_BITS-1:0] MMX_ASLV;
|
reg [SLV_BITS-1:0] MMX_ASLV;
|
reg MMX_AIDOK;
|
reg MMX_AIDOK;
|
|
|
|
wire [DEC_MSB:DEC_LSB] MMX_AADDR_DEC;
|
|
|
|
|
|
assign MMX_AADDR_DEC = MMX_AADDR[DEC_MSB:DEC_LSB];
|
|
|
LOOP MX
|
LOOP MX
|
always @(MMX_AADDR or MMX_AIDOK)
|
always @(MMX_AADDR or MMX_AIDOK)
|
begin
|
begin
|
IFDEF TRUE(SLAVE_NUM==1)
|
IFDEF TRUE(SLAVE_NUM==1)
|
case (MMX_AIDOK)
|
case (MMX_AIDOK)
|
1'b1 : MMX_ASLV = SLV_BITS'd0;
|
1'b1 : MMX_ASLV = SLV_BITS'd0;
|
ELSE TRUE(SLAVE_NUM==1)
|
ELSE TRUE(SLAVE_NUM==1)
|
case ({MMX_AIDOK, MMX_AADDR[DEC_MSB:DEC_LSB]})
|
case ({MMX_AIDOK, MMX_AADDR_DEC})
|
{1'b1, BIN(SX SLV_BITS)} : MMX_ASLV = SLV_BITS'dSX;
|
{1'b1, BIN(SX SLV_BITS)} : MMX_ASLV = SLV_BITS'dSX;
|
ENDIF TRUE(SLAVE_NUM==1)
|
ENDIF TRUE(SLAVE_NUM==1)
|
default : MMX_ASLV = SLV_BITS'dSERR;
|
default : MMX_ASLV = SLV_BITS'dSERR;
|
endcase
|
endcase
|
end
|
end
|
|
|
always @(MMX_AID)
|
always @(MMX_AID)
|
begin
|
begin
|
case (MMX_AID[MSTR_ID_BITS-1:0])
|
case (MMX_AID[MSTR_ID_BITS-1:0])
|
MSTR_ID_BITS'bGROUP_MMX_ID : MMX_AIDOK = 1'b1;
|
MSTR_ID_BITS'bGROUP_MMX_ID : MMX_AIDOK = 1'b1;
|
default : MMX_AIDOK = 1'b0;
|
default : MMX_AIDOK = 1'b0;
|
endcase
|
endcase
|
end
|
end
|
|
|
ENDLOOP MX
|
ENDLOOP MX
|
|
|
endmodule
|
endmodule
|
|
|
|
|
|
|
|
|