cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
common.hpp File Reference
#include <stdio.h>
#include <iostream>
#include <cstdlib>
#include <assert.h>
#include <string>
#include <string.h>
#include <sstream>
#include <cstdio>
#include <memory>
#include <stdexcept>
#include <array>
#include <sys/stat.h>
#include <stdlib.h>
#include "config.h"
#include <algorithm>
#include <fstream>
#include <bitset>
#include <vector>
#include <cmath>
#include <chrono>
#include <ctime>
Include dependency graph for common.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  MemoryTestResult
 

Macros

#define MAX_TESTABLE_ADDRESS   8000000000
 
#define MAX_TEST_REPETITION_BITWIDTH   16
 
#define MAX_BURST_SIZE   4096
 
#define OK   true
 
#define KO   false
 

Functions

void print_cFpMemtest (void)
 
void delay (unsigned int mseconds)
 
void printBits (size_t const size, void const *const ptr)
 print the binary representation of a target pointer buffer of a given size. Assumes little endian. More...
 
void ascii2hex (const string &in, string &out)
 Convert a ascii string to a hexadecimal string. More...
 
template<unsigned int bytes_per_line = 8>
string createMemTestCommands (unsigned long long int mem_address, unsigned int testingNumber, unsigned int burst_size)
 Create the commands for a memory test with start/max address to test-nop to execute-stop. More...
 
template<unsigned int bytes_per_line = 8>
string createMemTestStopCommand ()
 
unsigned char hexval (unsigned char c)
 convert a char to its hexadecimal representation. More...
 
void hex2ascii (const string &in, string &out)
 Convert a hexadecimal string to a ascii string. More...
 
template<typename T >
void number2hexString (const T in, char *out, size_t byteSize)
 
template<unsigned int bytes_per_line = 8>
string dumpFileToStringRawDataString (const string inpFileName, int *rawdatalines, size_t outputSize)
 Initialize an input data stream from a file with only data. More...
 
void ascii2hexWithSize (const string &in, string &out, size_t bytesize)
 Convert a ascii string to a hexadecimal string. More...
 
bool findCharNullPos (char *str)
 
void printStringHex (const string inStr, size_t strSize)
 print byte-per-byte a given string in hexadecimal format More...
 
void printCharBuffHex (const char *inStr, size_t strSize)
 print byte-per-byte a given char buff in hexadecimal format More...
 
void printCharBuffHexSafe (const char *inStr, size_t strSize)
 
void string2hexnumerics (const string &in, char *out, size_t byteSize)
 
template<unsigned int bytes_per_line = 8>
std::vector< MemoryTestResultparseMemoryTestOutput (const string longbuf, size_t charOutputSize, int rawdatalines)
 Parse the memory test output contained in astring with a given size. More...
 
void createAVGLogFile ()
 
void logTheAvgResult (unsigned int iters, unsigned long long int trgt_address, unsigned int brst_size, unsigned int wr_words, double rd_bw, double wr_bw, unsigned int faults)
 
void createItLogFile ()
 
void logTheSingleResult (unsigned int iters, unsigned long long int trgt_address, unsigned int brst_size, unsigned int wr_words, double rd_bw, double wr_bw, unsigned int faults, unsigned long long int first_faulty_address)
 

Variables

std::ofstream loggingAVGFile
 
const std::string loggingAVGFileName ="cfp_vitis_memtest_avg.csv"
 
std::ofstream loggingMultiItFile
 
const std::string loggingMultiItFileName ="cfp_vitis_memtest_multi.csv"