ArmSemihosting.py revision 12698:cef1e0e7a368
111185Serfan.azarkhish@unibo.it# Copyright (c) 2018 ARM Limited
211185Serfan.azarkhish@unibo.it# All rights reserved.
311185Serfan.azarkhish@unibo.it#
411185Serfan.azarkhish@unibo.it# The license below extends only to copyright in the software and shall
511185Serfan.azarkhish@unibo.it# not be construed as granting a license to any other intellectual
611185Serfan.azarkhish@unibo.it# property including but not limited to intellectual property relating
711185Serfan.azarkhish@unibo.it# to a hardware implementation of the functionality of the software
811185Serfan.azarkhish@unibo.it# licensed hereunder.  You may use the software subject to the license
911185Serfan.azarkhish@unibo.it# terms below provided that you ensure that this notice is replicated
1011185Serfan.azarkhish@unibo.it# unmodified and in its entirety in all distributions of the software,
1111185Serfan.azarkhish@unibo.it# modified or unmodified, in source code or in binary form.
1211185Serfan.azarkhish@unibo.it#
1311185Serfan.azarkhish@unibo.it# Redistribution and use in source and binary forms, with or without
1411185Serfan.azarkhish@unibo.it# modification, are permitted provided that the following conditions are
1511185Serfan.azarkhish@unibo.it# met: redistributions of source code must retain the above copyright
1611185Serfan.azarkhish@unibo.it# notice, this list of conditions and the following disclaimer;
1711185Serfan.azarkhish@unibo.it# redistributions in binary form must reproduce the above copyright
1811185Serfan.azarkhish@unibo.it# notice, this list of conditions and the following disclaimer in the
1911185Serfan.azarkhish@unibo.it# documentation and/or other materials provided with the distribution;
2011185Serfan.azarkhish@unibo.it# neither the name of the copyright holders nor the names of its
2111185Serfan.azarkhish@unibo.it# contributors may be used to endorse or promote products derived from
2211185Serfan.azarkhish@unibo.it# this software without specific prior written permission.
2311185Serfan.azarkhish@unibo.it#
2411185Serfan.azarkhish@unibo.it# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2511185Serfan.azarkhish@unibo.it# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2611185Serfan.azarkhish@unibo.it# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2711185Serfan.azarkhish@unibo.it# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2811185Serfan.azarkhish@unibo.it# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2911185Serfan.azarkhish@unibo.it# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3011185Serfan.azarkhish@unibo.it# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3111185Serfan.azarkhish@unibo.it# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3211185Serfan.azarkhish@unibo.it# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3311185Serfan.azarkhish@unibo.it# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3411185Serfan.azarkhish@unibo.it# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3511185Serfan.azarkhish@unibo.it#
3611185Serfan.azarkhish@unibo.it# Authors: Andreas Sandberg
3711185Serfan.azarkhish@unibo.it
3811185Serfan.azarkhish@unibo.itfrom m5.params import *
3911185Serfan.azarkhish@unibo.itfrom m5.SimObject import *
4011185Serfan.azarkhish@unibo.it
4111185Serfan.azarkhish@unibo.itfrom Serial import SerialDevice
4211185Serfan.azarkhish@unibo.itfrom Terminal import Terminal
4311185Serfan.azarkhish@unibo.it
4411185Serfan.azarkhish@unibo.itclass ArmSemihosting(SimObject):
4511185Serfan.azarkhish@unibo.it    type = 'ArmSemihosting'
4611185Serfan.azarkhish@unibo.it    cxx_header = "arch/arm/semihosting.hh"
4711185Serfan.azarkhish@unibo.it
4811185Serfan.azarkhish@unibo.it    cmd_line = Param.String("", "Command line to report to guest");
4911185Serfan.azarkhish@unibo.it    stdin = Param.String("stdin",
5011185Serfan.azarkhish@unibo.it                         "Standard input (stdin for gem5's terminal)")
5111185Serfan.azarkhish@unibo.it    stdout = Param.String("stdout",
5211185Serfan.azarkhish@unibo.it                          "Standard output (stdout for gem5's terminal)")
5311185Serfan.azarkhish@unibo.it    stderr = Param.String("stderr",
5411185Serfan.azarkhish@unibo.it                          "Standard error (stderr for gem5's terminal)")
5511185Serfan.azarkhish@unibo.it
5611185Serfan.azarkhish@unibo.it    mem_reserve = Param.MemorySize("32MB",
5711185Serfan.azarkhish@unibo.it        "Amount of memory to reserve at the start of the address map. This "
5811185Serfan.azarkhish@unibo.it        "memory won't be used by the heap reported to an application.");
5911185Serfan.azarkhish@unibo.it    stack_size = Param.MemorySize("32MB", "Application stack size");
6011185Serfan.azarkhish@unibo.it
6111185Serfan.azarkhish@unibo.it    time = Param.Time('01/01/2009',
6211185Serfan.azarkhish@unibo.it                      "System time to use ('Now' for actual time)")
6311185Serfan.azarkhish@unibo.it