Skip to content

Commit

Permalink
Fixed bugs in input buffer constraint handling
Browse files Browse the repository at this point in the history
azonenberg committed Apr 8, 2017
1 parent 49d4941 commit 9da41dc
Showing 2 changed files with 29 additions and 4 deletions.
31 changes: 28 additions & 3 deletions src/greenpak4/Greenpak4NetlistModule.cpp
Original file line number Diff line number Diff line change
@@ -195,13 +195,38 @@ void Greenpak4NetlistModule::AddWireAttribute(string target, string name, string
//Find the cell that drove the wire and tag it
auto net = m_nets[target];
auto driver = net->m_driver;
if(driver.m_cell != NULL)
{
LogDebug("Wire is driven by cell %s, constraining that instead\n", driver.m_cell->m_name.c_str());
driver.m_cell->m_attributes[name] = value;
return;
}

//If the wire is undriven, maybe it's a top-level input! Should be driving a single GP_I[O]BUF cell
if(net->m_nodeports.size() != 1)
{
LogWarning("Couldn't constrain object \"%s\" because it has no driver and more than one load\n", target.c_str());
return;
}
driver = net->m_nodeports[0];
if(driver.m_cell == NULL)
{
LogWarning("Couldn't constrain object \"%s\" because it has no driver\n", target.c_str());
LogWarning("Couldn't constrain object \"%s\" because it has no driver and no loads\n", target.c_str());
return;
}
LogDebug("Wire is driven by cell %s, constraining that instead\n", driver.m_cell->m_name.c_str());
driver.m_cell->m_attributes[name] = value;

if( (driver.m_portname == "IN") && (driver.m_cell->m_type == "GP_IBUF") )
{
LogDebug("Wire drives input buffer %s, constraining that instead\n", driver.m_cell->m_name.c_str());
driver.m_cell->m_attributes[name] = value;
}
else if( (driver.m_portname == "IO") && (driver.m_cell->m_type == "GP_IOBUF") )
{
LogDebug("Wire drives input/output buffer %s, constraining that instead\n", driver.m_cell->m_name.c_str());
driver.m_cell->m_attributes[name] = value;
}
else
LogWarning("Couldn't constrain object \"%s\" because it has no driver and does not drive a GP_I[O]BUF\n", target.c_str());
}

void Greenpak4NetlistModule::LoadAttributes(json_object* object)
2 changes: 1 addition & 1 deletion src/log
Submodule log updated from 4bf105 to 8015d9

0 comments on commit 9da41dc

Please sign in to comment.