Просмотр исходного кода

Тесты конвертера

Anatoliy Chigirinskiy 11 месяцев назад
Родитель
Сommit
5575da1ae9
2 измененных файлов с 84 добавлено и 3 удалено
  1. 73 0
      .gitignore
  2. 11 3
      main.c

+ 73 - 0
.gitignore

@@ -5,3 +5,76 @@ build/
 
 /cmake-build-debug-remote-host/.cmake/api/v1/reply/cmakeFiles-v1-6b5a041faa2b8215aaca.json
 /cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-11-15T02-52-29-0308.json
+/.idea/codeStyles/codeStyleConfig.xml
+/.idea/editor.xml
+/.vscode/c_cpp_properties.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/codemodel-v2-a433c6f9c6607e0e9b0a.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-11-18T03-21-28-0948.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-11-19T07-22-45-0176.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-11-19T10-05-18-0150.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-11-20T03-41-18-0758.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-11-20T04-52-31-0668.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-11-20T04-54-14-0896.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-11-20T10-10-36-0956.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-11-20T10-14-42-0835.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-11-21T08-42-39-0459.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-11-21T10-42-48-0256.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-11-25T02-57-54-0375.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-11-26T04-53-22-0357.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-11-29T03-59-44-0772.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-11-29T04-57-50-0631.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-11-29T05-31-33-0163.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-11-29T10-19-01-0279.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-11-29T11-03-50-0530.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-02T05-50-16-0076.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-02T07-41-15-0217.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-12T10-51-42-0174.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-12T11-16-25-0689.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-12T11-27-25-0719.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-13T09-06-36-0958.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-13T09-31-56-0499.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-13T09-58-44-0000.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-13T10-28-58-0977.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-13T10-46-42-0517.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-16T04-13-15-0156.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-16T04-39-15-0414.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-16T07-45-33-0901.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-16T08-01-48-0704.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-16T08-22-47-0896.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-17T08-44-26-0242.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-17T09-20-54-0991.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-17T09-54-27-0966.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-17T10-16-58-0185.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-17T10-22-46-0995.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-17T10-56-46-0590.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-17T11-29-17-0270.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-18T03-03-32-0648.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-18T03-35-27-0448.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-18T03-52-29-0238.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-18T04-22-37-0069.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-18T04-48-28-0473.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-18T05-54-59-0770.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-18T06-12-37-0740.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-18T08-18-43-0253.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-18T08-59-25-0691.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-19T04-33-43-0231.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-19T05-04-26-0539.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-19T05-24-33-0875.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-19T05-59-55-0076.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-19T06-20-13-0376.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-19T07-38-47-0709.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-19T07-57-27-0930.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-19T08-29-37-0695.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-19T09-07-24-0697.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-19T09-22-43-0978.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-20T03-23-19-0766.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-20T03-37-26-0553.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-23T07-47-28-0631.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-23T07-51-18-0268.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-23T08-30-50-0054.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-23T08-36-51-0749.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-24T03-35-23-0169.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-26T10-18-39-0829.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-26T10-51-07-0915.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/index-2024-12-26T11-06-15-0172.json
+/cmake-build-debug-remote-host/.cmake/api/v1/reply/target-TMSG44_CoolPi-Debug-0be072451eb933393393.json

+ 11 - 3
main.c

@@ -27,7 +27,7 @@
 
 #define REQUESTED_MEMORY_SIZE  		0x1000
 #define REQUESTED_MEMORY_SIZE_DMA	0x10000
-#define BUFF_SIZE			   		2048
+#define BUFF_SIZE			   		160
 #define STREAM_SIZE                                     (STREAM_WORDS<<3)
 /* 64'hdeadbeefdeadbeef */
 #define TAIL_MAGIC                              0xdeadbeefdeadbeef
@@ -188,11 +188,16 @@ int main(int argc, char *argv[])
       /* Iterate over the addresses */
         for (int i = 0; i < 5; i++) {
             user_buffer[0] = HEAD_MAGIC;
-            user_buffer[1] = (0 << INCR_POS) | ((uint32_t) (BUFF_SIZE - (4 << 3)) << SIZE_POS);
+            user_buffer[1] = (0 << INCR_POS) | ((uint32_t) ((BUFF_SIZE - (4 << 3)) >> 1) << SIZE_POS);
             user_buffer[2] = addr_buffer[i];
-            for (int j = 3; j < (BUFF_SIZE >> 3) - 1; j++) {
+            for (int j = 3; j < 11; j++) {
                 user_buffer[j] = j;
             }
+            user_buffer[11] = (0 << INCR_POS) | ( 52 << SIZE_POS);
+            user_buffer[12] = addr_buffer[i];
+                for (int j = 13; j < (BUFF_SIZE >> 3) - 1; j++) {
+                        user_buffer[j] = j;
+                }
             /* tail magic */
             user_buffer[(BUFF_SIZE >> 3) - 1 ] = TAIL_MAGIC;
             /* show the buffer */
@@ -203,6 +208,9 @@ int main(int argc, char *argv[])
             rc = write_to_buffer(filename_dma, dma_fd, (void *) user_buffer, BUFF_SIZE, 0);
             if (rc < 0) {
               fprintf(stderr, "write_to_buffer failed\n");
+              free(user_buffer);
+              free(user_buffer_read);
+              free(addr_buffer);
               return 1;
             }