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

Handle ERR in VexRiscV #29

Merged
merged 1 commit into from
Apr 3, 2024
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
4,763 changes: 2,479 additions & 2,284 deletions clash-vexriscv/example-cpu/VexRiscv.v

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion clash-vexriscv/example-cpu/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import Dependencies._

val spinalVersion = "1.7.1"
val spinalVersion = "1.10.1"

ThisBuild / scalaVersion := "2.11.12"
ThisBuild / version := "0.1.0-SNAPSHOT"
Expand Down
53 changes: 53 additions & 0 deletions clash-vexriscv/example-cpu/lib/update-vexriscv.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/env python3
"""
Usage:

python3 update-vexriscv.py <commit_hash>
"""
# SPDX-FileCopyrightText: 2022 Google LLC
#
# SPDX-License-Identifier: Apache-2.0

import glob
import os
import shutil
import subprocess
import sys
import tempfile

LICENSE = """
SPDX-FileCopyrightText: 2016 Spinal HDL contributors

SPDX-License-Identifier: MIT
""".lstrip()

VEXRISCV_REPO = "https://github.com/SpinalHDL/VexRiscv.git"

HERE = os.path.dirname(os.path.abspath(__file__))

def main(commit_hash):
# Remove old JAR in current directory
for file in os.listdir(HERE):
if file.endswith((".jar", ".jar.license")):
os.remove(os.path.join(HERE, file))

with tempfile.TemporaryDirectory() as temp_dir:
# Build new JAR
subprocess.check_call(["git", "clone", VEXRISCV_REPO, temp_dir])
subprocess.check_call(["git", "checkout", commit_hash], cwd=temp_dir)
subprocess.check_call(["sbt", "package"], cwd=temp_dir)

# Find and copy new JAR
jar_path = glob.glob(os.path.join(temp_dir, "target", "scala-*", "vexriscv_*.jar"))[0]
jar_filename = os.path.basename(jar_path)
jar_base, jar_ext = os.path.splitext(jar_filename)
new_jar_filename = f"{jar_base}-{commit_hash}{jar_ext}"
shutil.copyfile(jar_path, os.path.join(HERE, new_jar_filename))

# Write license file
with open(os.path.join(HERE, f"{new_jar_filename}.license"), "w") as f:
f.write(LICENSE)


if __name__ == '__main__':
main(sys.argv[1])
Binary file not shown.
Binary file not shown.
Loading