From d6bdd35f5e85795b98a7ef7d0aa2bfddaa3ca4d1 Mon Sep 17 00:00:00 2001 From: Scott Fennell Date: Mon, 14 Jun 2021 13:50:32 -0500 Subject: [PATCH] separate perl generated top level objects from icg generated class information #1127 (#1161) closes #1127 Co-authored-by: Fennell, Scott P 263712616 --- libexec/trick/pm/s_source.pm | 8 ++++---- libexec/trick/sie_concat | 10 ++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/libexec/trick/pm/s_source.pm b/libexec/trick/pm/s_source.pm index 4eeb6d20..efdc25c1 100644 --- a/libexec/trick/pm/s_source.pm +++ b/libexec/trick/pm/s_source.pm @@ -17,7 +17,7 @@ sub s_source($) { # Generate S_source.c open S_SOURCE, ">build/S_source.cpp" or die "Couldn't open build/S_source.cpp!\n"; open S_SOURCE_H, ">S_source.hh" or die "Couldn't open S_source.hh!\n"; - open CLASSES_RESOURCE, ">build/classes.resource" or die "Couldn't open classes.resource!"; + open TOP_LEVEL_OBJECTS_RESOURCE, ">build/top_level_objects.resource" or die "Couldn't open top_level_objects.resource!"; # Get Trick version my ($version, $thread) = get_trick_version() ; @@ -211,7 +211,7 @@ PURPOSE: print S_SOURCE " " x 4 , "if ( (ai = get_alloc_info_at(&$inst)) != NULL ) {\n" ; print S_SOURCE " " x 8 , "ai->alloced_in_memory_init = 1 ;\n" ; print S_SOURCE " " x 4 , "}\n" ; - print CLASSES_RESOURCE " \\n \\n\n"; + print TOP_LEVEL_OBJECTS_RESOURCE " \\n \\n\n"; } @@ -222,9 +222,9 @@ PURPOSE: print S_SOURCE " " x 4 , "if ( (ai = get_alloc_info_at(&$$integ_loop{name})) != NULL ) {\n" ; print S_SOURCE " " x 8 , "ai->alloced_in_memory_init = 1 ;\n" ; print S_SOURCE " " x 4 , "}\n" ; - print CLASSES_RESOURCE " \\n \\n\n"; + print TOP_LEVEL_OBJECTS_RESOURCE " \\n \\n\n"; } - close CLASSES_RESOURCE ; + close TOP_LEVEL_OBJECTS_RESOURCE ; print S_SOURCE "\n" ; print S_SOURCE $$sim_ref{create_connections} ; diff --git a/libexec/trick/sie_concat b/libexec/trick/sie_concat index 76771462..29e6817b 100755 --- a/libexec/trick/sie_concat +++ b/libexec/trick/sie_concat @@ -11,7 +11,17 @@ open(my $classes_resource, "<", "build/classes.resource") while(my $line = <$classes_resource>) { print $S_sie_resource $line; } + close($classes_resource); + +open(my $top_level_objects_resource, "<", "build/top_level_objects.resource") + or die "cannot open build/top_level_objects.resource"; +while(my $line = <$top_level_objects_resource>) { + print $S_sie_resource $line; +} + +close($top_level_objects_resource); + my $sim_services_resource; open($sim_services_resource, "<", "$ENV{TRICK_HOME}/share/trick/xml/sim_services_classes.resource") or open($sim_services_resource, "<", "$ENV{TRICK_HOME}/temp_src/io_src/sim_services_classes.resource")