# # Authors: Gabe Black from __future__ import print_function import argparse import m5 import os import re import sys from m5.objects import SystemC_Kernel, Root # pylint:disable=unused-variable kernel = SystemC_Kernel() root = Root(full_system=True, systemc_kernel=kernel) parser = argparse.ArgumentParser() parser.add_argument('--working-dir') args = parser.parse_args() if args.working_dir: os.chdir(args.working_dir) kernel.sc_main() m5.instantiate(None) cause = m5.simulate(m5.MaxTick).getCause()
import argparse import m5 import sys from m5.objects import SystemC_Kernel, Root, SystemC_Printer, Gem5_Feeder # pylint:disable=unused-variable parser = argparse.ArgumentParser() parser.add_argument('--word', action="append", default=[]) parser.add_argument('--delay', default='1ns') parser.add_argument('--prefix', default='') args = parser.parse_args() printer = SystemC_Printer() printer.prefix = args.prefix feeder = Gem5_Feeder() feeder.printer = printer feeder.delay = args.delay feeder.strings = args.word kernel = SystemC_Kernel(feeder=feeder) root = Root(full_system=True, systemc_kernel=kernel) m5.instantiate(None) cause = m5.simulate(m5.MaxTick).getCause() print(cause)