示例#1
0
int MAX_CommitAdd(uint32_t *data_read,uint32_t *data_write, unsigned size_b, char *address_read,  char *address_write) {
    
  max_run(device,
        max_input(address_write, data_write, size_b),
        max_input(address_read,  data_read,  size_b),
        max_end());


  return 0;
}
示例#2
0
std::string PADeviceInfo::str()
{
	std::stringstream ss;
	ss << "== idx=" << idx() << std::endl;
	ss << "  name    = " << name() << std::endl;
	ss << "  host_ap = " << host_ap() << std::endl;

	if (has_input()) {
		ss << "  [in]  max_input  = " << max_input() << std::endl;
		ss << "        default_low_input_latency(s)   = " << default_low_input_latency() << std::endl;
		ss << "        default_high_input_latency(s)  = " << default_high_input_latency() << std::endl;
		ss << "        freq(kHz) = " << supported_input_sample_rate_str() << std::endl;
	}

	if (has_output()) {
		ss << "  [out] max_output = " << max_output() << std::endl;
		ss << "        default_low_output_latency(s)  = " << default_low_output_latency() << std::endl;
		ss << "        default_high_output_latency(s) = " << default_high_output_latency() << std::endl;
		ss << "        freq(kHz) = " << supported_output_sample_rate_str() << std::endl;
	}

	if (is_asio()) {
		ss << "  asio_min_buffer_size       = " << asio_min_buffer_size() << std::endl;
		ss << "  asio_max_buffer_size       = " << asio_max_buffer_size() << std::endl;
		ss << "  asio_prefereed_buffer_size = " << asio_prefereed_buffer_size() << std::endl;
	}

	return ss.str();
}
示例#3
0
int MAX_CommitAdd1(uint32_t *data,unsigned size_b, char *address) {
    
  max_run(device,
        max_input(address,  data,  size_b),
        max_end());


  return 0;
}
示例#4
0
int MAX_Mem2PCI(void *data, int size_b, char *stream_pci, char *stream_mem) {
  int status = 0;

  status = MAX_Enable_Mem(stream_mem);
  max_run(device,
      max_input(stream_pci, data, size_b),
      max_end());
  status |= MAX_Disable_Mem(stream_mem);

  if (status)
    printf("Error: from stream %s to stream %s!\n", stream_mem, stream_pci);

  return status;
}
示例#5
0
int MAX_PCI2Mem(uint32_t *data, unsigned size_b, char *stream_pci, char *stream_mem) {
  int status = 0;

  status =  MAX_Enable_Mem(stream_mem);
  status |= MAX_Set_Int(stream_mem);
  if (!status) {
    max_run(device,
        max_input(stream_pci, data, size_b),
        max_end());
  //interrupt is need to address the latency between PCIe and DRAM
  max_wait_for_interrupt(device, FPGA_A);
  status |= MAX_Disable_Mem(stream_mem);
  }

  if (status)
    printf("Error: from stream %s to stream %s!\n", stream_pci, stream_mem);

  return status;}
示例#6
0
bool PADeviceInfo::has_input()
{
	if (max_input() > 0) return true;
	return false;
}