Commit 0c436917 authored by Jens Korinth's avatar Jens Korinth
Browse files

Merge branch 'ATSBackports' into '2017.1'

Ports changes of the ATS Branch of TPC to Tapasco

See merge request !1
parents a543f07d bfcfeb64
...@@ -72,12 +72,12 @@ protected: ...@@ -72,12 +72,12 @@ protected:
platform::platform_read_ctl(base_addr, sizeof(intr.interrupts[i].vector_control), &intr.interrupts[i].vector_control, platform::PLATFORM_CTL_FLAGS_RAW); platform::platform_read_ctl(base_addr, sizeof(intr.interrupts[i].vector_control), &intr.interrupts[i].vector_control, platform::PLATFORM_CTL_FLAGS_RAW);
base_addr += 4; base_addr += 4;
} }
base_addr = 0x502000; base_addr = 0x508000;
for(int i = 0; i < 1 + (total_interrupts / 64) + ((total_interrupts % 64) != 0); ++i) { for(int i = 0; i < 1 + (total_interrupts / 64) + ((total_interrupts % 64) != 0); ++i) {
platform::platform_read_ctl(base_addr, sizeof(intr.pba[i]), &intr.pba[i], platform::PLATFORM_CTL_FLAGS_RAW); platform::platform_read_ctl(base_addr, sizeof(intr.pba[i]), &intr.pba[i], platform::PLATFORM_CTL_FLAGS_RAW);
base_addr += 8; base_addr += 8;
} }
base_addr = 0x504000; base_addr = 0x508100;
platform::platform_read_ctl(base_addr, sizeof(intr.core_id), &intr.core_id, platform::PLATFORM_CTL_FLAGS_RAW); platform::platform_read_ctl(base_addr, sizeof(intr.core_id), &intr.core_id, platform::PLATFORM_CTL_FLAGS_RAW);
base_addr += 4; base_addr += 4;
platform::platform_read_ctl(base_addr, sizeof(intr.enableAndMask), &intr.enableAndMask, platform::PLATFORM_CTL_FLAGS_RAW); platform::platform_read_ctl(base_addr, sizeof(intr.enableAndMask), &intr.enableAndMask, platform::PLATFORM_CTL_FLAGS_RAW);
......
...@@ -1096,7 +1096,7 @@ ...@@ -1096,7 +1096,7 @@
<spirit:parameters> <spirit:parameters>
<spirit:parameter> <spirit:parameter>
<spirit:name>viewChecksum</spirit:name> <spirit:name>viewChecksum</spirit:name>
<spirit:value>34326147</spirit:value> <spirit:value>ded3be7f</spirit:value>
</spirit:parameter> </spirit:parameter>
</spirit:parameters> </spirit:parameters>
</spirit:view> </spirit:view>
...@@ -1112,7 +1112,7 @@ ...@@ -1112,7 +1112,7 @@
<spirit:parameters> <spirit:parameters>
<spirit:parameter> <spirit:parameter>
<spirit:name>viewChecksum</spirit:name> <spirit:name>viewChecksum</spirit:name>
<spirit:value>34326147</spirit:value> <spirit:value>ded3be7f</spirit:value>
</spirit:parameter> </spirit:parameter>
</spirit:parameters> </spirit:parameters>
</spirit:view> </spirit:view>
...@@ -2953,27 +2953,27 @@ ...@@ -2953,27 +2953,27 @@
<spirit:fileType>verilogSource</spirit:fileType> <spirit:fileType>verilogSource</spirit:fileType>
</spirit:file> </spirit:file>
<spirit:file> <spirit:file>
<spirit:name>src/SizedFIFO.v</spirit:name> <spirit:name>src/SyncFIFO1.v</spirit:name>
<spirit:fileType>verilogSource</spirit:fileType> <spirit:fileType>verilogSource</spirit:fileType>
</spirit:file> </spirit:file>
<spirit:file> <spirit:file>
<spirit:name>src/SyncFIFO1.v</spirit:name> <spirit:name>src/SyncRegister.v</spirit:name>
<spirit:fileType>verilogSource</spirit:fileType> <spirit:fileType>verilogSource</spirit:fileType>
</spirit:file> </spirit:file>
<spirit:file> <spirit:file>
<spirit:name>src/SyncFIFO.v</spirit:name> <spirit:name>src/FIFO1.v</spirit:name>
<spirit:fileType>verilogSource</spirit:fileType> <spirit:fileType>verilogSource</spirit:fileType>
</spirit:file> </spirit:file>
<spirit:file> <spirit:file>
<spirit:name>src/SyncRegister.v</spirit:name> <spirit:name>src/FIFO2.v</spirit:name>
<spirit:fileType>verilogSource</spirit:fileType> <spirit:fileType>verilogSource</spirit:fileType>
</spirit:file> </spirit:file>
<spirit:file> <spirit:file>
<spirit:name>src/FIFO2.v</spirit:name> <spirit:name>src/SizedFIFO.v</spirit:name>
<spirit:fileType>verilogSource</spirit:fileType> <spirit:fileType>verilogSource</spirit:fileType>
</spirit:file> </spirit:file>
<spirit:file> <spirit:file>
<spirit:name>src/FIFO1.v</spirit:name> <spirit:name>src/SyncFIFO.v</spirit:name>
<spirit:fileType>verilogSource</spirit:fileType> <spirit:fileType>verilogSource</spirit:fileType>
</spirit:file> </spirit:file>
<spirit:file> <spirit:file>
...@@ -2983,7 +2983,7 @@ ...@@ -2983,7 +2983,7 @@
<spirit:file> <spirit:file>
<spirit:name>src/mkBlueDMAVivado.v</spirit:name> <spirit:name>src/mkBlueDMAVivado.v</spirit:name>
<spirit:fileType>verilogSource</spirit:fileType> <spirit:fileType>verilogSource</spirit:fileType>
<spirit:userFileType>CHECKSUM_0e8625c1</spirit:userFileType> <spirit:userFileType>CHECKSUM_578878b6</spirit:userFileType>
</spirit:file> </spirit:file>
</spirit:fileSet> </spirit:fileSet>
<spirit:fileSet> <spirit:fileSet>
...@@ -2993,27 +2993,27 @@ ...@@ -2993,27 +2993,27 @@
<spirit:fileType>verilogSource</spirit:fileType> <spirit:fileType>verilogSource</spirit:fileType>
</spirit:file> </spirit:file>
<spirit:file> <spirit:file>
<spirit:name>src/SizedFIFO.v</spirit:name> <spirit:name>src/SyncFIFO1.v</spirit:name>
<spirit:fileType>verilogSource</spirit:fileType> <spirit:fileType>verilogSource</spirit:fileType>
</spirit:file> </spirit:file>
<spirit:file> <spirit:file>
<spirit:name>src/SyncFIFO1.v</spirit:name> <spirit:name>src/SyncRegister.v</spirit:name>
<spirit:fileType>verilogSource</spirit:fileType> <spirit:fileType>verilogSource</spirit:fileType>
</spirit:file> </spirit:file>
<spirit:file> <spirit:file>
<spirit:name>src/SyncFIFO.v</spirit:name> <spirit:name>src/FIFO1.v</spirit:name>
<spirit:fileType>verilogSource</spirit:fileType> <spirit:fileType>verilogSource</spirit:fileType>
</spirit:file> </spirit:file>
<spirit:file> <spirit:file>
<spirit:name>src/SyncRegister.v</spirit:name> <spirit:name>src/FIFO2.v</spirit:name>
<spirit:fileType>verilogSource</spirit:fileType> <spirit:fileType>verilogSource</spirit:fileType>
</spirit:file> </spirit:file>
<spirit:file> <spirit:file>
<spirit:name>src/FIFO2.v</spirit:name> <spirit:name>src/SizedFIFO.v</spirit:name>
<spirit:fileType>verilogSource</spirit:fileType> <spirit:fileType>verilogSource</spirit:fileType>
</spirit:file> </spirit:file>
<spirit:file> <spirit:file>
<spirit:name>src/FIFO1.v</spirit:name> <spirit:name>src/SyncFIFO.v</spirit:name>
<spirit:fileType>verilogSource</spirit:fileType> <spirit:fileType>verilogSource</spirit:fileType>
</spirit:file> </spirit:file>
<spirit:file> <spirit:file>
...@@ -3055,7 +3055,7 @@ ...@@ -3055,7 +3055,7 @@
<xilinx:displayName>BlueDMA</xilinx:displayName> <xilinx:displayName>BlueDMA</xilinx:displayName>
<xilinx:definitionSource>package_project</xilinx:definitionSource> <xilinx:definitionSource>package_project</xilinx:definitionSource>
<xilinx:coreRevision>1</xilinx:coreRevision> <xilinx:coreRevision>1</xilinx:coreRevision>
<xilinx:coreCreationDateTime>2017-06-09T13:48:43Z</xilinx:coreCreationDateTime> <xilinx:coreCreationDateTime>2017-07-06T11:01:37Z</xilinx:coreCreationDateTime>
<xilinx:tags> <xilinx:tags>
<xilinx:tag xilinx:name="nopcore"/> <xilinx:tag xilinx:name="nopcore"/>
</xilinx:tags> </xilinx:tags>
...@@ -3065,7 +3065,7 @@ ...@@ -3065,7 +3065,7 @@
<xilinx:checksum xilinx:scope="busInterfaces" xilinx:value="4abcc88b"/> <xilinx:checksum xilinx:scope="busInterfaces" xilinx:value="4abcc88b"/>
<xilinx:checksum xilinx:scope="addressSpaces" xilinx:value="39f16c3a"/> <xilinx:checksum xilinx:scope="addressSpaces" xilinx:value="39f16c3a"/>
<xilinx:checksum xilinx:scope="memoryMaps" xilinx:value="5dd283ff"/> <xilinx:checksum xilinx:scope="memoryMaps" xilinx:value="5dd283ff"/>
<xilinx:checksum xilinx:scope="fileGroups" xilinx:value="b6d869fa"/> <xilinx:checksum xilinx:scope="fileGroups" xilinx:value="d8fab998"/>
<xilinx:checksum xilinx:scope="ports" xilinx:value="8523f8a5"/> <xilinx:checksum xilinx:scope="ports" xilinx:value="8523f8a5"/>
<xilinx:checksum xilinx:scope="parameters" xilinx:value="1bb46e31"/> <xilinx:checksum xilinx:scope="parameters" xilinx:value="1bb46e31"/>
</xilinx:packagingInfo> </xilinx:packagingInfo>
......
This diff is collapsed.
// //
// Generated by Bluespec Compiler, version 2015.09.beta2 (build 34689, 2015-09-07) // Generated by Bluespec Compiler, version 2015.09.beta2 (build 34689, 2015-09-07)
// //
// On Fri Jun 9 15:48:16 CEST 2017 // On Thu Jul 6 13:00:49 CEST 2017
// //
// //
// Ports: // Ports:
......
...@@ -427,7 +427,7 @@ ...@@ -427,7 +427,7 @@
<spirit:parameters> <spirit:parameters>
<spirit:parameter> <spirit:parameter>
<spirit:name>viewChecksum</spirit:name> <spirit:name>viewChecksum</spirit:name>
<spirit:value>93bc1b6f</spirit:value> <spirit:value>558b72aa</spirit:value>
</spirit:parameter> </spirit:parameter>
</spirit:parameters> </spirit:parameters>
</spirit:view> </spirit:view>
...@@ -443,7 +443,7 @@ ...@@ -443,7 +443,7 @@
<spirit:parameters> <spirit:parameters>
<spirit:parameter> <spirit:parameter>
<spirit:name>viewChecksum</spirit:name> <spirit:name>viewChecksum</spirit:name>
<spirit:value>93bc1b6f</spirit:value> <spirit:value>558b72aa</spirit:value>
</spirit:parameter> </spirit:parameter>
</spirit:parameters> </spirit:parameters>
</spirit:view> </spirit:view>
...@@ -1249,11 +1249,11 @@ ...@@ -1249,11 +1249,11 @@
<spirit:fileSet> <spirit:fileSet>
<spirit:name>xilinx_anylanguagesynthesis_view_fileset</spirit:name> <spirit:name>xilinx_anylanguagesynthesis_view_fileset</spirit:name>
<spirit:file> <spirit:file>
<spirit:name>src/SizedFIFO.v</spirit:name> <spirit:name>src/BRAM2BE.v</spirit:name>
<spirit:fileType>verilogSource</spirit:fileType> <spirit:fileType>verilogSource</spirit:fileType>
</spirit:file> </spirit:file>
<spirit:file> <spirit:file>
<spirit:name>src/BRAM2BE.v</spirit:name> <spirit:name>src/FIFO1.v</spirit:name>
<spirit:fileType>verilogSource</spirit:fileType> <spirit:fileType>verilogSource</spirit:fileType>
</spirit:file> </spirit:file>
<spirit:file> <spirit:file>
...@@ -1261,23 +1261,23 @@ ...@@ -1261,23 +1261,23 @@
<spirit:fileType>verilogSource</spirit:fileType> <spirit:fileType>verilogSource</spirit:fileType>
</spirit:file> </spirit:file>
<spirit:file> <spirit:file>
<spirit:name>src/FIFO1.v</spirit:name> <spirit:name>src/SizedFIFO.v</spirit:name>
<spirit:fileType>verilogSource</spirit:fileType> <spirit:fileType>verilogSource</spirit:fileType>
</spirit:file> </spirit:file>
<spirit:file> <spirit:file>
<spirit:name>src/mkMSIXIntrCtrl.v</spirit:name> <spirit:name>src/mkMSIXIntrCtrl.v</spirit:name>
<spirit:fileType>verilogSource</spirit:fileType> <spirit:fileType>verilogSource</spirit:fileType>
<spirit:userFileType>CHECKSUM_3366b868</spirit:userFileType> <spirit:userFileType>CHECKSUM_7049b426</spirit:userFileType>
</spirit:file> </spirit:file>
</spirit:fileSet> </spirit:fileSet>
<spirit:fileSet> <spirit:fileSet>
<spirit:name>xilinx_anylanguagebehavioralsimulation_view_fileset</spirit:name> <spirit:name>xilinx_anylanguagebehavioralsimulation_view_fileset</spirit:name>
<spirit:file> <spirit:file>
<spirit:name>src/SizedFIFO.v</spirit:name> <spirit:name>src/BRAM2BE.v</spirit:name>
<spirit:fileType>verilogSource</spirit:fileType> <spirit:fileType>verilogSource</spirit:fileType>
</spirit:file> </spirit:file>
<spirit:file> <spirit:file>
<spirit:name>src/BRAM2BE.v</spirit:name> <spirit:name>src/FIFO1.v</spirit:name>
<spirit:fileType>verilogSource</spirit:fileType> <spirit:fileType>verilogSource</spirit:fileType>
</spirit:file> </spirit:file>
<spirit:file> <spirit:file>
...@@ -1285,7 +1285,7 @@ ...@@ -1285,7 +1285,7 @@
<spirit:fileType>verilogSource</spirit:fileType> <spirit:fileType>verilogSource</spirit:fileType>
</spirit:file> </spirit:file>
<spirit:file> <spirit:file>
<spirit:name>src/FIFO1.v</spirit:name> <spirit:name>src/SizedFIFO.v</spirit:name>
<spirit:fileType>verilogSource</spirit:fileType> <spirit:fileType>verilogSource</spirit:fileType>
</spirit:file> </spirit:file>
<spirit:file> <spirit:file>
...@@ -1323,7 +1323,7 @@ ...@@ -1323,7 +1323,7 @@
<xilinx:displayName>MSIXIntrCtrl</xilinx:displayName> <xilinx:displayName>MSIXIntrCtrl</xilinx:displayName>
<xilinx:definitionSource>package_project</xilinx:definitionSource> <xilinx:definitionSource>package_project</xilinx:definitionSource>
<xilinx:coreRevision>1</xilinx:coreRevision> <xilinx:coreRevision>1</xilinx:coreRevision>
<xilinx:coreCreationDateTime>2017-06-09T13:47:07Z</xilinx:coreCreationDateTime> <xilinx:coreCreationDateTime>2017-07-05T16:28:24Z</xilinx:coreCreationDateTime>
<xilinx:tags> <xilinx:tags>
<xilinx:tag xilinx:name="nopcore"/> <xilinx:tag xilinx:name="nopcore"/>
</xilinx:tags> </xilinx:tags>
...@@ -1333,7 +1333,7 @@ ...@@ -1333,7 +1333,7 @@
<xilinx:checksum xilinx:scope="busInterfaces" xilinx:value="a9103989"/> <xilinx:checksum xilinx:scope="busInterfaces" xilinx:value="a9103989"/>
<xilinx:checksum xilinx:scope="addressSpaces" xilinx:value="39f94240"/> <xilinx:checksum xilinx:scope="addressSpaces" xilinx:value="39f94240"/>
<xilinx:checksum xilinx:scope="memoryMaps" xilinx:value="2b2da2c0"/> <xilinx:checksum xilinx:scope="memoryMaps" xilinx:value="2b2da2c0"/>
<xilinx:checksum xilinx:scope="fileGroups" xilinx:value="5c9a1c13"/> <xilinx:checksum xilinx:scope="fileGroups" xilinx:value="057aaeb0"/>
<xilinx:checksum xilinx:scope="ports" xilinx:value="19368f77"/> <xilinx:checksum xilinx:scope="ports" xilinx:value="19368f77"/>
<xilinx:checksum xilinx:scope="parameters" xilinx:value="4b2b81b7"/> <xilinx:checksum xilinx:scope="parameters" xilinx:value="4b2b81b7"/>
</xilinx:packagingInfo> </xilinx:packagingInfo>
......
set_false_path -to [get_cells system_i/InterruptControl/msix_intr_ctrl/inst/interrupts_*] set_false_path -through [get_pins system_i/InterruptControl/msix_intr_ctrl/interrupt*]
This diff is collapsed.
...@@ -31,7 +31,7 @@ set(FF_ROOT "$ENV{FF_ROOT}") ...@@ -31,7 +31,7 @@ set(FF_ROOT "$ENV{FF_ROOT}")
endif (${REQUIRES_FASTFLOW}) endif (${REQUIRES_FASTFLOW})
# link_directories(${TAPASCO_HOME}/arch/lib/${ARCH} ${TAPASCO_HOME}/arch/lib/${ARCH}/static ${TAPASCO_HOME}/platform/lib/${ARCH} ${TAPASCO_HOME}/platform/lib/${ARCH}/static) # link_directories(${TAPASCO_HOME}/arch/lib/${ARCH} ${TAPASCO_HOME}/arch/lib/${ARCH}/static ${TAPASCO_HOME}/platform/lib/${ARCH} ${TAPASCO_HOME}/platform/lib/${ARCH}/static)
link_directories(${TAPASCO_HOME}/arch/lib/${ARCH}/static ${TAPASCO_HOME}/platform/lib/${ARCH}/static) link_directories(${TAPASCO_HOME}/arch/lib/${ARCH} ${TAPASCO_HOME}/platform/lib/${ARCH})
include_directories(${TAPASCO_HOME}/arch/common/include ${TAPASCO_HOME}/platform/common/include ${FF_ROOT}) include_directories(${TAPASCO_HOME}/arch/common/include ${TAPASCO_HOME}/platform/common/include ${FF_ROOT})
...@@ -82,7 +82,8 @@ static int runTest(int const s) ...@@ -82,7 +82,8 @@ static int runTest(int const s)
assert(rarr != NULL); assert(rarr != NULL);
// get tapasco handle // get tapasco handle
tapasco_handle_t h = tapasco_device_alloc(dev, arr_szs[s] * sizeof(int), 0); tapasco_handle_t h;
tapasco_device_alloc(dev, &h, arr_szs[s] * sizeof(int), 0);
std::cout << s << ": handle = 0x" << std::hex << std::setfill('0') std::cout << s << ": handle = 0x" << std::hex << std::setfill('0')
<< std::setw(8) << static_cast<uint32_t>(h) << std::setw(8) << static_cast<uint32_t>(h)
<< ", size = " << arr_szs[s] * sizeof(int) << " bytes" << ", size = " << arr_szs[s] * sizeof(int) << " bytes"
...@@ -112,7 +113,7 @@ static int runTest(int const s) ...@@ -112,7 +113,7 @@ static int runTest(int const s)
merr += 1; merr += 1;
} }
__sync_add_and_fetch(&errs, merr); __sync_add_and_fetch(&errs, merr);
tapasco_device_free(dev, h); tapasco_device_free(dev, h, 0);
if (! merr) if (! merr)
std::cout << s << ": Array size " << arr_szs[s] << " (" std::cout << s << ": Array size " << arr_szs[s] << " ("
...@@ -167,7 +168,7 @@ int main(int argc, char **argv) ...@@ -167,7 +168,7 @@ int main(int argc, char **argv)
std::vector<ff_node *> f; std::vector<ff_node *> f;
for (int i = 0; i < sysconf(_SC_NPROCESSORS_CONF); ++i) for (int i = 0; i < sysconf(_SC_NPROCESSORS_CONF); ++i)
f.push_back(new Worker); f.push_back(new Worker);
Emitter e; Emitter e;
Collector c; Collector c;
ff_farm<> farm(f, &e, &c); ff_farm<> farm(f, &e, &c);
...@@ -176,7 +177,7 @@ int main(int argc, char **argv) ...@@ -176,7 +177,7 @@ int main(int argc, char **argv)
farm.cleanup_workers(); farm.cleanup_workers();
farm.run_and_wait_end(); farm.run_and_wait_end();
if (! errs) if (! errs)
std::cout << "SUCCESS!" << std::endl; std::cout << "SUCCESS!" << std::endl;
else else
std::cerr << "FAILURE" << std::endl; std::cerr << "FAILURE" << std::endl;
......
...@@ -75,7 +75,7 @@ static void *test_thread(void *p) ...@@ -75,7 +75,7 @@ static void *test_thread(void *p)
long int s; long int s;
while ((s = __atomic_sub_fetch(&runs, 1, __ATOMIC_SEQ_CST)) > 0) { while ((s = __atomic_sub_fetch(&runs, 1, __ATOMIC_SEQ_CST)) > 0) {
s = s % sc; s = s % sc;
//printf("%ld: Checking array size %zd (%zd byte) ...\n", //printf("%ld: Checking array size %zd (%zd byte) ...\n",
// s, arr_szs[s], arr_szs[s] * sizeof(int)); // s, arr_szs[s], arr_szs[s] * sizeof(int));
// allocate and fill array // allocate and fill array
int *arr = (int *)malloc(arr_szs[s] * sizeof(int)); int *arr = (int *)malloc(arr_szs[s] * sizeof(int));
...@@ -86,7 +86,8 @@ static void *test_thread(void *p) ...@@ -86,7 +86,8 @@ static void *test_thread(void *p)
assert(rarr != NULL); assert(rarr != NULL);
// get tapasco handle // get tapasco handle
tapasco_handle_t h = tapasco_device_alloc(dev, arr_szs[s] * sizeof(int), 0); tapasco_handle_t h;
tapasco_device_alloc(dev, &h, arr_szs[s] * sizeof(int), 0);
// printf("%ld: handle = 0x%08lx, size = %zd bytes\n", s, // printf("%ld: handle = 0x%08lx, size = %zd bytes\n", s,
// (unsigned long)h, arr_szs[s] * sizeof(int)); // (unsigned long)h, arr_szs[s] * sizeof(int));
assert((unsigned long)h > 0); assert((unsigned long)h > 0);
...@@ -113,7 +114,7 @@ static void *test_thread(void *p) ...@@ -113,7 +114,7 @@ static void *test_thread(void *p)
merr += 1; merr += 1;
} }
__atomic_add_fetch(&errs, merr, __ATOMIC_SEQ_CST); __atomic_add_fetch(&errs, merr, __ATOMIC_SEQ_CST);
tapasco_device_free(dev, h); tapasco_device_free(dev, h, 0);
if (! merr) if (! merr)
/*printf("%ld: Array size %zd (%zd byte) ok!\n", /*printf("%ld: Array size %zd (%zd byte) ok!\n",
...@@ -157,7 +158,7 @@ int main(int argc, char **argv) { ...@@ -157,7 +158,7 @@ int main(int argc, char **argv) {
pthread_join(thrds[s], NULL); pthread_join(thrds[s], NULL);
} }
if (! errs) if (! errs)
printf("\nSUCCESS\n"); printf("\nSUCCESS\n");
else else
fprintf(stderr, "\nFAILURE\n"); fprintf(stderr, "\nFAILURE\n");
......
...@@ -73,7 +73,7 @@ int main(int argc, char **argv) { ...@@ -73,7 +73,7 @@ int main(int argc, char **argv) {
check_fpga(tapasco_create_device(ctx, 0, &dev, 0)); check_fpga(tapasco_create_device(ctx, 0, &dev, 0));
for (int s = 0; s < sizeof(arr_szs) / sizeof(*arr_szs) && errs == 0; ++s) { for (int s = 0; s < sizeof(arr_szs) / sizeof(*arr_szs) && errs == 0; ++s) {
printf("Checking array size %zd (%zd byte) ...\n", printf("Checking array size %zd (%zd byte) ...\n",
arr_szs[s], arr_szs[s] * sizeof(int)); arr_szs[s], arr_szs[s] * sizeof(int));
// allocate and fill array // allocate and fill array
int *arr = (int *)malloc(arr_szs[s] * sizeof(int)); int *arr = (int *)malloc(arr_szs[s] * sizeof(int));
...@@ -83,7 +83,8 @@ int main(int argc, char **argv) { ...@@ -83,7 +83,8 @@ int main(int argc, char **argv) {
int *rarr = (int *)malloc(arr_szs[s] * sizeof(int)); int *rarr = (int *)malloc(arr_szs[s] * sizeof(int));
// get fpga handle // get fpga handle
tapasco_handle_t h = tapasco_device_alloc(dev, arr_szs[s] * sizeof(int), 0); tapasco_handle_t h;
tapasco_device_alloc(dev, &h, arr_szs[s] * sizeof(int), 0);
printf("handle = 0x%08lx\n", (unsigned long)h); printf("handle = 0x%08lx\n", (unsigned long)h);
check((unsigned long)h); check((unsigned long)h);
...@@ -92,7 +93,7 @@ int main(int argc, char **argv) { ...@@ -92,7 +93,7 @@ int main(int argc, char **argv) {
check_fpga(tapasco_device_copy_to(dev, arr, h, arr_szs[s] * sizeof(int), 0)); check_fpga(tapasco_device_copy_to(dev, arr, h, arr_szs[s] * sizeof(int), 0));
check_fpga(tapasco_device_copy_from(dev, h, rarr, arr_szs[s] * sizeof(int), 0)); check_fpga(tapasco_device_copy_from(dev, h, rarr, arr_szs[s] * sizeof(int), 0));
tapasco_device_free(dev, h); tapasco_device_free(dev, h, 0);
int merr = compare_arrays(arr, rarr, arr_szs[s]); int merr = compare_arrays(arr, rarr, arr_szs[s]);
errs =+ merr; errs =+ merr;
...@@ -108,7 +109,7 @@ int main(int argc, char **argv) { ...@@ -108,7 +109,7 @@ int main(int argc, char **argv) {
free(rarr); free(rarr);
} }
if (! errs) if (! errs)
printf("\nSUCCESS\n"); printf("\nSUCCESS\n");
else else
fprintf(stderr, "\nFAILURE\n"); fprintf(stderr, "\nFAILURE\n");
......
...@@ -72,15 +72,15 @@ void blue_dma_transmit_from_device(void * device_buffer, dma_addr_t host_handle, ...@@ -72,15 +72,15 @@ void blue_dma_transmit_from_device(void * device_buffer, dma_addr_t host_handle,
// fflink_warn("got killed while aquiring the mutex\n"); // fflink_warn("got killed while aquiring the mutex\n");
/* SA */ /* SA */
pcie_writel((unsigned long)device_buffer, device_base_addr + REG_FPGA_ADDR); pcie_writeq((unsigned long)device_buffer, device_base_addr + REG_FPGA_ADDR);
/* DA */ /* DA */
pcie_writel(host_handle, device_base_addr + REG_HOST_ADDR); pcie_writeq(host_handle, device_base_addr + REG_HOST_ADDR);
/* btt */ /* btt */
pcie_writel(btt, device_base_addr + REG_BTT); pcie_writeq(btt, device_base_addr + REG_BTT);
/* presvious data have to be written first */ /* presvious data have to be written first */
wmb(); wmb();
/* start cmd */ /* start cmd */
pcie_writel(CMD_READ, device_base_addr + REG_CMD); pcie_writeq(CMD_READ, device_base_addr + REG_CMD);
//mutex_unlock(&dma_regs_mutex); //mutex_unlock(&dma_regs_mutex);
} }
...@@ -100,15 +100,15 @@ void blue_dma_transmit_to_device(void * device_buffer, dma_addr_t host_handle, i ...@@ -100,15 +100,15 @@ void blue_dma_transmit_to_device(void * device_buffer, dma_addr_t host_handle, i
// fflink_warn("got killed while aquiring the mutex\n"); // fflink_warn("got killed while aquiring the mutex\n");
/* SA */ /* SA */
pcie_writel(host_handle, device_base_addr + REG_HOST_ADDR); pcie_writeq(host_handle, device_base_addr + REG_HOST_ADDR);
/* DA */ /* DA */
pcie_writel((unsigned long)device_buffer, device_base_addr + REG_FPGA_ADDR); pcie_writeq((unsigned long)device_buffer, device_base_addr + REG_FPGA_ADDR);
/* btt */ /* btt */
pcie_writel(btt, device_base_addr + REG_BTT); pcie_writeq(btt, device_base_addr + REG_BTT);
/* presvious data have to be written first */ /* presvious data have to be written first */
wmb(); wmb();
/* start cmd */ /* start cmd */
pcie_writel(CMD_WRITE, device_base_addr + REG_CMD); pcie_writeq(CMD_WRITE, device_base_addr + REG_CMD);
//mutex_unlock(&dma_regs_mutex); //mutex_unlock(&dma_regs_mutex);
} }
......
...@@ -111,26 +111,27 @@ static int user_close(struct inode *inode, struct file *filp) ...@@ -111,26 +111,27 @@ static int user_close(struct inode *inode, struct file *filp)
static ssize_t user_read(struct file *filp, char __user *buf, size_t count, loff_t *f_pos) static ssize_t user_read(struct file *filp, char __user *buf, size_t count, loff_t *f_pos)
{ {
struct user_rw_params params; struct user_rw_params params;
uint32_t i, err = 0, static_buffer[STATIC_BUFFER_SIZE], *copy_buffer; uint32_t i, err = 0;
uint32_t static_buffer[STATIC_BUFFER_SIZE], *copy_buffer;
bool use_dynamic = false; bool use_dynamic = false;
fflink_notice("Called for device minor %d\n", ((struct priv_data_struct *) filp->private_data)->minor); fflink_notice("Called for device minor %d\n", ((struct priv_data_struct *) filp->private_data)->minor);
copy_buffer = static_buffer; copy_buffer = static_buffer;
if(count != sizeof(struct user_rw_params)) { if (count != sizeof(struct user_rw_params)) {
fflink_warn("Wrong size to parse parameters accordingly %ld vs %ld\n", count, sizeof(struct user_rw_params)); fflink_warn("Wrong size to parse parameters accordingly %ld vs %ld\n", count, sizeof(struct user_rw_params));
return -EACCES;