From 7bfa7fb5af44adf4395e2b87e33d9838e0f9b160 Mon Sep 17 00:00:00 2001 From: Michael Rogenmoser Date: Thu, 27 Jul 2023 09:44:56 +0200 Subject: [PATCH 1/7] Limit page deployment of CI to master branch --- .github/workflows/doc.yml | 5 +++-- .github/workflows/gitlab-ci.yml | 4 ---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 0f50b87e5..2996e519b 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -60,8 +60,9 @@ jobs: - name: Deploy documentation uses: JamesIves/github-pages-deploy-action@v4 if: > - github.event_name == 'push' - || github.event.pull_request.head.repo.full_name == github.repository + (github.event_name == 'push' + || github.event.pull_request.head.repo.full_name == github.repository) && + github.ref == 'refs/heads/master' with: token: ${{ secrets.GH_PAGES }} branch: gh-pages # The branch the action should deploy to. diff --git a/.github/workflows/gitlab-ci.yml b/.github/workflows/gitlab-ci.yml index 560eaedbb..96456f43e 100644 --- a/.github/workflows/gitlab-ci.yml +++ b/.github/workflows/gitlab-ci.yml @@ -4,10 +4,6 @@ on: branches-ignore: - gh-pages # deployment target branch (this workflow should not exist on that branch anyway) - v** # such branch names conflict with tags - pull_request: - branches-ignore: - - gh-pages # deployment target branch (this workflow should not exist on that branch anyway) - - v** # such branch names conflict with tags workflow_dispatch: jobs: From 9e1b7d27bca357de59cf978e1a81c860d3422973 Mon Sep 17 00:00:00 2001 From: Michael Rogenmoser Date: Thu, 27 Jul 2023 16:21:35 +0200 Subject: [PATCH 2/7] Properly handle response code in axi_to_detailed_mem Fixes #319 --- Bender.yml | 2 +- src/axi_to_detailed_mem.sv | 71 +++++++++++++++++++++++++++++++++----- 2 files changed, 64 insertions(+), 9 deletions(-) diff --git a/Bender.yml b/Bender.yml index 8f16f74cb..2f121e0bf 100644 --- a/Bender.yml +++ b/Bender.yml @@ -19,7 +19,7 @@ package: - "Florian Zaruba " dependencies: - common_cells: { git: "https://github.com/pulp-platform/common_cells.git", version: 1.27.0 } + common_cells: { git: "https://github.com/pulp-platform/common_cells.git", rev: "be16fe6efa97af39ca258e398f37b7910e636e02" } common_verification: { git: "https://github.com/pulp-platform/common_verification.git", version: 0.2.3 } tech_cells_generic: { git: "https://github.com/pulp-platform/tech_cells_generic.git", version: 0.2.2 } diff --git a/src/axi_to_detailed_mem.sv b/src/axi_to_detailed_mem.sv index 691a1f5c8..3a656b0dc 100644 --- a/src/axi_to_detailed_mem.sv +++ b/src/axi_to_detailed_mem.sv @@ -122,6 +122,7 @@ module axi_to_detailed_mem #( addr_t addr; axi_pkg::atop_t atop; logic lock; + axi_strb_t strb; axi_id_t id; logic last; axi_pkg::qos_t qos; @@ -133,7 +134,13 @@ module axi_to_detailed_mem #( axi_pkg::region_t region; } meta_t; - axi_data_t mem_rdata, + typedef struct packed { + axi_data_t data; + logic [NumBanks-1:0] err; + logic [NumBanks-1:0] exokay; + } mem_rsp_t; + + mem_rsp_t mem_rdata, m2s_resp; axi_pkg::len_t r_cnt_d, r_cnt_q, w_cnt_d, w_cnt_q; @@ -188,6 +195,7 @@ module axi_to_detailed_mem #( addr: addr_t'(axi_pkg::aligned_addr(axi_req_i.ar.addr, axi_req_i.ar.size)), atop: '0, lock: axi_req_i.ar.lock, + strb: '0, id: axi_req_i.ar.id, last: (axi_req_i.ar.len == '0), qos: axi_req_i.ar.qos, @@ -224,6 +232,7 @@ module axi_to_detailed_mem #( wr_meta.addr = wr_meta_q.addr + axi_pkg::num_bytes(wr_meta_q.size); if (axi_req_i.w_valid) begin wr_valid = 1'b1; + wr_meta.strb = axi_req_i.w.strb; if (wr_ready) begin axi_resp_o.w_ready = 1'b1; w_cnt_d--; @@ -236,6 +245,7 @@ module axi_to_detailed_mem #( addr: addr_t'(axi_pkg::aligned_addr(axi_req_i.aw.addr, axi_req_i.aw.size)), atop: axi_req_i.aw.atop, lock: axi_req_i.aw.lock, + strb: axi_req_i.w.strb, id: axi_req_i.aw.id, last: (axi_req_i.aw.len == '0), qos: axi_req_i.aw.qos, @@ -384,7 +394,7 @@ module axi_to_detailed_mem #( // Interface memory as stream. stream_to_mem #( .mem_req_t ( mem_req_t ), - .mem_resp_t ( axi_data_t ), + .mem_resp_t ( mem_rsp_t ), .BufDepth ( BufDepth ) ) i_stream_to_mem ( .clk_i, @@ -438,10 +448,20 @@ module axi_to_detailed_mem #( assign mem_region_o[i] = banked_req_atop[i].region; end + logic [NumBanks*2-1:0] tmp_ersp; + logic [NumBanks-1:0][1:0] bank_ersp; + for (genvar i = 0; i < NumBanks; i++) begin + assign mem_rdata.err[i] = tmp_ersp[i*2]; + assign mem_rdata.exokay[i] = tmp_ersp[i*2+1]; + assign bank_ersp[i][0] = mem_err_i[i]; + assign bank_ersp[i][1] = mem_exokay_i[i]; + end + // Split single memory request to desired number of banks. - mem_to_banks #( + mem_to_banks_detailed #( .AddrWidth ( AddrWidth ), .DataWidth ( DataWidth ), + .ErspWidth ( 2 ), .NumBanks ( NumBanks ), .HideStrb ( HideStrb ), .MaxTrans ( BufDepth ), @@ -458,7 +478,8 @@ module axi_to_detailed_mem #( .atop_i ( mem_req_atop ), .we_i ( mem_req.we ), .rvalid_o ( mem_rvalid ), - .rdata_o ( mem_rdata ), + .rdata_o ( mem_rdata.data ), + .ersp_o ( tmp_ersp ), .bank_req_o ( mem_req_o ), .bank_gnt_i ( mem_gnt_i ), .bank_addr_o ( mem_addr_o ), @@ -467,7 +488,8 @@ module axi_to_detailed_mem #( .bank_atop_o ( banked_req_atop ), .bank_we_o ( mem_we_o ), .bank_rvalid_i ( mem_rvalid_i ), - .bank_rdata_i ( mem_rdata_i ) + .bank_rdata_i ( mem_rdata_i ), + .bank_ersp_i ( bank_ersp ) ); // Join memory read data and meta data stream. @@ -496,19 +518,50 @@ module axi_to_detailed_mem #( .ready_i ({axi_req_i.b_ready, axi_req_i.r_ready }) ); + // Accumulate errors if memory responds + localparam NumBytesPerBank = DataWidth/NumBanks/8; + logic collect_b_err_d, collect_b_err_q; + logic collect_b_exokay_d, collect_b_exokay_q; + logic [NumBanks-1:0] meta_buf_bank_strb, meta_buf_size_enable; + logic resp_b_err, resp_b_exokay, resp_r_err, resp_r_exokay; + for (genvar i = 0; i < NumBanks; i++) begin + assign meta_buf_bank_strb[i] = meta_buf.strb[i*NumBytesPerBank +: NumBytesPerBank]; + assign meta_buf_size_enable[i] = i*NumBytesPerBank + NumBytesPerBank > (meta_buf.addr % DataWidth/8) && + i*NumBytesPerBank < ((meta_buf.addr % DataWidth/8) + 1< Date: Fri, 28 Jul 2023 17:38:30 +0200 Subject: [PATCH 3/7] axi_to_detailed_mem: Expand explanation --- Bender.yml | 2 +- src/axi_to_detailed_mem.sv | 41 +++++++++++++++++++++++++------------- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/Bender.yml b/Bender.yml index 2f121e0bf..ab90f8c83 100644 --- a/Bender.yml +++ b/Bender.yml @@ -19,7 +19,7 @@ package: - "Florian Zaruba " dependencies: - common_cells: { git: "https://github.com/pulp-platform/common_cells.git", rev: "be16fe6efa97af39ca258e398f37b7910e636e02" } + common_cells: { git: "https://github.com/pulp-platform/common_cells.git", rev: "99fcffdc3f8a5f3f590f6c9f687f65a2e9f2e0fe" } # updated mem_to_banks_detailed common_verification: { git: "https://github.com/pulp-platform/common_verification.git", version: 0.2.3 } tech_cells_generic: { git: "https://github.com/pulp-platform/tech_cells_generic.git", version: 0.2.2 } diff --git a/src/axi_to_detailed_mem.sv b/src/axi_to_detailed_mem.sv index 3a656b0dc..9da63c013 100644 --- a/src/axi_to_detailed_mem.sv +++ b/src/axi_to_detailed_mem.sv @@ -448,11 +448,11 @@ module axi_to_detailed_mem #( assign mem_region_o[i] = banked_req_atop[i].region; end - logic [NumBanks*2-1:0] tmp_ersp; + logic [NumBanks-1:0][1:0] tmp_ersp; logic [NumBanks-1:0][1:0] bank_ersp; for (genvar i = 0; i < NumBanks; i++) begin - assign mem_rdata.err[i] = tmp_ersp[i*2]; - assign mem_rdata.exokay[i] = tmp_ersp[i*2+1]; + assign mem_rdata.err[i] = tmp_ersp[i][0]; + assign mem_rdata.exokay[i] = tmp_ersp[i][1]; assign bank_ersp[i][0] = mem_err_i[i]; assign bank_ersp[i][1] = mem_exokay_i[i]; end @@ -518,21 +518,34 @@ module axi_to_detailed_mem #( .ready_i ({axi_req_i.b_ready, axi_req_i.r_ready }) ); - // Accumulate errors if memory responds localparam NumBytesPerBank = DataWidth/NumBanks/8; - logic collect_b_err_d, collect_b_err_q; - logic collect_b_exokay_d, collect_b_exokay_q; + logic [NumBanks-1:0] meta_buf_bank_strb, meta_buf_size_enable; logic resp_b_err, resp_b_exokay, resp_r_err, resp_r_exokay; + + // Collect `err` and `exokay` from all banks + // To ensure correct propagation, `err` is grouped with `OR` and `exokay` is grouped with `AND`. for (genvar i = 0; i < NumBanks; i++) begin - assign meta_buf_bank_strb[i] = meta_buf.strb[i*NumBytesPerBank +: NumBytesPerBank]; + // Set active write banks based on strobe + assign meta_buf_bank_strb[i] = |meta_buf.strb[i*NumBytesPerBank +: NumBytesPerBank]; + // Set active read banks based on size and address offset assign meta_buf_size_enable[i] = i*NumBytesPerBank + NumBytesPerBank > (meta_buf.addr % DataWidth/8) && i*NumBytesPerBank < ((meta_buf.addr % DataWidth/8) + 1< Date: Tue, 8 Aug 2023 13:56:04 +0200 Subject: [PATCH 4/7] Bump common_cells version --- Bender.yml | 2 +- src/axi_to_detailed_mem.sv | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Bender.yml b/Bender.yml index ab90f8c83..5435d12af 100644 --- a/Bender.yml +++ b/Bender.yml @@ -19,7 +19,7 @@ package: - "Florian Zaruba " dependencies: - common_cells: { git: "https://github.com/pulp-platform/common_cells.git", rev: "99fcffdc3f8a5f3f590f6c9f687f65a2e9f2e0fe" } # updated mem_to_banks_detailed + common_cells: { git: "https://github.com/pulp-platform/common_cells.git", version: 1.31.0 } common_verification: { git: "https://github.com/pulp-platform/common_verification.git", version: 0.2.3 } tech_cells_generic: { git: "https://github.com/pulp-platform/tech_cells_generic.git", version: 0.2.2 } diff --git a/src/axi_to_detailed_mem.sv b/src/axi_to_detailed_mem.sv index 9da63c013..8f5c11d21 100644 --- a/src/axi_to_detailed_mem.sv +++ b/src/axi_to_detailed_mem.sv @@ -459,14 +459,14 @@ module axi_to_detailed_mem #( // Split single memory request to desired number of banks. mem_to_banks_detailed #( - .AddrWidth ( AddrWidth ), - .DataWidth ( DataWidth ), - .ErspWidth ( 2 ), - .NumBanks ( NumBanks ), - .HideStrb ( HideStrb ), - .MaxTrans ( BufDepth ), - .FifoDepth ( OutFifoDepth ), - .AtopWidth ( $bits(tmp_atop_t) ) + .AddrWidth ( AddrWidth ), + .DataWidth ( DataWidth ), + .RUserWidth ( 2 ), + .NumBanks ( NumBanks ), + .HideStrb ( HideStrb ), + .MaxTrans ( BufDepth ), + .FifoDepth ( OutFifoDepth ), + .WUserWidth ( $bits(tmp_atop_t) ) ) i_mem_to_banks ( .clk_i, .rst_ni, @@ -475,21 +475,21 @@ module axi_to_detailed_mem #( .addr_i ( mem_req.addr ), .wdata_i ( mem_req.wdata ), .strb_i ( mem_req.strb ), - .atop_i ( mem_req_atop ), + .wuser_i ( mem_req_atop ), .we_i ( mem_req.we ), .rvalid_o ( mem_rvalid ), .rdata_o ( mem_rdata.data ), - .ersp_o ( tmp_ersp ), + .ruser_o ( tmp_ersp ), .bank_req_o ( mem_req_o ), .bank_gnt_i ( mem_gnt_i ), .bank_addr_o ( mem_addr_o ), .bank_wdata_o ( mem_wdata_o ), .bank_strb_o ( mem_strb_o ), - .bank_atop_o ( banked_req_atop ), + .bank_wuser_o ( banked_req_atop ), .bank_we_o ( mem_we_o ), .bank_rvalid_i ( mem_rvalid_i ), .bank_rdata_i ( mem_rdata_i ), - .bank_ersp_i ( bank_ersp ) + .bank_ruser_i ( bank_ersp ) ); // Join memory read data and meta data stream. @@ -528,9 +528,9 @@ module axi_to_detailed_mem #( for (genvar i = 0; i < NumBanks; i++) begin // Set active write banks based on strobe assign meta_buf_bank_strb[i] = |meta_buf.strb[i*NumBytesPerBank +: NumBytesPerBank]; - // Set active read banks based on size and address offset - assign meta_buf_size_enable[i] = i*NumBytesPerBank + NumBytesPerBank > (meta_buf.addr % DataWidth/8) && - i*NumBytesPerBank < ((meta_buf.addr % DataWidth/8) + 1< addr) && (bank.start < addr+size) + assign meta_buf_size_enable[i] = ((i*NumBytesPerBank + NumBytesPerBank) > (meta_buf.addr % DataWidth/8)) && + ((i*NumBytesPerBank) < ((meta_buf.addr % DataWidth/8) + 1< Date: Tue, 8 Aug 2023 14:51:27 +0200 Subject: [PATCH 5/7] axi_to_detailed_mem: Ensure CI run with memora --- .ci/Memora.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.ci/Memora.yml b/.ci/Memora.yml index deda96773..c8fd967de 100644 --- a/.ci/Memora.yml +++ b/.ci/Memora.yml @@ -294,6 +294,7 @@ artifacts: - src/axi_intf.sv - src/axi_test.sv - src/axi_demux.sv + - src/axi_to_detailed_mem.sv - src/axi_to_mem.sv - src/axi_to_mem_banked.sv - test/tb_axi_to_mem_banked.sv From 25c1b9197d1e7f9c12fa8debb711e28b4017bee6 Mon Sep 17 00:00:00 2001 From: Michael Rogenmoser Date: Tue, 8 Aug 2023 14:54:42 +0200 Subject: [PATCH 6/7] Update Changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 328a8e818..d3b0caf4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## Unreleased +### Fixed +- `axi_to_detailed_mem`: Ensure proper propagation or `err` and `exokay` signals. + ## 0.39.0 - 2023-07-20 ### Added From cab37ddf45b98ce80cbd4533ed06574ed4b1f201 Mon Sep 17 00:00:00 2001 From: Michael Rogenmoser Date: Wed, 16 Aug 2023 09:45:34 +0200 Subject: [PATCH 7/7] Bump common_cells for proper parameter propagation --- Bender.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bender.yml b/Bender.yml index 5435d12af..d5cc6d008 100644 --- a/Bender.yml +++ b/Bender.yml @@ -19,7 +19,7 @@ package: - "Florian Zaruba " dependencies: - common_cells: { git: "https://github.com/pulp-platform/common_cells.git", version: 1.31.0 } + common_cells: { git: "https://github.com/pulp-platform/common_cells.git", version: 1.31.1 } common_verification: { git: "https://github.com/pulp-platform/common_verification.git", version: 0.2.3 } tech_cells_generic: { git: "https://github.com/pulp-platform/tech_cells_generic.git", version: 0.2.2 }