From cdfbc9d49b59209b468707c7d6dee45e487de7e4 Mon Sep 17 00:00:00 2001 From: Michael Rogenmoser Date: Mon, 21 Mar 2022 15:46:54 +0100 Subject: [PATCH 1/6] Fix ibex register file for FPGA --- Bender.yml | 2 +- CHANGELOG.md | 2 ++ rtl/fc/fc_subsystem.sv | 25 ++++++++++++++++++++++++- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/Bender.yml b/Bender.yml index 08b7e4fd..e12a28a5 100644 --- a/Bender.yml +++ b/Bender.yml @@ -31,7 +31,7 @@ dependencies: fpnew: { git: "https://github.com/pulp-platform/fpnew.git", version: 0.6.6 } jtag_pulp: { git: "https://github.com/pulp-platform/jtag_pulp.git", rev: "v0.1" } cv32e40p: { git: "https://github.com/pulp-platform/cv32e40p.git", rev: "pulpissimo-v3.4.0-rev3"} - ibex: { git: "https://github.com/lowRISC/ibex.git", rev: "pulpissimo-v6.1.1" } + ibex: { git: "https://github.com/pulp-platform/ibex.git", rev: "pulpissimo-v6.1.2" } scm: { git: "https://github.com/pulp-platform/scm.git", version: 1.0.1} generic_FLL: { git: "https://github.com/pulp-platform/generic_FLL.git", rev: "1c92dc73a940392182fd4cb7b86f35649b349595" } tech_cells_generic: { git: "https://github.com/pulp-platform/tech_cells_generic.git", version: 0.2.3 } diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cffe426..13006577 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## Fixed +- Fix ibex register file for FPGA ## [3.1.1] - 2022-03-11 ### Fixed - Fix cdc reset signal for cluster diff --git a/rtl/fc/fc_subsystem.sv b/rtl/fc/fc_subsystem.sv index 4408b3d9..210bd4c8 100644 --- a/rtl/fc/fc_subsystem.sv +++ b/rtl/fc/fc_subsystem.sv @@ -51,6 +51,29 @@ module fc_subsystem #( localparam IBEX_RV32M = CORE_TYPE == 1 ? ibex_pkg::RV32MFast : ibex_pkg::RV32MNone; localparam IBEX_RV32E = CORE_TYPE == 2; + +`ifdef TARGET_IBEX_USE_FPGA_REGFILE + localparam IBEX_RegFile = ibex_pkg::RegFileFPGA; +`else +`ifdef TARGET_IBEX_USE_LATCH_REGFILE + localparam IBEX_RegFile = ibex_pkg::RegFileLatch; +`else +`ifdef TARGET_IBEX_USE_FF_REGFILE + localparam IBEX_RegFile = ibex_pkg::RegFileFF; +`else +`ifdef TARGET_FPGA + localparam IBEX_RegFile = ibex_pkg::RegFileFPGA; +`else +`ifdef TARGET_SYNTHESIS + localparam IBEX_RegFile = ibex_pkg::RegFileLatch; +`else + localparam IBEX_RegFile = ibex_pkg::RegFileFF; +`endif +`endif +`endif +`endif +`endif + // Interrupt signals logic core_irq_req ; logic core_irq_sec ; @@ -200,7 +223,7 @@ module fc_subsystem #( .RV32E ( IBEX_RV32E ), .RV32M ( IBEX_RV32M ), .RV32B ( ibex_pkg::RV32BNone ), - .RegFile ( ibex_pkg::RegFileFF ), + .RegFile ( IBEX_RegFile ), .BranchTargetALU ( 1'b0 ), .WritebackStage ( 1'b0 ), .ICache ( 1'b0 ), From 2d82b58ea05b40f463f65160983b668f7a46b591 Mon Sep 17 00:00:00 2001 From: Michael Rogenmoser Date: Mon, 21 Mar 2022 17:30:55 +0100 Subject: [PATCH 2/6] bender: update cv32e40p reference --- Bender.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bender.yml b/Bender.yml index e12a28a5..bf05bb9e 100644 --- a/Bender.yml +++ b/Bender.yml @@ -30,7 +30,7 @@ dependencies: cluster_interconnect: { git: "https://github.com/pulp-platform/cluster_interconnect.git", version: 1.1.1 } fpnew: { git: "https://github.com/pulp-platform/fpnew.git", version: 0.6.6 } jtag_pulp: { git: "https://github.com/pulp-platform/jtag_pulp.git", rev: "v0.1" } - cv32e40p: { git: "https://github.com/pulp-platform/cv32e40p.git", rev: "pulpissimo-v3.4.0-rev3"} + cv32e40p: { git: "https://github.com/pulp-platform/cv32e40p.git", rev: "pulpissimo-v3.4.0-rev4"} ibex: { git: "https://github.com/pulp-platform/ibex.git", rev: "pulpissimo-v6.1.2" } scm: { git: "https://github.com/pulp-platform/scm.git", version: 1.0.1} generic_FLL: { git: "https://github.com/pulp-platform/generic_FLL.git", rev: "1c92dc73a940392182fd4cb7b86f35649b349595" } From c1d222d2507e7dcd45504f527430a44f12ed7b69 Mon Sep 17 00:00:00 2001 From: Michael Rogenmoser Date: Mon, 28 Mar 2022 15:21:05 +0200 Subject: [PATCH 3/6] ibex: clean up register file selection --- rtl/fc/fc_subsystem.sv | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/rtl/fc/fc_subsystem.sv b/rtl/fc/fc_subsystem.sv index 210bd4c8..4e9e8e5a 100644 --- a/rtl/fc/fc_subsystem.sv +++ b/rtl/fc/fc_subsystem.sv @@ -51,28 +51,16 @@ module fc_subsystem #( localparam IBEX_RV32M = CORE_TYPE == 1 ? ibex_pkg::RV32MFast : ibex_pkg::RV32MNone; localparam IBEX_RV32E = CORE_TYPE == 2; - -`ifdef TARGET_IBEX_USE_FPGA_REGFILE - localparam IBEX_RegFile = ibex_pkg::RegFileFPGA; -`else -`ifdef TARGET_IBEX_USE_LATCH_REGFILE - localparam IBEX_RegFile = ibex_pkg::RegFileLatch; -`else -`ifdef TARGET_IBEX_USE_FF_REGFILE - localparam IBEX_RegFile = ibex_pkg::RegFileFF; -`else -`ifdef TARGET_FPGA - localparam IBEX_RegFile = ibex_pkg::RegFileFPGA; -`else -`ifdef TARGET_SYNTHESIS - localparam IBEX_RegFile = ibex_pkg::RegFileLatch; -`else - localparam IBEX_RegFile = ibex_pkg::RegFileFF; -`endif -`endif -`endif -`endif -`endif + // Set register file for ibex based on bender targets. + // Default to FF for simulation, use FGPA for FPGA, use Latch for synthesis. + // Override by setting bender targets (`-t ibex_use_ff_regfile`) or defines below + localparam IBEX_RegFile = `ifdef TARGET_IBEX_USE_FPGA_REGFILE ibex_pkg::RegFileFPGA; `else // Override FPGA + `ifdef TARGET_IBEX_USE_LATCH_REGFILE ibex_pkg::RegFileLatch; `else // Override Latch + `ifdef TARGET_IBEX_USE_FF_REGFILE ibex_pkg::RegFileFF; `else // Override FF + `ifdef TARGET_FPGA ibex_pkg::RegFileFPGA; `else // FPGA + `ifdef TARGET_SYNTHESIS ibex_pkg::RegFileLatch; `else // Synthesis + ibex_pkg::RegFileFF; // Default + `endif `endif `endif `endif `endif // Interrupt signals logic core_irq_req ; From 84a8d595ae5f00092c24023d3b22bb2155da8773 Mon Sep 17 00:00:00 2001 From: Michael Rogenmoser Date: Thu, 31 Mar 2022 09:13:42 +0200 Subject: [PATCH 4/6] bender: bump udma versions for bender compatibility --- Bender.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Bender.yml b/Bender.yml index bf05bb9e..b3ef38fb 100644 --- a/Bender.yml +++ b/Bender.yml @@ -35,15 +35,15 @@ dependencies: scm: { git: "https://github.com/pulp-platform/scm.git", version: 1.0.1} generic_FLL: { git: "https://github.com/pulp-platform/generic_FLL.git", rev: "1c92dc73a940392182fd4cb7b86f35649b349595" } tech_cells_generic: { git: "https://github.com/pulp-platform/tech_cells_generic.git", version: 0.2.3 } - udma_core: { git: "https://github.com/pulp-platform/udma_core.git", version: 1.1.0 } - udma_uart: { git: "https://github.com/pulp-platform/udma_uart.git", version: 1.0.1 } - udma_i2c: { git: "https://github.com/pulp-platform/udma_i2c.git", version: 1.0.0 } + udma_core: { git: "https://github.com/pulp-platform/udma_core.git", version: 1.1.2 } + udma_uart: { git: "https://github.com/pulp-platform/udma_uart.git", version: 1.0.2 } + udma_i2c: { git: "https://github.com/pulp-platform/udma_i2c.git", version: 1.0.1 } udma_i2s: { git: "https://github.com/pulp-platform/udma_i2s.git", version: 1.1.2 } udma_qspi: { git: "https://github.com/pulp-platform/udma_qspi.git", version: 1.0.4 } udma_sdio: { git: "https://github.com/pulp-platform/udma_sdio.git", version: 1.1.2 } udma_camera: { git: "https://github.com/pulp-platform/udma_camera.git", version: 1.1.2 } - udma_filter: { git: "https://github.com/pulp-platform/udma_filter.git", version: 1.0.2 } - udma_external_per: { git: "https://github.com/pulp-platform/udma_external_per.git", version: 1.0.3 } + udma_filter: { git: "https://github.com/pulp-platform/udma_filter.git", version: 1.0.3 } + udma_external_per: { git: "https://github.com/pulp-platform/udma_external_per.git", version: 1.0.4 } udma_hyper: { git: "https://github.com/pulp-platform/udma_hyper.git", rev: "83ab704f9d1c5f9e5353268c901fe95c36bcea36" } hwpe-mac-engine: { git: "https://github.com/pulp-platform/hwpe-mac-engine.git", version: 1.3.3 } riscv-dbg: { git: "https://github.com/pulp-platform/riscv-dbg.git", version: 0.4.1 } From 0ffb94cca22fc37c5d2697b3fafbb5983b761eb5 Mon Sep 17 00:00:00 2001 From: Michael Rogenmoser Date: Thu, 31 Mar 2022 17:16:32 +0200 Subject: [PATCH 5/6] udma_i2c: repair port connections from update --- Bender.yml | 2 +- rtl/udma_subsystem/udma_subsystem.sv | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Bender.yml b/Bender.yml index b3ef38fb..e1cd1341 100644 --- a/Bender.yml +++ b/Bender.yml @@ -37,7 +37,7 @@ dependencies: tech_cells_generic: { git: "https://github.com/pulp-platform/tech_cells_generic.git", version: 0.2.3 } udma_core: { git: "https://github.com/pulp-platform/udma_core.git", version: 1.1.2 } udma_uart: { git: "https://github.com/pulp-platform/udma_uart.git", version: 1.0.2 } - udma_i2c: { git: "https://github.com/pulp-platform/udma_i2c.git", version: 1.0.1 } + udma_i2c: { git: "https://github.com/pulp-platform/udma_i2c.git", version: 2.0.0 } udma_i2s: { git: "https://github.com/pulp-platform/udma_i2s.git", version: 1.1.2 } udma_qspi: { git: "https://github.com/pulp-platform/udma_qspi.git", version: 1.0.4 } udma_sdio: { git: "https://github.com/pulp-platform/udma_sdio.git", version: 1.1.2 } diff --git a/rtl/udma_subsystem/udma_subsystem.sv b/rtl/udma_subsystem/udma_subsystem.sv index e9e953ed..4e9a97f3 100644 --- a/rtl/udma_subsystem/udma_subsystem.sv +++ b/rtl/udma_subsystem/udma_subsystem.sv @@ -627,7 +627,6 @@ module udma_subsystem .sys_clk_i ( s_clk_periphs_core[PER_ID_I2C+g_i2c] ), .periph_clk_i ( s_clk_periphs_per[PER_ID_I2C+g_i2c] ), .rstn_i ( sys_resetn_i ), - .i2c_eot_o ( s_i2c_eot[g_i2c] ), .cfg_data_i ( s_periph_data_to ), .cfg_addr_i ( s_periph_addr ), @@ -686,6 +685,8 @@ module udma_subsystem .data_rx_ready_i ( s_rx_ch_ready[CH_ID_RX_I2C+g_i2c] ), .err_o ( s_i2c_evt[g_i2c] ), + .eot_o ( s_i2c_eot[g_i2c] ), + .nack_o (), .scl_i ( i2c_scl_i[g_i2c] ), .scl_o ( i2c_scl_o[g_i2c] ), From 3b9ff968d234f2113820493578e6b90958749dbb Mon Sep 17 00:00:00 2001 From: Michael Rogenmoser Date: Thu, 31 Mar 2022 18:34:39 +0200 Subject: [PATCH 6/6] Update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13006577..752a91a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## Changed +- Update bender dependency link for udma components, ibex, cv32e40p +- Update interface for udma_i2c with unconnected `nack` ## Fixed - Fix ibex register file for FPGA ## [3.1.1] - 2022-03-11