Skip to content

Commit

Permalink
Implemented bitstream loading support for DCMPREF and SYSRST
Browse files Browse the repository at this point in the history
azonenberg committed Jul 20, 2017
1 parent 766dc7a commit fb63552
Showing 2 changed files with 27 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/greenpak4/Greenpak4DCMPRef.cpp
Original file line number Diff line number Diff line change
@@ -96,10 +96,12 @@ bool Greenpak4DCMPRef::CommitChanges()
return true;
}

bool Greenpak4DCMPRef::Load(bool* /*bitstream*/)
bool Greenpak4DCMPRef::Load(bool* bitstream)
{
LogError("Unimplemented\n");
return false;
m_referenceValue = bitstream[m_configBase + 0];
for(int i=1; i<8; i++)
m_referenceValue |= bitstream[m_configBase + i] << 1;
return true;
}

bool Greenpak4DCMPRef::Save(bool* bitstream)
25 changes: 22 additions & 3 deletions src/greenpak4/Greenpak4SystemReset.cpp
Original file line number Diff line number Diff line change
@@ -133,10 +133,29 @@ bool Greenpak4SystemReset::CommitChanges()
return true;
}

bool Greenpak4SystemReset::Load(bool* /*bitstream*/)
bool Greenpak4SystemReset::Load(bool* bitstream)
{
LogError("Unimplemented\n");
return false;
if(bitstream[m_configBase + 0])
m_resetMode = HIGH_LEVEL;
else
m_resetMode = RISING_EDGE;

if(bitstream[m_configBase + 1])
m_resetDelay = 500;
else
m_resetDelay = 4;

//Tie reset off to ground if we're not enabled
if(!bitstream[m_configBase + 2])
m_reset = m_device->GetGround();

else
{
//TODO: Load m_input
LogWarning("Greenpak4SystemReset::Load: not setting m_reset to pin 2's output yet");
}

return true;
}

bool Greenpak4SystemReset::Save(bool* bitstream)

0 comments on commit fb63552

Please sign in to comment.