Skip to content

Commit

Permalink
Merge pull request #163 from LucaZulberti/forward-ref-fix
Browse files Browse the repository at this point in the history
axi_dw_converter: Remove forward reference
  • Loading branch information
andreaskurth authored Feb 1, 2021
2 parents ecdc224 + a250c36 commit 45f477e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 23 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Changed

### Fixed
- `axi_dw_downsizer` and `axi_dw_upsizer` (part of `axi_dw_converter`): Fix declaration order of
`w_req_t`, `w_req_d`, and `w_req_q` to remove problematic forward references.
- FuseSoC: Fix version of `common_cells` (`1.21.0`).


Expand Down
26 changes: 14 additions & 12 deletions src/axi_dw_downsizer.sv
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,20 @@ module axi_dw_downsizer #(
logic injected_aw ;
} r_req_t;

// Write-related type, but w_req_q is referenced from Read logic
typedef struct packed {
aw_chan_t aw ;
logic aw_valid ;
logic aw_throw_error ;
burst_len_t burst_len ;
axi_pkg::len_t orig_aw_len ;
axi_pkg::burst_t orig_aw_burst;
axi_pkg::resp_t burst_resp ;
axi_pkg::size_t orig_aw_size ;
} w_req_t;

w_req_t w_req_d, w_req_q;

// Decide which downsizer will handle the incoming AXI transaction
logic [AxiMaxReads-1:0] idle_read_downsizer;
tran_id_t idx_ar_downsizer;
Expand Down Expand Up @@ -614,19 +628,7 @@ module axi_dw_downsizer #(
W_SPLIT_INCR_DOWNSIZE
} w_state_e;

typedef struct packed {
aw_chan_t aw ;
logic aw_valid ;
logic aw_throw_error ;
burst_len_t burst_len ;
axi_pkg::len_t orig_aw_len ;
axi_pkg::burst_t orig_aw_burst;
axi_pkg::resp_t burst_resp ;
axi_pkg::size_t orig_aw_size ;
} w_req_t;

w_state_e w_state_d, w_state_q;
w_req_t w_req_d, w_req_q;

// This FIFO holds the number of bursts generated by each write transactions handled by this downsizer.
// This is used to forward only the correct B beats to the slave.
Expand Down
24 changes: 13 additions & 11 deletions src/axi_dw_upsizer.sv
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,19 @@ module axi_dw_upsizer #(
R_INCR_UPSIZE
} r_state_e;

// Write-related type, but w_req_q is referenced from Read logic
typedef struct packed {
aw_chan_t aw ;
logic aw_valid ;
logic aw_throw_error ;
mst_w_chan_t w ;
logic w_valid ;
axi_pkg::len_t burst_len ;
axi_pkg::size_t orig_aw_size;
} w_req_t;

w_req_t w_req_d, w_req_q;

// Decide which upsizer will handle the incoming AXI transaction
logic [AxiMaxReads-1:0] idle_read_upsizer;
tran_id_t idx_ar_upsizer ;
Expand Down Expand Up @@ -529,18 +542,7 @@ module axi_dw_upsizer #(
W_INCR_UPSIZE
} w_state_e;

typedef struct packed {
aw_chan_t aw ;
logic aw_valid ;
logic aw_throw_error ;
mst_w_chan_t w ;
logic w_valid ;
axi_pkg::len_t burst_len ;
axi_pkg::size_t orig_aw_size;
} w_req_t;

w_state_e w_state_d, w_state_q;
w_req_t w_req_d , w_req_q ;

always_comb begin
inject_aw_into_ar_req = 1'b0;
Expand Down

0 comments on commit 45f477e

Please sign in to comment.