...
The user may also select a text file containing signal names
split by commas and by lines
When the user selects the Edit button next to the Smart SIG_NAME
...
If the user is comfortable using Perl, they can write a perl script to generate a string
of comma separated signal names that must be assigned to the variable named \$expString.
In this case, the user is responsible to make sure the Perl compiles cleanly
or a warning will popUp that
may or may not be easy to figure out
When the user selects the Edit button next to Entry, and the Entry contains a string but does not point to a file,
The user will be prompted to Pick a filenName to save to.
If that file does not end in ".pl", the contents of the Smart SIG_NAME Entry , and the Entry is empty or does not point to a file,
They will be prompted to Pick a fileName to save to.
If the file they choose ends in .pl, pinWire will create an empty template file with the following contents.
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
#!/usr/bin/perl
use strict;
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'
#Insert code here
#End insert code
print "\$expString=$expString\n";
#this needs to be the last thing you do in this code
$expString=$expString;
|
the User should put their code to build the $expString in between the
#Insert code here
and the
#End insert code
Here is an example of some valid perl code which will build up a list of sigNames
...
will be added to the file
The commas will be replaced with newLines so there will be one sigName on each line in the file for easier editing
When the user saves the file, pinWire will process the contents of the Text file, just as if they were directly entered in the Smart SIG_NAME(s) Entry
Smart SIG_NAME Perl File
If the user is comfortable using Perl, they can write a perl script to generate a string
of comma separated signal names that must be assigned to the variable named \$expString.
In this case, the user is responsible to make sure the Perl compiles cleanly
or a warning will popUp that
may or may not be easy to figure out
When the user selects the Edit button next to the Smart SIG_NAME Entry, and the Entry is empty or does not point to a file,
The user will be prompted to Pick a fileName to save to.
If the file they choose ends in .pl, pinWire will create an empty template file with the following contents.
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
#!/usr/bin/perl use strict; 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' #Insert code here foreach my $i (0..3){ foreach my $j (0..1){ foreach my $pn (qw(p n)){ $expString.="I:pcie_sw" . $j ."_rx_" .${i} .${pn}. ","; } } } #End insert code print "\$expString=$expString\n"; #this needs to be the last thing you do in this code $expString=$expString; |
Here is the resulting value of expString which pinWire will process in place of the contents of the Smart SIG_NAME(s) Entry
Code Block |
---|
$expString=I:pcie_sw0_rx_0p,I:pcie_sw0_rx_0n, I:pcie_sw1_rx_0p,I:pcie_sw1_rx_0n, I:pcie_sw0_rx_1p,I:pcie_sw0_rx_1n, I:pcie_sw1_rx_1p,I:pcie_sw1_rx_1n, I:pcie_sw0_rx_2p,I:pcie_sw0_rx_2n, I:pcie_sw1_rx_2p,I:pcie_sw1_rx_2n, I:pcie_sw0_rx_3p,I:pcie_sw0_rx_3n, I:pcie_sw1_rx_3p,I:pcie_sw1_rx_3n,#End insert code print "\$expString=$expString\n"; #this needs to be the last thing you do in this code $expString=$expString; |
the User should put their code to build the $expString in between the
#Insert code here
and the
#End insert code
Here is an example of some valid perl code which will build up a list of sigNames
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
#!/usr/bin/perl
use strict;
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'
#Insert code here
foreach my $i (0..3){
foreach my $j (0..1){
foreach my $pn (qw(p n)){
$expString.="I:pcie_sw" . $j ."_rx_" .${i} .${pn}. ",";
}
}
}
#End insert code
print "\$expString=$expString\n";
#this needs to be the last thing you do in this code
$expString=$expString;
|
Here is the resulting value of expString (split with newlines for easier reading) which will be passed to pinWire.
Code Block |
---|
$expString=I:pcie_sw0_rx_0p,I:pcie_sw0_rx_0n,
I:pcie_sw1_rx_0p,I:pcie_sw1_rx_0n,
I:pcie_sw0_rx_1p,I:pcie_sw0_rx_1n,
I:pcie_sw1_rx_1p,I:pcie_sw1_rx_1n,
I:pcie_sw0_rx_2p,I:pcie_sw0_rx_2n,
I:pcie_sw1_rx_2p,I:pcie_sw1_rx_2n,
I:pcie_sw0_rx_3p,I:pcie_sw0_rx_3n,
I:pcie_sw1_rx_3p,I:pcie_sw1_rx_3n,
|
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 | ||||
---|---|---|---|---|
| ||||
#!/usr/bin/perl
use strict;
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'
#Insert code here
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;
my @loopList=$byteOrderHighToLow ? (0,1,2,3) :(3,2,1,0);
#skip the first 4 pins in the bank (to get to first strobe pins
$expString="!skip[3:0],";
foreach my $i (@loopList) {
#add strobe diff pair
$expString.=sprintf(
"io:dqs%d_c,io:dqs%d_t,",
$dqs_start-$i,
$dqs_start-$i,
);
#add upper nibble
$expString.=sprintf(
"io:dq[%d:%d],",
($msb_unib)-8*$i,($msb_unib)-8*$i-3,
);
#skip the _n pin
$expString.="!skip,";
#add the dm pin
$expString.=sprintf(
"in:dm%d,",
$dqs_start-$i,
);
#add the lower nibble
$expString.=sprintf(
"io:dq[%d:%d],",
($msb_lnib)-8*$i,($msb_lnib)-8*$i-3
);
}
#End insert code
print "\$expString=$expString\n";
#this needs to be the last thing you do in this code
$expString=$expString;
|