/*
+ * Copyright (c) 2019 ARM Limited
+ * All rights reserved.
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder. You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
* Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
* All rights reserved.
*
}
uint32_t
-MessageBuffer::functionalWrite(Packet *pkt)
+MessageBuffer::functionalAccess(Packet *pkt, bool is_read)
{
- uint32_t num_functional_writes = 0;
+ DPRINTF(RubyQueue, "functional %s for %#x\n",
+ is_read ? "read" : "write", pkt->getAddr());
+
+ uint32_t num_functional_accesses = 0;
// Check the priority heap and write any messages that may
// correspond to the address in the packet.
for (unsigned int i = 0; i < m_prio_heap.size(); ++i) {
Message *msg = m_prio_heap[i].get();
- if (msg->functionalWrite(pkt)) {
- num_functional_writes++;
- }
+ if (is_read && msg->functionalRead(pkt))
+ return 1;
+ else if (!is_read && msg->functionalWrite(pkt))
+ num_functional_accesses++;
}
// Check the stall queue and write any messages that may
it != (map_iter->second).end(); ++it) {
Message *msg = (*it).get();
- if (msg->functionalWrite(pkt)) {
- num_functional_writes++;
- }
+ if (is_read && msg->functionalRead(pkt))
+ return 1;
+ else if (!is_read && msg->functionalWrite(pkt))
+ num_functional_accesses++;
}
}
- return num_functional_writes;
+ return num_functional_accesses;
}
MessageBuffer *
/*
+ * Copyright (c) 2019 ARM Limited
+ * All rights reserved.
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder. You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
* Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
* All rights reserved.
*
// Function for figuring out if any of the messages in the buffer need
// to be updated with the data from the packet.
// Return value indicates the number of messages that were updated.
- // This required for debugging the code.
- uint32_t functionalWrite(Packet *pkt);
+ uint32_t functionalWrite(Packet *pkt)
+ {
+ return functionalAccess(pkt, false);
+ }
+
+ // Function for figuring if message in the buffer has valid data for
+ // the packet.
+ // Returns true only if a message was found with valid data and the
+ // read was performed.
+ bool functionalRead(Packet *pkt)
+ {
+ return functionalAccess(pkt, true) == 1;
+ }
private:
void reanalyzeList(std::list<MsgPtr> &, Tick);
+ uint32_t functionalAccess(Packet *pkt, bool is_read);
+
private:
// Data Members (m_ prefix)
//! Consumer to signal a wakeup(), can be NULL