2019-09-26 18:29:20 +02:00
|
|
|
#ifndef XILINX_HPP
|
|
|
|
|
#define XILINX_HPP
|
|
|
|
|
|
2020-04-21 09:08:32 +02:00
|
|
|
#include <string>
|
|
|
|
|
|
2021-02-04 07:29:35 +01:00
|
|
|
#include "configBitstreamParser.hpp"
|
2019-09-26 18:29:20 +02:00
|
|
|
#include "device.hpp"
|
2020-03-06 09:05:57 +01:00
|
|
|
#include "jtag.hpp"
|
2020-04-21 09:08:32 +02:00
|
|
|
#include "spiInterface.hpp"
|
2019-09-26 18:29:20 +02:00
|
|
|
|
2020-04-21 09:08:32 +02:00
|
|
|
class Xilinx: public Device, SPIInterface {
|
2019-09-26 18:29:20 +02:00
|
|
|
public:
|
2020-09-25 18:58:31 +02:00
|
|
|
Xilinx(Jtag *jtag, const std::string &filename,
|
2021-02-21 18:30:13 +01:00
|
|
|
const std::string &file_type,
|
2021-04-19 21:17:08 +02:00
|
|
|
Device::prog_type_t prg_type,
|
2021-06-24 18:06:48 +02:00
|
|
|
std::string device_package,
|
|
|
|
|
bool verify, int8_t verbose);
|
2019-09-26 18:29:20 +02:00
|
|
|
~Xilinx();
|
|
|
|
|
|
2019-09-28 15:27:58 +02:00
|
|
|
void program(unsigned int offset = 0) override;
|
2021-02-04 07:29:35 +01:00
|
|
|
void program_spi(ConfigBitstreamParser * bit, unsigned int offset = 0);
|
|
|
|
|
void program_mem(ConfigBitstreamParser *bitfile);
|
2020-08-19 16:57:07 +02:00
|
|
|
int idCode() override;
|
|
|
|
|
void reset() override;
|
2020-04-21 09:08:32 +02:00
|
|
|
|
|
|
|
|
/* spi interface */
|
|
|
|
|
int spi_put(uint8_t cmd, uint8_t *tx, uint8_t *rx,
|
2020-08-23 17:16:21 +02:00
|
|
|
uint32_t len) override;
|
|
|
|
|
int spi_put(uint8_t *tx, uint8_t *rx, uint32_t len) override;
|
2020-04-21 09:08:32 +02:00
|
|
|
int spi_wait(uint8_t cmd, uint8_t mask, uint8_t cond,
|
|
|
|
|
uint32_t timeout, bool verbose = false) override;
|
2021-04-19 21:17:08 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
std::string _device_package;
|
2019-09-26 18:29:20 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|