Skip to content

Commit

Permalink
Timing analyzer is now aware of which cells are stateful, and won't r…
Browse files Browse the repository at this point in the history
…eport false combinatorial loops for stateful logic. No timing data for these blocks yet, though.
azonenberg committed Jun 24, 2017
1 parent b53f2e2 commit 1d910aa
Showing 3 changed files with 26 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/gp4par/par_reporting.cpp
Original file line number Diff line number Diff line change
@@ -264,8 +264,7 @@ void PrintTimingReport(Greenpak4Netlist* netlist, Greenpak4Device* device)
{
auto cell = it->second;

//TODO: check stateful internal blocks too
if(!cell->IsIbuf())
if(!cell->IsIbuf() && !cell->IsStateful())
continue;
sources.emplace(cell);
}
@@ -278,7 +277,7 @@ void PrintTimingReport(Greenpak4Netlist* netlist, Greenpak4Device* device)
auto cell = it->second;

//TODO: check stateful internal blocks too
if(!cell->IsObuf())
if(!cell->IsObuf() && !cell->IsStateful())
continue;
sinks.emplace(cell);
}
21 changes: 21 additions & 0 deletions src/greenpak4/Greenpak4NetlistCell.cpp
Original file line number Diff line number Diff line change
@@ -29,6 +29,9 @@ Greenpak4NetlistCell::~Greenpak4NetlistCell()
//do not delete wires, module dtor handles that
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Accessors

string Greenpak4NetlistCell::GetLOC()
{
string loc = m_attributes.at("LOC");
@@ -98,3 +101,21 @@ string Greenpak4NetlistCell::GetLOC()
else
return loc;
}

bool Greenpak4NetlistCell::IsStateful()
{
if(m_type.find("GP_COUNT") == 0)
return true;
if(m_type.find("GP_DFF") == 0)
return true;
if(m_type.find("GP_DLATCH") == 0)
return true;
if(m_type == "GP_PGEN")
return true;
if(m_type.find("GP_SHREG") == 0)
return true;
if(m_type.find("GP_SPI") == 0)
return true;

return false;
}
3 changes: 3 additions & 0 deletions src/greenpak4/Greenpak4NetlistCell.h
Original file line number Diff line number Diff line change
@@ -66,6 +66,9 @@ class Greenpak4NetlistCell : public Greenpak4NetlistEntity
bool IsPowerRail()
{ return (m_type == "GP_VDD") || (m_type == "GP_VSS"); }

//Indicates whether the cell is stateful (can start or end a combinatorial path)
bool IsStateful();

std::string GetLOC();

bool HasLOC()

0 comments on commit 1d910aa

Please sign in to comment.