Skip to content

Commit

Permalink
vendor: import the HPDcache sources into the vendor subtree
Browse files Browse the repository at this point in the history
Signed-off-by: Cesar Fuguet <[email protected]>
  • Loading branch information
cfuguet committed Oct 8, 2023
1 parent cce022f commit c8d518a
Show file tree
Hide file tree
Showing 84 changed files with 25,376 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ $(warning must set CVA6_REPO_DIR to point at the root of CVA6 sources -- doing i
export CVA6_REPO_DIR = $(abspath $(root-dir))
endif

export HPDCACHE_DIR = $(CVA6_REPO_DIR)/vendor/openhwgroup/cvhpdcache

support_verilator_4 := $(shell ($(verilator) --version | grep '4\.') > /dev/null 2>&1 ; echo $$?)
ifeq ($(support_verilator_4), 0)
verilator_threads := 1
Expand Down
1 change: 1 addition & 0 deletions core/Flist.cva6
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ ${CVA6_REPO_DIR}/core/cache_subsystem/cache_ctrl.sv
${CVA6_REPO_DIR}/core/cache_subsystem/cva6_icache_axi_wrapper.sv
${CVA6_REPO_DIR}/core/cache_subsystem/std_cache_subsystem.sv
${CVA6_REPO_DIR}/core/cache_subsystem/std_nbdcache.sv
-F ${CVA6_REPO_DIR}/vendor/openhwgroup/cvhpdcache/rtl/hpdcache_cva6.Flist

// Physical Memory Protection
// NOTE: pmp.sv modified for DSIM (unchanged for other simulators)
Expand Down
6 changes: 6 additions & 0 deletions vendor/openhwgroup/cvhpdcache/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
vnc_logs/
veloce.map
VRMDATA/
*.log
*.wlf
*.ucdb
80 changes: 80 additions & 0 deletions vendor/openhwgroup/cvhpdcache/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

### Removed

### Changed

### Fixed

## [3.0.0] 2023-10-08

### Added

- Add support for virtually-indexed addressing

### Fixed

- Fix forwarding logic of uncacheable Icache response in the cva6 cache subsystem.
- Fix wrong mask signal when implementing the MSHR in registers

## [2.1.0] - 2023-09-25

### Added

- Add additional configuration to implement MSHR in registers (when the number
of entries is low)

### Fixed

- Fix cache data SRAM chip-select generation when word width is different than
64 bits (e.g. 32 bits)

## [2.0.0] - 2023-09-18

### Added

- Add parameters in the HPDcache module to define the types of interfaces to
the memory
- Add helper verilog header file with macros to ease the type definition of
interfaces to the memory
- Add new event signals in the HPDCache top module
- Add generic single-port RAM macros with byte-enable signals
- Add parameters in the package to choose between RAM macros implementing
byte-enable or bitmask for the different RAMs instances
- Add additional assertions to verify parameters
- Add additional configuration signal to inhibit write coalescing in the write
buffer

### Removed

- Remove base_id ports in the HPDCache top module
- Remove nettype (wire,var) in ports as it looks like is badly supported in
some cases by some simulation tools

### Changed

- Split the hpdcache_pkg into: (1) the hpdcache_pkg contains internally defined
parameters; (2) a new hpdcache_params_pkg that defines user parameters
- New selection policy of ready requests in the replay table. It gives priority
to requests in the same linked list.
- The write buffer now accepts writes from requesters in a pending slot when it
is waiting for the internal arbiter to forward the data to the NoC.

### Fixed

- Correctly support HPDCACHE_ACCESS_WORDS=1
- Correctly support HPDCACHE_ACCESS_WORDS=HPDCACHE_CL_WORDS
- Fix width of the nlines count register in the HW memory prefetcher.

## [1.0.0] - 2023-02-22

### Added
- Initial release to the OpenHW Group
2 changes: 2 additions & 0 deletions vendor/openhwgroup/cvhpdcache/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Global Owners
* @cfuguet
97 changes: 97 additions & 0 deletions vendor/openhwgroup/cvhpdcache/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
Solderpad Hardware License v2.1

This license operates as a wraparound license to the Apache License
Version 2.0 (the “Apache License”) and incorporates the terms and
conditions of the Apache License (which can be found here:
http://apache.org/licenses/LICENSE-2.0), with the following additions and
modifications. It must be read in conjunction with the Apache License.
Section 1 below modifies definitions and terminology in the Apache
License and Section 2 below replaces Section 2 of the Apache License.
The Appendix replaces the Appendix in the Apache License. You may, at
your option, choose to treat any Work released under this license as
released under the Apache License (thus ignoring all sections written
below entirely).

1. Terminology in the Apache License is supplemented or modified as
follows:

“Authorship”: any reference to ‘authorship’ shall be taken to read
“authorship or design”.

“Copyright owner”: any reference to ‘copyright owner’ shall be taken to
read “Rights owner”.

“Copyright statement”: the reference to ‘copyright statement’ shall be
taken to read ‘copyright or other statement pertaining to Rights’.

The following new definition shall be added to the Definitions section of
the Apache License:

“Rights” means copyright and any similar right including design right
(whether registered or unregistered), rights in semiconductor
topographies (mask works) and database rights (but excluding Patents and
Trademarks).

The following definitions shall replace the corresponding definitions in
the Apache License:

“License” shall mean this Solderpad Hardware License version 2.1, being
the terms and conditions for use, manufacture, instantiation, adaptation,
reproduction, and distribution as defined by Sections 1 through 9 of this
document.

“Licensor” shall mean the owner of the Rights or entity authorized by the
owner of the Rights that is granting the License.

“Derivative Works” shall mean any work, whether in Source or Object form,
that is based on (or derived from) the Work and for which the editorial
revisions, annotations, elaborations, or other modifications represent,
as a whole, an original work of authorship or design. For the purposes of
this License, Derivative Works shall not include works that remain
reversibly separable from, or merely link (or bind by name) or physically
connect to or interoperate with the Work and Derivative Works thereof.

“Object” form shall mean any form resulting from mechanical
transformation or translation of a Source form or the application of a
Source form to physical material, including but not limited to compiled
object code, generated documentation, the instantiation of a hardware
design or physical object or material and conversions to other media
types, including intermediate forms such as bytecodes, FPGA bitstreams,
moulds, artwork and semiconductor topographies (mask works).

“Source” form shall mean the preferred form for making modifications,
including but not limited to source code, net lists, board layouts, CAD
files, documentation source, and configuration files.

“Work” shall mean the work of authorship or design, whether in Source or
Object form, made available under the License, as indicated by a notice
relating to Rights that is included in or attached to the work (an
example is provided in the Appendix below).

2. Grant of License. Subject to the terms and conditions of this License,
each Contributor hereby grants to You a perpetual, worldwide,
non-exclusive, no-charge, royalty-free, irrevocable license under the
Rights to reproduce, prepare Derivative Works of, make, adapt, repair,
publicly display, publicly perform, sublicense, and distribute the Work
and such Derivative Works in Source or Object form and do anything in
relation to the Work as if the Rights did not exist.

APPENDIX

Copyright 2023 CEA*
*Commissariat a l'Energie Atomique et aux Energies Alternatives (CEA)

SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1

Licensed under the Solderpad Hardware License v 2.1 (the “License”); you
may not use this file except in compliance with the License, or, at your
option, the Apache License version 2.0. You may obtain a copy of the
License at

https://solderpad.org/licenses/SHL-2.1/

Unless required by applicable law or agreed to in writing, any work
distributed under the License is distributed on an “AS IS” BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
45 changes: 45 additions & 0 deletions vendor/openhwgroup/cvhpdcache/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# OpenHW Core-V High-Performance L1 Dcache (CV-HPDcache)

The HPDcache is an open-source High-Performance, Multi-requester, Out-of-Order L1 Dcache for RISC-V cores and accelerators.


## Directory Structure

<table>
<tr>
<th style="text-align:left;width:20%">Directory</th>
<th style="text-align:left">Description</th>
</tr>
<tr>
<td><i>rtl</i></td>
<td>Contains the file lists to be used for the compiling of the HPDcache</td>
</tr>
<tr>
<td><i>rtl/src<i></td>
<td>Contains the SystemVerilog RTL sources of the HPDcache</td>
</tr>
<tr>
<td><i>rtl/src/target</i></td>
<td>Contains processor-dependent sources (e.g. adapter modules for the CVA6 core)</td>
</tr>
<tr>
<td><i>docs</i></td>
<td>Contains documentation of the HPDcache</td>
</tr>
</table>


## Documentation

The HPDcache specification document can be found in the *docs/hpdcache_spec_document* folder.
It is written in LaTeX.
You cand find pre-compiled PDF documents in *docs/hpdcache_spec_document/release*.

If you need to recompile the specification document, a dedicated *Makefile* is in the specification folder.
This *Makefile* needs the *latexmk* command-line tool (included in most common LaTeX distributions) and the *inkscape* tool to convert SVG images into PDF.


## Licensing

The HPDcache is released under the Solderpad Hardware License (version 2.1).
Please refer to the [LICENSE](LICENSE) file for further information.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build/
pdf/
supplement/package
122 changes: 122 additions & 0 deletions vendor/openhwgroup/cvhpdcache/docs/hpdcache_spec_document/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
##
## Copyright 2023 CEA*
## *Commissariat a l'Energie Atomique et aux Energies Alternatives (CEA)
##
## SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
##
## Licensed under the Solderpad Hardware License v 2.1 (the “License”); you
## may not use this file except in compliance with the License, or, at your
## option, the Apache License version 2.0. You may obtain a copy of the
## License at
##
## https://solderpad.org/licenses/SHL-2.1/
##
## Unless required by applicable law or agreed to in writing, any work
## distributed under the License is distributed on an “AS IS” BASIS, WITHOUT
## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
## License for the specific language governing permissions and limitations
## under the License.
##
## Author(s): Cesar Fuguet
## Date: February, 2023
## Description: Makefile for the specification document of the HPDcache
## hardware IP
##
LATEXMK = latexmk -pdf
INKSCAPE = inkscape --without-gui
PDFVIEWER = evince
RM = rm -rf
RMDIR = rmdir -p
CP = cp -f
ECHO = echo -e
MKDIR = mkdir -p

PDF_DIR = pdf
AUX_DIR = build
SOURCE_DIR = source
RELEASE_DIR = release

VERSION = $(shell cat version)

TARGET = hpdcache_spec
TEX_SOURCES = $(SOURCE_DIR)/$(TARGET).bib \
$(SOURCE_DIR)/hpdcache_spec_changelog.tex \
$(SOURCE_DIR)/hpdcache_spec_preamble.tex \
$(AUX_DIR)/hpdcache_data_ram_organization.pdf \
$(AUX_DIR)/hpdcache_request_arbiter.pdf \
$(AUX_DIR)/hpdcache_core.pdf \
$(AUX_DIR)/hpdcache_request_address_data_alignment.pdf \
$(AUX_DIR)/hpdcache_data_ram_organization.emf \
$(AUX_DIR)/hpdcache_request_arbiter.emf \
$(AUX_DIR)/hpdcache_core.emf \
$(AUX_DIR)/hpdcache_request_address_data_alignment.emf \
$(AUX_DIR)/wave_ready_before_valid.pdf \
$(AUX_DIR)/wave_valid_before_ready.pdf \
$(AUX_DIR)/wave_ready_when_valid.pdf \
$(AUX_DIR)/wave_back_to_back.pdf \
$(AUX_DIR)/wave_ready_before_valid.emf \
$(AUX_DIR)/wave_valid_before_ready.emf \
$(AUX_DIR)/wave_ready_when_valid.emf \
$(AUX_DIR)/wave_back_to_back.emf

LATEXMK_ARGS = -bibtex \
$(if $(VERBOSE),,-silent) \
-pretex='\newcommand{\docversion}{$(VERSION)}' \
-usepretex

vpath %.svg $(SOURCE_DIR)/images
vpath %.svg $(SOURCE_DIR)/images/exported

all:
@$(ECHO) "usage: make [target]\n"
@$(ECHO) "Target candidates:\n"
@$(ECHO) "pdf generate PDF document"
@$(ECHO) "release make a release of the PDF document"
@$(ECHO) "view view PDF document"
@$(ECHO) "clean clean auxiliary files"
@$(ECHO) "clean_pdf clean PDF file"
@$(ECHO) "distclean clean all generated files"

.PHONY: release
release: $(RELEASE_DIR)/$(TARGET)-$(VERSION).pdf

$(RELEASE_DIR)/$(TARGET)-$(VERSION).pdf: $(PDF_DIR)/$(TARGET).pdf
@$(MKDIR) $(dir $@)
$(CP) $< $@

.PHONY: pdf
pdf: $(PDF_DIR)/$(TARGET).pdf

$(PDF_DIR)/$(TARGET).pdf: $(AUX_DIR)/$(TARGET).pdf
@$(MKDIR) $(dir $@)
$(CP) $< $@

$(AUX_DIR)/$(TARGET).pdf: $(SOURCE_DIR)/$(TARGET).tex \
$(TEX_SOURCES)
@$(MKDIR) $(dir $@)
$(LATEXMK) $(LATEXMK_ARGS) --output-directory=$(dir $@) $<

$(AUX_DIR)/%.pdf: %.svg
@$(MKDIR) $(dir $@)
$(INKSCAPE) --export-pdf=$@ --export-area-drawing $<

$(AUX_DIR)/%.emf: %.svg
@$(MKDIR) $(dir $@)
$(INKSCAPE) --export-emf=$@ --export-area-drawing $<

.PHONY: view
view: $(PDF_DIR)/$(TARGET).pdf
@$(ECHO) "Opening PDF viewer..."
@$(PDFVIEWER) $< >&/dev/null &

.PHONY: clean clean_pdf distclean
clean:
@$(ECHO) "Cleaning build directory..."
@$(RM) $(AUX_DIR)

clean_pdf:
@$(ECHO) "Cleaning generated PDF file..."
@$(RM) $(PDF_DIR)/$(TARGET).pdf
@$(RMDIR) $(PDF_DIR) >&/dev/null || true

distclean: clean clean_pdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$ENV{'TEXINPUTS'}=':source:source/images:source/images/exported:build:';
$ENV{'BIBINPUTS'}=':source:';
Binary file not shown.
Loading

0 comments on commit c8d518a

Please sign in to comment.