up_axi: Allow to configure AXI address width

Not all peripherals need the full address space. To be able to infer the
size of the address space of a peripheral allow the size of the AXI address
signals to be configurable rather than hardcoding its width to 32 bit.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
main
Lars-Peter Clausen 2017-03-24 18:26:20 +01:00
parent 9f382d56c6
commit 9550c7f352
1 changed files with 5 additions and 3 deletions

View File

@ -39,7 +39,8 @@
module up_axi #(
parameter ADDRESS_WIDTH = 14) (
parameter ADDRESS_WIDTH = 14,
parameter AXI_ADDRESS_WIDTH = 32) (
// reset and clocks
@ -49,7 +50,7 @@ module up_axi #(
// axi4 interface
input up_axi_awvalid,
input [31:0] up_axi_awaddr,
input [AXI_AW:0] up_axi_awaddr,
output reg up_axi_awready,
input up_axi_wvalid,
input [31:0] up_axi_wdata,
@ -59,7 +60,7 @@ module up_axi #(
output [ 1:0] up_axi_bresp,
input up_axi_bready,
input up_axi_arvalid,
input [31:0] up_axi_araddr,
input [AXI_AW:0] up_axi_araddr,
output reg up_axi_arready,
output reg up_axi_rvalid,
output [ 1:0] up_axi_rresp,
@ -77,6 +78,7 @@ module up_axi #(
input [31:0] up_rdata,
input up_rack);
localparam AXI_AW = AXI_ADDRESS_WIDTH - 1;
localparam AW = ADDRESS_WIDTH - 1;
// internal registers