config.py (13099:4cb81fed7ee3) config.py (13182:9e030f636a8c)
1# Copyright 2018 Google, Inc.
2#
3# Redistribution and use in source and binary forms, with or without
4# modification, are permitted provided that the following conditions are
5# met: redistributions of source code must retain the above copyright
6# notice, this list of conditions and the following disclaimer;
7# redistributions in binary form must reproduce the above copyright
8# notice, this list of conditions and the following disclaimer in the

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

26# Authors: Gabe Black
27
28from __future__ import print_function
29
30import argparse
31import m5
32import os
33import re
1# Copyright 2018 Google, Inc.
2#
3# Redistribution and use in source and binary forms, with or without
4# modification, are permitted provided that the following conditions are
5# met: redistributions of source code must retain the above copyright
6# notice, this list of conditions and the following disclaimer;
7# redistributions in binary form must reproduce the above copyright
8# notice, this list of conditions and the following disclaimer in the

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

26# Authors: Gabe Black
27
28from __future__ import print_function
29
30import argparse
31import m5
32import os
33import re
34import sys
34
35from m5.objects import SystemC_Kernel, Root
36
37# pylint:disable=unused-variable
38
39kernel = SystemC_Kernel()
40root = Root(full_system=True, systemc_kernel=kernel)
41

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

53cause = m5.simulate(m5.MaxTick).getCause()
54
55result = kernel.sc_main_result()
56if result.code != 0:
57 # Arguably this should make gem5 fail, but some tests purposefully
58 # generate errors, and as long as their output matches that's still
59 # considered correct. A "real" systemc config should expect sc_main
60 # (if present) not to fail.
35
36from m5.objects import SystemC_Kernel, Root
37
38# pylint:disable=unused-variable
39
40kernel = SystemC_Kernel()
41root = Root(full_system=True, systemc_kernel=kernel)
42

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

54cause = m5.simulate(m5.MaxTick).getCause()
55
56result = kernel.sc_main_result()
57if result.code != 0:
58 # Arguably this should make gem5 fail, but some tests purposefully
59 # generate errors, and as long as their output matches that's still
60 # considered correct. A "real" systemc config should expect sc_main
61 # (if present) not to fail.
61 scrubbed = re.sub(r'In file: .*$',
62 'In file: <removed by verify.pl>',
63 result.message)
64 print('\n' + scrubbed)
62 print('\n' + result.message)
63 sys.exit(int(result.code))