59 this->readAddr = cmd.
saddr(15, 0);
60 this->readId = cmd.
saddr(31, 16);
61 uint16_t tempLen = (uint16_t) cmd.
btt(15, 0);
62 this->readLen = (
int) tempLen;
67 this->writeAddr = cmd.
saddr(15, 0);
68 this->writeId = cmd.
saddr(31, 16);
73 readStorageIt = storage.find(readId);
74 if (readStorageIt == storage.end()) {
75 readStorageIt = createBuffer(readId);
80 while (this->readLen > 0 and i < 8) {
81 chunk.
setLE_TData((readStorageIt->second)[readAddr], (i*8)+7, i*8);
87 if (this->readLen == 0) {
97 writeStorageIt = storage.find(writeId);
98 if (writeStorageIt == storage.end()) {
99 writeStorageIt = createBuffer(writeId);
103 for (
int i = 0; i < 8; i++) {
105 (writeStorageIt->second)[writeAddr] = chunk.
getLE_TData((i*8)+7, i*8);
115 std::map<ap_uint<16>, ap_uint<8>*>::iterator DummyMemory::createBuffer(ap_uint<16>
id)
117 ap_uint<8>* array =
new ap_uint<8>[65536];
118 std::pair<std::map<ap_uint<16>, ap_uint<8>*>::iterator,
bool>
ret;
120 ret = storage.insert(std::make_pair(
id, array));
124 return storage.end();
127 void DummyMemory::shuffleWord(ap_uint<64>& word)
131 temp( 7, 0) = word(63, 56);
132 temp(15, 8) = word(55, 48);
133 temp(23, 16) = word(47, 40);
134 temp(31, 24) = word(39, 32);
136 temp(39, 32) = word(31, 24);
137 temp(47, 40) = word(23, 16);
138 temp(55, 48) = word(15, 8);
139 temp(63, 56) = word(7, 0);
void setTLast(tLast last)
LE_tKeep getLE_TKeep(int leHi=64/8-1, int leLo=0) const
LE_tData getLE_TData(int leHi=64 -1, int leLo=0) const
void setLE_TData(LE_tData data, int leHi=64 -1, int leLo=0)
void setLE_TKeep(LE_tKeep keep, int leHi=64/8-1, int leLo=0)
: A class to emulate the TCP buffer memory.
void setReadCmd(DmCmd cmd)
void setWriteCmd(DmCmd cmd)
void readChunk(AxisApp &chunk)
void writeChunk(AxisApp &chunk)