Skip to content
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

Integrate Hyperbus peripheral #47

Open
wants to merge 5 commits into
base: devel
Choose a base branch
from
Open

Integrate Hyperbus peripheral #47

wants to merge 5 commits into from

Conversation

sermazz
Copy link

@sermazz sermazz commented Oct 4, 2024

This PR:

@sermazz sermazz changed the base branch from main to devel October 4, 2024 18:17
@sermazz sermazz force-pushed the smazzola/hyperbus branch 5 times, most recently from 19cbd63 to d1090d3 Compare October 7, 2024 12:02
Copy link

@Lore0599 Lore0599 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM

hw/chimera_top_wrapper.sv Outdated Show resolved Hide resolved
sw/tests/testHyperbusAddr.c Outdated Show resolved Hide resolved
hw/chimera_pkg.sv Show resolved Hide resolved
hw/chimera_pkg.sv Outdated Show resolved Hide resolved
@sermazz sermazz changed the title Integrate Hyperbus peripheral and test infrastructure Integrate Hyperbus integration + stack pointer fix Oct 8, 2024
@sermazz sermazz changed the title Integrate Hyperbus integration + stack pointer fix Integrate Hyperbus peripheral Oct 8, 2024
@sermazz
Copy link
Author

sermazz commented Oct 17, 2024

@Lore0599 @arpansur @Scheremo @adimauro-iis
CI is finally passing after the fixes on devel, we should now define the range we need for HyperRAM (https://github.com/pulp-platform/chimera/pull/47/files#diff-7310782802ac0d64363e8ceb9e90e54a5c0c858fc1e63688d48ad6964dd3fb4bR131). And also have a plan for #43.
If these are not blocking, we can merge.

@Scheremo
Copy link
Collaborator

@Lore0599 @arpansur @Scheremo @adimauro-iis CI is finally passing after the fixes on devel, we should now define the range we need for HyperRAM (https://github.com/pulp-platform/chimera/pull/47/files#diff-7310782802ac0d64363e8ceb9e90e54a5c0c858fc1e63688d48ad6964dd3fb4bR131). And also have a plan for #43. If these are not blocking, we can merge.

I think both are blocking but trivial to resolve. You can extend the register memory map range (0x3000_0000 - 0x4000_0000) contiguously with the config registers and map the hyperbus memory "somewhere reasonable" (why not 0x5000_0000?)

@@ -8,4 +8,4 @@
COMMON_TARGS ?=
COMMON_TARGS += -t snitch_cluster -t cv32a6_convolve -t cva6 -t rtl

SIM_TARGS = -t test -t sim
SIM_TARGS = $(COMMON_TARGS) -t test -t sim

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you add here $(COMMON_TARGS)? Isn't the variable already used in sim.mk?

Copy link
Author

@sermazz sermazz Oct 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also answers the other comment
Just a small modification to make (in my opinion) the flow clearer. At some point we'll have many targets in the bender.mk, e.g. SIM_TARGS, ASIC_TARGS, FPGA_XILING_TARGS, FPGA_whatever_TARGS, etc...
So I explicitly add $(COMMON_TARGS) (which is common to all of them) within all those other TARGS variables.
Previously, it was left to whoever wrote the independent target .mk (e.g., sim.mk, asic.mk, ...) to use both variables, as in: bender script vsim $(COMMON_TARGS) $(SIM_TARGS) [...].
But ultimately it's the same argument for bender so we might as well use this clearer form.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sense, thanks

$(CHIM_SIM_DIR)/vsim/compile.tcl: chs-hw-init snitch-hw-init
@bender script vsim $(COMMON_TARGS) $(SIM_TARGS) --vlog-arg="$(VLOG_ARGS)"> $@
@bender script vsim $(SIM_TARGS) --vlog-arg="$(CHIM_VLOG_ARGS)" > $@

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove $(COMMON_TARGS)?

.UserPreload (HypUserPreload),
.mem_file_name(HypUserPreloadMemFiles[i]),
.TimingModel ("S27KS0641DPBHI020")
) dut (

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Chimera instance inside fixture_chimera_soc.sv is already called DUT.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True but the hierarchy is different so no problem arises. Should I change it?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine for now.

Copy link
Collaborator

@Scheremo Scheremo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly fine to me, some comments sprinkled throughout. Is there some consideration behind having two PHYs? I understand two endpoints (HyperRAM and HyperFlash), but that should only necessitate another CS pin.

- hw/chimera_top_wrapper.sv

- target: any(simulation, test)
files:
- target/sim/models/s27ks0641/s27ks0641.v
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this included in Cheshire?


module chimera_top_wrapper
import cheshire_pkg::*;
import chimera_pkg::*;
import chimera_reg_pkg::*;
#(
parameter int unsigned SelectedCfg = 0
parameter int unsigned SelectedCfg = 0,
parameter int unsigned HypNumPhys = 2,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this correspond to 2 PHYs? In this case I think a smarter default is 1 PHY.

localparam byte_bt HyperbusIdx = MemIslandIdx + 1;
localparam doub_bt HyperbusRegionStart = 64'h5000_0000;
//TODO(smazzola): Correct size of HyperRAM?
localparam doub_bt HyperbusRegionEnd = HyperbusRegionStart + 64'h0800_0000;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think after our discussion last week, we can extend the region size of 64'h1000_0000

Comment on lines +499 to +500
.RstChipBase (ChsCfg.LlcOutRegionStart),
.RstChipSpace (HypNumPhys * HypNumChips * 'h800_0000),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this is correct, can you comment?

.UserPreload (HypUserPreload),
.mem_file_name(HypUserPreloadMemFiles[i]),
.TimingModel ("S27KS0641DPBHI020")
) dut (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants