cloudFPGA (cF) API
1.0
The documentation of the source code of cloudFPGA (cF)
|
A library for some common functionalities: Memory interaction Performance Counters. More...
#include <stdio.h>
#include <iostream>
#include <hls_stream.h>
#include "ap_int.h"
#include <stdint.h>
#include "../../../../../HOST/vision/warp_transform/languages/cplusplus/include/config.h"
#include "memory_utils.hpp"
#include "network.hpp"
Go to the source code of this file.
Classes | |
union | float_bits_u |
Functions | |
template<typename Tin , typename Tout , unsigned int arraysize> | |
void | pMyMemtestMemCpy (Tin *in, Tout *out) |
Copy a fixed compile time amount of data to another array. More... | |
template<typename Tin , typename Tout , const unsigned int arraysize> | |
void | pMemCpyCircularBuff (Tin *buff, Tout *out_mem, unsigned int elems, unsigned int offset_buff) |
Copy a run-time variable amount of data to another array employing the src as circular buffer i.e., handling overflow. More... | |
template<typename Tin , typename Tout , const unsigned int burstsize> | |
void | pReadAxiMemMapped2HlsStream (Tin *main_mem, hls::stream< Tout > &sOut, unsigned int elems) |
Copy a run-time variable amount of data to an hls stream with a given max. More... | |
template<typename Tin , typename Tout , const unsigned int burstsize, typename Tcntr > | |
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 initialization of a perf counter of "perfCounterMultipleCounts" function. More... | |
template<typename Tin , typename Tout , const unsigned int burstsize, typename Tcntr > | |
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 "perfCounterMultipleCounts" function already initialized so it just incr. More... | |
template<typename Tin , const unsigned int loop_cnt, const unsigned int bytes_per_loop, const unsigned int max_data_transfer> | |
void | storeWordToAxiStream (NetworkWord word, Tin &img_in_axi_stream, unsigned int *processed_word_rx, unsigned int *processed_bytes_rx, stream< bool > &sImageLoaded) |
Store a net word to a local AXI stream. More... | |
template<typename TInImg , const unsigned int img_pckts> | |
void | storeWordToArray (uint64_t input, TInImg img[img_pckts], unsigned int *processed_word, unsigned int *image_loaded) |
Store a net word to local memory. More... | |
template<typename Tin , typename Tout , unsigned int counter_precision = 64> | |
void | perfCounterProc (hls::stream< Tin > &cmd, hls::stream< Tout > &out, int direction, int burst_length, int nmbr_outstanding) |
template<typename Tin , typename Tout , unsigned int counter_precision = 64> | |
void | perfCounterProc2Mem (hls::stream< Tin > &cmd, Tout *out, int direction, int burst_length, int nmbr_outstanding) |
template<typename Tin , typename Tout , unsigned int counter_precision = 64> | |
void | perfCounterProc2MemCountOnly (hls::stream< Tin > &cmd, Tout *out) |
Count Clock Cycles between two events, the first event init the counter the second stop the count. More... | |
template<typename Tin , typename Tout , unsigned int counter_precision = 64> | |
void | perfCounterProc2MemCountIncremental (hls::stream< Tin > &cmd, Tout *out) |
Count Clock Cycles between two events, the first event init the counter the second stop the count and increment the out register TODO: seems not working at the csim lvl (never tested below) when executing single DUT step, hanging stream values. More... | |
template<typename Tin , typename Tout , unsigned int counter_precision = 64> | |
void | perfCounterMultipleCounts (hls::stream< Tin > &cmd, Tout *out) |
Count Clock Cycles between two events, the first event init the counter the second stop the count, a 0 after the init stop definitevely the counter. More... | |
template<typename Tevent = bool, const unsigned int counter_width = 32, const unsigned int maximum_counter_value_before_reset = 4000000> | |
void | pCountClockCycles (hls::stream< Tevent > &sOfEnableCCIncrement, hls::stream< Tevent > &sOfResetCounter, hls::stream< Tevent > &sOfGetTheCounter, hls::stream< ap_uint< counter_width > > &oSClockCounter) |
Count Clock Cycles between two events first sketch TODO: make it working without counting with the stream or reshaping as FSM. More... | |
Variables | |
const unsigned long int | max_counter_cc = 4000000 |
A library for some common functionalities: Memory interaction Performance Counters.
Copyright 2016 – 2022 IBM Corporation
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Implementations of library example functionalities:
Memory interaction pMyMemtestMemCpy --> memcpy reimplementation pMemCpyCircularBuff --> memcpy using a circular buffer (not optimized) pReadAxiMemMapped2HlsStream --> read data and write on stream pReadAxiMemMapped2HlsStreamCountFirst --> as before but with the activation of perf counter pReadAxiMemMapped2HlsStreamCountActivated --> as before but with perf counter activated pReadAxiMemMapped2HlsStreamCountExtern --> summary of two function before but with activation as input param
Performance Counters perfCounterProc --> original function from Xilinx for perf counters that takes INIT and STOP (any) perfCounterProc2Mem --> first iteration on the original function perfCounterProc2MemCountOnly --> trimming unsued stuffs perfCounterProc2MemCountIncremental --> as before but incrementing the output register not overwriting perfCounterMultipleCounts --> as before but with multiple activations possible: INIT;ANY(repeat);STOP(0) pCountClockCycles --> alternative implementations that does not behave correctly in hls
Definition in file warp_transform_hw_common.hpp.