Skip to content

Commit

Permalink
axi_dmac: address_generator: Remove resets from data path
Browse files Browse the repository at this point in the history
There is no need to reset the data path in the address generator. The
values of the register on the data path are not used until they have been
explicitly initialized. Removing the reset simplifies the structure and
reduces the fan-out of the reset signal.

Signed-off-by: Lars-Peter Clausen <[email protected]>
  • Loading branch information
larsclausen authored and Lars-Peter Clausen committed Jun 5, 2018
1 parent 67600f9 commit 6b7a464
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions library/axi_dmac/address_generator.v
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ end

always @(posedge clk) begin
if (addr_valid == 1'b0) begin
last <= eot;
if (eot == 1'b1)
length <= last_burst_len;
else
Expand All @@ -117,31 +118,27 @@ always @(posedge clk) begin
end

always @(posedge clk) begin
if (resetn == 1'b0) begin
last <= 1'b0;
end else if (addr_valid == 1'b0) begin
last <= eot;
if (req_ready == 1'b1) begin
address <= req_address;
last_burst_len <= req_last_burst_length;
end else if (addr_valid == 1'b1 && addr_ready == 1'b1) begin
address <= address + MAX_BEATS_PER_BURST;
end
end

always @(posedge clk) begin
if (resetn == 1'b0) begin
address <= 'h00;
last_burst_len <= 'h00;
req_ready <= 1'b1;
addr_valid <= 1'b0;
end else begin
if (~enabled) begin
req_ready <= 1'b1;
end else if (req_ready) begin
if (req_valid && enable) begin
address <= req_address;
req_ready <= 1'b0;
last_burst_len <= req_last_burst_length;
end
end else begin
if (addr_valid && addr_ready) begin
address <= address + MAX_BEATS_PER_BURST;
addr_valid <= 1'b0;
if (last)
req_ready <= 1'b1;
Expand Down

0 comments on commit 6b7a464

Please sign in to comment.