40 char *
data = (
char *)dest;
41 if (offset + len >=
size())
48 while (offset >= pkt->length) {
49 offset -= pkt->length;
54 panic(
"invalid fifo");
56 unsigned size = min(pkt->length - offset, len);
57 memcpy(data, pkt->data, size);
71 packet->serialize(base +
".packet", cp);
72 paramOut(cp, base +
".slack", slack);
73 paramOut(cp, base +
".number", number);
80 packet = make_shared<EthPacketData>();
81 packet->unserialize(base +
".packet", cp);
82 paramIn(cp, base +
".slack", slack);
83 paramIn(cp, base +
".number", number);
91 paramOut(cp, base +
".maxsize", _maxsize);
92 paramOut(cp, base +
".reserved", _reserved);
93 paramOut(cp, base +
".packets", fifo.size());
96 for (
const auto &entry : fifo)
97 entry.serialize(
csprintf(
"%s.entry%d", base, i++), cp);
103 paramIn(cp, base +
".size", _size);
105 paramIn(cp, base +
".reserved", _reserved);
107 paramIn(cp, base +
".packets", fifosize);
111 for (
int i = 0;
i < fifosize; ++
i) {
114 fifo.push_back(entry);
void unserialize(const std::string &base, CheckpointIn &cp)
void unserialize(const std::string &base, CheckpointIn &cp)
void serialize(const std::string &base, CheckpointOut &cp) const
Serialization stuff.
std::string csprintf(const char *format, const Args &...args)
void paramOut(CheckpointOut &cp, const string &name, ExtMachInst const &machInst)
std::shared_ptr< EthPacketData > EthPacketPtr
void serialize(const std::string &base, CheckpointOut &cp) const
std::ostream CheckpointOut
fifo_list::iterator iterator
void paramIn(CheckpointIn &cp, const string &name, ExtMachInst &machInst)
bool copyout(void *dest, unsigned offset, unsigned len)