#836 remove all S_default.dat stuff

This commit is contained in:
Scott Fennell 2019-07-09 15:58:26 -05:00
parent 101ae55bb0
commit 82bae3b0d0
10 changed files with 2 additions and 133 deletions

View File

@ -135,10 +135,6 @@ The simulation-specific executive source code file.
The simulation-specific object code link list file.
=item B<S_default.dat>
The simulation-specific default initialization data file.
=back
=cut
@ -280,7 +276,6 @@ tidy:
-rm -f S_source.hh S_sie.resource
-rm -f S_main* T_main*
-rm -f build/Makefile_*
-rm -f S_default.dat
clean: tidy
-rm -f DP_Product/DP_rt_frame DP_Product/DP_rt_itimer

View File

@ -326,12 +326,6 @@ namespace Trick {
*/
virtual int load_checkpoint_job() ;
/**
* Calls the MemoryManager restore_managed_memory method with S_default.dat
* @return always 0
*/
virtual int load_default_data() ;
// Removed all doxygen documents for functions that have documents in the parent class since
// Doxygen inherits the documents from the parent class automatically.

View File

@ -14,7 +14,6 @@ use lib "$RealBin/pm" ;
use parse_s_define ;
use gte ;
use s_source ;
use default_data ;
use trick_print ;
use trick_version ;
@ -81,13 +80,9 @@ trick_print($sim{fh}, "S_source.c\n", "title_white", $sim{args}{v});
s_source( \%sim ) ;
#--------------------------------------------------------------
# Make Default Data
# close
chdir ($cwd) ;
trick_print($sim{fh}, "Writing ", "title_blue" , $sim{args}{v}) ;
trick_print($sim{fh}, "Default_data\n", "title_white" , $sim{args}{v}) ;
make_default_data( \%sim ) ;
close OUTFILE ;
#--------------------------------------------------------------
@ -124,10 +119,6 @@ See the Trick User's guide for B<CP>
=over 8
=item B<-d>
S_default.dat and Default_data (Default data files)
=item B<-e>
S_main_\${TRICK_HOST_CPU}.exe (Master executable)

View File

@ -1,93 +0,0 @@
package default_data ;
use Exporter ();
@ISA = qw(Exporter);
@EXPORT = qw(make_default_data);
use strict ;
use lib $ENV{"TRICK_HOME"} . "/bin/pm" ;
use gte ;
use trick_print ;
use get_paths ;
#--------------------------------------------------------------
# Make Default Data
sub make_default_data($) {
my ($sim_ref) = @_ ;
my $title ;
my @all_lines ;
my $date = localtime() ;
my $user ;
my @include_paths ;
if (open FILE, "Title") {
@all_lines = <FILE> ;
$title = join "" , @all_lines ;
chomp $title ;
close FILE ;
}
else {
$title = "No Title Specified" ;
}
$user = gte("USER");
chomp $user ;
open S_DEF, ">S_default.dat" or die "Could not open S_default.dat for writing" ;
my ($sec,$min,$hour,$mday,$mon,$year) = localtime ;
$year += 1900 ;
$mon += 1 ;
my ($login) = getpwuid($<) ;
#---------------------------
# Print version - date
printf S_DEF "\n// Created $year/%02d/%02d %02d\:%02d\:%02d $login\n",
$mon , $mday , $hour , $min , $sec ;
print S_DEF "
// TITLE: $title
// DATE: $date
// USER: $user\n\n" ;
my @default_data_list ;
@include_paths = get_include_paths() ;
foreach my $dd_comment ( @{$$sim_ref{default_data}} ) {
$dd_comment =~ s/\(\s*\(/\(/sg ;
$dd_comment =~ s/\)\s*\)/\)/sg ;
@default_data_list = $dd_comment =~ m/\((.+?)\)/sg ;
foreach my $dd ( @default_data_list ) {
my $file_found = 0 ;
my ($type , $var , $file_name) = split /\s+/ , $dd ;
if ( $file_name eq "" ) {
# not enough fields
trick_print($$sim_ref{fh},"Default data does not have \"TYPE VAR FILE\" syntax\n$dd\n", "title_red", $$sim_ref{args}{v}) ;
exit -1 ;
}
print S_DEF "\n// from $type $var $file_name\n\n" ;
(my $cc = gte("TRICK_CC")) =~ s/\n// ;
foreach my $inc ( @include_paths ) {
if ( -e "$inc/$file_name") {
open DEFDATA, "$cc -E -x c -D$type=$var $inc/$file_name |" ;
while ( <DEFDATA> ) {
print S_DEF if ( !/^#\s\d+/ )
}
$file_found = 1 ;
last ;
}
}
if ( $file_found == 0 ) {
print "\033[31mCould not find default data file $file_name\033[00m\n" ;
}
}
}
return ;
}
1;

View File

@ -39,8 +39,6 @@ The simulation-specific executive source code file.
\fIbuild/S_library_list\fP
The simulation-specific object code link list file.
.TP
\fIS_default.dat\fP
The simulation-specific default initialization data file.
.SH ENVIRONMENT
.TP
\fB${TRICK_CPFLAGS}\fP

View File

@ -214,8 +214,6 @@ class CheckPointRestartSimObject : public Trick::SimObject {
exec_register_scheduler(&cpr) ;
{TRK} P0 ("default_data") cpr.find_write_checkpoint_jobs(name + ".cpr") ;
{TRK} P0 ("default_data") cpr.load_default_data() ;
{TRK} P1 ("initialization") cpr.write_pre_init_checkpoint() ;
{TRK} P65535 ("initialization") cpr.write_post_init_checkpoint() ;
{TRK} P0 ("system_checkpoint") cpr.write_checkpoint() ;

1
test/.gitignore vendored
View File

@ -13,7 +13,6 @@ CP_out
MAKE_out
Makefile_sim
Makefile_swig
S_default.dat
S_document.xml
S_library_list
S_main_*

View File

@ -14,7 +14,6 @@ CP_out
MAKE_out
Makefile_sim
Makefile_swig
S_default.dat
S_document.xml
S_library_list
S_main_*

View File

@ -443,12 +443,6 @@ int Trick::CheckPointRestart::load_checkpoint_job() {
return(0) ;
}
int Trick::CheckPointRestart::load_default_data() {
trick_MM->read_checkpoint("S_default.dat") ;
return(0) ;
}
int Trick::CheckPointRestart::write_s_job_execution(FILE *fp) {
if ( fp == NULL ) {

View File

@ -63,13 +63,7 @@ int Trick::MemoryManager::read_checkpoint(const char* filename ) {
// Create a stream from the named file.
std::ifstream infile(filename , std::ios::in);
if (infile.is_open()) {
// If the filename is not S_default.dat, we will tell read_checkpoint to
// restore stls.
bool do_restore_stls =
(std::string(filename).find("S_default.dat") == std::string::npos);
return ( read_checkpoint( &infile, do_restore_stls )) ;
return ( read_checkpoint( &infile, true )) ;
} else {
std::stringstream message;
message << "Couldn't open \"" << filename << "\"." ;