1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-27 01:31:42 +00:00

Ensures complete DPLL initial state assignment.

This commit is contained in:
Thomas Harte 2017-10-17 22:13:37 -04:00
parent 2d7a4fe5f0
commit 7f2febeec9
2 changed files with 10 additions and 14 deletions

View File

@ -13,13 +13,9 @@
using namespace Storage; using namespace Storage;
DigitalPhaseLockedLoop::DigitalPhaseLockedLoop(int clocks_per_bit, size_t length_of_history) : DigitalPhaseLockedLoop::DigitalPhaseLockedLoop(int clocks_per_bit, size_t length_of_history) :
clocks_per_bit_(clocks_per_bit),
phase_(0),
window_length_(clocks_per_bit),
offset_history_pointer_(0),
offset_history_(length_of_history, 0), offset_history_(length_of_history, 0),
offset_(0), window_length_(clocks_per_bit),
delegate_(nullptr) {} clocks_per_bit_(clocks_per_bit) {}
void DigitalPhaseLockedLoop::run_for(const Cycles cycles) { void DigitalPhaseLockedLoop::run_for(const Cycles cycles) {
offset_ += cycles.as_int(); offset_ += cycles.as_int();

View File

@ -50,20 +50,20 @@ class DigitalPhaseLockedLoop {
} }
private: private:
Delegate *delegate_; Delegate *delegate_ = nullptr;
void post_phase_offset(int phase, int offset); void post_phase_offset(int phase, int offset);
std::vector<int> offset_history_; std::vector<int> offset_history_;
size_t offset_history_pointer_; size_t offset_history_pointer_ = 0;
int offset_; int offset_ = 0;
int phase_; int phase_ = 0;
int window_length_; int window_length_ = 0;
bool window_was_filled_; bool window_was_filled_ = false;
int clocks_per_bit_; int clocks_per_bit_ = 0;
int tolerance_; int tolerance_ = 0;
}; };
} }