Skip to content

Commit

Permalink
Added bitstream loading support for bandgap, clock buffer, and DCMP mux
Browse files Browse the repository at this point in the history
azonenberg committed Jul 13, 2017
1 parent 353707d commit e47ccc4
Showing 5 changed files with 27 additions and 13 deletions.
15 changes: 12 additions & 3 deletions src/greenpak4/Greenpak4Bandgap.cpp
Original file line number Diff line number Diff line change
@@ -134,10 +134,19 @@ bool Greenpak4Bandgap::CommitChanges()
return true;
}

bool Greenpak4Bandgap::Load(bool* /*bitstream*/)
bool Greenpak4Bandgap::Load(bool* bitstream)
{
LogError("Unimplemented\n");
return false;
if(bitstream[m_configBase])
m_outDelay = 100;
else
m_outDelay = 550;

m_autoPowerDown = !bitstream[m_cbasePowerEn];

if(m_cbaseChopper)
m_chopperEn = bitstream[m_cbaseChopper];

return true;
}

bool Greenpak4Bandgap::Save(bool* bitstream)
8 changes: 4 additions & 4 deletions src/greenpak4/Greenpak4ClockBuffer.cpp
Original file line number Diff line number Diff line change
@@ -95,11 +95,11 @@ bool Greenpak4ClockBuffer::CommitChanges()
return true;
}

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

bool Greenpak4ClockBuffer::Save(bool* bitstream)
7 changes: 4 additions & 3 deletions src/greenpak4/Greenpak4DCMPMux.cpp
Original file line number Diff line number Diff line change
@@ -97,10 +97,11 @@ bool Greenpak4DCMPMux::CommitChanges()
return true;
}

bool Greenpak4DCMPMux::Load(bool* /*bitstream*/)
bool Greenpak4DCMPMux::Load(bool* bitstream)
{
LogError("Unimplemented\n");
return false;
ReadMatrixSelector(bitstream, m_inputBaseWord + 0, m_matrix, m_sel0);
ReadMatrixSelector(bitstream, m_inputBaseWord + 1, m_matrix, m_sel1);
return true;
}

bool Greenpak4DCMPMux::Save(bool* bitstream)
4 changes: 4 additions & 0 deletions src/greenpak4/Greenpak4Device.cpp
Original file line number Diff line number Diff line change
@@ -1038,6 +1038,10 @@ bool Greenpak4Device::ReadFromFile(string fname)
}
}

//TODO: Do some post-processing to create logical connections (e.g. infer VREF blocks)

//TODO: read this somewhere

/*
//Write chip-wide tuning data and ID code
switch(m_part)
6 changes: 3 additions & 3 deletions src/greenpak4/Greenpak4VoltageReference.cpp
Original file line number Diff line number Diff line change
@@ -110,9 +110,9 @@ bool Greenpak4VoltageReference::CommitChanges()

bool Greenpak4VoltageReference::Load(bool* /*bitstream*/)
{
//TODO: how do we do this?
LogError("Unimplemented\n");
return false;
//TODO: how do we do this? Vref is attached to the comparator, so we have to steal config from that...
LogWarning("Greenpak4VoltageReference::Load needs to be figured out\n");
return true;
}

bool Greenpak4VoltageReference::Save(bool* /*bitstream*/)

0 comments on commit e47ccc4

Please sign in to comment.