Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

pinWire will process the contents of the expString from the Perl Code,  just as if they were directly entered in the Smart SIG_NAME(s) Entry

Bonus Perl Code to Create DDR4 Signal Names for modern Xilinx FPGAs with 50 Pin I/O banks.

Code Block
languageperl
titlePerl Code to wire a 50 pin Xilinx I/O bank for DDR4 Memory
use warnings;
my $expString="";
#you need to create code that adds comma separated signal names to the $expString variable
#note that strict is enforced so you need to declare your variables with 'my'

my $highLow=0; #set to 1 for bus 63:32, set to 0 for bus 31:0
my $byteOrderHighToLow=0; #set to 1 to make the bytes/strobes descend
                      #set to 0 to make them ascend

my $msb_unib=$highLow? 63 : 31;
my $msb_lnib=$msb_unib-4;
my $dqs_start=$highLow? 7 : 3;
$expString="!skip[3:0],";
my @loopList=$byteOrderHighToLow ? (0,1,2,3) :(3,2,1,0);

foreach my $i (@loopList) {
  $expString.=sprintf(
                      "io:dqs%d_c,io:dqs%d_t,",
                      $dqs_start-$i,
                      $dqs_start-$i,
                     );
  $expString.=sprintf(
                      "io:dq[%d:%d],",
                      ($msb_unib)-8*$i,($msb_unib)-8*$i-3,
                     );
  $expString.="!skip,";
  $expString.=sprintf(
                      "in:dm%d,",
                      $dqs_start-$i,
                     );
  $expString.=sprintf(
                      "io:dq[%d:%d],",
                      ($msb_lnib)-8*$i,($msb_lnib)-8*$i-3
                     );


}
#print $expString ,"\n";

#this needs to be the last thing you do in this code

$expString=$expString;