@@ -356,37 +356,49 @@ bool PostPARDRC(PARGraph* netlist, Greenpak4Device* device)
356
356
// TODO: Cannot use DAC1 when ADC is used
357
357
}
358
358
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
360
360
// 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)
365
363
{
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)
370
369
{
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 ;
375
374
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 ;
378
378
379
- if ( (ioba == NULL ) && (iobb == NULL ) )
380
- continue ;
379
+ default :
380
+ LogError (" unrecognized device, cannot DRC POR routing\n " );
381
+ }
381
382
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 ());
390
402
}
391
403
}
392
404
}
0 commit comments