# Copyright (c) 2010-2012, 2015-2019 ARM Limited
+# Copyright (c) 2020 Barkhausen Institut
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# Populate to reflect supported os types per target ISA
os_types = { 'mips' : [ 'linux' ],
+ 'riscv' : [ 'linux' ], # TODO that's a lie
'sparc' : [ 'linux' ],
'x86' : [ 'linux' ],
'arm' : [ 'linux',
self.workload.command_line = fillInCmdline(mdesc, cmdline)
return self
+def makeBareMetalRiscvSystem(mem_mode, mdesc=None, cmdline=None):
+ self = System()
+ if not mdesc:
+ # generic system
+ mdesc = SysConfig()
+ self.mem_mode = mem_mode
+ self.mem_ranges = [AddrRange(mdesc.mem())]
+
+ self.workload = RiscvBareMetal()
+
+ self.iobus = IOXBar()
+ self.membus = MemBus()
+
+ self.bridge = Bridge(delay='50ns')
+ self.bridge.master = self.iobus.slave
+ self.bridge.slave = self.membus.master
+ # Sv39 has 56 bit physical addresses; use the upper 8 bit for the IO space
+ IO_address_space_base = 0x00FF000000000000
+ self.bridge.ranges = [AddrRange(IO_address_space_base, Addr.max)]
+
+ self.system_port = self.membus.slave
+ return self
def makeDualRoot(full_system, testSystem, driveSystem, dumpfile):
self = Root(full_system = full_system)
# Copyright (c) 2010-2013, 2016, 2019 ARM Limited
+# Copyright (c) 2020 Barkhausen Institut
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
test_sys = makeLinuxMipsSystem(test_mem_mode, bm[0], cmdline=cmdline)
elif buildEnv['TARGET_ISA'] == "sparc":
test_sys = makeSparcSystem(test_mem_mode, bm[0], cmdline=cmdline)
+ elif buildEnv['TARGET_ISA'] == "riscv":
+ test_sys = makeBareMetalRiscvSystem(test_mem_mode, bm[0],
+ cmdline=cmdline)
elif buildEnv['TARGET_ISA'] == "x86":
test_sys = makeLinuxX86System(test_mem_mode, np, bm[0], options.ruby,
cmdline=cmdline)
voltage_domain =
test_sys.cpu_voltage_domain)
- if options.kernel is not None:
+ if buildEnv['TARGET_ISA'] == 'riscv':
+ test_sys.workload.bootloader = options.kernel
+ elif options.kernel is not None:
test_sys.workload.object_file = binary(options.kernel)
if options.script is not None: