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: 4bcdb8596c91
Choose a base ref
...
head repository: azonenberg/openfpga
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b069ded4ec34
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Dec 31, 2016

  1. Copy the full SHA
    0946306 View commit details
  2. Copy the full SHA
    b069ded View commit details
Showing with 50 additions and 7 deletions.
  1. +29 −0 src/gp4par/par_main.cpp
  2. +16 −7 src/greenpak4/Greenpak4DigitalComparator.cpp
  3. +5 −0 src/greenpak4/Greenpak4DigitalComparator.h
29 changes: 29 additions & 0 deletions src/gp4par/par_main.cpp
Original file line number Diff line number Diff line change
@@ -329,6 +329,35 @@ bool PostPARDRC(PARGraph* netlist, Greenpak4Device* device)
}
}

//Check for multiple oscillators with power-down enabled but not the same source
powerdowns.clear();
for(int i=0; i<device->GetDcmpCount(); i++)
{
auto d = device->GetDcmp(i);
if(d->IsUsed())
powerdowns.push_back(spair(d->GetDescription(), d->GetPowerDown()));
}
if(!powerdowns.empty())
{
Greenpak4EntityOutput src = powerdowns[0].second;
bool xok = true;
for(auto p : powerdowns)
{
if(src != p.second)
xok = false;
}

if(!xok)
{
LogError(
"Multiple DCMPs have power-down enabled, but do not share the same power-down signal\n");
for(auto p : powerdowns)
LogNotice(" DCMPs %10s powerdown is %s\n", p.first.c_str(), p.second.GetOutputName().c_str());

ok = false;
}
}

//ADC/DAC conflicts
if( (device->GetPart() == Greenpak4Device::GREENPAK4_SLG46620) ||
(device->GetPart() == Greenpak4Device::GREENPAK4_SLG46621))
23 changes: 16 additions & 7 deletions src/greenpak4/Greenpak4DigitalComparator.cpp
Original file line number Diff line number Diff line change
@@ -158,8 +158,23 @@ bool Greenpak4DigitalComparator::Load(bool* /*bitstream*/)
return false;
}

bool Greenpak4DigitalComparator::IsUsed()
{
bool noClock = (m_clock.IsPowerRail() && !m_clock.GetPowerRailValue());
bool noInP = (m_inp[0].IsPowerRail() && !m_inp[0].GetPowerRailValue());
bool noInN = (m_inn[0].IsPowerRail() && !m_inn[0].GetPowerRailValue());
if(noClock && noInP && noInN)
return false;

return true;
}

bool Greenpak4DigitalComparator::Save(bool* bitstream)
{
//If no inputs hooked up, stop
if(!IsUsed())
return true;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// INPUT BUS

@@ -208,16 +223,10 @@ bool Greenpak4DigitalComparator::Save(bool* bitstream)
}
}

//If no input, stop
//If null inputs, but not unused, complain
bool noClock = (m_clock.IsPowerRail() && !m_clock.GetPowerRailValue());
bool noInP = (m_inp[0].IsPowerRail() && !m_inp[0].GetPowerRailValue());
bool noInN = (m_inn[0].IsPowerRail() && !m_inn[0].GetPowerRailValue());
if(noClock && noInP && noInN)
{
return true;
}

//If null inputs, but not unused, complain
if(noClock || noInP || noInN)
{
LogError("Missing clock or input to DCMP_%d (%s clock, %s inP, %s inN)\n",
5 changes: 5 additions & 0 deletions src/greenpak4/Greenpak4DigitalComparator.h
Original file line number Diff line number Diff line change
@@ -56,6 +56,11 @@ class Greenpak4DigitalComparator : public Greenpak4BitstreamEntity
void AddInputNMuxEntry(Greenpak4EntityOutput net, unsigned int sel)
{ m_innsels[net] = sel; }

bool IsUsed();

Greenpak4EntityOutput GetPowerDown()
{ return m_powerDown; }

protected:
Greenpak4EntityOutput m_powerDown;
Greenpak4EntityOutput m_inp[8];