From c88486d842689bc2fa27abdc1875529493e7200a Mon Sep 17 00:00:00 2001 From: Janik Schlemminger Date: Tue, 5 Aug 2014 00:07:22 +0200 Subject: [PATCH 1/2] memcpy bug --- dram/dramSys/dramSys.pro | 3 ++- dram/resources/configs/memconfigs/fifo.xml | 2 +- dram/resources/simulations/sim-batch.xml | 2 +- dram/src/simulation/Dram.h | 3 ++- dram/src/simulation/main.cpp | 1 + 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dram/dramSys/dramSys.pro b/dram/dramSys/dramSys.pro index 61f4c916..c4693944 100644 --- a/dram/dramSys/dramSys.pro +++ b/dram/dramSys/dramSys.pro @@ -8,13 +8,14 @@ LIBS += -L/opt/systemc/lib-linux64 -lsystemc LIBS += -L/opt/boost/lib -lboost_filesystem -lboost_system LIBS += -L/opt/sqlite3/lib -lsqlite3 LIBS += -lpthread -LIBS += -lxerces-c +LIBS += -L/opt/xerces-c-3.1.1/lib -lxerces-c LIBS += -L../src/common/third_party/DRAMPower/src/ -ldrampowerxml LIBS += -L../src/common/third_party/DRAMPower/src/ -ldrampower INCLUDEPATH += /opt/systemc/include INCLUDEPATH += /opt/boost/include INCLUDEPATH += /opt/sqlite3/include +INCLUDEPATH += /opt/xerces-c-3.1.1/include INCLUDEPATH += ../src/common/third_party/DRAMPower/src INCLUDEPATH += ../src/common/third_party/DRAMPower/src/libdrampower diff --git a/dram/resources/configs/memconfigs/fifo.xml b/dram/resources/configs/memconfigs/fifo.xml index 603049f2..2e23e330 100644 --- a/dram/resources/configs/memconfigs/fifo.xml +++ b/dram/resources/configs/memconfigs/fifo.xml @@ -1,6 +1,6 @@ - + diff --git a/dram/resources/simulations/sim-batch.xml b/dram/resources/simulations/sim-batch.xml index f1c7c731..89adea06 100644 --- a/dram/resources/simulations/sim-batch.xml +++ b/dram/resources/simulations/sim-batch.xml @@ -16,7 +16,7 @@ - chstone-sha_32.stl + small.stl diff --git a/dram/src/simulation/Dram.h b/dram/src/simulation/Dram.h index bdb70e99..42ca1880 100644 --- a/dram/src/simulation/Dram.h +++ b/dram/src/simulation/Dram.h @@ -56,7 +56,7 @@ class column column(int bytes) { - bytes = bytes; + this->bytes = bytes; data = new unsigned char[bytes]; } @@ -68,6 +68,7 @@ class column void set(unsigned char * payloadDataPtr) { printf("Dest: %p Source: %p\n",data,payloadDataPtr); + printf("Bytes: %i\n",bytes); cout << "mem" ; memcpy(data, payloadDataPtr, bytes); // XXX hier knallts cout << "copy" << endl; diff --git a/dram/src/simulation/main.cpp b/dram/src/simulation/main.cpp index c064bc67..00797a88 100644 --- a/dram/src/simulation/main.cpp +++ b/dram/src/simulation/main.cpp @@ -32,6 +32,7 @@ int main(int argc, char **argv) int sc_main(int argc, char **argv) { + cout<<"hello"< Date: Tue, 5 Aug 2014 00:22:03 +0200 Subject: [PATCH 2/2] destructor --- dram/src/simulation/Dram.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dram/src/simulation/Dram.h b/dram/src/simulation/Dram.h index 42ca1880..7ff6e630 100644 --- a/dram/src/simulation/Dram.h +++ b/dram/src/simulation/Dram.h @@ -62,7 +62,7 @@ class column ~column() { - //delete data; + delete data; } void set(unsigned char * payloadDataPtr)