Skip to content

Commit 43627e9

Browse files
committedOct 26, 2016
greenpak4: Added pin 13 reset output support for SLG46140V
1 parent 9685050 commit 43627e9

File tree

2 files changed

+49
-32
lines changed

2 files changed

+49
-32
lines changed
 

‎src/gp4par/par_main.cpp

+37-25
Original file line numberDiff line numberDiff line change
@@ -356,37 +356,49 @@ bool PostPARDRC(PARGraph* netlist, Greenpak4Device* device)
356356
//TODO: Cannot use DAC1 when ADC is used
357357
}
358358

359-
//If POR is driven to an IOB, it should be pin 8 using dedicated routing
359+
//If POR is driven to an IOB, it should use dedicated routing
360360
//If not, warn about timing
361-
if(
362-
(device->GetPart() == Greenpak4Device::GREENPAK4_SLG46620) ||
363-
(device->GetPart() == Greenpak4Device::GREENPAK4_SLG46621)
364-
)
361+
auto por = device->GetPowerOnReset()->GetPARNode()->GetMate();
362+
if(por)
365363
{
366-
//Get all IOB loads of the POR
367-
auto p8 = device->GetIOB(8);
368-
auto por = device->GetPowerOnReset()->GetPARNode()->GetMate();
369-
if(por)
364+
Greenpak4IOB* reset_iob = NULL;
365+
366+
//Find the dedicated reset pin
367+
auto part = device->GetPart();
368+
switch(part)
370369
{
371-
for(uint32_t i=0; i<por->GetEdgeCount(); i++)
372-
{
373-
auto dest = por->GetEdgeByIndex(i)->m_destnode->GetMate();
374-
auto n = static_cast<Greenpak4BitstreamEntity*>(dest->GetData())->GetRealEntity();
370+
case Greenpak4Device::GREENPAK4_SLG46620:
371+
case Greenpak4Device::GREENPAK4_SLG46621:
372+
reset_iob = device->GetIOB(8);
373+
break;
375374

376-
auto ioba = dynamic_cast<Greenpak4IOBTypeA*>(n);
377-
auto iobb = dynamic_cast<Greenpak4IOBTypeB*>(n);
375+
case Greenpak4Device::GREENPAK4_SLG46140:
376+
reset_iob = device->GetIOB(13);
377+
break;
378378

379-
if( (ioba == NULL) && (iobb == NULL) )
380-
continue;
379+
default:
380+
LogError("unrecognized device, cannot DRC POR routing\n");
381+
}
381382

382-
if(n != p8)
383-
{
384-
LogWarning(
385-
"Pin %s is driven by the power-on reset, but is does not have dedicated reset routing.\n"
386-
"This may lead to synchronization issues or glitches if this pin is used to drive resets on "
387-
"external logic.\n",
388-
n->GetDescription().c_str());
389-
}
383+
//Look for IOBs driven by the PAR
384+
for(uint32_t i=0; i<por->GetEdgeCount(); i++)
385+
{
386+
auto dest = por->GetEdgeByIndex(i)->m_destnode->GetMate();
387+
auto n = static_cast<Greenpak4BitstreamEntity*>(dest->GetData())->GetRealEntity();
388+
389+
auto ioba = dynamic_cast<Greenpak4IOBTypeA*>(n);
390+
auto iobb = dynamic_cast<Greenpak4IOBTypeB*>(n);
391+
392+
if( (ioba == NULL) && (iobb == NULL) )
393+
continue;
394+
395+
if(n != reset_iob)
396+
{
397+
LogWarning(
398+
"Pin %s is driven by the power-on reset, but is does not have dedicated reset routing.\n"
399+
"This may lead to synchronization issues or glitches if this pin is used to drive resets on "
400+
"external logic.\n",
401+
n->GetDescription().c_str());
390402
}
391403
}
392404
}

‎src/greenpak4/Greenpak4IOBTypeB.cpp

+12-7
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,25 @@ bool Greenpak4IOBTypeB::Save(bool* bitstream)
7979
if(!WriteMatrixSelector(bitstream, m_inputBaseWord, m_outputSignal))
8080
return false;
8181

82-
//If we are pin 8 on the SLG4662x, use dedicated routing when driven by the POR block
83-
if((m_pinNumber == 8) && (m_outputSignal.GetRealEntity() == m_device->GetPowerOnReset()) )
82+
//Use dedicated routing when driven by the POR block
83+
if(m_outputSignal.GetRealEntity() == m_device->GetPowerOnReset())
8484
{
85-
if(
86-
(m_device->GetPart() == Greenpak4Device::GREENPAK4_SLG46620) ||
87-
(m_device->GetPart() == Greenpak4Device::GREENPAK4_SLG46621)
85+
if( (m_pinNumber == 8) &&
86+
(
87+
(m_device->GetPart() == Greenpak4Device::GREENPAK4_SLG46620) ||
88+
(m_device->GetPart() == Greenpak4Device::GREENPAK4_SLG46621)
89+
)
8890
)
8991
{
9092
bitstream[2012] = true;
9193
bitstream[2011] = false;
9294
}
9395

94-
else
95-
LogError("Greenpak4IOBTypeB: not implemented for 46140 yet\n");
96+
else if( (m_pinNumber == 13) && (m_device->GetPart() == Greenpak4Device::GREENPAK4_SLG46140) )
97+
{
98+
bitstream[999] = 1;
99+
bitstream[998] = 0;
100+
}
96101
}
97102

98103
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)
Please sign in to comment.