Skip to content

Add support for CVA6 + HPDC#172

Open
ArnauBigas wants to merge 37 commits into
PrincetonUniversity:openpiton-devfrom
bsc-loca:ft/ariane_hpdc
Open

Add support for CVA6 + HPDC#172
ArnauBigas wants to merge 37 commits into
PrincetonUniversity:openpiton-devfrom
bsc-loca:ft/ariane_hpdc

Conversation

@ArnauBigas
Copy link
Copy Markdown
Contributor

@ArnauBigas ArnauBigas commented Nov 6, 2025

This Pull Request adds support for using the HPDC in OpenPiton. To do so, I have added and updated the L1.5 adapters and hpdcache cache subsystems.

Because previously the L1.5 interface types & enums were in the wt_cache pkg and adapter files, I have moved the typedefs to a l15_pkg in this repository. This allows any cache (and any core) to interface with the L1.5.

I have tested the changes and they're passing physical and virtual single core tests. I am running more tests but I thought I'd open the merge requests already to get any possible discussions out of the way earlier.

When openhwgroup/cva6#3134 is accepted I will change the submodule paths and this will be ready to be merged.

This merge requests also contains some misc. fixes by me to provide support for my testing environment, mainly verilator 5+, waveforms, multithreaded compilation of bootrom, newer riscv compiler fixes, etc...

CC: @Jbalkind

AileonN and others added 30 commits October 22, 2025 18:27
It's necessary to analyze the proper value of the FIFO
@Jbalkind
Copy link
Copy Markdown
Collaborator

Jbalkind commented Nov 6, 2025

This patch is ultimately pretty small but the history is quite long - could you squash it down to a single commit?

@ArnauBigas
Copy link
Copy Markdown
Contributor Author

Yup, I was planning on doing that once everything was set and ready, e.g. in case I need to add some more commits to apply feedback or update ariane or whatever. If you consider it necessary I can do that right now.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

L15_BYTE_MASK_WIDHT -> L15_BYTE_MASK_WIDTH

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changed, thanks for the heads-up

Copy link
Copy Markdown

@AnaBSF AnaBSF Nov 26, 2025

Choose a reason for hiding this comment

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

I get this error (perl 5, version 26, subversion 1 (v5.26.1)): Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/\${ <-- HERE ?(\w+)}?/ at piton/tools/src/sims/sims,2.0 line 1165

Shouldn't it be $line =~ s/\$\{?(\w+)\}?/$ENV{$1}/g ; ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hmmm that doesn't work for me, and {} are not special characters in regex.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I don't get this error anymore, which I believe is because I have since updated my system. My apologies!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No worries, glad it's resolved

Comment thread piton/ariane_setup.sh
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

VERILATOR_ROOT should also be updated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't understand, why should that be updated?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I was getting some errors because verilator is no longer in that directory (and I am using verilator-v5.008, as i believe this PR also aims to do in commit 44c420)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah I see, they have upgraded the verilator version in upstream, I'll update it here too.

To be honest, I don't like these scripts installing tools and stuff, I like using my own and that's why I didn't catch this error, but I'll fix it regardless

@ArnauBigas ArnauBigas marked this pull request as ready for review May 7, 2026 13:53
@ArnauBigas
Copy link
Copy Markdown
Contributor Author

Ariane patches have been merged, let me know how we can proceed with this!

Copy link
Copy Markdown
Collaborator

@Jbalkind Jbalkind left a comment

Choose a reason for hiding this comment

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

Have you run the OpenPiton CI scripts with OST1 too? Have you checked that the changes don't break the other cores?

CFLAGS=-mabi=lp64d -Tlinker.ld -nostdlib -static -Wl,--no-gc-sections

ifeq "$(GCC_VERSION_GTEQ_12)" "1"
CFLAGS += -march=rv64imafd_zicsr
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

not sure that I care about making this conditional - probably everyone has GCC newer than 12 at this point

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You'd be surprised... Although I guess the changes were done a while ago

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This was added something like 4-5 years ago so I'm fine with just making it unconditional as a change

LDFLAGS = -nostdlib -nodefaultlibs -nostartfiles

ifeq "$(GCC_VERSION_GTEQ_12)" "1"
CFLAGS += -march=rv64ima_zicsr
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same here

-flist=$DV_ROOT/design/chip/jtag/rtl/Flist.jtag
-flist=$DV_ROOT/design/chip/tile/rtl/Flist.tile
-flist=$DV_ROOT/design/chip/tile/rtap/rtl/Flist.rtap
-flist=$DV_ROOT/design/chip/tile/l15/rtl/Flist.l15
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm hesitant about reordering this as I have to spend quite a long time to find the correct order for particular tools. Why is this one being moved specifically?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have changed the order because Flist.l15 contains the l15 package that CVA6 then uses for its configuration and adapters.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Right but that can break things across tools. This order was carefully set to make sure it works across VCS, Questa, Incisive, etc. Have you checked it hasn't broken anything across tools?

push (@{$opt{diaglist_cpp_args}}, "-DRISCV32") if ($opt{pico} || $opt{pico_het}) ;
push (@{$opt{diaglist_cpp_args}}, "-DRISCV64") if ($opt{ariane}) ;

if ($opt{ariane}) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can this one be put in another place where config_rtl are being set?

$build_cmd .= "-CFLAGS -I$dv_root/tools/pli/iop " ;
$build_cmd .= "-CFLAGS -I$dv_root/tools/verilator " ;

if ($opt{log_all}) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

is this logging really important enough to be PRd here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It was for my debugging convenience -- we can split it up

}
}

# Run the verilator --version command and capture the output
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I am ok with us moving to assuming verilator 5 going forward. Is that what is built by default in cva6 now?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I also have a branch here with other changes for timing mode for v5 that we could consider pulling in if we know the right macro for timing vs no timing https://github.com/Jbalkind/openpiton/tree/verilator-5

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What do you mean the right macro? Also, removing the my_top.cpp has some drawbacks as you have less control over the "runtime", in my experience. Things like not dumping the waveform when you do ctrl+c, for example .

Comment thread piton/ariane_build_tools.sh
Comment thread piton/piton_settings.bash
Comment thread .gitmodules Outdated
[submodule "piton/design/chip/tile/sparc"]
path = piton/design/chip/tile/sparc
url = git@github.com:openpiton/ost1-core.git
[submodule "piton/design/chip/tile/ariane"]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This isn't a valid change to .gitmodules

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will fix.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Actually can we just remove this? The repo should be redirecting already and I'd rather not force every user to git submodule sync

@ArnauBigas
Copy link
Copy Markdown
Contributor Author

Have you run the OpenPiton CI scripts with OST1 too? Have you checked that the changes don't break the other cores?

No, only the CVA6 + HPDC configuration, I understood that was the idea. What do you think we should test?

@Jbalkind
Copy link
Copy Markdown
Collaborator

Jbalkind commented May 7, 2026

We should check at least that the OST1 (small ones like tile1_mini and tile2_mini are likely sufficient) and WT_DCACHE Ariane regressions still work

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