two_level.py (13774:a1be2a0c55f2) two_level.py (13839:a32423451596)
1# -*- coding: utf-8 -*-
2# Copyright (c) 2015 Jason Power
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 53 unchanged lines hidden (view full) ---

62
63# Finalize the arguments and grab the opts so we can pass it on to our objects
64(opts, args) = SimpleOpts.parse_args()
65
66# get ISA for the default binary to run. This is mostly for simple testing
67isa = str(m5.defines.buildEnv['TARGET_ISA']).lower()
68
69# Default to running 'hello', use the compiled ISA to find the binary
1# -*- coding: utf-8 -*-
2# Copyright (c) 2015 Jason Power
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 53 unchanged lines hidden (view full) ---

62
63# Finalize the arguments and grab the opts so we can pass it on to our objects
64(opts, args) = SimpleOpts.parse_args()
65
66# get ISA for the default binary to run. This is mostly for simple testing
67isa = str(m5.defines.buildEnv['TARGET_ISA']).lower()
68
69# Default to running 'hello', use the compiled ISA to find the binary
70binary = 'tests/test-progs/hello/bin/' + isa + '/linux/hello'
70# grab the specific path to the binary
71thispath = os.path.dirname(os.path.realpath(__file__))
72binary = os.path.join(thispath, '../../../',
73 'tests/test-progs/hello/bin/', isa, 'linux/hello')
71
72# Check if there was a binary passed in via the command line and error if
73# there are too many arguments
74if len(args) == 1:
75 binary = args[0]
76elif len(args) > 1:
77 SimpleOpts.print_help()
78 m5.fatal("Expected a binary to execute as positional argument")

--- 76 unchanged lines hidden ---
74
75# Check if there was a binary passed in via the command line and error if
76# there are too many arguments
77if len(args) == 1:
78 binary = args[0]
79elif len(args) > 1:
80 SimpleOpts.print_help()
81 m5.fatal("Expected a binary to execute as positional argument")

--- 76 unchanged lines hidden ---