-
Notifications
You must be signed in to change notification settings - Fork 790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ibex,fpga] Apply Ibex FPGA patches #25480
Merged
luismarques
merged 2 commits into
lowRISC:earlgrey_1.0.0
from
nasahlpa:earlgrey_1.0.0_ibex_patch
Dec 9, 2024
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
hw/vendor/patches/lowrisc_ibex/rtl/0001-Fix-fpga-register-file.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
diff --git a/ibex_register_file_fpga.sv b/ibex_register_file_fpga.sv | ||
index 7a0ae34b15..73e0afab2f 100644 | ||
--- a/ibex_register_file_fpga.sv | ||
+++ b/ibex_register_file_fpga.sv | ||
@@ -147,14 +147,14 @@ module ibex_register_file_fpga #( | ||
.out_o (mem_o_b) | ||
); | ||
|
||
- assign rdata_a_o = (raddr_a_i == '0) ? '0 : mem_o_a; | ||
- assign rdata_b_o = (raddr_b_i == '0) ? '0 : mem_o_b; | ||
+ assign rdata_a_o = (raddr_a_i == '0) ? WordZeroVal : mem_o_a; | ||
+ assign rdata_b_o = (raddr_b_i == '0) ? WordZeroVal : mem_o_b; | ||
end else begin : gen_no_rdata_mux_check | ||
// async_read a | ||
- assign rdata_a_o = (raddr_a_i == '0) ? '0 : mem[raddr_a_i]; | ||
+ assign rdata_a_o = (raddr_a_i == '0) ? WordZeroVal : mem[raddr_a_i]; | ||
|
||
// async_read b | ||
- assign rdata_b_o = (raddr_b_i == '0) ? '0 : mem[raddr_b_i]; | ||
+ assign rdata_b_o = (raddr_b_i == '0) ? WordZeroVal : mem[raddr_b_i]; | ||
end | ||
|
||
// we select |
19 changes: 19 additions & 0 deletions
19
hw/vendor/patches/lowrisc_ibex/rtl/0002-Fix-fpga-counter-reset.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
diff --git a/ibex_counter.sv b/ibex_counter.sv | ||
index c78e510ee4..b4dc7ec347 100644 | ||
--- a/ibex_counter.sv | ||
+++ b/ibex_counter.sv | ||
@@ -55,8 +55,12 @@ module ibex_counter #( | ||
localparam int DspPragma = CounterWidth < 49 ? "yes" : "no"; | ||
(* use_dsp = DspPragma *) logic [CounterWidth-1:0] counter_q; | ||
|
||
- // DSP output register requires synchronous reset. | ||
- `define COUNTER_FLOP_RST posedge clk_i | ||
+ if (CounterWidth < 49) begin : g_dsp_counter | ||
+ // DSP output register requires synchronous reset. | ||
+ `define COUNTER_FLOP_RST posedge clk_i | ||
+ end else begin : g_no_dsp_counter | ||
+ `define COUNTER_FLOP_RST posedge clk_i or negedge rst_ni | ||
+ end | ||
`else | ||
logic [CounterWidth-1:0] counter_q; | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note that this code relying on a pre-processor
`define
isn't generally correct, because the pre-processor would resolve the`define
before elaboration resolves the parameterizedif
-else
construct. However, this only affects Xilinx code (it's inside an`ifdef FPGA_XILINX
) and @nasahlpa tested that this works as intended in Vivado.On
master
a proper fix has been applied (#25458), but that would also modify ASIC RTL, which we don't allow on this branch.