types.hh revision 7678
12686Sksewell@umich.edu/*
25254Sksewell@umich.edu * Copyright (c) 2003-2005 The Regents of The University of Michigan
35254Sksewell@umich.edu * All rights reserved.
42686Sksewell@umich.edu *
55254Sksewell@umich.edu * Redistribution and use in source and binary forms, with or without
65254Sksewell@umich.edu * modification, are permitted provided that the following conditions are
75254Sksewell@umich.edu * met: redistributions of source code must retain the above copyright
85254Sksewell@umich.edu * notice, this list of conditions and the following disclaimer;
95254Sksewell@umich.edu * redistributions in binary form must reproduce the above copyright
105254Sksewell@umich.edu * notice, this list of conditions and the following disclaimer in the
115254Sksewell@umich.edu * documentation and/or other materials provided with the distribution;
125254Sksewell@umich.edu * neither the name of the copyright holders nor the names of its
135254Sksewell@umich.edu * contributors may be used to endorse or promote products derived from
145254Sksewell@umich.edu * this software without specific prior written permission.
152686Sksewell@umich.edu *
165254Sksewell@umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
175254Sksewell@umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
185254Sksewell@umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
195254Sksewell@umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
205254Sksewell@umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
215254Sksewell@umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
225254Sksewell@umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
235254Sksewell@umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
245254Sksewell@umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
255254Sksewell@umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
265254Sksewell@umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
272706Sksewell@umich.edu *
285254Sksewell@umich.edu * Authors: Nathan Binkert
292686Sksewell@umich.edu */
302686Sksewell@umich.edu
317678Sgblack@eecs.umich.edu/**
327678Sgblack@eecs.umich.edu * @file
334661Sksewell@umich.edu * Defines global host-dependent types:
348799Sgblack@eecs.umich.edu * Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
352686Sksewell@umich.edu */
368799Sgblack@eecs.umich.edu
374661Sksewell@umich.edu#ifndef __BASE_TYPES_HH__
382980Sgblack@eecs.umich.edu#define __BASE_TYPES_HH__
398229Snate@binkert.org
408229Snate@binkert.org#include <inttypes.h>
418799Sgblack@eecs.umich.edu
428229Snate@binkert.org/** uint64_t constant */
432686Sksewell@umich.edu#define ULL(N)          ((uint64_t)N##ULL)
445222Sksewell@umich.edu/** int64_t constant */
452686Sksewell@umich.edu#define LL(N)           ((int64_t)N##LL)
464661Sksewell@umich.edu
472686Sksewell@umich.edu/** Statistics counter type.  Not much excuse for not using a 64-bit
485222Sksewell@umich.edu * integer here, but if you're desperate and only run short
495222Sksewell@umich.edu * simulations you could make this 32 bits.
502686Sksewell@umich.edu */
517707Sgblack@eecs.umich.edutypedef int64_t Counter;
525222Sksewell@umich.edu
538775Sgblack@eecs.umich.edu/**
545222Sksewell@umich.edu * Clock cycle count type.
555222Sksewell@umich.edu * @note using an unsigned breaks the cache.
565222Sksewell@umich.edu */
575222Sksewell@umich.edutypedef int64_t Tick;
585222Sksewell@umich.edutypedef uint64_t UTick;
592686Sksewell@umich.edu
602686Sksewell@umich.educonst Tick MaxTick = LL(0x7fffffffffffffff);
612686Sksewell@umich.edu
622686Sksewell@umich.edu/**
632686Sksewell@umich.edu * Address type
642686Sksewell@umich.edu * This will probably be moved somewhere else in the near future.
652686Sksewell@umich.edu * This should be at least as big as the biggest address width in use
662686Sksewell@umich.edu * in the system, which will probably be 64 bits.
672686Sksewell@umich.edu */
682686Sksewell@umich.edutypedef uint64_t Addr;
692686Sksewell@umich.edu
702686Sksewell@umich.educonst Addr MaxAddr = (Addr)-1;
712686Sksewell@umich.edu
722686Sksewell@umich.edu/**
732686Sksewell@umich.edu * Thread index/ID type
742686Sksewell@umich.edu */
752686Sksewell@umich.edutypedef int16_t ThreadID;
762686Sksewell@umich.educonst ThreadID InvalidThreadID = (ThreadID)-1;
772686Sksewell@umich.edu
782686Sksewell@umich.educlass FaultBase;
792686Sksewell@umich.edutemplate <class T> class RefCountingPtr;
802686Sksewell@umich.edutypedef RefCountingPtr<FaultBase> Fault;
812686Sksewell@umich.edu
822686Sksewell@umich.edu#endif // __BASE_TYPES_HH__
832686Sksewell@umich.edu