OpenCores
URL https://opencores.org/ocsvn/scan_based_serial_communication/scan_based_serial_communication/trunk

Subversion Repositories scan_based_serial_communication

[/] [scan_based_serial_communication/] [trunk/] [scan.perl.v] - Diff between revs 4 and 11

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 4 Rev 11
Line 128... Line 128...
       for (my $i = 0; $i < scalar @signal_list; $i++) {
       for (my $i = 0; $i < scalar @signal_list; $i++) {
          if ($signal_list[$i]{writable} == 1) {
          if ($signal_list[$i]{writable} == 1) {
 
 
             my $name      = $signal_list[$i]{name};
             my $name      = $signal_list[$i]{name};
             my $size      = $signal_list[$i]{size};
             my $size      = $signal_list[$i]{size};
             my $addr_bits = $signal_list[$i]{addr_bits};
             my $addr_bits = 0 + $signal_list[$i]{addr_bits};
             my $data_bits = $signal_list[$i]{data_bits};
             my $data_bits = 0 + $signal_list[$i]{data_bits};
 
             my $reset   = 0 + $signal_list[$i]{reset};
 
 
             my $size_begin = $signal_list[$i]{start};
             my $size_begin = $signal_list[$i]{start};
             my $size_end   = $size_begin + $size - 1;
             my $size_end   = $size_begin + $size - 1;
 
 
             my $addr_begin = $signal_list[$i]{start};
             my $addr_begin = $signal_list[$i]{start};
Line 141... Line 142...
 
 
             my $data_begin = $addr_end + 1;
             my $data_begin = $addr_end + 1;
             my $data_end   = $data_begin + $data_bits - 1;
             my $data_end   = $data_begin + $data_bits - 1;
 
 
             if ($signal_list[$i]{addr_bits} == 0) {
             if ($signal_list[$i]{addr_bits} == 0) {
                print "      $name = scan_slave[$size_end:$size_begin];\n";
                print "      $name = scan_slave[$scan_reset_bit] ? ${size}'d${reset} : scan_slave[$size_end:$size_begin];\n";
             } else {
             } else {
                if ($scan_reset_exists) {
                if ($scan_reset_exists) {
                   print "      if (scan_slave[$scan_reset_bit]) ${name} = ${size}'d0; else\n";
                   print "      if (scan_slave[$scan_reset_bit]) ${name} = ${size}'d${reset}; else\n";
                }
                }
                print "      case (scan_slave[$addr_end:$addr_begin])\n";
                print "      case (scan_slave[$addr_end:$addr_begin])\n";
                for (my $a = 0; ($a+1-1)*$data_bits < $size; $a++) {
                for (my $a = 0; ($a+1-1)*$data_bits < $size; $a++) {
                   print "         ${addr_bits}'d${a}: ${name}[$a*$data_bits +: $data_bits] = scan_slave[$data_end:$data_begin];\n";
                   print "         ${addr_bits}'d${a}: ${name}[$a*$data_bits +: $data_bits] = scan_slave[$data_end:$data_begin];\n";
                }
                }

powered by: WebSVN 2.1.0

© copyright 1999-2019 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.