cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
memtest_pattern_library.hpp File Reference

A library for memory test functionalities: sequence generation, reading, writing. More...

#include <stdio.h>
#include <iostream>
#include <hls_stream.h>
#include "ap_int.h"
#include <stdint.h>
#include "../../../../../HOST/custom/memtest/languages/cplusplus/include/config.h"
#include "network.hpp"
Include dependency graph for memtest_pattern_library.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define LOCAL_MEM_WORD_SIZE   512
 
#define LOCAL_MEM_ADDR_SIZE   40
 
#define LOCAL_MEM_ADDR_SIZE_NON_BYTE_ADDRESSABLE   40
 
#define LOCAL_MEM_ADDR_OFFSET   (LOCAL_MEM_WORD_SIZE/8)
 
#define LOCAL_MEM_WORD_BYTE_SIZE   (LOCAL_MEM_WORD_SIZE/8)
 

Typedefs

typedef ap_uint< 512 > local_mem_word_t
 
typedef ap_uint< 40 > local_mem_addr_t
 
typedef ap_uint< 40 > local_mem_addr_non_byteaddressable_t
 

Functions

template<typename Tin , typename Tout >
Tout genNextFibonacciNumber (Tin curr, Tin prev)
 
template<typename ADDR_T , unsigned int sequenceDim, typename BIGWORD_T , typename SMALLWORD_T , unsigned int smallWordDim>
void genFibonacciNumbers (ADDR_T curr, BIGWORD_T *outBigWord)
 
template<typename ADDR_T , unsigned int sequenceDim, typename BIGWORD_T , typename SMALLWORD_T , unsigned int smallWordDim>
void genXoredSequentialNumbers (ADDR_T curr, BIGWORD_T *outBigWord)
 
template<typename ADDR_T , unsigned int sequenceDim, typename BIGWORD_T , typename SMALLWORD_T , unsigned int smallWordDim>
void genXoredSequentialNumbersSecondVersion (ADDR_T curr, BIGWORD_T *outBigWord)
 
template<typename ADDR_T , typename BIGWORD_T >
void genXoredNumbersSingleWord (ADDR_T curr, BIGWORD_T *outBigWord)
 
template<typename ADDR_T , typename BIGWORD_T >
void genSequentialNumbers (ADDR_T curr, BIGWORD_T *outBigWord)
 
template<const unsigned int max_iterations = 4000000, const unsigned int buff_dim = 16>
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: FAULT_INJECTION define insert after the third test some faults. More...
 
template<typename Tcntr , const unsigned int max_iterations = 4000000, const unsigned int buff_dim = 64*2>
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. More...
 
template<typename Tcntr , const unsigned int max_iterations = 4000000, const unsigned int buff_dim = 64*2>
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 size or on the first faulty address. More...
 
template<typename Tcntr , const unsigned int max_iterations = 4000000, const unsigned int buff_dim = 64*2>
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 or on the first faulty address. More...
 
template<typename Tcntr , const unsigned int max_iterations = 4000000, const unsigned int buff_dim = 64*2>
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 transfer but without using memcpy. More...
 
template<const unsigned int max_iterations = 4000000>
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. More...
 
template<const unsigned int max_iterations = 4000000, const unsigned int buff_dim = 16>
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. More...
 
template<const unsigned int max_iterations = 4000000, const unsigned int unrolling_factor = ( 512 /8), const unsigned int buff_dim = 16>
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, but check every single byte NOT USED. More...
 
template<typename Tcntr , const unsigned int max_iterations = 4000000, const unsigned int buff_dim = 64*2>
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. More...
 
template<typename Tcntr , const unsigned int max_iterations = 4000000, const unsigned int buff_dim = 64*2>
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 transfer
THIS FUNCTION SUFFER FIFO OVERFLOW 4 transfer different from power of 2 numbers NOT USED. More...
 

Detailed Description

A library for memory test functionalities: sequence generation, reading, writing.

Author
DCO

@date September 2021

The pattern library is a collection of functions to abstract employs different approach to generate a sequence (useful to test particular bits of the current memory word of 512 bits); the way of reading: having run-time variable (controllable) data to read/write requires different methodologies. The write currently exploit a buffer of MAX_BURST (i.e., 4096) to accumulate the data to write and then write exploitng memtest_library.hpp functions. The read instead harvest the data and write to a stream, generate the gold value (based the sequence generation approach) and then compare, collecting some information on how the memory test went (how many faults, where the first and the CC needed ONLY for AXI transactions) WARNING: HLS-based memory perf counters of AXI transactions accounts for the overall time of a read, while the write is considered finished when issuing the data (while the AXI protocol considers the transaction closed when the slave answer with the ACK/BRESP)

Deprecated:


Definition in file memtest_pattern_library.hpp.