Deleted Added
sdiff udiff text old ( 8453:82fc1267d3bb ) new ( 9528:d05714c2ab9c )
full compact
1# Copyright (c) 2008-2009 The Hewlett-Packard Development Company
2# Copyright (c) 2004-2006 The Regents of The University of Michigan
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;

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

51
52# fatal() should be called when the simulation cannot continue due to
53# some condition that is the user's fault (bad configuration, invalid
54# arguments, etc.) and not a simulator bug.
55def fatal(fmt, *args):
56 print >>sys.stderr, 'fatal:', fmt % args
57 sys.exit(1)
58
59class Singleton(type):
60 def __call__(cls, *args, **kwargs):
61 if hasattr(cls, '_instance'):
62 return cls._instance
63
64 cls._instance = super(Singleton, cls).__call__(*args, **kwargs)
65 return cls._instance
66

--- 121 unchanged lines hidden ---