From 7ca43f492078325eaea83a2bc9db5558a72c645c Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Fri, 4 Apr 2014 14:55:27 +0200 Subject: [PATCH] axi_dmac: address_generator: Make 'len' registered Slightly improves the timing. Signed-off-by: Lars-Peter Clausen --- library/axi_dmac/address_generator.v | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/library/axi_dmac/address_generator.v b/library/axi_dmac/address_generator.v index 5762a0f37..0c3d4a829 100644 --- a/library/axi_dmac/address_generator.v +++ b/library/axi_dmac/address_generator.v @@ -76,9 +76,10 @@ localparam MAX_BEATS_PER_BURST = 2**(C_BEATS_PER_BURST_WIDTH); assign burst = 2'b01; assign prot = 3'b000; assign cache = 4'b0011; -assign len = eot ? req_last_burst_length : MAX_BEATS_PER_BURST - 1; +assign len = length; assign size = $clog2(C_DMA_DATA_WIDTH/8); +reg [7:0] length = 'h0; reg [31-C_ADDR_ALIGN_BITS:0] address = 'h00; reg [C_BEATS_PER_BURST_WIDTH-1:0] last_burst_len = 'h00; assign addr = {address, {C_ADDR_ALIGN_BITS{1'b0}}}; @@ -96,6 +97,13 @@ always @(posedge clk) begin end end +always @(posedge clk) begin + if (eot == 1'b1) + length <= req_last_burst_length; + else + length <= MAX_BEATS_PER_BURST - 1; +end + always @(posedge clk) begin if (resetn == 1'b0) begin address <= 'h00;