store_set.hh revision 2107
16167SN/A/* 26167SN/A * Copyright (c) 2004-2005 The Regents of The University of Michigan 36167SN/A * All rights reserved. 48835SAli.Saidi@ARM.com * 57892SN/A * Redistribution and use in source and binary forms, with or without 67892SN/A * modification, are permitted provided that the following conditions are 77892SN/A * met: redistributions of source code must retain the above copyright 86167SN/A * notice, this list of conditions and the following disclaimer; 96167SN/A * redistributions in binary form must reproduce the above copyright 106167SN/A * notice, this list of conditions and the following disclaimer in the 119864Snilay@cs.wisc.edu * documentation and/or other materials provided with the distribution; 128835SAli.Saidi@ARM.com * neither the name of the copyright holders nor the names of its 139864Snilay@cs.wisc.edu * contributors may be used to endorse or promote products derived from 149864Snilay@cs.wisc.edu * this software without specific prior written permission. 158835SAli.Saidi@ARM.com * 168835SAli.Saidi@ARM.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 178835SAli.Saidi@ARM.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 187077SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 199864Snilay@cs.wisc.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 208673SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 218721SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 228835SAli.Saidi@ARM.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 238835SAli.Saidi@ARM.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 247935SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 257935SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 267935SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 277935SN/A */ 287935SN/A 297935SN/A#ifndef __CPU_O3_CPU_STORE_SET_HH__ 307935SN/A#define __CPU_O3_CPU_STORE_SET_HH__ 318983Snate@binkert.org 326167SN/A#include <vector> 339864Snilay@cs.wisc.edu 349864Snilay@cs.wisc.edu#include "arch/isa_traits.hh" 359864Snilay@cs.wisc.edu#include "cpu/inst_seq.hh" 369864Snilay@cs.wisc.edu 379864Snilay@cs.wisc.educlass StoreSet 386167SN/A{ 396167SN/A protected: 409864Snilay@cs.wisc.edu typedef TheISA::Addr Addr; 416167SN/A public: 429864Snilay@cs.wisc.edu typedef unsigned SSID; 436167SN/A 446167SN/A public: 458835SAli.Saidi@ARM.com StoreSet(int SSIT_size, int LFST_size); 466167SN/A 476167SN/A void violation(Addr store_PC, Addr load_PC); 486167SN/A 496167SN/A void insertLoad(Addr load_PC, InstSeqNum load_seq_num); 508835SAli.Saidi@ARM.com 519469Snilay@cs.wisc.edu void insertStore(Addr store_PC, InstSeqNum store_seq_num); 526167SN/A 536167SN/A InstSeqNum checkInst(Addr PC); 546167SN/A 556167SN/A void issued(Addr issued_PC, InstSeqNum issued_seq_num, bool is_store); 566167SN/A 576167SN/A void squash(InstSeqNum squashed_num); 588835SAli.Saidi@ARM.com 596167SN/A void clear(); 609864Snilay@cs.wisc.edu 619469Snilay@cs.wisc.edu private: 626167SN/A inline int calcIndex(Addr PC) 636167SN/A { return (PC >> offset_bits) & index_mask; } 646167SN/A 659469Snilay@cs.wisc.edu inline SSID calcSSID(Addr PC) 669469Snilay@cs.wisc.edu { return ((PC ^ (PC >> 10)) % LFST_size); } 676167SN/A 689864Snilay@cs.wisc.edu SSID *SSIT; 699864Snilay@cs.wisc.edu 709864Snilay@cs.wisc.edu std::vector<bool> validSSIT; 719864Snilay@cs.wisc.edu 729864Snilay@cs.wisc.edu InstSeqNum *LFST; 739864Snilay@cs.wisc.edu 749864Snilay@cs.wisc.edu std::vector<bool> validLFST; 759864Snilay@cs.wisc.edu 769864Snilay@cs.wisc.edu int *SSCounters; 779864Snilay@cs.wisc.edu 786167SN/A int SSIT_size; 796167SN/A 808835SAli.Saidi@ARM.com int LFST_size; 816167SN/A 828835SAli.Saidi@ARM.com int index_mask; 838835SAli.Saidi@ARM.com 848835SAli.Saidi@ARM.com // HACK: Hardcoded for now. 858835SAli.Saidi@ARM.com int offset_bits; 869864Snilay@cs.wisc.edu}; 879864Snilay@cs.wisc.edu 888835SAli.Saidi@ARM.com#endif // __CPU_O3_CPU_STORE_SET_HH__ 899469Snilay@cs.wisc.edu