Line 676... |
Line 676... |
|
|
}else{
|
}else{
|
$jtag="JTAG_INTFC=\"\$PRONOC_WORK/toolchain/bin/jtag_quartus_stp -a \$HARDWARE_NAME -b \$DEVICE_NAME\"";
|
$jtag="JTAG_INTFC=\"\$PRONOC_WORK/toolchain/bin/jtag_quartus_stp -a \$HARDWARE_NAME -b \$DEVICE_NAME\"";
|
|
|
}
|
}
|
print $file "#!/bin/sh
|
print $file "#!/bin/bash
|
|
|
PRODUCT_ID=\"0x$pid\"
|
PRODUCT_ID=\"0x$pid\"
|
HARDWARE_NAME=\'$hw *\'
|
HARDWARE_NAME=\'$hw *\'
|
DEVICE_NAME=\"\@$dw*\"
|
DEVICE_NAME=\"\@$dw*\"
|
|
|
Line 692... |
Line 692... |
|
|
#generate program_device.sh
|
#generate program_device.sh
|
open $file, ">", "$path/program_device.sh" or return "Error: Could not create $path/program_device.sh file in write mode!";
|
open $file, ">", "$path/program_device.sh" or return "Error: Could not create $path/program_device.sh file in write mode!";
|
|
|
|
|
print $file "#!/bin/sh
|
print $file "#!/bin/bash
|
|
|
#usage:
|
#usage:
|
# sh program_device.sh programming_file.sof
|
# bash program_device.sh programming_file.sof
|
|
|
#programming file
|
#programming file
|
#given as an argument: \$1
|
#given as an argument: \$1
|
|
|
#Programming mode
|
#Programming mode
|
Line 1012... |
Line 1012... |
|
|
#start compilation
|
#start compilation
|
my $Quartus_bin= $self->object_get_attribute('compile','quartus_bin');;
|
my $Quartus_bin= $self->object_get_attribute('compile','quartus_bin');;
|
add_info(\$tview, "Start Quartus compilation.....\n");
|
add_info(\$tview, "Start Quartus compilation.....\n");
|
my @compilation_command =(
|
my @compilation_command =(
|
"cd \"$target_dir/\" \n xterm -e sh -c '$Quartus_bin/quartus_map --64bit $name --read_settings_files=on; echo \$? > status' ",
|
"cd \"$target_dir/\" \n xterm -e bash -c '$Quartus_bin/quartus_map --64bit $name --read_settings_files=on; echo \$? > status' ",
|
"cd \"$target_dir/\" \n xterm -e sh -c '$Quartus_bin/quartus_fit --64bit $name --read_settings_files=on; echo \$? > status' ",
|
"cd \"$target_dir/\" \n xterm -e bash -c '$Quartus_bin/quartus_fit --64bit $name --read_settings_files=on; echo \$? > status' ",
|
"cd \"$target_dir/\" \n xterm -e sh -c '$Quartus_bin/quartus_asm --64bit $name --read_settings_files=on; echo \$? > status' ",
|
"cd \"$target_dir/\" \n xterm -e bash -c '$Quartus_bin/quartus_asm --64bit $name --read_settings_files=on; echo \$? > status' ",
|
"cd \"$target_dir/\" \n xterm -e sh -c '$Quartus_bin/quartus_sta --64bit $name;echo \$? > status' ");
|
"cd \"$target_dir/\" \n xterm -e bash -c '$Quartus_bin/quartus_sta --64bit $name;echo \$? > status' ");
|
|
|
foreach my $cmd (@compilation_command){
|
foreach my $cmd (@compilation_command){
|
add_info(\$tview,"$cmd\n");
|
add_info(\$tview,"$cmd\n");
|
unlink "$target_dir/status";
|
unlink "$target_dir/status";
|
my ($stdout,$exit)=run_cmd_in_back_ground_get_stdout( $cmd);
|
my ($stdout,$exit)=run_cmd_in_back_ground_get_stdout( $cmd);
|
Line 1063... |
Line 1063... |
unless (-f $bash_file) {
|
unless (-f $bash_file) {
|
add_colored_info(\$tview,"\tThe $bash_file does not exists! This file veries depend on your target board and must be available inside mpsoc/boards/[board_name].\n", 'red');
|
add_colored_info(\$tview,"\tThe $bash_file does not exists! This file veries depend on your target board and must be available inside mpsoc/boards/[board_name].\n", 'red');
|
$error=1;
|
$error=1;
|
}
|
}
|
return if($error);
|
return if($error);
|
my $command = "sh $bash_file $sof_file";
|
my $command = "bash $bash_file $sof_file";
|
add_info(\$tview,"$command\n");
|
add_info(\$tview,"$command\n");
|
my ($stdout,$exit,$stderr)=run_cmd_in_back_ground_get_stdout($command);
|
my ($stdout,$exit,$stderr)=run_cmd_in_back_ground_get_stdout($command);
|
if(length $stderr>1){
|
if(length $stderr>1){
|
add_colored_info(\$tview,"$stderr\n",'red');
|
add_colored_info(\$tview,"$stderr\n",'red');
|
add_colored_info(\$tview,"Board was not programed successfully!\n",'red');
|
add_colored_info(\$tview,"Board was not programed successfully!\n",'red');
|
Line 1250... |
Line 1250... |
$split->read_and_split(glob("$verilator/rtl_work/*.sv"));
|
$split->read_and_split(glob("$verilator/rtl_work/*.sv"));
|
$split->write_files();
|
$split->write_files();
|
|
|
|
|
#run verilator
|
#run verilator
|
#my $cmd= "cd \"$verilator/processed_rtl\" \n xterm -e sh -c ' verilator --cc $name.v --profile-cfuncs --prefix \"Vtop\" -O3 -CFLAGS -O3'";
|
#my $cmd= "cd \"$verilator/processed_rtl\" \n xterm -e bash -c ' verilator --cc $name.v --profile-cfuncs --prefix \"Vtop\" -O3 -CFLAGS -O3'";
|
foreach my $top (sort keys %tops) {
|
foreach my $top (sort keys %tops) {
|
add_colored_info(\$outtext,"Generate $top Verilator model from $tops{$top} file\n",'green');
|
add_colored_info(\$outtext,"Generate $top Verilator model from $tops{$top} file\n",'green');
|
my $cmd= "cd \"$verilator/processed_rtl\" \n verilator --cc $tops{$top} --prefix \"$top\" -O3 -CFLAGS -O3";
|
my $cmd= "cd \"$verilator/processed_rtl\" \n verilator --cc $tops{$top} --prefix \"$top\" -O3 -CFLAGS -O3";
|
add_info(\$outtext,"$cmd\n");
|
add_info(\$outtext,"$cmd\n");
|
my ($stdout,$exit,$stderr)=run_cmd_in_back_ground_get_stdout($cmd);
|
my ($stdout,$exit,$stderr)=run_cmd_in_back_ground_get_stdout($cmd);
|
Line 2189... |
Line 2189... |
});
|
});
|
|
|
$run -> signal_connect("clicked" => sub{
|
$run -> signal_connect("clicked" => sub{
|
my $bin="$verilator/processed_rtl/obj_dir/testbench";
|
my $bin="$verilator/processed_rtl/obj_dir/testbench";
|
if (-f $bin){
|
if (-f $bin){
|
my $cmd= "cd \"$verilator/processed_rtl/obj_dir/\" \n xterm -e sh -c $bin";
|
my $cmd= "cd \"$verilator/processed_rtl/obj_dir/\" \n xterm -e bash -c $bin";
|
add_info(\$tview,"$cmd\n");
|
add_info(\$tview,"$cmd\n");
|
my ($stdout,$exit,$stderr)=run_cmd_in_back_ground_get_stdout($cmd);
|
my ($stdout,$exit,$stderr)=run_cmd_in_back_ground_get_stdout($cmd);
|
if(length $stderr>1){
|
if(length $stderr>1){
|
add_colored_info(\$tview,"$stderr\n",'red');
|
add_colored_info(\$tview,"$stderr\n",'red');
|
}else {
|
}else {
|