From c5e26c0c6969b404ffb73493bac1dbbe200f5c05 Mon Sep 17 00:00:00 2001 From: Gwenhael Goavec-Merou Date: Sat, 28 Sep 2019 15:27:58 +0200 Subject: [PATCH] Xilinx: - adapt method signature to Device modifications - suppress useless methods - disable not working reset() --- xilinx.cpp | 37 ++++++------------------------------- xilinx.hpp | 10 +++------- 2 files changed, 9 insertions(+), 38 deletions(-) diff --git a/xilinx.cpp b/xilinx.cpp index 9202ea1..fb6c7a4 100644 --- a/xilinx.cpp +++ b/xilinx.cpp @@ -6,13 +6,10 @@ #include "xilinx.hpp" -Xilinx::Xilinx(FtdiJtag *jtag, enum prog_mode mode, std::string filename):Device(jtag, mode, filename), +Xilinx::Xilinx(FtdiJtag *jtag, std::string filename):Device(jtag, filename), _bitfile(filename) { - if (_mode == Device::SPI_MODE) { - throw std::runtime_error("SPI flash is not supported on xilinx devices"); - } - if (_mode != Device::NONE_MODE){ + if (_filename != ""){ _bitfile.parse(); } } @@ -28,6 +25,7 @@ Xilinx::~Xilinx() {} #define ISC_DISABLE 0x16 #define BYPASS 0x3f +#if 0 void Xilinx::reset() { unsigned char instr; @@ -69,6 +67,7 @@ void Xilinx::reset() _jtag->toggleClk(2000); _jtag->go_test_logic_reset(); } +#endif int Xilinx::idCode() { @@ -83,33 +82,9 @@ int Xilinx::idCode() ((rx_data[3] << 24) & 0xff000000)); } -void Xilinx::flow_enable() -{ - unsigned char data; - data = ISC_ENABLE; - _jtag->shiftIR(&data, NULL, 6); - //data[0]=0x0; - //jtag->shiftDR(data,0,5); - //io->cycleTCK(tck_len); -} - - -void Xilinx::flow_disable() -{ - unsigned char data; - - data = ISC_DISABLE; - _jtag->shiftIR(&data, NULL, 6); - //io->cycleTCK(tck_len); - //jtag->shiftIR(&BYPASS); - //data[0]=0x0; - //jtag->shiftDR(data,0,1); - //io->cycleTCK(1); -} - - -void Xilinx::program() +void Xilinx::program(unsigned int offset) { + if (_filename == "") return; std::cout << "load program" << std::endl; unsigned char tx_buf, rx_buf; /* comment TDI TMS TCK diff --git a/xilinx.hpp b/xilinx.hpp index 4789fd7..ab51538 100644 --- a/xilinx.hpp +++ b/xilinx.hpp @@ -7,17 +7,13 @@ class Xilinx: public Device { public: - Xilinx(FtdiJtag *jtag, enum prog_mode mode, std::string filename); + Xilinx(FtdiJtag *jtag, std::string filename); ~Xilinx(); - void program(); + void program(unsigned int offset = 0) override; int idCode(); - void reset(); + //void reset(); private: - void flow_enable(); - void flow_disable(); - //FtdiJtag *_jtag; - //std::string _filename; BitParser _bitfile; };