titan-asic.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef __TITAN_ASIC_H
  2. #define __TITAN_ASIC_H
  3. #include "knc-asic/knc-asic.h"
  4. #include "knc-asic/knc-transport.h"
  5. #define KNC_TITAN_MAX_ASICS 6
  6. #define KNC_TITAN_DIES_PER_ASIC 4
  7. #define KNC_TITAN_CORES_PER_DIE 571
  8. #define KNC_TITAN_CORES_PER_ASIC (KNC_TITAN_CORES_PER_DIE * KNC_TITAN_DIES_PER_ASIC)
  9. #define KNC_TITAN_WORKSLOTS_PER_CORE 2
  10. #define KNC_TITAN_THREADS_PER_CORE 8
  11. #define KNC_TITAN_NONCES_PER_REPORT 5
  12. /* Valid slot numbers: 1..15 */
  13. #define KNC_TITAN_MIN_WORK_SLOT_NUM 1
  14. #define KNC_TITAN_MAX_WORK_SLOT_NUM 15
  15. #define KNC_TITAN_FPGA_SYSCLK_FREQ 24576000
  16. #define KNC_TITAN_FPGA_SPI_FREQ 3072000
  17. #define KNC_TITAN_FPGA_SPI_DIVIDER (KNC_TITAN_FPGA_SYSCLK_FREQ / (2*KNC_TITAN_FPGA_SPI_FREQ) - 1)
  18. #if KNC_TITAN_FPGA_SYSCLK_FREQ % (2*KNC_TITAN_FPGA_SPI_FREQ) != 0
  19. #warning Requested SPI frequency could not be accomplished exactly, adjusting as needed
  20. #endif
  21. #define KNC_TITAN_FPGA_SPI_PRECLK 7
  22. #define KNC_TITAN_FPGA_SPI_DECLK 7
  23. #define KNC_TITAN_FPGA_SPI_SSLOWMIN 15
  24. #define KNC_TITAN_FPGA_RETRIES 1
  25. struct nonce_report {
  26. uint32_t nonce;
  27. uint8_t slot;
  28. };
  29. bool knc_titan_get_info(const char *repr, void * const ctx, int channel, int die, struct knc_die_info *die_info);
  30. bool knc_titan_set_work(const char *repr, void * const ctx, int channel, int die, int core, int slot, struct work *work, bool urgent, bool *work_accepted, struct knc_report *report);
  31. bool knc_titan_set_work_multi(const char *repr, void * const ctx, int channel, int die, int core_start, int slot, struct work *work, bool urgent, bool *work_accepted, struct knc_report *reports, int num);
  32. bool knc_titan_get_report(const char *repr, void * const ctx, int channel, int die, int core, struct knc_report *report);
  33. bool knc_titan_setup_core_local(const char *repr, void * const ctx, int channel, int die, int core, struct titan_setup_core_params *params);
  34. bool knc_titan_setup_spi(const char *repr, void * const ctx, int asic, int divider, int preclk, int declk, int sslowmin);
  35. bool knc_titan_set_work_parallel(const char *repr, void * const ctx, int asic, int die, int core_start, int slot, struct work *work, bool urgent, int num, int resend);
  36. bool knc_titan_get_work_status(const char *repr, void * const ctx, int asic, int *num_request_busy, int *num_status_byte_error);
  37. #endif /* __TITAN_ASIC_H */