types.hh revision 2665
15647Sgblack@eecs.umich.edu/* 29544Sandreas.hansson@arm.com * Copyright (c) 2003-2005 The Regents of The University of Michigan 38922Swilliam.wang@arm.com * All rights reserved. 48922Swilliam.wang@arm.com * 58922Swilliam.wang@arm.com * Redistribution and use in source and binary forms, with or without 68922Swilliam.wang@arm.com * modification, are permitted provided that the following conditions are 78922Swilliam.wang@arm.com * met: redistributions of source code must retain the above copyright 88922Swilliam.wang@arm.com * notice, this list of conditions and the following disclaimer; 98922Swilliam.wang@arm.com * redistributions in binary form must reproduce the above copyright 108922Swilliam.wang@arm.com * notice, this list of conditions and the following disclaimer in the 118922Swilliam.wang@arm.com * documentation and/or other materials provided with the distribution; 128922Swilliam.wang@arm.com * neither the name of the copyright holders nor the names of its 138922Swilliam.wang@arm.com * contributors may be used to endorse or promote products derived from 145647Sgblack@eecs.umich.edu * this software without specific prior written permission. 155647Sgblack@eecs.umich.edu * 165647Sgblack@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 177087Snate@binkert.org * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 187087Snate@binkert.org * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 197087Snate@binkert.org * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 207087Snate@binkert.org * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 217087Snate@binkert.org * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 227087Snate@binkert.org * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 237087Snate@binkert.org * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 247087Snate@binkert.org * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 255647Sgblack@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 267087Snate@binkert.org * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 277087Snate@binkert.org * 287087Snate@binkert.org * Authors: Nathan Binkert 297087Snate@binkert.org */ 307087Snate@binkert.org 317087Snate@binkert.org/** 327087Snate@binkert.org * @file 337087Snate@binkert.org * Defines host-dependent types: 345647Sgblack@eecs.umich.edu * Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t. 357087Snate@binkert.org */ 365647Sgblack@eecs.umich.edu 375647Sgblack@eecs.umich.edu#ifndef __HOST_HH__ 385647Sgblack@eecs.umich.edu#define __HOST_HH__ 395647Sgblack@eecs.umich.edu 405647Sgblack@eecs.umich.edu#include <inttypes.h> 415647Sgblack@eecs.umich.edu 425647Sgblack@eecs.umich.edu/** uint64_t constant */ 435647Sgblack@eecs.umich.edu#define ULL(N) ((uint64_t)N##ULL) 445647Sgblack@eecs.umich.edu/** int64_t constant */ 455647Sgblack@eecs.umich.edu#define LL(N) (((int64_t)N##LL) 465647Sgblack@eecs.umich.edu 475647Sgblack@eecs.umich.edu/** Statistics counter type. Not much excuse for not using a 64-bit 485647Sgblack@eecs.umich.edu * integer here, but if you're desperate and only run short 495647Sgblack@eecs.umich.edu * simulations you could make this 32 bits. 505647Sgblack@eecs.umich.edu */ 515647Sgblack@eecs.umich.edutypedef int64_t Counter; 5211793Sbrandon.potter@amd.com 5311793Sbrandon.potter@amd.com/** 5410474Sandreas.hansson@arm.com * Clock cycle count type. 5510474Sandreas.hansson@arm.com * @note using an unsigned breaks the cache. 5611793Sbrandon.potter@amd.com */ 578229Snate@binkert.orgtypedef int64_t Tick; 585647Sgblack@eecs.umich.edu 598232Snate@binkert.org/** 606137Sgblack@eecs.umich.edu * Address type 616137Sgblack@eecs.umich.edu * This will probably be moved somewhere else in the near future. 626137Sgblack@eecs.umich.edu * This should be at least as big as the biggest address width in use 635654Sgblack@eecs.umich.edu * in the system, which will probably be 64 bits. 6411793Sbrandon.potter@amd.com */ 656046Sgblack@eecs.umich.edutypedef uint64_t Addr; 665647Sgblack@eecs.umich.edu 675648Sgblack@eecs.umich.educonst Addr MaxAddr = (Addr)-1; 685648Sgblack@eecs.umich.edu 695647Sgblack@eecs.umich.edu#endif // __HOST_H__ 705647Sgblack@eecs.umich.edu