Перейти к содержанию
    

WeDZmin

Новичок
  • Постов

    2
  • Зарегистрирован

  • Посещение

Репутация

0 Обычный
  1. Решение, вдруг кому понадобится. Что бы LUT не уходил на память добавляется прагма RESOURCE, но тогда скорее всего много LUT уйдет на интрефес к памяти, тогда еще добавляем прагму RESET off
  2. Всем привет. Работаю на win7_64bit, Vivado HLS 2016.2. Написал простейшее скользящее окно, по ресурсам все должно занимать 10BRAM, а остального по мелочи. но в результате синтеза и экспорта почему-то используется 8BRAM и множество LUT и FF. Пробовал уменьшать ширину данных (чуть чуть что бы расчетное число BRAM осталось тем же), пробовал уменьшать частоту, пробовал убрать требования к II, ничего не помогает. Может кто подсказать что в коде не правильно, может прагму какую-то пропустил? Не смог загрузить файл cpp #include "../test/test_debaeyer_core.hpp" void debaeyer_core(hls::stream<double_type_inp> &input, hls::stream<double_type_out> &output) { #pragma HLS INTERFACE ap_ctrl_none port=return #pragma HLS DATA_PACK variable=input struct_level #pragma HLS STREAM variable=input depth=1 dim=1 #pragma HLS INTERFACE axis depth=1 port=input #pragma HLS DATA_PACK variable=output struct_level #pragma HLS STREAM variable=output depth=1 dim=1 #pragma HLS INTERFACE axis depth=1 port=output static double_type_inp lines_buffer_cfa[height_cfa][width_img]; #pragma HLS ARRAY_PARTITION variable=lines_buffer_cfa complete dim=1 double_type_inp window_cfa[height_cfa][width_cfa]; #pragma HLS ARRAY_PARTITION variable=window_cfa complete dim=0 double_type_inp colam_lb_row_cfa[height_cfa]; #pragma HLS ARRAY_PARTITION variable=colam_lb_row_cfa complete dim=0 double_type_inp tmp_cfa; IMAGE_H:for (int row = 0; row < height_img; row++) { IMAGE_W:for (int col = 0; col < width_img; col++) { #pragma HLS PIPELINE II=1 input.read(tmp_cfa); SHIFT_W_H:for (int i = 0; i < height_cfa; i++) { #pragma HLS UNROLL SHIFT_W_W:for (int j = 0; j < width_cfa-1; j++) { #pragma HLS UNROLL window_cfa[i][j] = window_cfa[i][j+1]; } } SHIFT_LB:for (int i = 0; i < height_cfa-1; i++) { #pragma HLS UNROLL lines_buffer_cfa[i][col] = lines_buffer_cfa[i+1][col]; } lines_buffer_cfa[height_cfa - 1][col] = tmp_cfa; WRITE_W:for (int i = 0; i < height_cfa; i++) { #pragma HLS UNROLL window_cfa[i][width_cfa-1] = lines_buffer_cfa[i][col]; } if ((row < rows_cfa_ckip) || (col < cols_cfa_ckip)) continue; double_type_out rgb_out; rgb_out.r1 = window_cfa[0][0].pixel1; rgb_out.r2 = window_cfa[0][0].pixel2; rgb_out.g1 = window_cfa[2][1].pixel1; rgb_out.g2 = window_cfa[2][1].pixel2; rgb_out.b1 = window_cfa[4][2].pixel1; rgb_out.b2 = window_cfa[4][2].pixel2; output.write(rgb_out); } } }; hpp #include "hls_video.h" #include "ap_int.h" #include "hls_stream.h" #include "ap_axi_sdata.h" const int width_img = 1024;//1032;//256;// const int height_img = 1552;//768;// const int width_cfa = 3;//double cfa const int height_cfa = 5; const int rows_cfa_ckip = height_cfa - 1; const int cols_cfa_ckip = width_cfa - 1; const int wi = 18; typedef ap_uint<wi> type_inp; typedef struct { type_inp pixel1; type_inp pixel2; }double_type_inp; typedef struct { type_G r1; type_G r2; type_G g1; type_G g2; type_G b1; type_G b2; } double_type_out; void debaeyer_core(hls::stream<double_type_inp> &input, hls::stream<double_type_out> &output);
×
×
  • Создать...