#define __MEM_RUBY_SLICC_INTERFACE_MESSAGE_HH__
#include <iostream>
+#include <memory>
-#include "base/refcnt.hh"
#include "mem/packet.hh"
class Message;
-typedef RefCountingPtr<Message> MsgPtr;
+typedef std::shared_ptr<Message> MsgPtr;
-class Message : public RefCounted
+class Message
{
public:
Message(Tick curTime)
virtual ~Message() { }
- virtual Message* clone() const = 0;
+ virtual MsgPtr clone() const = 0;
virtual void print(std::ostream& out) const = 0;
virtual void setIncomingLink(int) {}
virtual void setVnet(int) {}
#define __MEM_RUBY_SLICC_INTERFACE_NETWORKMESSAGE_HH__
#include <iostream>
+#include <memory>
#include "mem/protocol/MessageSizeType.hh"
#include "mem/ruby/common/NetDest.hh"
#include "mem/ruby/slicc_interface/Message.hh"
class NetworkMessage;
-typedef RefCountingPtr<NetworkMessage> NetMsgPtr;
+typedef std::shared_ptr<NetworkMessage> NetMsgPtr;
class NetworkMessage : public Message
{
}
RubyRequest(Tick curTime) : Message(curTime) {}
- RubyRequest* clone() const { return new RubyRequest(*this); }
+ MsgPtr clone() const
+ { return std::shared_ptr<Message>(new RubyRequest(*this)); }
const Address& getLineAddress() const { return m_LineAddress; }
const Address& getPhysicalAddress() const { return m_PhysicalAddress; }
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <memory>
+
#include "debug/RubyDma.hh"
#include "debug/RubyStats.hh"
#include "mem/protocol/SequencerMsg.hh"
active_request.bytes_issued = 0;
active_request.pkt = pkt;
- SequencerMsg *msg = new SequencerMsg(clockEdge());
+ std::shared_ptr<SequencerMsg> msg =
+ std::make_shared<SequencerMsg>(clockEdge());
msg->getPhysicalAddress() = Address(paddr);
msg->getLineAddress() = line_address(msg->getPhysicalAddress());
msg->getType() = write ? SequencerRequestType_ST : SequencerRequestType_LD;
return;
}
- SequencerMsg *msg = new SequencerMsg(clockEdge());
+ std::shared_ptr<SequencerMsg> msg =
+ std::make_shared<SequencerMsg>(clockEdge());
msg->getPhysicalAddress() = Address(active_request.start_paddr +
active_request.bytes_completed);
#define __MEM_RUBY_SYSTEM_DMASEQUENCER_HH__
#include <ostream>
+#include <memory>
#include "mem/protocol/DMASequencerRequestType.hh"
#include "mem/ruby/common/DataBlock.hh"
pc = pkt->req->getPC();
}
- RubyRequest *msg = new RubyRequest(clockEdge(), pkt->getAddr(),
- pkt->getPtr<uint8_t>(true),
- pkt->getSize(), pc, secondary_type,
- RubyAccessMode_Supervisor, pkt,
- PrefetchBit_No, proc_id);
+ std::shared_ptr<RubyRequest> msg =
+ std::make_shared<RubyRequest>(clockEdge(), pkt->getAddr(),
+ pkt->getPtr<uint8_t>(true),
+ pkt->getSize(), pc, secondary_type,
+ RubyAccessMode_Supervisor, pkt,
+ PrefetchBit_No, proc_id);
DPRINTFR(ProtocolTrace, "%15s %3s %10s%20s %6s>%-6s %s %s\n",
curTick(), m_version, "Seq", "Begin", "", "",
self.symtab.newSymbol(v)
# Declare message
- code("${{msg_type.ident}} *out_msg = "\
- "new ${{msg_type.ident}}(clockEdge());")
+ code("std::shared_ptr<${{msg_type.ident}}> out_msg = "\
+ "std::make_shared<${{msg_type.ident}}>(clockEdge());")
# The other statements
t = self.statements.generate(code, None)
code('}')
# create a clone member
- code('''
+ if self.isMessage:
+ code('''
+MsgPtr
+clone() const
+{
+ return std::shared_ptr<Message>(new ${{self.c_ident}}(*this));
+}
+''')
+ else:
+ code('''
${{self.c_ident}}*
clone() const
{
*/
#include <iostream>
+#include <memory>
#include "mem/protocol/${{self.c_ident}}.hh"
#include "mem/ruby/common/Global.hh"