26 #ifndef _ROLE_MEMTEST_PATTERN_LIBRARY_HPP_
27 #define _ROLE_MEMTEST_PATTERN_LIBRARY_HPP_
31 #include <hls_stream.h>
34 #include "../../../../../HOST/custom/memtest/languages/cplusplus/include/config.h"
41 #define LOCAL_MEM_WORD_SIZE 512
42 #define LOCAL_MEM_ADDR_SIZE 40
46 #define LOCAL_MEM_ADDR_SIZE_NON_BYTE_ADDRESSABLE 40
48 #define LOCAL_MEM_ADDR_OFFSET (LOCAL_MEM_WORD_SIZE/8)
49 #define LOCAL_MEM_WORD_BYTE_SIZE (LOCAL_MEM_WORD_SIZE/8)
58 template<
typename Tin,
typename Tout>
61 return static_cast<Tout
>(curr + prev);
64 template<
typename ADDR_T,
unsigned int sequenceDim,
typename BIGWORD_T,
typename SMALLWORD_T,
unsigned int smallWordDim>
71 SMALLWORD_T currentFibonacciNumber =
static_cast<SMALLWORD_T
>(curr);
72 SMALLWORD_T prevFibonacciNumber = currentFibonacciNumber + 1;
73 SMALLWORD_T nextFibonacciNumber = genNextFibonacciNumber<ADDR_T,SMALLWORD_T>(currentFibonacciNumber,prevFibonacciNumber);
75 gen_sequence_loop:
for (
unsigned int i = 0; i < sequenceDim; i++)
78 (*outBigWord).range(smallWordDim*(i+1)-1,smallWordDim*i)=nextFibonacciNumber;
79 prevFibonacciNumber=currentFibonacciNumber;
80 currentFibonacciNumber=nextFibonacciNumber;
81 nextFibonacciNumber=genNextFibonacciNumber<ADDR_T,SMALLWORD_T>(currentFibonacciNumber,prevFibonacciNumber);
88 template<
typename ADDR_T,
unsigned int sequenceDim,
typename BIGWORD_T,
typename SMALLWORD_T,
unsigned int smallWordDim>
90 #pragma HLS INLINE off
95 SMALLWORD_T currentNumber =
static_cast<SMALLWORD_T
>(curr);
96 SMALLWORD_T nextNumber = (currentNumber+1) xor 1;
97 SMALLWORD_T prevNumber = currentNumber;
99 gen_sequence_loop:
for (
unsigned int i = 0; i < sequenceDim; i++)
102 (*outBigWord).range(smallWordDim*(i+1)-1,smallWordDim*i)=nextNumber;
103 prevNumber = currentNumber;
104 currentNumber = nextNumber;
105 nextNumber = (nextNumber + 1 ) xor i;
110 template<
typename ADDR_T,
unsigned int sequenceDim,
typename BIGWORD_T,
typename SMALLWORD_T,
unsigned int smallWordDim>
115 SMALLWORD_T currentNumber =
static_cast<SMALLWORD_T
>(curr);
116 SMALLWORD_T nextNumber = (currentNumber+1) xor 1;
117 SMALLWORD_T prevNumber = currentNumber;
119 gen_sequence_loop:
for (
unsigned int i = 0; i < sequenceDim; i++)
122 (*outBigWord).range(smallWordDim*(i+1)-1,smallWordDim*i)=nextNumber;
123 prevNumber = currentNumber;
124 currentNumber = nextNumber;
125 nextNumber = (nextNumber + 1 ) xor i;
129 template<
typename ADDR_T,
typename BIGWORD_T>
132 BIGWORD_T currentNumber =
static_cast<BIGWORD_T
>(curr);
133 BIGWORD_T nextNumber = (currentNumber+1) xor 1;
134 *outBigWord=nextNumber;
138 template<
typename ADDR_T,
typename BIGWORD_T>
141 *outBigWord = curr+1;
163 template<const
unsigned int max_iterations=4000000, const
unsigned int buff_dim = 16>
165 hls::stream<local_mem_word_t>& sOutGeneratedData,
166 ap_uint<32> * testCounter,
169 #pragma HLS INLINE off
171 #pragma HLS array_partition variable=tmp_out cyclic factor=2 dim=1
175 for (; curr_address_ut < max_addr_ut; )
177 #pragma HLS PIPELINE II=1
178 #pragma HLS LOOP_TRIPCOUNT min = 1 max = max_iterations
180 if (!sOutGeneratedData.full())
194 #ifdef FAULT_INJECTION
196 if(*testCounter >= 2 && curr_address_ut > 0){
197 tmp_out_scalar = tmp_out[curr_address_ut%buff_dim] &
static_cast<local_mem_word_t>(0);
199 tmp_out_scalar = tmp_out[curr_address_ut%buff_dim];
202 tmp_out_scalar = tmp_out[curr_address_ut%buff_dim];
205 sOutGeneratedData.write(tmp_out_scalar);
226 template <
typename Tcntr,
const unsigned int max_iterations=4000000,
227 const unsigned int buff_dim=64*2>
229 hls::stream<Tcntr>& sOutCmd,
230 hls::stream<local_mem_word_t>& sInGeneratedData,
233 unsigned int burst_size)
235 #pragma HLS INLINE off
239 static unsigned int end_distance=0;
240 static bool last_iteration =
false;
241 static bool activated_cntr =
false;
242 #pragma HLS array_partition variable=tmp_out block factor=2 dim=1
245 int ptrs_difference=0;
246 unsigned int last_words=max_addr_ut;
247 unsigned int maximum_usable_fifo_words=buff_dim-buff_dim%burst_size;
249 for (curr_address_ut = 0, idx=0, curr_writing_addr=0, written_i=0; curr_address_ut < max_addr_ut; curr_address_ut++)
251 #pragma HLS PIPELINE II=1
252 #pragma HLS LOOP_TRIPCOUNT min = 1 max = max_iterations
253 if (!sInGeneratedData.empty())
255 tmp_out[idx] = sInGeneratedData.read();
256 #if DEBUG_LEVEL == TRACE_ALL
257 #ifndef __SYNTHESIS__
258 std::cout << tmp_out[idx] << std::endl;
262 end_distance = max_addr_ut-curr_address_ut;
263 last_iteration = 1>=end_distance;
264 #if DEBUG_LEVEL == TRACE_ALL
265 #ifndef __SYNTHESIS__
266 std::cout <<
"test addr " << idx <<
" current address " << curr_address_ut <<
" max addr " << max_addr_ut << std::endl;
267 std::cout <<
"ptrs_difference " << ptrs_difference <<
" last_iteration " << last_iteration <<std::endl;
271 if ((ptrs_difference>0 && ptrs_difference>=burst_size-1) || (last_iteration))
273 #if DEBUG_LEVEL == TRACE_ALL
274 #ifndef __SYNTHESIS__
275 std::cout <<
"Burst filled or last iteration, end distance will be= " << end_distance << std::endl;
280 #if DEBUG_LEVEL == TRACE_ALL
281 #ifndef __SYNTHESIS__
282 std::cout <<
"BURST transferring " << burst_size <<
" words at " << curr_writing_addr <<
" address, from " << written_i << std::endl;
287 activated_cntr =
true;
291 memcpy(lcl_mem+curr_writing_addr, tmp_out+written_i,
sizeof(
local_mem_word_t)*burst_size);
293 curr_writing_addr+=burst_size;
294 written_i= (written_i+burst_size)%maximum_usable_fifo_words;
295 ptrs_difference-=burst_size;
296 last_words=end_distance;
298 #if DEBUG_LEVEL == TRACE_ALL
300 std::cout <<
"LAST transferring " << last_words <<
" words at " << curr_writing_addr <<
" address, from " << written_i << std::endl;
305 activated_cntr =
true;
309 memcpy(lcl_mem+curr_writing_addr, tmp_out+written_i,
sizeof(
local_mem_word_t)*(last_words));
311 curr_writing_addr+=(last_words);
312 written_i=(written_i+last_words)%maximum_usable_fifo_words;
313 ptrs_difference-=last_words;
316 if(idx==maximum_usable_fifo_words-1){
328 last_iteration =
false;
342 template <
typename Tcntr, const
unsigned int max_iterations=4000000,const
unsigned int buff_dim=64*2>
344 hls::stream<Tcntr>& sOutCmd,
347 unsigned int burst_size)
353 for (curr_address_ut = 0; curr_address_ut < max_addr_ut; curr_address_ut++)
355 #pragma HLS PIPELINE II=1
356 #pragma HLS LOOP_TRIPCOUNT min = 1 max = max_iterations
357 #if DEBUG_LEVEL == TRACE_ALL
358 #ifndef __SYNTHESIS__
359 printf(
"Writing address %s with max %s\n",curr_address_ut.to_string().c_str(), max_addr_ut.to_string().c_str());
362 lcl_mem[curr_address_ut]=curr_address_ut+1;
389 template <
typename Tcntr, const
unsigned int max_iterations=4000000,const
unsigned int buff_dim=64*2>
391 hls::stream<Tcntr>& sOutCmd,
394 unsigned int burst_size ,
395 ap_uint<32> * faulty_addresses_cntr,
402 for (curr_address_ut = 0; curr_address_ut < max_addr_ut; curr_address_ut++){
403 #pragma HLS PIPELINE II=1
404 #pragma HLS LOOP_TRIPCOUNT min = 1 max = max_iterations
405 #if DEBUG_LEVEL == TRACE_ALL
406 #ifndef __SYNTHESIS__
407 printf(
"Tst=%s vs gld=%s\n",lcl_mem[curr_address_ut].to_string().c_str(),(curr_address_ut+1).to_string().c_str());
411 faults += (lcl_mem[curr_address_ut]!=(curr_address_ut+1)) ? 1 : 0;
415 *faulty_addresses_cntr = faults;
416 *first_faulty_address = 0;
432 template <
typename Tcntr,
const unsigned int max_iterations=4000000,
433 const unsigned int buff_dim=64*2>
435 hls::stream<Tcntr>& sOutCmd,
436 hls::stream<local_mem_word_t>& sOutReadData,
439 unsigned int burst_size)
441 #pragma HLS INLINE off
442 #pragma HLS interface ap_ctrl_none port=return
446 #pragma HLS array_partition variable=tmp_out cyclic factor=2 dim=1
449 static unsigned int end_distance=0;
450 static bool transfer_less_than_burst =
false;
451 static bool activated_cntr =
false;
452 static bool can_read_data =
false;
454 read_data_from_main_mem:
455 int reading_mm_i = 0;
456 int consumed_fifo_i = 0;
458 for (curr_address_ut = 0, curr_reading_addr=0; curr_address_ut < max_addr_ut; )
460 #pragma HLS PIPELINE II=1
461 #pragma HLS LOOP_TRIPCOUNT min = 1 max = max_iterations
462 if (!sOutReadData.full())
464 end_distance = max_addr_ut-curr_reading_addr;
465 transfer_less_than_burst = burst_size>end_distance;
467 can_read_data=(end_distance > 0) ;
468 #if DEBUG_LEVEL == TRACE_ALL
469 #ifndef __SYNTHESIS__
470 std::cout <<
"Max " << max_addr_ut <<
" reading at " << curr_reading_addr <<
" reading fifo at " << reading_mm_i <<
" consumed at " << consumed_fifo_i << std::endl;
471 std::cout <<
"End dst " << end_distance <<
" is last? " << transfer_less_than_burst << std::endl;
472 std::cout <<
"curr_address_ut " << curr_address_ut << std::endl;
477 if (!transfer_less_than_burst)
481 activated_cntr =
true;
484 sOutReadData, burst_size, sOutCmd);
488 sOutReadData, burst_size, sOutCmd);
490 #if DEBUG_LEVEL == TRACE_ALL
491 #ifndef __SYNTHESIS__
492 std::cout <<
"BURST reading " << burst_size <<
" words from " << curr_reading_addr <<
" address, to " << reading_mm_i << std::endl;
495 curr_reading_addr+=burst_size;
496 reading_mm_i=(reading_mm_i+burst_size)%buff_dim;
499 missing_words= end_distance%burst_size;
501 activated_cntr =
true;
504 sOutReadData, missing_words, sOutCmd);
508 sOutReadData, missing_words, sOutCmd);
510 #if DEBUG_LEVEL == TRACE_ALL
511 #ifndef __SYNTHESIS__
512 std::cout <<
"LAST reading " << missing_words <<
" words from " << curr_reading_addr <<
" address, to " << reading_mm_i << std::endl;
515 curr_reading_addr+=missing_words;
516 reading_mm_i=(reading_mm_i+missing_words)%buff_dim;
527 #if DEBUG_LEVEL == TRACE_ALL
528 #ifndef __SYNTHESIS__
529 std::cout <<std::endl;
537 transfer_less_than_burst =
false;
538 activated_cntr=
false;
553 template<const
unsigned int max_iterations=4000000>
555 hls::stream<local_mem_word_t>& sInReadData,
557 hls::stream<local_mem_word_t>& sOutReadData,
558 hls::stream<local_mem_word_t>& sOutGoldData)
560 #pragma HLS interface ap_ctrl_none port=return
566 for (; curr_address_ut < max_addr_ut; )
568 #pragma HLS PIPELINE II=1
569 #pragma HLS LOOP_TRIPCOUNT min = 1 max = max_iterations
570 if (!sInReadData.empty() && !sOutReadData.full() && !sOutGoldData.full())
572 testingVector = sInReadData.read();
580 sOutReadData.write(testingVector);
581 sOutGoldData.write(goldenVector);
600 template<const
unsigned int max_iterations=4000000, const
unsigned int buff_dim=16>
603 hls::stream<local_mem_word_t>& sInReadData,
604 hls::stream<local_mem_word_t>& sInGoldData,
605 ap_uint<32> * faulty_addresses_cntr,
608 #pragma HLS INLINE off
609 #pragma HLS interface ap_ctrl_none port=return
614 static bool cmp_ok [buff_dim];
615 static ap_uint<32> faulty_addresses_cntr_support_array [buff_dim];
617 static bool first_fault_found =
false;
618 static ap_uint<32> faulty_addresses_cntr_local;
621 for (curr_address_ut = 0, faulty_addresses_cntr_local=0; curr_address_ut < max_addr_ut; curr_address_ut++)
624 #pragma HLS LOOP_TRIPCOUNT min = 1 max = max_iterations
625 #pragma HLS dependence variable=faulty_addresses_cntr_support_array inter RAW distance=buff_dim true
627 if (!sInReadData.empty() && !sInGoldData.empty())
629 testingVector[maddr_non_byte%buff_dim] = sInReadData.read();
630 goldenVector[maddr_non_byte%buff_dim] = sInGoldData.read();
632 int idx=maddr_non_byte%buff_dim;
633 #if DEBUG_LEVEL == TRACE_ALL
634 #ifndef __SYNTHESIS__
635 std::cout << maddr_non_byte <<
" tst=" << testingVector[idx] <<
" vs gld=" << goldenVector[idx] << std::endl;
638 bool cmp_results = testingVector[idx] == goldenVector[idx];
639 cmp_ok[idx]=cmp_results;
641 faulty_addresses_cntr_support_array[idx]++;
642 if (!first_fault_found)
644 *first_faulty_address=curr_address_ut*64;
645 first_fault_found =
true;
647 first_fault_found = first_fault_found;
658 for (
int i = 0; i < buff_dim; i++)
661 faulty_addresses_cntr_local += faulty_addresses_cntr_support_array[i];
662 faulty_addresses_cntr_support_array[i]=0;
665 first_fault_found=
false;
666 *faulty_addresses_cntr=faulty_addresses_cntr_local;
686 template<
const unsigned int max_iterations=4000000,
const unsigned int unrolling_factor=
LOCAL_MEM_ADDR_OFFSET,
687 const unsigned int buff_dim=16>
690 hls::stream<local_mem_word_t>& sInReadData,
691 hls::stream<local_mem_word_t>& sInGoldData,
692 ap_uint<32> * faulty_addresses_cntr,
706 static ap_uint<8> testingVector_bytes [support_dim];
707 static ap_uint<8> goldenVector_bytes [support_dim];
708 static bool cmp_ok [support_dim];
709 static ap_uint<32> faulty_addresses_cntr_support_array [support_dim];
711 #pragma HLS array_partition variable=faulty_addresses_cntr_support_array cyclic factor=2 dim=1
712 #pragma HLS array_partition variable=testingVector_bytes cyclic factor=2 dim=1
713 #pragma HLS array_partition variable=goldenVector_bytes cyclic factor=2 dim=1
714 #pragma HLS array_partition variable=cmp_ok cyclic factor=2 dim=1
716 static bool first_fault_found =
false;
717 static ap_uint<32> faulty_addresses_cntr_local;
721 for (curr_address_ut = 0, k=0, faulty_addresses_cntr_local=0; curr_address_ut < max_addr_ut; k++, curr_address_ut++)
724 #pragma HLS LOOP_TRIPCOUNT min = 1 max = max_iterations
725 if (!sInReadData.empty() && !sInGoldData.empty())
727 testingVector[maddr_non_byte%buff_dim] = sInReadData.read();
728 goldenVector[maddr_non_byte%buff_dim] = sInGoldData.read();
733 testingVector_bytes[idx]=testingVector[maddr_non_byte%buff_dim].range((i+1)*8-1,i*8);
734 goldenVector_bytes[idx]=goldenVector[maddr_non_byte%buff_dim].range((i+1)*8-1,i*8);
735 #if DEBUG_LEVEL == TRACE_ALL
736 #ifndef __SYNTHESIS__
737 std::cout <<
" tst=" << testingVector_bytes[idx] <<
" vs gld=" << goldenVector_bytes[idx] ;
741 cmp_ok[idx] = testingVector_bytes[idx] == goldenVector_bytes[idx];
743 faulty_addresses_cntr_support_array[i+k]++;
744 if (!first_fault_found)
746 *first_faulty_address=i+curr_address_ut*64;
747 first_fault_found =
true;
749 first_fault_found = first_fault_found;
753 #if DEBUG_LEVEL == TRACE_ALL
754 #ifndef __SYNTHESIS__
755 std::cout << std::endl;
766 flt_cntr_loop:
for (
int i = 0; i < support_dim; i++)
769 faulty_addresses_cntr_local += faulty_addresses_cntr_support_array[i];
770 faulty_addresses_cntr_support_array[i]=0;
773 first_fault_found=
false;
774 *faulty_addresses_cntr=faulty_addresses_cntr_local;
793 template <
typename Tcntr,
const unsigned int max_iterations=4000000,
794 const unsigned int buff_dim=64*2>
796 hls::stream<Tcntr>& sOutCmd,
797 hls::stream<local_mem_word_t>& sOutreadData,
800 unsigned int burst_size)
802 #pragma HLS INLINE off
807 #pragma HLS array_partition variable=tmp_out cyclic factor=2 dim=1
811 read_data_from_main_mem:
812 for (i = 0, curr_address_ut = 0, curr_reading_addr=0, reading_i=0; curr_address_ut < max_addr_ut; )
814 #pragma HLS PIPELINE II=1
815 #pragma HLS LOOP_TRIPCOUNT min = 1 max = max_iterations
816 if (!sOutreadData.full())
819 memcpy(tmp_out+reading_i, lcl_mem+curr_address_ut,
sizeof(
local_mem_word_t));
820 if(reading_i > curr_reading_addr+1){
821 sOutreadData.write(tmp_out[curr_reading_addr]);
822 #if DEBUG_LEVEL == TRACE_ALL
823 #ifndef __SYNTHESIS__
824 std::cout <<
" writing a memory word " << curr_reading_addr <<
" I have to reach " << i << std::endl;
830 #if DEBUG_LEVEL == TRACE_ALL
831 #ifndef __SYNTHESIS__
832 std::cout <<
"read the " << reading_i <<
" memory word, outputreading at " << curr_reading_addr <<
" i at " << i << std::endl;
836 if(reading_i==buff_dim-1){
848 reading_i=i%buff_dim;
849 sent_out_remaining_buff:
850 for (
int j = 0; j < buff_dim; j++)
852 #pragma HLS LOOP_TRIPCOUNT min = 1 max = buff_dim
853 #pragma HLS PIPELINE II=1
854 if (!sOutreadData.full())
856 if(j==curr_reading_addr && i >= curr_reading_addr){
857 #if DEBUG_LEVEL == TRACE_ALL
858 #ifndef __SYNTHESIS__
859 std::cout <<
" writing a memory word " << curr_reading_addr <<
" I have to reach " << i << std::endl;
862 sOutreadData.write(tmp_out[curr_reading_addr]);
890 template <
typename Tcntr,
const unsigned int max_iterations=4000000,
891 const unsigned int buff_dim=64*2>
893 hls::stream<Tcntr>& sOutCmd,
894 hls::stream<local_mem_word_t>& sOutreadData,
897 unsigned int burst_size)
899 #pragma HLS INLINE off
903 #pragma HLS array_partition variable=tmp_out cyclic factor=2 dim=1
906 static unsigned int end_distance=0;
907 static int ptrs_distance=0;
908 static int ptrs_distance_opposite=0;
909 static bool transfer_less_than_burst =
false;
910 static bool activated_cntr =
false;
911 static bool can_read_data =
false;
913 read_data_from_main_mem:
914 int reading_mm_i = 0;
915 int consumed_fifo_i = 0;
917 unsigned int total_consumed_words=0;
918 unsigned int total_readfrom_mm_words=0;
919 bool fifo_is_not_full=
false;
920 for (curr_address_ut = 0, curr_reading_addr=0; curr_address_ut < max_addr_ut; )
922 #pragma HLS PIPELINE II=1
923 #pragma HLS LOOP_TRIPCOUNT min = 1 max = max_iterations
924 if (!sOutreadData.full())
927 end_distance = max_addr_ut-curr_reading_addr;
928 ptrs_distance = total_readfrom_mm_words - total_consumed_words;
929 ptrs_distance_opposite = total_consumed_words - total_readfrom_mm_words;
930 transfer_less_than_burst = burst_size>end_distance;
931 fifo_is_not_full = ptrs_distance <= burst_size;
933 can_read_data=(end_distance > 0) && (fifo_is_not_full || (ptrs_distance<=end_distance && transfer_less_than_burst));
934 #if DEBUG_LEVEL == TRACE_ALL
935 #ifndef __SYNTHESIS__
936 std::cout <<
"Max " << max_addr_ut <<
" reading at " << curr_reading_addr <<
" reading fifo at " << reading_mm_i <<
" consumed at " << consumed_fifo_i << std::endl;
937 std::cout <<
"End dst " << end_distance <<
" ptrs dst " << ptrs_distance <<
" is last? " << transfer_less_than_burst << std::endl;
938 std::cout <<
"curr_address_ut " << curr_address_ut << std::endl;
943 if (!transfer_less_than_burst)
948 activated_cntr =
true;
952 #if DEBUG_LEVEL == TRACE_ALL
953 #ifndef __SYNTHESIS__
954 std::cout <<
"BURST reading " << burst_size <<
" words from " << curr_reading_addr <<
" address, to " << reading_mm_i << std::endl;
957 memcpy(tmp_out+reading_mm_i, lcl_mem+curr_reading_addr,
sizeof(
local_mem_word_t)*burst_size);
959 std::cout <<
"before " << curr_reading_addr;
960 curr_reading_addr+=burst_size;
961 std::cout <<
" afterwards " << curr_reading_addr << std::endl;
962 total_readfrom_mm_words+=burst_size;
963 reading_mm_i=(reading_mm_i+burst_size)%buff_dim;
966 missing_words= end_distance%burst_size;
967 std::cout <<
"before of before 1" << curr_reading_addr << std::endl;
970 activated_cntr =
true;
974 #if DEBUG_LEVEL == TRACE_ALL
975 #ifndef __SYNTHESIS__
976 std::cout <<
"LAST reading " << missing_words <<
" words from " << curr_reading_addr <<
" address, to " << reading_mm_i << std::endl;
979 total_readfrom_mm_words+=missing_words;
980 std::cout <<
"before of before 3" << curr_reading_addr << std::endl;
981 memcpy(tmp_out+reading_mm_i, lcl_mem+curr_reading_addr,
sizeof(
local_mem_word_t)*(end_distance%burst_size));
984 std::cout <<
"before " << curr_reading_addr;
985 curr_reading_addr+=missing_words;
986 std::cout <<
" afterwards " << curr_reading_addr << std::endl;
987 reading_mm_i=(reading_mm_i+missing_words)%buff_dim;
991 if(ptrs_distance > 0 || can_read_data){
992 sOutreadData.write(tmp_out[consumed_fifo_i]);
993 #if DEBUG_LEVEL == TRACE_ALL
994 #ifndef __SYNTHESIS__
995 std::cout <<
" consumin a read memory word " << consumed_fifo_i <<
" I have to reach " << reading_mm_i << std::endl;
996 std::cout <<
" The readmemoryword is " << tmp_out[consumed_fifo_i] << std::endl;
1000 if(consumed_fifo_i==buff_dim-1){
1005 total_consumed_words++;
1014 #if DEBUG_LEVEL == TRACE_ALL
1015 #ifndef __SYNTHESIS__
1016 std::cout <<std::endl;
1024 transfer_less_than_burst =
false;
1025 activated_cntr=
false;
1026 can_read_data=
false;
void genFibonacciNumbers(ADDR_T curr, BIGWORD_T *outBigWord)
ap_uint< 40 > local_mem_addr_t
void pRDMainMemoryRead2StreamData(hls::stream< Tcntr > &sOutCmd, hls::stream< local_mem_word_t > &sOutreadData, membus_t *lcl_mem, local_mem_addr_t max_addr_ut, unsigned int burst_size)
Read a single word of data and output on a stream and count the cc needed just 4 transfer NOT USED.
void genXoredSequentialNumbersSecondVersion(ADDR_T curr, BIGWORD_T *outBigWord)
ap_uint< 40 > local_mem_addr_non_byteaddressable_t
void genXoredSequentialNumbers(ADDR_T curr, BIGWORD_T *outBigWord)
void pReadSimplerTestMemTest(hls::stream< Tcntr > &sOutCmd, membus_t *lcl_mem, local_mem_addr_t max_addr_ut, unsigned int burst_size, ap_uint< 32 > *faulty_addresses_cntr, local_mem_addr_t *first_faulty_address)
Simple version of a read memtest that read up to a given maximum address No control on the burst size...
void pWRStream2WriteMainMemory(hls::stream< Tcntr > &sOutCmd, hls::stream< local_mem_word_t > &sInGeneratedData, membus_t *lcl_mem, local_mem_addr_t max_addr_ut, unsigned int burst_size)
A function that read a stream of data and write them in a run-time variable burst-size.
void pRDRead2StreamDataVariableBurstNoMemCpy(hls::stream< Tcntr > &sOutCmd, hls::stream< local_mem_word_t > &sOutReadData, membus_t *lcl_mem, local_mem_addr_t max_addr_ut, unsigned int burst_size)
Read a variable burst_size amount of data and output on a stream and count the cc needed just 4 trans...
void pReadAxiMemMapped2HlsStreamCountFirst(Tin *main_mem, hls::stream< Tout > &sOut, unsigned int elems, hls::stream< Tcntr > &cmd)
Copy a run-time variable amount of data to an hls stream with a given max it assumes also the initial...
#define LOCAL_MEM_ADDR_OFFSET
void genSequentialNumbers(ADDR_T curr, BIGWORD_T *outBigWord)
void pRDRead2StreamDataVariableBurst(hls::stream< Tcntr > &sOutCmd, hls::stream< local_mem_word_t > &sOutreadData, membus_t *lcl_mem, local_mem_addr_t max_addr_ut, unsigned int burst_size)
Read a variable burst_size amount of data and output on a stream and count the cc needed just 4 trans...
Tout genNextFibonacciNumber(Tin curr, Tin prev)
void pRDReadDataStreamAndProduceGold(hls::stream< local_mem_word_t > &sInReadData, local_mem_addr_t max_addr_ut, hls::stream< local_mem_word_t > &sOutReadData, hls::stream< local_mem_word_t > &sOutGoldData)
Read a data stream and produce the gold expected value.
void pReadAxiMemMapped2HlsStreamCountActivated(Tin *main_mem, hls::stream< Tout > &sOut, unsigned int elems, hls::stream< Tcntr > &cmd)
Copy a run-time variable amount of data to an hls stream with a given max it assumes "perfCounterMult...
void pWRGenerateData2WriteOnStream(hls::stream< local_mem_word_t > &sOutGeneratedData, ap_uint< 32 > *testCounter, local_mem_addr_t max_addr_ut)
A function that generate a streams of data according to function and writes them on a stream CHECK: F...
void pWriteSimplerTestMemTest(hls::stream< Tcntr > &sOutCmd, membus_t *lcl_mem, local_mem_addr_t max_addr_ut, unsigned int burst_size)
Simple version of a write memtest that write up to a given maximum address No control on the burst si...
void pRDCmpStreamsCntWordAligned(local_mem_addr_t max_addr_ut, hls::stream< local_mem_word_t > &sInReadData, hls::stream< local_mem_word_t > &sInGoldData, ap_uint< 32 > *faulty_addresses_cntr, local_mem_addr_t *first_faulty_address)
Read two streams, compare them and output the number of faults and the first faulty address.
void genXoredNumbersSingleWord(ADDR_T curr, BIGWORD_T *outBigWord)
ap_uint< 512 > local_mem_word_t
void pRDCompareDataStreamsCount(local_mem_addr_t max_addr_ut, hls::stream< local_mem_word_t > &sInReadData, hls::stream< local_mem_word_t > &sInGoldData, ap_uint< 32 > *faulty_addresses_cntr, local_mem_addr_t *first_faulty_address)
Read two streams, compare them and output the number of faults and the first faulty address,...