store_set.hh revision 2107
12315SN/A/*
28733Sgeoffrey.blake@arm.com * Copyright (c) 2004-2005 The Regents of The University of Michigan
38733Sgeoffrey.blake@arm.com * All rights reserved.
48733Sgeoffrey.blake@arm.com *
58733Sgeoffrey.blake@arm.com * Redistribution and use in source and binary forms, with or without
68733Sgeoffrey.blake@arm.com * modification, are permitted provided that the following conditions are
78733Sgeoffrey.blake@arm.com * met: redistributions of source code must retain the above copyright
88733Sgeoffrey.blake@arm.com * notice, this list of conditions and the following disclaimer;
98733Sgeoffrey.blake@arm.com * redistributions in binary form must reproduce the above copyright
108733Sgeoffrey.blake@arm.com * notice, this list of conditions and the following disclaimer in the
118733Sgeoffrey.blake@arm.com * documentation and/or other materials provided with the distribution;
128733Sgeoffrey.blake@arm.com * neither the name of the copyright holders nor the names of its
138733Sgeoffrey.blake@arm.com * contributors may be used to endorse or promote products derived from
142332SN/A * this software without specific prior written permission.
152315SN/A *
162315SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
172315SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
182315SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
192315SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
202315SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
212315SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
222315SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
232315SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
242315SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
252315SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
262315SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
272315SN/A */
282315SN/A
292315SN/A#ifndef __CPU_O3_CPU_STORE_SET_HH__
302315SN/A#define __CPU_O3_CPU_STORE_SET_HH__
312315SN/A
322315SN/A#include <vector>
332315SN/A
342315SN/A#include "arch/isa_traits.hh"
352315SN/A#include "cpu/inst_seq.hh"
362315SN/A
372315SN/Aclass StoreSet
382315SN/A{
392689SN/A  protected:
402689SN/A    typedef TheISA::Addr Addr;
418733Sgeoffrey.blake@arm.com  public:
422315SN/A    typedef unsigned SSID;
432315SN/A
442315SN/A  public:
452315SN/A    StoreSet(int SSIT_size, int LFST_size);
462315SN/A
478888Sgeoffrey.blake@arm.com    void violation(Addr store_PC, Addr load_PC);
488793Sgblack@eecs.umich.edu
492315SN/A    void insertLoad(Addr load_PC, InstSeqNum load_seq_num);
506658Snate@binkert.org
512315SN/A    void insertStore(Addr store_PC, InstSeqNum store_seq_num);
528733Sgeoffrey.blake@arm.com
532683SN/A    InstSeqNum checkInst(Addr PC);
548229Snate@binkert.org
552680SN/A    void issued(Addr issued_PC, InstSeqNum issued_seq_num, bool is_store);
568733Sgeoffrey.blake@arm.com
578733Sgeoffrey.blake@arm.com    void squash(InstSeqNum squashed_num);
588793Sgblack@eecs.umich.edu
592315SN/A    void clear();
602315SN/A
612315SN/A  private:
622315SN/A    inline int calcIndex(Addr PC)
638733Sgeoffrey.blake@arm.com    { return (PC >> offset_bits) & index_mask; }
642315SN/A
658733Sgeoffrey.blake@arm.com    inline SSID calcSSID(Addr PC)
662315SN/A    { return ((PC ^ (PC >> 10)) % LFST_size); }
678733Sgeoffrey.blake@arm.com
688733Sgeoffrey.blake@arm.com    SSID *SSIT;
698733Sgeoffrey.blake@arm.com
708733Sgeoffrey.blake@arm.com    std::vector<bool> validSSIT;
718733Sgeoffrey.blake@arm.com
728733Sgeoffrey.blake@arm.com    InstSeqNum *LFST;
738733Sgeoffrey.blake@arm.com
748733Sgeoffrey.blake@arm.com    std::vector<bool> validLFST;
758733Sgeoffrey.blake@arm.com
768733Sgeoffrey.blake@arm.com    int *SSCounters;
778733Sgeoffrey.blake@arm.com
788733Sgeoffrey.blake@arm.com    int SSIT_size;
798733Sgeoffrey.blake@arm.com
808733Sgeoffrey.blake@arm.com    int LFST_size;
818733Sgeoffrey.blake@arm.com
828733Sgeoffrey.blake@arm.com    int index_mask;
838733Sgeoffrey.blake@arm.com
848733Sgeoffrey.blake@arm.com    // HACK: Hardcoded for now.
858733Sgeoffrey.blake@arm.com    int offset_bits;
868733Sgeoffrey.blake@arm.com};
878733Sgeoffrey.blake@arm.com
888733Sgeoffrey.blake@arm.com#endif // __CPU_O3_CPU_STORE_SET_HH__
898733Sgeoffrey.blake@arm.com