rework xilinx fpga spiOverJtag to respect model/package

This commit is contained in:
Gwenhael Goavec-Merou
2021-04-19 21:17:08 +02:00
parent 65a1e995ec
commit 7039465353
21 changed files with 123 additions and 63 deletions
+12 -3
View File
@@ -1,5 +1,6 @@
#include <iostream>
#include <stdexcept>
#include <string>
#include "jtag.hpp"
#include "bitparser.hpp"
@@ -15,8 +16,9 @@
Xilinx::Xilinx(Jtag *jtag, const std::string &filename,
const std::string &file_type,
Device::prog_type_t prg_type, int8_t verbose):
Device(jtag, filename, file_type, verbose)
Device::prog_type_t prg_type,
std::string device_package, int8_t verbose):
Device(jtag, filename, file_type, verbose),_device_package(device_package)
{
if (!_file_extension.empty()) {
if (_file_extension == "mcs") {
@@ -123,9 +125,16 @@ void Xilinx::program(unsigned int offset)
void Xilinx::program_spi(ConfigBitstreamParser * bit, unsigned int offset)
{
if (_device_package.empty()) {
printError("Can't program SPI flash: missing device-package information");
return;
}
// DATA_DIR is defined at compile time.
std::string bitname = DATA_DIR "/openFPGALoader/spiOverJtag_";
bitname += fpga_list[idCode()].model + ".bit";
bitname += _device_package + ".bit";
std::cout << "use: " << bitname << std::endl;
/* first: load spi over jtag */
try {