types.hh revision 2667
113207Sgabeblack@google.com/*
213207Sgabeblack@google.com * Copyright (c) 2003-2005 The Regents of The University of Michigan
313207Sgabeblack@google.com * All rights reserved.
413207Sgabeblack@google.com *
513207Sgabeblack@google.com * Redistribution and use in source and binary forms, with or without
613207Sgabeblack@google.com * modification, are permitted provided that the following conditions are
713207Sgabeblack@google.com * met: redistributions of source code must retain the above copyright
813207Sgabeblack@google.com * notice, this list of conditions and the following disclaimer;
913207Sgabeblack@google.com * redistributions in binary form must reproduce the above copyright
1013207Sgabeblack@google.com * notice, this list of conditions and the following disclaimer in the
1113207Sgabeblack@google.com * documentation and/or other materials provided with the distribution;
1213207Sgabeblack@google.com * neither the name of the copyright holders nor the names of its
1313207Sgabeblack@google.com * contributors may be used to endorse or promote products derived from
1413207Sgabeblack@google.com * this software without specific prior written permission.
1513207Sgabeblack@google.com *
1613207Sgabeblack@google.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1713207Sgabeblack@google.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1813207Sgabeblack@google.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1913207Sgabeblack@google.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2013207Sgabeblack@google.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2113207Sgabeblack@google.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2213207Sgabeblack@google.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2313207Sgabeblack@google.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2413207Sgabeblack@google.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2513207Sgabeblack@google.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2613207Sgabeblack@google.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2713207Sgabeblack@google.com *
2813207Sgabeblack@google.com * Authors: Nathan Binkert
2913207Sgabeblack@google.com */
3013207Sgabeblack@google.com
3113207Sgabeblack@google.com/**
3213207Sgabeblack@google.com * @file
3313207Sgabeblack@google.com * Defines host-dependent types:
3413273Sgabeblack@google.com * Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
3513207Sgabeblack@google.com */
3613207Sgabeblack@google.com
3713239Sgabeblack@google.com#ifndef __HOST_HH__
3813207Sgabeblack@google.com#define __HOST_HH__
3913207Sgabeblack@google.com
4013207Sgabeblack@google.com#include <inttypes.h>
4113207Sgabeblack@google.com
4213207Sgabeblack@google.com/** uint64_t constant */
4313207Sgabeblack@google.com#define ULL(N)		((uint64_t)N##ULL)
4413207Sgabeblack@google.com/** int64_t constant */
4513207Sgabeblack@google.com#define LL(N)		(((int64_t)N##LL)
4613260Sgabeblack@google.com
4713207Sgabeblack@google.com/** Statistics counter type.  Not much excuse for not using a 64-bit
4813207Sgabeblack@google.com * integer here, but if you're desperate and only run short
4913207Sgabeblack@google.com * simulations you could make this 32 bits.
5013207Sgabeblack@google.com */
5113207Sgabeblack@google.comtypedef int64_t Counter;
5213207Sgabeblack@google.com
5313207Sgabeblack@google.com/**
5413207Sgabeblack@google.com * Clock cycle count type.
5513207Sgabeblack@google.com * @note using an unsigned breaks the cache.
5613207Sgabeblack@google.com */
5713207Sgabeblack@google.comtypedef int64_t Tick;
5813207Sgabeblack@google.com
5913207Sgabeblack@google.comconst Tick MaxTick = (1LL << 62);
6013207Sgabeblack@google.com
6113273Sgabeblack@google.com/**
6213273Sgabeblack@google.com * Address type
6313207Sgabeblack@google.com * This will probably be moved somewhere else in the near future.
6413207Sgabeblack@google.com * This should be at least as big as the biggest address width in use
6513260Sgabeblack@google.com * in the system, which will probably be 64 bits.
6613207Sgabeblack@google.com */
6713207Sgabeblack@google.comtypedef uint64_t Addr;
6813239Sgabeblack@google.com
6913207Sgabeblack@google.comconst Addr MaxAddr = (Addr)-1;
7013239Sgabeblack@google.com
7113239Sgabeblack@google.com#endif // __HOST_H__
7213239Sgabeblack@google.com