altera: cosmetic/linter

This commit is contained in:
Gwenhael Goavec-Merou 2025-02-01 08:28:17 +01:00
parent 959201a21f
commit 533dd1ea5f
1 changed files with 42 additions and 45 deletions

View File

@ -7,18 +7,19 @@
#include <string.h> #include <string.h>
#include <map>
#include <string> #include <string>
#include "common.hpp" #include "common.hpp"
#include "jtag.hpp"
#include "device.hpp" #include "device.hpp"
#include "epcq.hpp" #include "epcq.hpp"
#include "jtag.hpp"
#include "progressBar.hpp" #include "progressBar.hpp"
#include "rawParser.hpp" #include "rawParser.hpp"
#include "pofParser.hpp"
#if defined (_WIN64) || defined (_WIN32) #if defined (_WIN64) || defined (_WIN32)
#include "pathHelper.hpp" #include "pathHelper.hpp"
#endif #endif
#include "pofParser.hpp"
#define IDCODE 6 #define IDCODE 6
#define USER0 0x0C #define USER0 0x0C
@ -73,7 +74,6 @@ Altera::Altera(Jtag *jtag, const std::string &filename,
} else { } else {
_fpga_family = CYCLONE_MISC; // FIXME _fpga_family = CYCLONE_MISC; // FIXME
} }
} }
Altera::~Altera() Altera::~Altera()
@ -525,8 +525,6 @@ uint32_t Altera::verifyxFM(const uint8_t *cfg_data, uint32_t base_addr, uint32_t
{ {
uint8_t *ptr = (uint8_t *)cfg_data + offset; // avoid passing offset ? uint8_t *ptr = (uint8_t *)cfg_data + offset; // avoid passing offset ?
//const uint32_t isc_read_delay = 5120 / _clk_period;
const uint8_t read_cmd[2] = MAX10_ISC_READ; const uint8_t read_cmd[2] = MAX10_ISC_READ;
uint32_t errors = 0; uint32_t errors = 0;
@ -577,8 +575,8 @@ void Altera::max_10_flow_enable()
void Altera::max_10_flow_disable() void Altera::max_10_flow_disable()
{ {
//ISC_DISABLE WAIT 100.0e-3) // ISC_DISABLE WAIT 100.0e-3)
//BYPASS WAIT 305.0e-6 // BYPASS WAIT 305.0e-6
const int disable_len = (1e9 * 350e-3) / _clk_period; const int disable_len = (1e9 * 350e-3) / _clk_period;
const int bypass_len = (3 + (1e9 * 1e-3) / _clk_period); const int bypass_len = (3 + (1e9 * 1e-3) / _clk_period);
const uint8_t cmd0[2] = MAX10_ISC_DISABLE; const uint8_t cmd0[2] = MAX10_ISC_DISABLE;
@ -626,7 +624,7 @@ bool Altera::max10_dsm_verify()
const uint8_t cmd[2] = MAX10_DSM_VERIFY; const uint8_t cmd[2] = MAX10_DSM_VERIFY;
const uint8_t tx = 0x00; // 1 in bsdl, 0 in svf const uint8_t tx = 0x00; // 1 in bsdl, 0 in svf
uint8_t rx=0; uint8_t rx = 0;
_jtag->shiftIR((unsigned char *)cmd, NULL, IRLENGTH); _jtag->shiftIR((unsigned char *)cmd, NULL, IRLENGTH);
_jtag->set_state(Jtag::RUN_TEST_IDLE); _jtag->set_state(Jtag::RUN_TEST_IDLE);
@ -649,7 +647,6 @@ void Altera::max10_addr_shift(uint32_t addr)
uint8_t addr_arr[4]; uint8_t addr_arr[4];
word_to_array(base_addr, addr_arr); word_to_array(base_addr, addr_arr);
//printf("%08x %08x\n", addr, base_addr);
/* FIXME/TODO: /* FIXME/TODO:
* 1. in bsdl file no delay between IR and DR * 1. in bsdl file no delay between IR and DR
@ -667,7 +664,7 @@ void Altera::max10_dsm_program_success(const uint32_t pgm_success_addr)
{ {
const uint32_t prog_len = 5120 / _clk_period; // ?? const uint32_t prog_len = 5120 / _clk_period; // ??
const uint32_t prog2_len = 320000 / _clk_period; // ?? const uint32_t prog2_len = 320000 / _clk_period; // ??
//
const uint8_t cmd[2] = MAX10_DSM_ICB_PROGRAM; const uint8_t cmd[2] = MAX10_DSM_ICB_PROGRAM;
uint8_t magic[4]; uint8_t magic[4];