OpenCores
URL https://opencores.org/ocsvn/an-fpga-implementation-of-low-latency-noc-based-mpsoc/an-fpga-implementation-of-low-latency-noc-based-mpsoc/trunk

Subversion Repositories an-fpga-implementation-of-low-latency-noc-based-mpsoc

[/] [an-fpga-implementation-of-low-latency-noc-based-mpsoc/] [trunk/] [mpsoc/] [perl_gui/] [lib/] [perl/] [temp.pl] - Diff between revs 25 and 28

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

Rev 25 Rev 28
Line 1... Line 1...
#!/usr/bin/perl
#!/usr/bin/perl
use warnings;
use warnings;
use strict;
use strict;
use File::System
use List::Util 'shuffle';
 
 
my $fs = File::System->new('Real');
 
my $fs = File::System->new('My::File::System::Foo');
 
(system("ls"));
 
 
 
 
 
 No newline at end of file
 No newline at end of file
 
sub remove_scolar_from_array{
 
        my ($array_ref,$item)=@_;
 
        my @array=@{$array_ref};
 
        my @new;
 
        foreach my $p (@array){
 
                if($p ne $item ){
 
                        push(@new,$p);
 
                }
 
        }
 
        return @new;
 
}
 
 
 
sub random_dest_gen {
 
        my $n=shift;
 
        my @c=(0..$n-1);
 
        my @o;
 
        for (my $i=0; $i<$n; $i++){
 
                my @l= shuffle @c;
 
                @l=remove_scolar_from_array(\@l,$i);
 
                $o[$i]=\@l;
 
 
 
        }
 
        return \@o;
 
 
 
}
 
 
 
my $ref=random_dest_gen(16);
 
my @random= @{$ref};
 
 
 
for (my $i=0; $i<16; $i++){
 
        for (my $j=0; $j<15; $j++){
 
        print @{$random[$i]}[$j];
 
        print ",";
 
}
 
print "\n";
 
}
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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