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

cpu/vexiiriscv integration #1923

Merged
merged 28 commits into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d7a862f
wip
Dolu1990 Mar 20, 2024
edc24b3
Got linux + jtag to run in sim
Dolu1990 Mar 20, 2024
90c1d7b
Update the reset topology
Dolu1990 Mar 20, 2024
72cb7d3
Fix jtag reset
Dolu1990 Mar 21, 2024
473c52c
Got jtag instruction interface to work
Dolu1990 Mar 21, 2024
c7b2393
nax jtag renaming
Dolu1990 Mar 28, 2024
206118c
Add missing file
Dolu1990 Mar 28, 2024
8f86108
tools/litex_json2dts add vexiiriscv
Dolu1990 Apr 8, 2024
9654b40
Got litex dma to work with vexii
Dolu1990 Apr 8, 2024
555f89c
set default l2 ways to 4
Dolu1990 Apr 8, 2024
62cf95c
cpu/vexii add git
Dolu1990 Apr 10, 2024
8831acb
naxriscv fix simulation reset
Dolu1990 Apr 25, 2024
588b7a9
Update Vexii
Dolu1990 May 6, 2024
7b7334f
cpu/vexiiriscv update
Dolu1990 May 14, 2024
57f74da
Merge branch 'master' into vexiiriscv
Dolu1990 May 16, 2024
60b0273
Add baremetal IRQ support
Dolu1990 May 16, 2024
122e060
update vexii
Dolu1990 May 16, 2024
0720ffb
Update vexii
Dolu1990 May 17, 2024
8c0f544
fix nax/vexii git checkout process, thanks JoyBed
Dolu1990 May 18, 2024
5eeb999
update vexii
Dolu1990 May 18, 2024
21e0ec7
vexii/naxii fix floating axi wires
Dolu1990 May 20, 2024
06bbbe7
vexii/naxii fix floating axi wires
Dolu1990 May 20, 2024
4a6efa4
Add variants to VexiiRiscv
Dolu1990 May 23, 2024
2dac84f
vexii l2 now support self flush. ex :
Dolu1990 May 27, 2024
9165886
snyc
Dolu1990 May 28, 2024
0e04949
vexii fix l1 cache size
Dolu1990 Jun 6, 2024
bd96b47
Vexii fix mem data width
Dolu1990 Jun 6, 2024
9c202b5
Fix axi id width
Dolu1990 Jun 7, 2024
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
30 changes: 23 additions & 7 deletions litex/soc/cores/cpu/naxriscv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,11 @@ def generate_netlist_name(reset_address):


@staticmethod
def git_setup(name, dir, repo, branch, hash):
def git_setup(name, dir, repo, branch, hash, update):
if update == "no":
return
if "recommended" not in update:
hash = ""
if not os.path.exists(dir):
# Clone Repo.
print(f"Cloning {name} Git repository...")
Expand All @@ -306,7 +310,7 @@ def git_setup(name, dir, repo, branch, hash):
print(f"Updating {name} Git repository...")
cwd = os.getcwd()
os.chdir(os.path.join(dir))
wipe_cmd = "&& git clean --force -d -x && git reset --hard" if "wipe" in NaxRiscv.update_repo else ""
wipe_cmd = "&& git clean --force -d -x && git reset --hard" if "wipe" in update else ""
checkout_cmd = f"&& git checkout {hash}" if hash is not None else ""
subprocess.check_call(f"cd {dir} {wipe_cmd} && git checkout {branch} && git submodule init && git pull --recurse-submodules {checkout_cmd}", shell=True)
os.chdir(cwd)
Expand All @@ -318,8 +322,7 @@ def generate_netlist(reset_address):
ndir = os.path.join(vdir, "ext", "NaxRiscv")
sdir = os.path.join(vdir, "ext", "SpinalHDL")

if NaxRiscv.update_repo != "no":
NaxRiscv.git_setup("NaxRiscv", ndir, "https://github.com/SpinalHDL/NaxRiscv.git", "main", "f3357383" if NaxRiscv.update_repo=="recommended" else None)
NaxRiscv.git_setup("NaxRiscv", ndir, "https://github.com/SpinalHDL/NaxRiscv.git", "main", "f3357383", NaxRiscv.update_repo)

gen_args = []
gen_args.append(f"--netlist-name={NaxRiscv.netlist_name}")
Expand Down Expand Up @@ -399,13 +402,13 @@ def add_soc_components(self, soc):

if NaxRiscv.jtag_tap:
self.jtag_tms = Signal()
self.jtag_tck = Signal()
self.jtag_clk = Signal()
self.jtag_tdi = Signal()
self.jtag_tdo = Signal()

self.cpu_params.update(
i_jtag_tms = self.jtag_tms,
i_jtag_tck = self.jtag_tck,
i_jtag_tck = self.jtag_clk,
i_jtag_tdi = self.jtag_tdi,
o_jtag_tdo = self.jtag_tdo,
)
Expand Down Expand Up @@ -452,7 +455,10 @@ def add_soc_components(self, soc):
# Reset SoC's CRG when debug_ndmreset rising edge.
self.sync.debug_por += debug_ndmreset_last.eq(debug_ndmreset)
self.comb += debug_ndmreset_rise.eq(debug_ndmreset & ~debug_ndmreset_last)
self.comb += If(debug_ndmreset_rise, soc.crg.rst.eq(1))
if soc.get_build_name() == "sim":
self.comb += If(debug_ndmreset_rise, soc.crg.cd_sys.rst.eq(1))
else:
self.comb += If(debug_ndmreset_rise, soc.crg.rst.eq(1))

self.soc_bus = soc.bus # FIXME: Save SoC Bus instance to retrieve the final mem layout on finalization.

Expand All @@ -470,6 +476,16 @@ def add_memory_buses(self, address_width, data_width):
)
self.memory_buses.append(mbus)

self.comb += mbus.aw.cache.eq(0xF)
self.comb += mbus.aw.lock.eq(0)
self.comb += mbus.aw.prot.eq(1)
self.comb += mbus.aw.qos.eq(0)

self.comb += mbus.ar.cache.eq(0xF)
self.comb += mbus.ar.lock.eq(0)
self.comb += mbus.ar.prot.eq(1)
self.comb += mbus.ar.qos.eq(0)

self.cpu_params.update(
# Memory Bus (Master).
# --------------------
Expand Down
1 change: 1 addition & 0 deletions litex/soc/cores/cpu/vexiiriscv/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from litex.soc.cores.cpu.vexiiriscv.core import VexiiRiscv
15 changes: 15 additions & 0 deletions litex/soc/cores/cpu/vexiiriscv/boot-helper.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.section .text, "ax", @progbits
.global boot_helper
.global smp_lottery_target
.global smp_lottery_lock
.global smp_lottery_args

boot_helper:
sw x10, smp_lottery_args , x14
sw x11, smp_lottery_args+4, x14
sw x12, smp_lottery_args+8, x14
sw x13, smp_lottery_target, x14
fence w, w
li x15, 1
sw x15, smp_lottery_lock, x14
jr x13
Loading
Loading