提交 2b5bf193 编写于 作者: J jameswu2014 提交者: GitHub

opendevice bug fixed for FPGA V1 track (#1635)

* V2-conv-hellocase pass & V1 verify-pass

* V1 paralvl equal to 2

* softmax channel =2 bug

* softmaxbug update2

* io update2

* V1-dwconv relu bug

* opendevice bug fixed
上级 20f5ae65
......@@ -51,6 +51,10 @@ int open_memdevice() {
return g_fpgainfo.fd_mem;
}
int close_drvdevice() { return close(g_fpgainfo.fd_drv); }
int close_memdevice() { return close(g_fpgainfo.fd_mem); }
void pl_reset() { usleep(100 * 1000); }
void setup_pe(struct pe_data_s *pe_data, struct fpga_pe *pe,
......@@ -144,17 +148,6 @@ int fpga_regpoll(uint64_t reg, uint64_t val, int time) {
}
}
void memory_release(struct fpga_memory *memory) {
void *ptr = nullptr;
/*unmap memory*/
std::map<void *, size_t> map = g_fpgainfo.fpga_addr2size_map;
std::map<void *, size_t>::iterator iter;
for (iter = map.begin(); iter != map.end(); iter++) {
fpga_free_driver(ptr);
}
}
uint64_t vaddr_to_paddr_driver(void *address) {
uint64_t paddr = 0;
auto iter = g_fpgainfo.fpga_vaddr2paddr_map.find(address);
......@@ -291,8 +284,10 @@ int open_device_driver() {
int close_device_driver() {
pl_destroy();
fpga_reg_free(g_fpgainfo.FpgaRegVirAddr);
memory_release(g_fpgainfo.memory_info);
return 0;
int ret = 0;
ret = close_drvdevice();
ret |= close_memdevice();
return ret;
}
} // namespace driver
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册