params.py (5578:db6756431717) params.py (5822:05ffa2c3c800)
1# Copyright (c) 2004-2006 The Regents of The University of Michigan
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

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

322 if not cls.swig_predecls:
323 # most derived types require this, so we just do it here once
324 cls.swig_predecls = ['%import "stdint.i"\n' +
325 '%import "sim/host.hh"']
326
327 if not (hasattr(cls, 'min') and hasattr(cls, 'max')):
328 if not (hasattr(cls, 'size') and hasattr(cls, 'unsigned')):
329 panic("CheckedInt subclass %s must define either\n" \
1# Copyright (c) 2004-2006 The Regents of The University of Michigan
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

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

322 if not cls.swig_predecls:
323 # most derived types require this, so we just do it here once
324 cls.swig_predecls = ['%import "stdint.i"\n' +
325 '%import "sim/host.hh"']
326
327 if not (hasattr(cls, 'min') and hasattr(cls, 'max')):
328 if not (hasattr(cls, 'size') and hasattr(cls, 'unsigned')):
329 panic("CheckedInt subclass %s must define either\n" \
330 " 'min' and 'max' or 'size' and 'unsigned'\n" \
331 % name);
330 " 'min' and 'max' or 'size' and 'unsigned'\n",
331 name);
332 if cls.unsigned:
333 cls.min = 0
334 cls.max = 2 ** cls.size - 1
335 else:
336 cls.min = -(2 ** (cls.size - 1))
337 cls.max = (2 ** (cls.size - 1)) - 1
338
339# Abstract superclass for bounds-checked integer parameters. This

--- 847 unchanged lines hidden ---
332 if cls.unsigned:
333 cls.min = 0
334 cls.max = 2 ** cls.size - 1
335 else:
336 cls.min = -(2 ** (cls.size - 1))
337 cls.max = (2 ** (cls.size - 1)) - 1
338
339# Abstract superclass for bounds-checked integer parameters. This

--- 847 unchanged lines hidden ---