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

add CV_CORE_PATH for optionally having rtl repo dir symlinked locally #543

Merged
merged 1 commit into from
Mar 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cv32e40x/sim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ The directories from which you should launch your interactive simulations and
regressions are the `core` and `uvmt_cv32` directories located here.

### Cloning the RTL
The Makefiles will automatically clone the required RTL to `../../core-v-cores/cv32e40x`.
The Makefiles will automatically clone the required RTL to `../../core-v-cores/cv32e40x`,
unless the CV_CORE_PATH parameter is set.
If the CV_CORE_PATH is set, a symlink to this path will be created in `../../core-v-cores/` instead of cloning the repo.
This allows for working on the RTL in a separate environment.
<br><br>
There are user variables
in `./Common.mk` that control the URL, branch and hash of the cloned code - see
Expand Down
28 changes: 16 additions & 12 deletions mk/Common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,26 @@ $(error Must define a COMPLIANCE_REPO to use the common makefile)
endif
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This diff of Common.mk is a bit difficult to read because diff gets confused by the similarity of the lines.
It is easier read by opening the entire file.


###############################################################################
# Generate command to clone the core RTL
ifeq ($(CV_CORE_BRANCH), master)
TMP = git clone $(CV_CORE_REPO) $(CV_CORE_PKG)
else
TMP = git clone -b $(CV_CORE_BRANCH) --single-branch $(CV_CORE_REPO) $(CV_CORE_PKG)
endif
# Generate command to clone or symlink the core RTL
ifeq ($(CV_CORE_PATH), "")
ifeq ($(CV_CORE_BRANCH), master)
TMP = git clone $(CV_CORE_REPO) $(CV_CORE_PKG)
else
TMP = git clone -b $(CV_CORE_BRANCH) --single-branch $(CV_CORE_REPO) $(CV_CORE_PKG)
endif

# If a TAG is specified, the HASH is not considered
ifeq ($(CV_CORE_TAG), none)
ifeq ($(CV_CORE_HASH), head)
CLONE_CV_CORE_CMD = $(TMP)
# If a TAG is specified, the HASH is not considered
ifeq ($(CV_CORE_TAG), none)
ifeq ($(CV_CORE_HASH), head)
CLONE_CV_CORE_CMD = $(TMP)
else
CLONE_CV_CORE_CMD = $(TMP); cd $(CV_CORE_PKG); git checkout $(CV_CORE_HASH)
endif
else
CLONE_CV_CORE_CMD = $(TMP); cd $(CV_CORE_PKG); git checkout $(CV_CORE_HASH)
CLONE_CV_CORE_CMD = $(TMP); cd $(CV_CORE_PKG); git checkout tags/$(CV_CORE_TAG)
endif
else
CLONE_CV_CORE_CMD = $(TMP); cd $(CV_CORE_PKG); git checkout tags/$(CV_CORE_TAG)
CLONE_CV_CORE_CMD = ln -s $(CV_CORE_PATH) $(CV_CORE_PKG)
endif

###############################################################################
Expand Down