Skip to content

Commit

Permalink
Merge pull request #1888 from Dolu1990/reset_vector
Browse files Browse the repository at this point in the history
core/vexriscv_smp add reset vector support
  • Loading branch information
enjoy-digital authored Feb 13, 2024
2 parents f36e7d3 + 795fa1e commit 89bf0fb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion litex/soc/cores/cpu/vexriscv_smp/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class VexRiscvSMP(CPU):
csr_base = 0xf000_0000
clint_base = 0xf001_0000
plic_base = 0xf0c0_0000
reset_vector = 0

# Command line configuration arguments.
@staticmethod
Expand Down Expand Up @@ -178,6 +179,7 @@ def reserved_interrupts(self):
def generate_cluster_name():
ldw = f"Ldw{VexRiscvSMP.litedram_width}"
VexRiscvSMP.cluster_name = f"VexRiscvLitexSmpCluster_" \
f"{'R' + hex(VexRiscvSMP.reset_vector) if VexRiscvSMP.reset_vector else ''}"\
f"Cc{VexRiscvSMP.cpu_count}" \
"_" \
f"Iw{VexRiscvSMP.icache_width}" \
Expand Down Expand Up @@ -276,6 +278,7 @@ def generate_netlist():
if(VexRiscvSMP.coherent_dma):
gen_args.append("--coherent-dma")
gen_args.append(f"--cpu-count={VexRiscvSMP.cpu_count}")
gen_args.append(f"--reset-vector={VexRiscvSMP.reset_vector}")
gen_args.append(f"--ibus-width={VexRiscvSMP.icache_width}")
gen_args.append(f"--dbus-width={VexRiscvSMP.dcache_width}")
gen_args.append(f"--dcache-size={VexRiscvSMP.dcache_size}")
Expand Down Expand Up @@ -394,7 +397,7 @@ def __init__(self, platform, variant):

def set_reset_address(self, reset_address):
self.reset_address = reset_address
assert reset_address == 0x0000_0000
VexRiscvSMP.reset_vector = reset_address

def add_sources(self, platform):
vdir = get_data_mod("cpu", "vexriscv_smp").data_location
Expand Down

0 comments on commit 89bf0fb

Please sign in to comment.