Skip to content

Commit

Permalink
difftest: Turn off h2c when it is not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaokamikami committed Nov 18, 2024
1 parent fcc98c7 commit c3d5c14
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/test/csrc/common/mpool.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ class MemoryIdxPool {

// Wait mempool have data
void wait_mempool_start();

private:
MemoryBlock memory_pool[NUM_BLOCKS]; // Mempool
std::mutex window_mutexes; // window sliding protection
Expand Down
3 changes: 2 additions & 1 deletion src/test/csrc/fpga/xdma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,15 @@ FpgaXdma::FpgaXdma(const char *workload) {
}
std::cout << "XDMA link " << c2h_device << std::endl;
}

#ifdef CONFIG_USE_XDMA_H2C
xdma_h2c_fd = open(XDMA_H2C_DEVICE, O_WRONLY);
if (xdma_h2c_fd == -1) {
std::cout << XDMA_H2C_DEVICE << std::endl;
perror("Failed to open XDMA device");
exit(-1);
}
std::cout << "XDMA link " << XDMA_H2C_DEVICE << std::endl;
#endif
}

void FpgaXdma::handle_sigint(int sig) {
Expand Down
2 changes: 2 additions & 0 deletions src/test/csrc/fpga/xdma.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ class FpgaXdma {
std::thread process_thread;

int xdma_c2h_fd[CONFIG_DMA_CHANNELS];
#ifdef CONFIG_USE_XDMA_H2C
int xdma_h2c_fd;
#endif

static void handle_sigint(int sig);
};
Expand Down

0 comments on commit c3d5c14

Please sign in to comment.