Commit 6144275b authored by ROKICKI Simon's avatar ROKICKI Simon
Browse files

Add support for unsigned byte/half store

They are handled like signed stores.
parent 9da78821
...@@ -183,9 +183,11 @@ public: ...@@ -183,9 +183,11 @@ public:
if (opType == STORE) { if (opType == STORE) {
switch (mask) { switch (mask) {
case BYTE: case BYTE:
case BYTE_U:
localValStore.set_slc((((int)addr.slc<2>(0)) << 3) + TAG_SIZE + 4 * 8 * offset, dataIn.slc<8>(0)); localValStore.set_slc((((int)addr.slc<2>(0)) << 3) + TAG_SIZE + 4 * 8 * offset, dataIn.slc<8>(0));
break; break;
case HALF: case HALF:
case HALF_U:
localValStore.set_slc((addr[1] ? 16 : 0) + TAG_SIZE + 4 * 8 * offset, dataIn.slc<16>(0)); localValStore.set_slc((addr[1] ? 16 : 0) + TAG_SIZE + 4 * 8 * offset, dataIn.slc<16>(0));
break; break;
case WORD: case WORD:
...@@ -275,9 +277,11 @@ public: ...@@ -275,9 +277,11 @@ public:
if (opType == STORE) { if (opType == STORE) {
switch (mask) { switch (mask) {
case BYTE: case BYTE:
case BYTE_U:
newVal.set_slc((((int)addr.slc<2>(0)) << 3) + TAG_SIZE + 4 * 8 * offset, dataIn.slc<8>(0)); newVal.set_slc((((int)addr.slc<2>(0)) << 3) + TAG_SIZE + 4 * 8 * offset, dataIn.slc<8>(0));
break; break;
case HALF: case HALF:
case HALF_U:
newVal.set_slc((addr[1] ? 16 : 0) + TAG_SIZE + 4 * 8 * offset, dataIn.slc<16>(0)); newVal.set_slc((addr[1] ? 16 : 0) + TAG_SIZE + 4 * 8 * offset, dataIn.slc<16>(0));
break; break;
case WORD: case WORD:
......
...@@ -25,11 +25,13 @@ void SimpleMemory::process(ac_int<32, false> addr, memMask mask, memOpType opTyp ...@@ -25,11 +25,13 @@ void SimpleMemory::process(ac_int<32, false> addr, memMask mask, memOpType opTyp
switch (opType) { switch (opType) {
case STORE: case STORE:
switch (mask) { switch (mask) {
case BYTE_U:
case BYTE: case BYTE:
temp = data[addr >> 2]; temp = data[addr >> 2];
data[addr >> 2].set_slc(((int)addr.slc<2>(0)) << 3, dataIn.slc<8>(0)); data[addr >> 2].set_slc(((int)addr.slc<2>(0)) << 3, dataIn.slc<8>(0));
break; break;
case HALF: case HALF:
case HALF_U:
temp = data[addr >> 2]; temp = data[addr >> 2];
data[addr >> 2].set_slc(addr[1] ? 16 : 0, dataIn.slc<16>(0)); data[addr >> 2].set_slc(addr[1] ? 16 : 0, dataIn.slc<16>(0));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment