CPLD: Method to calculate bitstream CRC32.

This commit is contained in:
Jared Boone 2016-07-05 12:06:51 -07:00
parent df825807d6
commit 3ed1d9e24a
2 changed files with 24 additions and 0 deletions

View file

@ -23,6 +23,7 @@
#define __CPLD_MAX5_H__
#include "jtag.hpp"
#include "crc.hpp"
#include <cstdint>
#include <cstddef>
@ -75,6 +76,8 @@ public:
bool is_blank();
uint32_t crc();
std::pair<bool, uint8_t> boundary_scan();
enum class Instruction {
@ -135,6 +138,9 @@ private:
bool is_blank_block(const uint16_t id, const size_t count);
using crc_t = CRC<32, true, true>;
void block_crc(const uint16_t id, const size_t count, crc_t& crc);
const uint32_t IDCODE = 0b00000010000010100101000011011101;
const size_t IR_LENGTH = 10;