fixed new AFU Driver bugs - now functional
This commit is contained in:
@@ -15,13 +15,15 @@
|
||||
#include <future>
|
||||
#include <vector>
|
||||
|
||||
#define CACHE_BLOCK_SIZE 64
|
||||
|
||||
class opae_sim {
|
||||
public:
|
||||
|
||||
opae_sim();
|
||||
virtual ~opae_sim();
|
||||
|
||||
void prepare_buffer(uint64_t len, void **buf_addr, uint64_t *wsid, int flags);
|
||||
int prepare_buffer(uint64_t len, void **buf_addr, uint64_t *wsid, int flags);
|
||||
|
||||
void release_buffer(uint64_t wsid);
|
||||
|
||||
@@ -31,30 +33,32 @@ public:
|
||||
|
||||
void read_mmio64(uint32_t mmio_num, uint64_t offset, uint64_t *value);
|
||||
|
||||
void flush();
|
||||
|
||||
private:
|
||||
|
||||
typedef struct {
|
||||
int cycles_left;
|
||||
std::array<uint8_t, GLOBAL_BLOCK_SIZE> block;
|
||||
std::array<uint8_t, CACHE_BLOCK_SIZE> block;
|
||||
unsigned tag;
|
||||
} dram_rd_req_t;
|
||||
|
||||
typedef struct {
|
||||
int cycles_left;
|
||||
std::array<uint8_t, GLOBAL_BLOCK_SIZE> block;
|
||||
std::array<uint8_t, CACHE_BLOCK_SIZE> block;
|
||||
unsigned mdata;
|
||||
} cci_rd_req_t;
|
||||
|
||||
typedef struct {
|
||||
int cycles_left;
|
||||
std::array<uint8_t, GLOBAL_BLOCK_SIZE> block;
|
||||
unsigned mdata;
|
||||
} cci_wr_req_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t* data;
|
||||
size_t size;
|
||||
} host_alloc_t;
|
||||
uint64_t* data;
|
||||
size_t size;
|
||||
uint64_t ioaddr;
|
||||
} host_buffer_t;
|
||||
|
||||
void reset();
|
||||
|
||||
@@ -66,12 +70,12 @@ private:
|
||||
void sTxPort_bus();
|
||||
void avs_bus();
|
||||
|
||||
uint8_t* find_host_ptr(uint64_t addr);
|
||||
uint64_t* to_host_ptr(uint64_t addr);
|
||||
|
||||
std::future<void> future_;
|
||||
bool stop_;
|
||||
|
||||
std::vector<host_alloc_t> host_allocs_;
|
||||
std::vector<host_buffer_t> host_buffers_;
|
||||
|
||||
std::vector<dram_rd_req_t> dram_reads_;
|
||||
|
||||
@@ -79,6 +83,8 @@ private:
|
||||
|
||||
std::vector<cci_wr_req_t> cci_writes_;
|
||||
|
||||
std::mutex mutex_;
|
||||
|
||||
RAM ram_;
|
||||
Vvortex_afu_shim *vortex_afu_;
|
||||
#ifdef VCD_OUTPUT
|
||||
|
||||
Reference in New Issue
Block a user