store_set.hh revision 2665
11689SN/A/*
21689SN/A * Copyright (c) 2004-2005 The Regents of The University of Michigan
31689SN/A * All rights reserved.
41689SN/A *
51689SN/A * Redistribution and use in source and binary forms, with or without
61689SN/A * modification, are permitted provided that the following conditions are
71689SN/A * met: redistributions of source code must retain the above copyright
81689SN/A * notice, this list of conditions and the following disclaimer;
91689SN/A * redistributions in binary form must reproduce the above copyright
101689SN/A * notice, this list of conditions and the following disclaimer in the
111689SN/A * documentation and/or other materials provided with the distribution;
121689SN/A * neither the name of the copyright holders nor the names of its
131689SN/A * contributors may be used to endorse or promote products derived from
141689SN/A * this software without specific prior written permission.
151689SN/A *
161689SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
171689SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
181689SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
191689SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
201689SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
211689SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
221689SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
231689SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
241689SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
251689SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
261689SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
272665Ssaidi@eecs.umich.edu *
282665Ssaidi@eecs.umich.edu * Authors: Kevin Lim
291689SN/A */
301689SN/A
311755SN/A#ifndef __CPU_O3_CPU_STORE_SET_HH__
321755SN/A#define __CPU_O3_CPU_STORE_SET_HH__
331061SN/A
341061SN/A#include <vector>
351061SN/A
362107SN/A#include "arch/isa_traits.hh"
371061SN/A#include "cpu/inst_seq.hh"
381061SN/A
391061SN/Aclass StoreSet
401061SN/A{
411061SN/A  public:
421061SN/A    typedef unsigned SSID;
431061SN/A
441061SN/A  public:
451061SN/A    StoreSet(int SSIT_size, int LFST_size);
461061SN/A
471062SN/A    void violation(Addr store_PC, Addr load_PC);
481061SN/A
491061SN/A    void insertLoad(Addr load_PC, InstSeqNum load_seq_num);
501061SN/A
511061SN/A    void insertStore(Addr store_PC, InstSeqNum store_seq_num);
521061SN/A
531061SN/A    InstSeqNum checkInst(Addr PC);
541061SN/A
551061SN/A    void issued(Addr issued_PC, InstSeqNum issued_seq_num, bool is_store);
561061SN/A
571061SN/A    void squash(InstSeqNum squashed_num);
581061SN/A
591061SN/A    void clear();
601061SN/A
611061SN/A  private:
621061SN/A    inline int calcIndex(Addr PC)
631061SN/A    { return (PC >> offset_bits) & index_mask; }
641061SN/A
651061SN/A    inline SSID calcSSID(Addr PC)
661061SN/A    { return ((PC ^ (PC >> 10)) % LFST_size); }
671061SN/A
681061SN/A    SSID *SSIT;
691061SN/A
701061SN/A    std::vector<bool> validSSIT;
711061SN/A
721061SN/A    InstSeqNum *LFST;
731061SN/A
741061SN/A    std::vector<bool> validLFST;
751061SN/A
761061SN/A    int *SSCounters;
771061SN/A
781061SN/A    int SSIT_size;
791061SN/A
801061SN/A    int LFST_size;
811061SN/A
821061SN/A    int index_mask;
831061SN/A
841061SN/A    // HACK: Hardcoded for now.
851061SN/A    int offset_bits;
861061SN/A};
871061SN/A
881755SN/A#endif // __CPU_O3_CPU_STORE_SET_HH__
89