Merge ktlim@zizzer.eecs.umich.edu:/bk/m5
[gem5.git] / cpu / ooo_cpu / ea_list.hh
1 #ifndef __CPU_EA_LIST_HH__
2 #define __CPU_EA_LIST_HH__
3
4 #include <list>
5 #include <utility>
6
7 #include "arch/alpha/isa_traits.hh"
8 #include "cpu/inst_seq.hh"
9
10 /**
11 * Simple class to hold onto a list of pairs, each pair having a memory
12 * instruction's sequence number and effective addr. This list can be used
13 * for memory disambiguation. However, if I ever want to forward results, I
14 * may have to use a list that holds DynInstPtrs. Hence this may change in
15 * the future.
16 */
17 class EAList {
18 private:
19 typedef std::pair<InstSeqNum, Addr> instEA;
20 typedef std::list<instEA>::iterator eaListIt;
21 typedef std::list<instEA>::const_iterator constEAListIt;
22
23 std::list<instEA> eaList;
24
25 public:
26 EAList() { }
27 ~EAList() { }
28
29 void addAddr(const InstSeqNum &new_sn, const Addr &new_ea);
30
31 void clearAddr(const InstSeqNum &sn_to_clear, const Addr &ea_to_clear);
32
33 /** Checks if any instructions older than check_sn have a conflicting
34 * address with check_ea. Note that this function does not handle the
35 * sequence number rolling over.
36 */
37 bool checkConflict(const InstSeqNum &check_sn, const Addr &check_ea) const;
38
39 void clear();
40
41 void commit(const InstSeqNum &commit_sn);
42 };
43
44 #endif // __CPU_EA_LIST_HH__