Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: azonenberg/openfpga
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 96420f32efd2
Choose a base ref
...
head repository: azonenberg/openfpga
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 59c095e0b29a
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Jul 21, 2017

  1. Copy the full SHA
    b160414 View commit details
  2. Copy the full SHA
    59c095e View commit details
Showing with 35 additions and 9 deletions.
  1. +12 −4 src/greenpak4/Greenpak4Delay.cpp
  2. +22 −4 src/greenpak4/Greenpak4ShiftRegister.cpp
  3. +1 −1 src/greenpak4/Greenpak4SystemReset.cpp
16 changes: 12 additions & 4 deletions src/greenpak4/Greenpak4Delay.cpp
Original file line number Diff line number Diff line change
@@ -136,11 +136,19 @@ bool Greenpak4Delay::CommitChanges()
return true;
}

bool Greenpak4Delay::Load(bool* /*bitstream*/)
bool Greenpak4Delay::Load(bool* bitstream)
{
//TODO: Do our inputs
LogError("Unimplemented\n");
return false;
ReadMatrixSelector(bitstream, m_inputBaseWord, m_matrix, m_input);

int imode = (bitstream[m_configBase + 1] << 1) | bitstream[m_configBase + 0];
modes xmodes[] = {RISING_EDGE, FALLING_EDGE, BOTH_EDGE, DELAY};
m_mode = xmodes[imode];

m_delayTap = ( (bitstream[m_configBase + 3] << 1) | bitstream[m_configBase + 2]) + 1;

m_glitchFilter = bitstream[m_configBase + 4];

return true;
}

bool Greenpak4Delay::Save(bool* bitstream)
26 changes: 22 additions & 4 deletions src/greenpak4/Greenpak4ShiftRegister.cpp
Original file line number Diff line number Diff line change
@@ -142,11 +142,29 @@ bool Greenpak4ShiftRegister::CommitChanges()
return true;
}

bool Greenpak4ShiftRegister::Load(bool* /*bitstream*/)
bool Greenpak4ShiftRegister::Load(bool* bitstream)
{
//TODO: Do our inputs
LogError("Unimplemented\n");
return false;
ReadMatrixSelector(bitstream, m_inputBaseWord + 0, m_matrix, m_clock);
ReadMatrixSelector(bitstream, m_inputBaseWord + 1, m_matrix, m_input);
ReadMatrixSelector(bitstream, m_inputBaseWord + 2, m_matrix, m_reset);

m_delayB = (
(bitstream[m_configBase + 3] << 3) |
(bitstream[m_configBase + 2] << 2) |
(bitstream[m_configBase + 1] << 1) |
(bitstream[m_configBase + 0])
) + 1;

m_delayA = (
(bitstream[m_configBase + 7] << 3) |
(bitstream[m_configBase + 6] << 2) |
(bitstream[m_configBase + 5] << 1) |
(bitstream[m_configBase + 4])
) + 1;

m_invertA = bitstream[m_configBase + 8];

return true;
}

bool Greenpak4ShiftRegister::Save(bool* bitstream)
2 changes: 1 addition & 1 deletion src/greenpak4/Greenpak4SystemReset.cpp
Original file line number Diff line number Diff line change
@@ -152,7 +152,7 @@ bool Greenpak4SystemReset::Load(bool* bitstream)
else
{
//TODO: Load m_input
LogWarning("Greenpak4SystemReset::Load: not setting m_reset to pin 2's output yet");
LogWarning("Greenpak4SystemReset::Load: not setting m_reset to pin 2's output yet\n");
}

return true;