Initialize mem dep unit properly.

src/cpu/o3/mem_dep_unit_impl.hh:
    Initialize mem dep unit properly, add debug output.

--HG--
extra : convert_revision : 3c56dedfa57de1edc4b1c8f8d9bc94e18002eff2
This commit is contained in:
Kevin Lim 2006-11-07 13:53:06 -05:00
parent bf3223d7ce
commit d9f159a3b9
2 changed files with 14 additions and 1 deletions

View file

@ -69,7 +69,7 @@ class MemDepUnit {
typedef typename Impl::DynInstPtr DynInstPtr; typedef typename Impl::DynInstPtr DynInstPtr;
/** Empty constructor. Must call init() prior to using in this case. */ /** Empty constructor. Must call init() prior to using in this case. */
MemDepUnit() {} MemDepUnit();
/** Constructs a MemDepUnit with given parameters. */ /** Constructs a MemDepUnit with given parameters. */
MemDepUnit(Params *params); MemDepUnit(Params *params);

View file

@ -33,6 +33,13 @@
#include "cpu/o3/inst_queue.hh" #include "cpu/o3/inst_queue.hh"
#include "cpu/o3/mem_dep_unit.hh" #include "cpu/o3/mem_dep_unit.hh"
template <class MemDepPred, class Impl>
MemDepUnit<MemDepPred, Impl>::MemDepUnit()
: loadBarrier(false), loadBarrierSN(0), storeBarrier(false),
storeBarrierSN(0), iqPtr(NULL)
{
}
template <class MemDepPred, class Impl> template <class MemDepPred, class Impl>
MemDepUnit<MemDepPred, Impl>::MemDepUnit(Params *params) MemDepUnit<MemDepPred, Impl>::MemDepUnit(Params *params)
: depPred(params->SSITSize, params->LFSTSize), loadBarrier(false), : depPred(params->SSITSize, params->LFSTSize), loadBarrier(false),
@ -160,8 +167,12 @@ MemDepUnit<MemDepPred, Impl>::insert(DynInstPtr &inst)
// producing memrefs/stores. // producing memrefs/stores.
InstSeqNum producing_store; InstSeqNum producing_store;
if (inst->isLoad() && loadBarrier) { if (inst->isLoad() && loadBarrier) {
DPRINTF(MemDepUnit, "Load barrier [sn:%lli] in flight\n",
loadBarrierSN);
producing_store = loadBarrierSN; producing_store = loadBarrierSN;
} else if (inst->isStore() && storeBarrier) { } else if (inst->isStore() && storeBarrier) {
DPRINTF(MemDepUnit, "Store barrier [sn:%lli] in flight\n",
storeBarrierSN);
producing_store = storeBarrierSN; producing_store = storeBarrierSN;
} else { } else {
producing_store = depPred.checkInst(inst->readPC()); producing_store = depPred.checkInst(inst->readPC());
@ -171,10 +182,12 @@ MemDepUnit<MemDepPred, Impl>::insert(DynInstPtr &inst)
// If there is a producing store, try to find the entry. // If there is a producing store, try to find the entry.
if (producing_store != 0) { if (producing_store != 0) {
DPRINTF(MemDepUnit, "Searching for producer\n");
MemDepHashIt hash_it = memDepHash.find(producing_store); MemDepHashIt hash_it = memDepHash.find(producing_store);
if (hash_it != memDepHash.end()) { if (hash_it != memDepHash.end()) {
store_entry = (*hash_it).second; store_entry = (*hash_it).second;
DPRINTF(MemDepUnit, "Proucer found\n");
} }
} }