Skip to content

Commit

Permalink
axi_demux: Add parameter AtopSupport
Browse files Browse the repository at this point in the history
Adapted from `0009-Remove-atomics-from-DMA-path.patch` of the Snitch
repository.

Co-authored-by: Florian Zaruba <[email protected]>
  • Loading branch information
andreaskurth and zarubaf committed Feb 26, 2022
1 parent d715a90 commit e8fa729
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## Unreleased

### Added
- `axi_demux`: Add parameter `AtopSupport` to optionally disable the support for atomic operations
(ATOPs). This parameter defaults to `1'b1`, i.e., ATOPs are supported. Therefore, this change is
backward-compatible.
- `axi_xbar`: Add `Connectivity` parameter to enable the implementation of partially-connected
crossbars. This parameter defaults to `'1`, i.e., every slave port is connected to every master
port. Therefore, this change is backward-compatible.
Expand Down
13 changes: 9 additions & 4 deletions src/axi_demux.sv
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// - Wolfgang Roenninger <[email protected]>
// - Andreas Kurth <[email protected]>

`include "common_cells/assertions.svh"
`include "common_cells/registers.svh"

`ifdef QUESTA
Expand All @@ -24,6 +25,7 @@
// See `doc/axi_demux.md` for the documentation, including the definition of parameters and ports.
module axi_demux #(
parameter int unsigned AxiIdWidth = 32'd0,
parameter bit AtopSupport = 1'b1,
parameter type aw_chan_t = logic,
parameter type w_chan_t = logic,
parameter type b_chan_t = logic,
Expand Down Expand Up @@ -205,12 +207,14 @@ module axi_demux #(
slv_aw_ready = 1'b1;
lock_aw_valid_d = 1'b0;
load_aw_lock = 1'b1;
atop_inject = slv_aw_chan_select.aw_chan.atop[5]; // inject the ATOP if necessary
// inject the ATOP if necessary
atop_inject = slv_aw_chan_select.aw_chan.atop[5] & AtopSupport;
end
end else begin
// Process can start handling a transaction if its `i_aw_id_counter` and `w_fifo` have
// space in them. Further check if we could inject something on the AR channel.
if (!aw_id_cnt_full && !w_fifo_full && !ar_id_cnt_full) begin
// space in them. Further check if we could inject something on the AR channel (only if
// ATOPs are supported).
if (!aw_id_cnt_full && !w_fifo_full && (!ar_id_cnt_full || !AtopSupport)) begin
// there is a valid AW vector make the id lookup and go further, if it passes
if (slv_aw_valid && (!aw_select_occupied ||
(slv_aw_chan_select.aw_select == lookup_aw_select))) begin
Expand All @@ -221,7 +225,7 @@ module axi_demux #(
// on AW transaction
if (aw_ready) begin
slv_aw_ready = 1'b1;
atop_inject = slv_aw_chan_select.aw_chan.atop[5];
atop_inject = slv_aw_chan_select.aw_chan.atop[5] & AtopSupport;
// no AW transaction this cycle, lock the decision
end else begin
lock_aw_valid_d = 1'b1;
Expand Down Expand Up @@ -574,6 +578,7 @@ module axi_demux #(
internal_aw_select: assert property( @(posedge clk_i)
(aw_valid |-> slv_aw_chan_select.aw_select < NoMstPorts))
else $fatal(1, "slv_aw_chan_select.aw_select illegal while aw_valid.");
`ASSUME(NoAtopAllowed, !AtopSupport && slv_req_i.aw_valid |-> slv_req_i.aw.atop == '0)
`endif
`endif
// pragma translate_on
Expand Down
1 change: 1 addition & 0 deletions src/axi_xbar.sv
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ import cf_math_pkg::idx_width;
// pragma translate_on
axi_demux #(
.AxiIdWidth ( Cfg.AxiIdWidthSlvPorts ), // ID Width
.AtopSupport ( ATOPs ),
.aw_chan_t ( slv_aw_chan_t ), // AW Channel Type
.w_chan_t ( w_chan_t ), // W Channel Type
.b_chan_t ( slv_b_chan_t ), // B Channel Type
Expand Down

0 comments on commit e8fa729

Please sign in to comment.