summaryrefslogtreecommitdiff
path: root/src/cpu/testers/directedtest/SeriesRequestGenerator.cc
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2012-12-11 10:05:55 -0600
committerNilay Vaish <nilay@cs.wisc.edu>2012-12-11 10:05:55 -0600
commitc120273708ca9843d15f4179c924bccc0f133d65 (patch)
tree253e77e7b35dbd5ea12695952f64e11ceffbfca0 /src/cpu/testers/directedtest/SeriesRequestGenerator.cc
parent9b72a0f627bb9d9f3028e1ad7bf65976863db099 (diff)
downloadgem5-c120273708ca9843d15f4179c924bccc0f133d65.tar.xz
ruby: modify the directed tester to read/write streams
The directed tester supports only generating only read or only write accesses. The patch modifies the tester to support streams that have both read and write accesses.
Diffstat (limited to 'src/cpu/testers/directedtest/SeriesRequestGenerator.cc')
-rw-r--r--src/cpu/testers/directedtest/SeriesRequestGenerator.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/cpu/testers/directedtest/SeriesRequestGenerator.cc b/src/cpu/testers/directedtest/SeriesRequestGenerator.cc
index abcb0278f..f4bb578e3 100644
--- a/src/cpu/testers/directedtest/SeriesRequestGenerator.cc
+++ b/src/cpu/testers/directedtest/SeriesRequestGenerator.cc
@@ -33,13 +33,13 @@
#include "debug/DirectedTest.hh"
SeriesRequestGenerator::SeriesRequestGenerator(const Params *p)
- : DirectedGenerator(p)
+ : DirectedGenerator(p),
+ m_addr_increment_size(p->addr_increment_size),
+ m_percent_writes(p->percent_writes)
{
m_status = SeriesRequestGeneratorStatus_Thinking;
m_active_node = 0;
m_address = 0x0;
- m_addr_increment_size = p->addr_increment_size;
- m_issue_writes = p->issue_writes;
}
SeriesRequestGenerator::~SeriesRequestGenerator()
@@ -60,11 +60,13 @@ SeriesRequestGenerator::initiate()
Request *req = new Request(m_address, 1, flags, masterId);
Packet::Command cmd;
- if (m_issue_writes) {
+ bool do_write = ((random() % 100) < m_percent_writes);
+ if (do_write) {
cmd = MemCmd::WriteReq;
} else {
cmd = MemCmd::ReadReq;
}
+
PacketPtr pkt = new Packet(req, cmd);
uint8_t* dummyData = new uint8_t;
*dummyData = 0;