Loading files
#ifndef WRAPPERREGDRIVER_H
#define WRAPPERREGDRIVER_H
#include <stdint.h>
#include <string>
// TODO wrapper driver should be a singleton
typedef unsigned int AccelReg;
typedef uint64_t AccelDblReg;
class WrapperRegDriver
{
public:
virtual ~WrapperRegDriver() {}
// (optional) functions for host-accelerator buffer management
virtual void copyBufferHostToAccel(const void * hostBuffer, void * accelBuffer, unsigned int numBytes) {(void) hostBuffer; (void) accelBuffer; (void) numBytes;}
virtual void copyBufferAccelToHost(const void * accelBuffer, void * hostBuffer, unsigned int numBytes) {(void) hostBuffer; (void) accelBuffer; (void) numBytes;}
virtual void * allocAccelBuffer(unsigned int numBytes) { (void)numBytes; throw "allocAccelBuffer not supported"; }
virtual void deallocAccelBuffer(void * buffer) {(void) buffer;}
// return CPU-accessible address for a buffer returned from allocAccelBuffer
// only makes sense for some (shared-memory) platforms
// facilitates SW that takes advantage of cache coherency
virtual void * phys2virt(void * accelBuffer) {(void) accelBuffer; throw "phys2virt not supported"; }
virtual bool is_coherent() { return false; }
// (optional) functions for accelerator attach-detach handling
virtual void attach(const char * name) {(void)name; }
virtual void detach() {}
// (mandatory) register access methods for the platform wrapper
virtual void writeReg(unsigned int regInd, AccelReg regValue) = 0;
virtual AccelReg readReg(unsigned int regInd) = 0;
virtual std::string platformID() = 0;
};
#endif // WRAPPERREGDRIVER_H
fa5a8d840This file is pinned to the selected release. Download the original to open it in your design tool.