Skip to content

Commit aba5d93

Browse files
committed
Add CHERI Alliance opensbi target.
This should support the standard zcheri ISA, support for the xcheri ISA is uncertain and there is no hybrid ABI support. We should merge the CHERI Alliance opensbi target with the existing opensbi target as things converge.
1 parent 95ed3fb commit aba5d93

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

pycheribuild/projects/cross/opensbi.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,27 @@ def run_tests(self):
208208
give_tty_control=True,
209209
cwd="/",
210210
)
211+
212+
213+
class BuildAllianceOpenSBI(BuildOpenSBI):
214+
target = "cheri-alliance-opensbi"
215+
_default_install_dir_fn = ComputedDefaultValue(
216+
function=lambda config, p: config.cheri_sdk_dir / "cheri-alliance-opensbi/riscv64",
217+
as_string="$SDK_ROOT/cheri-alliance-opensbi/riscv64"
218+
)
219+
repository = GitRepository("https://github.com/CHERI-Alliance/opensbi",
220+
default_branch="codasip-cheri-riscv")
221+
supported_architectures = (
222+
CompilationTargets.FREESTANDING_RISCV64,
223+
CompilationTargets.FREESTANDING_RISCV64_PURECAP,
224+
)
225+
226+
@property
227+
def all_platforms(self):
228+
return ["generic"]
229+
230+
def compile(self, **kwargs):
231+
for platform in self.all_platforms:
232+
args = self.make_args.copy()
233+
args.set(PLATFORM=platform)
234+
self.run_make(parallel=False, cwd=self.source_dir, options=args)

0 commit comments

Comments
 (0)