summaryrefslogtreecommitdiff
path: root/cpu/ooo_cpu/ea_list.cc
blob: 4142e7f5e84083d8f22efd03e3faf321e6a15228 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

#include "arch/alpha/isa_traits.hh"
#include "cpu/inst_seq.hh"
#include "cpu/ooo_cpu/ea_list.hh"

void
EAList::addAddr(const InstSeqNum &new_sn, const Addr &new_ea)
{
    instEA newEA(new_sn, new_ea);

    eaList.push_back(newEA);
}

void
EAList::clearAddr(const InstSeqNum &sn_to_clear, const Addr &ea_to_clear)
{
    eaListIt list_it = eaList.begin();

    while (list_it != eaList.end() && (*list_it).first != sn_to_clear) {
        assert((*list_it).second == ea_to_clear);
    }
}

bool
EAList::checkConflict(const InstSeqNum &check_sn, const Addr &check_ea) const
{
    const constEAListIt list_it = eaList.begin();

    while (list_it != eaList.end() && (*list_it).first < check_sn) {
        if ((*list_it).second == check_ea) {
            return true;
        }
    }

    return false;
}

void
EAList::clear()
{
    eaList.clear();
}

void
EAList::commit(const InstSeqNum &commit_sn)
{
    while (!eaList.empty() && eaList.front().first <= commit_sn) {
        eaList.pop_front();
    }
}