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

Subversion Repositories instruction_list_pipelined_processor_with_peripherals

[/] [instruction_list_pipelined_processor_with_peripherals/] [trunk/] [architecture/] [input_script.pl] - Diff between revs 15 and 16

Show entire file | Details | Blame | View Log

Rev 15 Rev 16
Line 4... Line 4...
print "Enter the Number of Rungs :\n";
print "Enter the Number of Rungs :\n";
my $rung_num = <>;
my $rung_num = <>;
chomp($rung_num);
chomp($rung_num);
 
 
my (@inp_array, @out_array, @inst_array);
my (@inp_array, @out_array, @inst_array);
@inp_array = ('10', '11', '12', '13', '14', '15', '16');
@inp_array = ('I0', 'I1', 'I2', 'I3', 'I4', 'I5', 'I6');
@out_array = ('20', '21', '22', '23', '24', '25', 'O6');
@out_array = ('O0', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6');
@inst_array = ('1', '2', '3', '4', '5');
@inst_array = ('LD', 'ST', 'AND', 'OR', 'N');
 
 
#Loop for Creating Instructions in a rung
#Loop for Creating Instructions in a rung
open my $file_out, ">", "PLC_instruction.txt";
open my $file_out, ">", "PLC_instruction.txt";
 
 
for (my $i = 1; $i <= $rung_num ; $i++)
for (my $i = 1; $i <= $rung_num ; $i++)
Line 34... Line 34...
        {
        {
        print {$file_out} $inst_array[int(rand(3))+1], " ";
        print {$file_out} $inst_array[int(rand(3))+1], " ";
    print {$file_out} $inp_array[int(rand(6))], "\n";
    print {$file_out} $inp_array[int(rand(6))], "\n";
        }
        }
  }
  }
print {$file_out} "5555 5555", "\n";
print {$file_out} "ENDOFRUNG", "\n";
#print {$file_out} "\n";
#print {$file_out} "\n";
}
}
close($file_out);
close($file_out);
 
 
 
 
 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.