projects
/
x300-pci
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
c5a7e89
)
support multiple remote openocd instances
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Thu, 9 Jun 2016 17:15:48 +0000
(19:15 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Thu, 9 Jun 2016 17:15:48 +0000
(19:15 +0200)
openocd-jtag-boundary-scan.pl
patch
|
blob
|
history
diff --git
a/openocd-jtag-boundary-scan.pl
b/openocd-jtag-boundary-scan.pl
index
bc02ce3
..
50043df
100755
(executable)
--- a/
openocd-jtag-boundary-scan.pl
+++ b/
openocd-jtag-boundary-scan.pl
@@
-6,6
+6,8
@@
use autodie;
use Data::Dump qw(dump);
use IO::Socket::INET;
use Data::Dump qw(dump);
use IO::Socket::INET;
+my $openocd_remote = shift @ARGV || 'picam:4444';
+
my $bit2pin;
my $io2bit;
my $bit2pin;
my $io2bit;
@@
-13,6
+15,7
@@
my $pin2io;
my $in_pin_map = 0;
my $pin_map = '';
my $in_pin_map = 0;
my $pin_map = '';
+$|=1; # flush stdout
open(my $bsdl, '<', '_3128at100.bsd');
while(<$bsdl>) {
open(my $bsdl, '<', '_3128at100.bsd');
while(<$bsdl>) {
@@
-64,7
+67,7
@@
sub print_io {
my $bits = shift;
my $i = 0;
# foreach my $io ( @sort ) {
my $bits = shift;
my $i = 0;
# foreach my $io ( @sort ) {
- print "pin off io___ I C O | " x 4, "\n";
+ print "pin off io___ I C O | " x 4,
$openocd_remote,
"\n";
foreach my $i ( 0 .. ($#$pin2io/4)-1 ) {
foreach my $j ( 0 .. 3 ) {
#my $pin = ($i*4) + $j + 1; # rows
foreach my $i ( 0 .. ($#$pin2io/4)-1 ) {
foreach my $j ( 0 .. 3 ) {
#my $pin = ($i*4) + $j + 1; # rows
@@
-86,7
+89,7
@@
sub print_io {
# printf "hex = %4s binary = %16s\n", $h, hex2bin($h);
#}
# printf "hex = %4s binary = %16s\n", $h, hex2bin($h);
#}
-my $sock = IO::Socket::INET->new(
'picam:4444'
);
+my $sock = IO::Socket::INET->new(
$openocd_remote
);
sub hex2bin {
my $h = shift;
sub hex2bin {
my $h = shift;
@@
-119,6
+122,7
@@
while (<$sock>) {
if ( /^\s*([A-F0-9]+)/ ) {
my $hex = $1;
my $bin = hex2bin($hex);
if ( /^\s*([A-F0-9]+)/ ) {
my $hex = $1;
my $bin = hex2bin($hex);
+ diff_bits($BSR, $bin);
$BSR = $bin;
print_io $bin;
last;
$BSR = $bin;
print_io $bin;
last;