ruby: Fixed minor bug in ruby test for setting the request type

This commit is contained in:
Brad Beckmann 2010-08-20 11:46:14 -07:00
parent e7f2da517a
commit 908364a1c9

View file

@ -82,10 +82,6 @@ Check::initiatePrefetch()
Request::Flags flags; Request::Flags flags;
flags.set(Request::PREFETCH); flags.set(Request::PREFETCH);
// Prefetches are assumed to be 0 sized
Request *req = new Request(m_address.getAddress(), 0, flags, curTick,
m_pc.getAddress());
Packet::Command cmd; Packet::Command cmd;
// 1 in 8 chance this will be an exclusive prefetch // 1 in 8 chance this will be an exclusive prefetch
@ -101,6 +97,10 @@ Check::initiatePrefetch()
flags.set(Request::PF_EXCLUSIVE); flags.set(Request::PF_EXCLUSIVE);
} }
// Prefetches are assumed to be 0 sized
Request *req = new Request(m_address.getAddress(), 0, flags, curTick,
m_pc.getAddress());
PacketPtr pkt = new Packet(req, cmd, port->idx); PacketPtr pkt = new Packet(req, cmd, port->idx);
// push the subblock onto the sender state. The sequencer will // push the subblock onto the sender state. The sequencer will
@ -198,15 +198,15 @@ Check::initiateCheck()
Request::Flags flags; Request::Flags flags;
// Checks are sized depending on the number of bytes written
Request *req = new Request(m_address.getAddress(), CHECK_SIZE, flags,
curTick, m_pc.getAddress());
// 50% chance that the request will be an instruction fetch // 50% chance that the request will be an instruction fetch
if ((random() & 0x1) == 0) { if ((random() & 0x1) == 0) {
flags.set(Request::INST_FETCH); flags.set(Request::INST_FETCH);
} }
// Checks are sized depending on the number of bytes written
Request *req = new Request(m_address.getAddress(), CHECK_SIZE, flags,
curTick, m_pc.getAddress());
PacketPtr pkt = new Packet(req, MemCmd::ReadReq, port->idx); PacketPtr pkt = new Packet(req, MemCmd::ReadReq, port->idx);
uint8_t* dataArray = new uint8_t[CHECK_SIZE]; uint8_t* dataArray = new uint8_t[CHECK_SIZE];
pkt->dataDynamicArray(dataArray); pkt->dataDynamicArray(dataArray);