store_set.hh revision 2107
16226Snate@binkert.org/*
26226Snate@binkert.org * Copyright (c) 2004-2005 The Regents of The University of Michigan
36226Snate@binkert.org * All rights reserved.
46226Snate@binkert.org *
56226Snate@binkert.org * Redistribution and use in source and binary forms, with or without
66226Snate@binkert.org * modification, are permitted provided that the following conditions are
76226Snate@binkert.org * met: redistributions of source code must retain the above copyright
86226Snate@binkert.org * notice, this list of conditions and the following disclaimer;
96226Snate@binkert.org * redistributions in binary form must reproduce the above copyright
106226Snate@binkert.org * notice, this list of conditions and the following disclaimer in the
116226Snate@binkert.org * documentation and/or other materials provided with the distribution;
126226Snate@binkert.org * neither the name of the copyright holders nor the names of its
136226Snate@binkert.org * contributors may be used to endorse or promote products derived from
146226Snate@binkert.org * this software without specific prior written permission.
156226Snate@binkert.org *
166226Snate@binkert.org * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
176226Snate@binkert.org * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
186226Snate@binkert.org * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
196226Snate@binkert.org * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
206226Snate@binkert.org * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
216226Snate@binkert.org * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
226226Snate@binkert.org * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
236226Snate@binkert.org * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
246226Snate@binkert.org * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
256226Snate@binkert.org * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
266226Snate@binkert.org * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
276226Snate@binkert.org */
286226Snate@binkert.org
296226Snate@binkert.org#ifndef __CPU_O3_CPU_STORE_SET_HH__
306226Snate@binkert.org#define __CPU_O3_CPU_STORE_SET_HH__
316226Snate@binkert.org
326226Snate@binkert.org#include <vector>
3310281SAndreas.Sandberg@ARM.com
3410281SAndreas.Sandberg@ARM.com#include "arch/isa_traits.hh"
359480Snilay@cs.wisc.edu#include "cpu/inst_seq.hh"
3610281SAndreas.Sandberg@ARM.com
3710281SAndreas.Sandberg@ARM.comclass StoreSet
3811433Smitch.hayenga@arm.com{
3910281SAndreas.Sandberg@ARM.com  protected:
4010281SAndreas.Sandberg@ARM.com    typedef TheISA::Addr Addr;
4110281SAndreas.Sandberg@ARM.com  public:
4213957Sjairo.balart@metempsy.com    typedef unsigned SSID;
4311433Smitch.hayenga@arm.com
4410281SAndreas.Sandberg@ARM.com  public:
4510281SAndreas.Sandberg@ARM.com    StoreSet(int SSIT_size, int LFST_size);
4610281SAndreas.Sandberg@ARM.com
4713626Sjairo.balart@metempsy.com    void violation(Addr store_PC, Addr load_PC);
4813454Spau.cabre@metempsy.com
4913627Sjavier.bueno@metempsy.com    void insertLoad(Addr load_PC, InstSeqNum load_seq_num);
5011784Sarthur.perais@inria.fr
5114034Sjavier.bueno@metempsy.com    void insertStore(Addr store_PC, InstSeqNum store_seq_num);
5214034Sjavier.bueno@metempsy.com
5314034Sjavier.bueno@metempsy.com    InstSeqNum checkInst(Addr PC);
5414081Sjavier.bueno@metempsy.com
5514081Sjavier.bueno@metempsy.com    void issued(Addr issued_PC, InstSeqNum issued_seq_num, bool is_store);
5614081Sjavier.bueno@metempsy.com
5713685Sjavier.bueno@metempsy.com    void squash(InstSeqNum squashed_num);
5813685Sjavier.bueno@metempsy.com
5913685Sjavier.bueno@metempsy.com    void clear();
6013685Sjavier.bueno@metempsy.com
6110281SAndreas.Sandberg@ARM.com  private:
6210281SAndreas.Sandberg@ARM.com    inline int calcIndex(Addr PC)
6313454Spau.cabre@metempsy.com    { return (PC >> offset_bits) & index_mask; }
6410785Sgope@wisc.edu
6513685Sjavier.bueno@metempsy.com    inline SSID calcSSID(Addr PC)
66    { return ((PC ^ (PC >> 10)) % LFST_size); }
67
68    SSID *SSIT;
69
70    std::vector<bool> validSSIT;
71
72    InstSeqNum *LFST;
73
74    std::vector<bool> validLFST;
75
76    int *SSCounters;
77
78    int SSIT_size;
79
80    int LFST_size;
81
82    int index_mask;
83
84    // HACK: Hardcoded for now.
85    int offset_bits;
86};
87
88#endif // __CPU_O3_CPU_STORE_SET_HH__
89