6. Save the data into a file - 2024.1 English

Vitis Tutorials: Vitis Platform Creation

Document ID
XD101
Release Date
2024-05-30
Version
2024.1 English

This can be added right after the piece of result verification that already exists.

OLD

int match = 0;
for (int i = 0; i < DATA_SIZE; i++) {
    int host_result = ptr_a[i] + ptr_b[i];
    if (ptr_result[i] != host_result) {
        printf(error_message.c_str(), i, host_result, ptr_result[i]);
        match = 1;
        break;
    }
}

NEW

int match = 0;
 for (int i = 0; i < DATA_SIZE; i++) {
     int host_result = ptr_a[i] + ptr_b[i];
     if (ptr_result[i] != host_result) {
         printf(error_message.c_str(), i, host_result, ptr_result[i]);
         match = 1;
         break;
     }
 }

 FILE *fp_dout;
 fp_dout=fopen("wave_out.txt","w");

 for (int i = 0; i < 1024; i++) {
   fprintf(fp_dout,"%d\n",ptr_waveout[i]<<17);
 }

 fclose(fp_dout);