Skip to content

Commit 9da41dc

Browse files
committedApr 8, 2017
Fixed bugs in input buffer constraint handling
1 parent 49d4941 commit 9da41dc

File tree

2 files changed

+29
-4
lines changed

2 files changed

+29
-4
lines changed
 

‎src/greenpak4/Greenpak4NetlistModule.cpp

+28-3
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,38 @@ void Greenpak4NetlistModule::AddWireAttribute(string target, string name, string
195195
//Find the cell that drove the wire and tag it
196196
auto net = m_nets[target];
197197
auto driver = net->m_driver;
198+
if(driver.m_cell != NULL)
199+
{
200+
LogDebug("Wire is driven by cell %s, constraining that instead\n", driver.m_cell->m_name.c_str());
201+
driver.m_cell->m_attributes[name] = value;
202+
return;
203+
}
204+
205+
//If the wire is undriven, maybe it's a top-level input! Should be driving a single GP_I[O]BUF cell
206+
if(net->m_nodeports.size() != 1)
207+
{
208+
LogWarning("Couldn't constrain object \"%s\" because it has no driver and more than one load\n", target.c_str());
209+
return;
210+
}
211+
driver = net->m_nodeports[0];
198212
if(driver.m_cell == NULL)
199213
{
200-
LogWarning("Couldn't constrain object \"%s\" because it has no driver\n", target.c_str());
214+
LogWarning("Couldn't constrain object \"%s\" because it has no driver and no loads\n", target.c_str());
201215
return;
202216
}
203-
LogDebug("Wire is driven by cell %s, constraining that instead\n", driver.m_cell->m_name.c_str());
204-
driver.m_cell->m_attributes[name] = value;
217+
218+
if( (driver.m_portname == "IN") && (driver.m_cell->m_type == "GP_IBUF") )
219+
{
220+
LogDebug("Wire drives input buffer %s, constraining that instead\n", driver.m_cell->m_name.c_str());
221+
driver.m_cell->m_attributes[name] = value;
222+
}
223+
else if( (driver.m_portname == "IO") && (driver.m_cell->m_type == "GP_IOBUF") )
224+
{
225+
LogDebug("Wire drives input/output buffer %s, constraining that instead\n", driver.m_cell->m_name.c_str());
226+
driver.m_cell->m_attributes[name] = value;
227+
}
228+
else
229+
LogWarning("Couldn't constrain object \"%s\" because it has no driver and does not drive a GP_I[O]BUF\n", target.c_str());
205230
}
206231

207232
void Greenpak4NetlistModule::LoadAttributes(json_object* object)

‎src/log

Submodule log updated from 4bf1057 to 8015d9d

0 commit comments

Comments
 (0)