-
Notifications
You must be signed in to change notification settings - Fork 687
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
Merge CVA6Cfg
and ArianeCfg
#1321
Merge CVA6Cfg
and ArianeCfg
#1321
Conversation
34f24be
to
f174a6d
Compare
Two things:
|
Should be fixed, please re-check. I've renamed it to |
Ok I see what you did - seems fine from my perspective :) Thanks! |
❌ failed run, report available here. |
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.
Very good proposal !! I approve
corev_apu/tb/ariane_testharness.sv
Outdated
unsigned'(cva6_config_pkg::CVA6ConfigAxiIdWidth), // AxiIdWidth | ||
unsigned'(cva6_config_pkg::CVA6ConfigDataUserWidth) // AxiUserWidth | ||
}, | ||
parameter ariane_pkg::cva6_cfg_t CVA6Cfg = ariane_soc::CVA6SoCCfg, |
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.
Why not replacing it by:
parameter ariane_pkg::cva6_cfg_t CVA6Cfg = ariane_pkg::CVA6Cfg
and remove the arien_soc::CVA6SocCfg definition ?
To avoid duplication
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.
That would create a dependency again from the soc
into the main core, memory regions are inherently tied to the SoC which is using the core and I want to keep those as part of the SoC package (if that makes sense). I think we need to live with this duplication here :/
corev_apu/tb/ariane_tb.sv
Outdated
unsigned'(cva6_config_pkg::CVA6ConfigAxiDataWidth), // AxiDataWidth | ||
unsigned'(cva6_config_pkg::CVA6ConfigAxiIdWidth), // AxiIdWidth | ||
unsigned'(cva6_config_pkg::CVA6ConfigDataUserWidth) // AxiUserWidth | ||
}; | ||
localparam type rvfi_instr_t = struct packed { |
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.
I think vcs-testharness regression will fail if CVA6Cfg is not defined in arien_tb module.
❌ failed run, report available here. |
342589f
to
bd6f8c9
Compare
❌ failed run, report available here. |
@zarubaf is there any fix for errors raised by the FPGA job? ERROR: [Synth 8-6038] cannot resolve hierarchical name for the item 'valid' [/gitlab-runner/riscv-public/builds/21Uxzs_1/8/riscv-ci/cva6/core/cva6.sv:1145] |
I think I have changed/fixed this. But the latest regression didn't run fully for some reason. |
corev_apu/fpga/src/ariane_xilinx.sv
Outdated
@@ -573,7 +564,7 @@ logic [1:0] axi_adapter_size; | |||
assign axi_adapter_size = (riscv::XLEN == 64) ? 2'b11 : 2'b10; | |||
|
|||
axi_adapter #( | |||
.CVA6Cfg ( CVA6Cfg ), | |||
.CVA6Cfg ( ariane_soc::CVA6SoCCfg ), |
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.
@ASintzoff and I have found that the issue was that rvfi was not supposed to be enabled in FPGA (see deleted line 160).
Below is my suggestion to only overwrite this parameter. It is an unpretty quick fix, but it makes the PR pass the dashboard tests. So I suggest to accept it, to be able to merge this PR, and proceed to better modifications later.
.CVA6Cfg ( ariane_soc::CVA6SoCCfg ), | |
.CVA6Cfg ('{ | |
NrCommitPorts: ariane_soc::CVA6SoCCfg.NrCommitPorts, | |
IsRVFI: '0, | |
AxiAddrWidth: ariane_soc::CVA6SoCCfg.AxiAddrWidth, | |
AxiDataWidth: ariane_soc::CVA6SoCCfg.AxiDataWidth, | |
AxiIdWidth: ariane_soc::CVA6SoCCfg.AxiIdWidth, | |
AxiUserWidth: ariane_soc::CVA6SoCCfg.AxiUserWidth, | |
RASDepth: ariane_soc::CVA6SoCCfg.RASDepth, | |
BTBEntries: ariane_soc::CVA6SoCCfg.BTBEntries, | |
BHTEntries: ariane_soc::CVA6SoCCfg.BHTEntries, | |
DmBaseAddress: ariane_soc::CVA6SoCCfg.DmBaseAddress, | |
NrPMPEntries: ariane_soc::CVA6SoCCfg.NrPMPEntries, | |
NOCType: ariane_soc::CVA6SoCCfg.NOCType, | |
// idempotent region | |
NrNonIdempotentRules: ariane_soc::CVA6SoCCfg.NrNonIdempotentRules, | |
NonIdempotentAddrBase: ariane_soc::CVA6SoCCfg.NonIdempotentAddrBase, | |
NonIdempotentLength: ariane_soc::CVA6SoCCfg.NonIdempotentLength, | |
NrExecuteRegionRules: ariane_soc::CVA6SoCCfg.NrExecuteRegionRules, | |
ExecuteRegionAddrBase: ariane_soc::CVA6SoCCfg.ExecuteRegionAddrBase, | |
ExecuteRegionLength: ariane_soc::CVA6SoCCfg.ExecuteRegionLength, | |
// cached region | |
NrCachedRegionRules: ariane_soc::CVA6SoCCfg.NrCachedRegionRules, | |
CachedRegionAddrBase: ariane_soc::CVA6SoCCfg.CachedRegionAddrBase, | |
CachedRegionLength: ariane_soc::CVA6SoCCfg.CachedRegionLength | |
}), |
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.
I think I would prefer to keep rvfi
on the FPGA as well, I think it should be synthesisable and it could become useful in the future in case we want to profile CVA6 on the FPGA.
What do you think?
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.
Until now, there is no rvfi
on FPGA.
Enabling rvfi
on FPGA is revealing another issue due to localparam type rvfi_instr_t = logic;
in ariane_xilinx.sv
(see error log).
To avoid resource usage for rvfi
when not required, it would be preferable to keep it disabled for now.
@cathales will suggest a fix.
corev_apu/tb/ariane_testharness.sv
Outdated
unsigned'(cva6_config_pkg::CVA6ConfigAxiIdWidth), // AxiIdWidth | ||
unsigned'(cva6_config_pkg::CVA6ConfigDataUserWidth) // AxiUserWidth | ||
}, | ||
parameter ariane_pkg::cva6_cfg_t CVA6Cfg = ariane_soc::CVA6SoCCfg, |
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.
That would create a dependency again from the soc
into the main core, memory regions are inherently tied to the SoC which is using the core and I want to keep those as part of the SoC package (if that makes sense). I think we need to live with this duplication here :/
@@ -720,6 +710,7 @@ ariane #( | |||
.irq_i ( irq ), | |||
.ipi_i ( ipi ), | |||
.time_irq_i ( timer_irq ), | |||
.rvfi_o ( /* open */ ), |
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.
I don't think there is a harm to enabling it for the FPGA as well, or is there? I would prefer this fix instead of the overwrite.
localparam type rvfi_instr_t = logic; | ||
|
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.
We have found with @Gchauvon that the issue was this type. Below is a suggestion (perhaps we should reduce repetition in the code later).
localparam type rvfi_instr_t = logic; | |
localparam type rvfi_instr_t = struct packed { | |
logic [ariane_pkg::NRET-1:0] valid; | |
logic [ariane_pkg::NRET*64-1:0] order; | |
logic [ariane_pkg::NRET*ariane_pkg::ILEN-1:0] insn; | |
logic [ariane_pkg::NRET-1:0] trap; | |
logic [ariane_pkg::NRET*riscv::XLEN-1:0] cause; | |
logic [ariane_pkg::NRET-1:0] halt; | |
logic [ariane_pkg::NRET-1:0] intr; | |
logic [ariane_pkg::NRET*2-1:0] mode; | |
logic [ariane_pkg::NRET*2-1:0] ixl; | |
logic [ariane_pkg::NRET*5-1:0] rs1_addr; | |
logic [ariane_pkg::NRET*5-1:0] rs2_addr; | |
logic [ariane_pkg::NRET*riscv::XLEN-1:0] rs1_rdata; | |
logic [ariane_pkg::NRET*riscv::XLEN-1:0] rs2_rdata; | |
logic [ariane_pkg::NRET*5-1:0] rd_addr; | |
logic [ariane_pkg::NRET*riscv::XLEN-1:0] rd_wdata; | |
logic [ariane_pkg::NRET*riscv::XLEN-1:0] pc_rdata; | |
logic [ariane_pkg::NRET*riscv::XLEN-1:0] pc_wdata; | |
logic [ariane_pkg::NRET*riscv::VLEN-1:0] mem_addr; | |
logic [ariane_pkg::NRET*riscv::PLEN-1:0] mem_paddr; | |
logic [ariane_pkg::NRET*(riscv::XLEN/8)-1:0] mem_rmask; | |
logic [ariane_pkg::NRET*(riscv::XLEN/8)-1:0] mem_wmask; | |
logic [ariane_pkg::NRET*riscv::XLEN-1:0] mem_rdata; | |
logic [ariane_pkg::NRET*riscv::XLEN-1:0] mem_wdata; | |
}; |
Is this PR blocked on something in particular? |
There was an issue with RVFI synthesis (on FPGA IIRC) but we didn’t know it as RVFI was disabled for synthesis. This PR enables RVFI so it reveals the issue (that was already there). So the dashboard won’t pass. A patch has been suggested to disable RVFI but it was rejected. Another patch to fix RVFI has been suggested but not accepted (yet?). Also, as this PR is older than the merge of core-v-verif into cva6, we need it to be rebased to prevent bad things from happening when merging it. |
This RVFI issue is fixed in the master. A rebase is necessary to integrate all the PRs made since then. |
I will try to rebase tomorrow, but likely that all the changes that went in in the meantime created a big mess during the rebase and that this work is lost. |
bd6f8c9
to
9927f6b
Compare
Okay after half a day of rebasing here it is. Let's see what the CI will say. Can we maybe derive a strategy together on how we manage the amount of different configs we maintain as part of the repository? |
❌ failed run, report available here. |
Agree. The configs to be supported can be listed in the User manual maintained by @jquevremont. Why not discussing it during the next West Shifted meeting? This allows @Jbalkind attendance. |
❌ failed run, report available here. |
Only one red item left in the report! ASIC area: +20kGates |
The BTB, BHT are present in the PR configuration, which is not the case in native embedded configuration. I think the BHT, BTB, maybe RAS are not well transmitted. |
Which config is being synthesised? How did you enable/disable the branch predictors before? |
CVA6Cfg.ExceptionAddress, | ||
CVA6Cfg.RASDepth, | ||
CVA6Cfg.BTBEntries, | ||
CVA6Cfg.BHTEntries, |
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.
This parameter is not transmitted in CVA6Cfg
yet. It is only in the package for now. https://github.com/openhwgroup/cva6/blob/master/core/include/cv32a60x_config_pkg.sv
RASDepth: unsigned'(CVA6ConfigRASDepth), | ||
BTBEntries: unsigned'(CVA6ConfigBTBEntries), | ||
BHTEntries: unsigned'(CVA6ConfigBHTEntries), |
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.
@cathales here the parameter is assigned to the struct. I don't think I understand why the predictors are not parameterised correctly.
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.
I think this user config is not the one CVA6Cfg
(cva6.sv
) refers to.
parameter config_pkg::cva6_cfg_t CVA6Cfg = config_pkg::cva6_cfg_default
The user configuration is cva6_config_pkg::cva6_cfg
.
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.
Don't we have a synthesis wrapper that sets this to the correct synthesis configuration that we are interested in? Seems dangerous to rely on the default. Do you know where the synthesis wrapper is located?
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.
- We set
TARGET
: .gitlab-ci.yml:322 - We make
cva6_synth
inpd/synth
: .gitlab-ci.yml:312 - It schedules analysis of files from Flist: pd/synth/Makefile:pre_cva6_synth
- This file references a
TARGET_CFG
variable: core/Flist.cva6:59 - Starts
cva6_synth.tcl
indc_shell
: pd/synth/Makefile:37. It transfersEXPORT_LIST
(pd/synth/Makefile:22) todc_shell
(I’m not sure how it is used, I guess it defines Tcl variables from it), with environment variablesTARGET
andDESIGN_NAME=cva6
(pd/synth/Makefile:11) - Sets
TARGET_CFG
: pd/synth/cva6_synth.tcl to theTARGET
variable fromEXPORT_LIST
I guess, hence from the environment. - Elaborates
DESIGN_NAME
: pd/synth/cva6_synth.tcl:30
So I guess the cva6
module from core/cva6.sv:16 is used as the top level, which the synthesis log seem to confirm.
RASDepth, BTBEntries, BHTEntries, DmBaseAddress, NrPMPEntries are now part of CVA6Cfg. This is a breaking change, but it is necessary to make the code more readable and to avoid passing around two parameters. Signed-off-by: Florian Zaruba <[email protected]>
Signed-off-by: Florian Zaruba <[email protected]>
Signed-off-by: Florian Zaruba <[email protected]>
Signed-off-by: Florian Zaruba <[email protected]>
Signed-off-by: Florian Zaruba <[email protected]>
Signed-off-by: Florian Zaruba <[email protected]>
Signed-off-by: Florian Zaruba <[email protected]>
Signed-off-by: Florian Zaruba <[email protected]>
Signed-off-by: Florian Zaruba <[email protected]>
Signed-off-by: Florian Zaruba <[email protected]>
Signed-off-by: Florian Zaruba <[email protected]>
Co-authored-by: Côme <[email protected]>
532104b
to
0c721a4
Compare
❌ failed run, report available here. |
Co-authored-by: Côme <[email protected]>
❌ failed run, report available here. |
Co-authored-by: Côme <[email protected]>
❌ failed run, report available here. |
Thanks @zarubaf The synthesis is not clean, but I propose to fix it after the merge. |
This commit merges these two similar strategies for parameterization. A further step towards the clean-up.
@Jbalkind I haven't adapted the OpenPiton wrapper so that will break for sure. Not sure how you'd like to proceed but probably it makes the most sense to adapt that once and for all, instead of incremental. Also see the new enum type,
I also have removedSwapEndianess
since I haven't seen a use-case for that anymore (it was set to1
in the OP config). I might have missed the underlying nature, so please do let me know.How has that been tested?
Running
dhrystone
before and after the merge.Fixes #1319