Skip to content

Commit

Permalink
introduce explicit spike_rv32 and spike_rv64 targets
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippvK committed Nov 17, 2024
1 parent b7c9fe4 commit 4567675
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
4 changes: 4 additions & 0 deletions mlonmcu/target/_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
from .riscv import (
EtissPulpinoTarget,
SpikeTarget,
SpikeRV32Target,
SpikeRV64Target,
OVPSimTarget,
COREVOVPSimTarget,
RiscvQemuTarget,
Expand Down Expand Up @@ -56,6 +58,8 @@ def get_targets():
register_target("host_x86_ssh", HostX86SSHTarget)
register_target("corstone300", Corstone300Target)
register_target("spike", SpikeTarget)
register_target("spike_rv32", SpikeRV32Target)
register_target("spike_rv64", SpikeRV64Target)
register_target("ovpsim", OVPSimTarget)
register_target("corev_ovpsim", COREVOVPSimTarget)
register_target("riscv_qemu", RiscvQemuTarget)
Expand Down
4 changes: 3 additions & 1 deletion mlonmcu/target/riscv/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .etiss_pulpino import EtissPulpinoTarget
from .etiss import EtissTarget, EtissRV32Target, EtissRV64Target
from .spike import SpikeTarget
from .spike import SpikeTarget, SpikeRV32Target, SpikeRV64Target
from .ovpsim import OVPSimTarget
from .corev_ovpsim import COREVOVPSimTarget
from .riscv_qemu import RiscvQemuTarget
Expand All @@ -17,6 +17,8 @@
"EtissRV32Target",
"EtissRV64Target",
"SpikeTarget",
"SpikeRV32Target",
"SpikeRV64Target",
"OVPSimTarget",
"COREVOVPSimTarget",
"RiscvQemuTarget",
Expand Down
31 changes: 31 additions & 0 deletions mlonmcu/target/riscv/spike.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,37 @@ def get_backend_config(self, backend, optimized_layouts=False, optimized_schedul
)
return ret

def get_target_system(self):
return "spike"


class SpikeRV32Target(SpikeTarget):
"""32-bit version of spike target"""

DEFAULTS = {
**SpikeTarget.DEFAULTS,
"xlen": 32,
"vlen": 0, # vectorization=off
"elen": 32,
}

def __init__(self, name="spike_rv32", features=None, config=None):
super().__init__(name, features=features, config=config)


class SpikeRV64Target(SpikeTarget):
"""64-bit version of spike target"""

DEFAULTS = {
**SpikeTarget.DEFAULTS,
"xlen": 64,
"vlen": 0, # vectorization=off
"elen": 64,
}

def __init__(self, name="spike_rv64", features=None, config=None):
super().__init__(name, features=features, config=config)


if __name__ == "__main__":
cli(target=SpikeTarget)

0 comments on commit 4567675

Please sign in to comment.