Line 52... |
Line 52... |
|
|
|
|
|
|
|
|
#verilate the noc
|
#verilate the noc
|
|
my $start = localtime;
|
add_info($info_text, "verilate the NoC and make the library files");
|
add_info($info_text, "verilate the NoC and make the library files");
|
my $command = "cd \"$script_dir/\" \n xterm -l -lf logfile1.txt -e sh verilator_compile_hw.sh";
|
my $command = "cd \"$script_dir/\" \n xterm -l -lf logfile1.txt -e sh verilator_compile_hw.sh";
|
my ($stdout,$exit)=run_cmd_in_back_ground_get_stdout( $command);
|
my ($stdout,$exit)=run_cmd_in_back_ground_get_stdout( $command);
|
if($exit != 0){
|
if($exit != 0){
|
print "Verilator compilation failed !\n";
|
print "Verilator compilation failed !\n";
|
Line 90... |
Line 90... |
if($exit != 0){
|
if($exit != 0){
|
print "Verilator compilation failed !\n";
|
print "Verilator compilation failed !\n";
|
add_info($info_text, "Verilator compilation failed !\n$command\n $stdout\n");
|
add_info($info_text, "Verilator compilation failed !\n$command\n $stdout\n");
|
return;
|
return;
|
}
|
}
|
|
my $end = localtime;
|
|
|
|
|
|
|
#save the binarry file
|
#save the binarry file
|
my $bin= "$ENV{PRONOC_WORK}/verilator/work/processed_rtl/obj_dir/testbench";
|
my $bin= "$ENV{PRONOC_WORK}/verilator/work/processed_rtl/obj_dir/testbench";
|
my $path=$simulate->object_get_attribute ('sim_param',"BIN_DIR");
|
my $path=$simulate->object_get_attribute ('sim_param',"BIN_DIR");
|
my $name=$simulate->object_get_attribute ('sim_param',"SAVE_NAME");
|
my $name=$simulate->object_get_attribute ('sim_param',"SAVE_NAME");
|
|
|
#create project didrectory if its not exist
|
#create project directory if its not exist
|
($stdout,$exit)=run_cmd_in_back_ground_get_stdout("mkdir -p $path" );
|
($stdout,$exit)=run_cmd_in_back_ground_get_stdout("mkdir -p $path" );
|
if($exit != 0 ){ print "$stdout\n"; message_dialog($stdout); return;}
|
if($exit != 0 ){ print "$stdout\n"; message_dialog($stdout,'error'); return;}
|
|
|
#move the log file
|
#move the log file
|
move("$script_dir/logfile1.txt" , "$path/$name.log1");
|
unlink "$path/$name.log";
|
move("$script_dir/logfile2.txt" , "$path/$name.log2");
|
append_text_to_file("$path/$name.log","start:$start\n");
|
|
merg_files("$script_dir/logfile1.txt" , "$path/$name.log");
|
|
merg_files("$script_dir/logfile2.txt" , "$path/$name.log");
|
|
append_text_to_file("$path/$name.log","end:$end\n");
|
#check if the verilation was successful
|
#check if the verilation was successful
|
if ((-e $bin)==0) {#something goes wrong
|
if ((-e $bin)==0) {#something goes wrong
|
message_dialog("Verilator compilation was unsuccessful please check the $path/$name.log files for more information");
|
message_dialog("Verilator compilation was unsuccessful please check the $path/$name.log files for more information",'error');
|
return;
|
return;
|
}
|
}
|
|
|
|
|
#copy ($bin,"$path/$name") or die "Can not copy: $!";
|
#copy ($bin,"$path/$name") or die "Can not copy: $!";
|
($stdout,$exit)=run_cmd_in_back_ground_get_stdout("cp -f $bin $path/$name");
|
($stdout,$exit)=run_cmd_in_back_ground_get_stdout("cp -f $bin $path/$name");
|
if($exit != 0 ){ print "$stdout\n"; message_dialog($stdout); return;}
|
if($exit != 0 ){ print "$stdout\n"; message_dialog($stdout,'error'); return;}
|
|
|
#save noc info
|
#save noc info
|
open(FILE, ">$path/$name.inf") || die "Can not open: $!";
|
open(FILE, ">$path/$name.inf") || die "Can not open: $!";
|
print FILE perl_file_header("$name.inf");
|
print FILE perl_file_header("$name.inf");
|
my %pp;
|
my %pp;
|
Line 145... |
Line 147... |
|
|
}
|
}
|
|
|
|
|
##########
|
##########
|
# save_emulation
|
# save_simulation
|
##########
|
##########
|
sub save_simulation {
|
sub save_simulation {
|
my ($simulate)=@_;
|
my ($simulate)=@_;
|
# read emulation name
|
# read emulation name
|
my $name=$simulate->object_get_attribute ("simulate_name",undef);
|
my $name=$simulate->object_get_attribute ("simulate_name",undef);
|