@@ -110,10 +110,14 @@ sub pre_workspace {
110
110
" \t -non_shared$crlf " ;
111
111
}
112
112
113
- # TODO(sonndinh): Looks like this only support [INTEGRITY Application] with
114
- # only one [Program] (i.e., executable) in the image. But this seems sufficient
115
- # for most cases. How does a [INTEGRITY Application] gpj file look with more
116
- # than one [Program]s and how does the corresponding .int file look?
113
+ # Write a .int file processed by the Integrate tool to create a dynamic download image.
114
+ # This file creates a single virtual AddressSpace with specific assumptions such as
115
+ # the language being used is C++, the heap size, stack length of the Initial Task.
116
+ # Specific application may need to update the generated .int file according to its needs.
117
+ # For example, if the application requires working with a file system, use the MULTI IDE
118
+ # GUI to add a file system module to the application; this will automatically update the
119
+ # .int file. If the application requires more heap memory, manually update the HeapSize
120
+ # line to increase the heap size.
117
121
sub create_integrity_project {
118
122
my ($self , $int_proj , $project , $type , $target ) = @_ ;
119
123
my $outdir = $self -> get_outdir();
@@ -141,8 +145,8 @@ sub create_integrity_project {
141
145
" AddressSpace$crlf " ,
142
146
" \t Filename\t\t\t $target$crlf " ,
143
147
" \t Language\t\t\t C++$crlf " ,
144
- # # sonndinh: Some ACE tests require a bigger heap memory size.
145
- # # Default heap size is 64kB; increase to 2MB here .
148
+ # Default heap size is 64kB .
149
+ # Increase to 2MB here to cover more applications .
146
150
" \t HeapSize\t\t\t 0x200000$crlf " ,
147
151
" \t Task Initial$crlf " ,
148
152
" \t\t StackLength\t\t 0x8000$crlf " ,
@@ -160,28 +164,32 @@ sub mix_settings {
160
164
my $mix = $project ;
161
165
my $outdir = $self -> get_outdir();
162
166
167
+ # If the project file path is already an absolute path, use it.
168
+ my $fullpath ;
169
+ if ($project =~ / ^\/ .*/ || $project =~ / ^[a-zA-Z]:.*/ ) {
170
+ $fullpath = $project ;
171
+ } else {
172
+ $fullpath = " $outdir /$project " ;
173
+ }
174
+
163
175
# # Things that seem like they should be set in the project
164
176
# # actually have to be set in the controlling project file.
165
- if (open ($rh , " $outdir / $project " )) {
177
+ if (open ($rh , $fullpath )) {
166
178
my $crlf = $self -> crlf();
167
179
my $integrity_project = (index ($tgt , ' integrity' ) >= 0);
168
180
my ($int_proj , $int_type , $target );
169
181
170
- # (sonndinh): Go through the lines in this project's gpj file.
171
- # Each line may result in some changes added to the workspace gpj file.
172
- # The changes are returned in the $mix variable.
173
- # In case the project is an
174
182
while (<$rh >) {
175
- # (sonndinh): Don't need to add compiler/linker options to the workspace file.
176
- # The gpj file for each individual project should have those already.
177
- # In the workspace file (the top-level project file) , only need to list the child projects.
183
+ # Don't need to add compiler/linker options to the workspace file.
184
+ # The . gpj file for each individual project should have those already.
185
+ # In the workspace file, only need to list the child projects.
178
186
if (/ ^\s *(\[ (Program|Library|Subproject)\] )\s *$ / ) {
179
187
my $type = $1 ;
180
188
if ($integrity_project && $type eq ' [Program]' ) {
181
- $int_proj = $project ; # E.g., tests/ARGV_Test .gpj
182
- $int_proj =~ s / (\. gpj)$/ _int$1 / ; # E.g., tests/ARGV_Test_int .gpj
189
+ $int_proj = $project ; # E.g., tests/MyTest .gpj
190
+ $int_proj =~ s / (\. gpj)$/ _int$1 / ; # E.g., tests/MyTest_int .gpj
183
191
$int_type = $type ; # E.g., [Program]
184
- $mix =~ s / (\. gpj)$/ _int$1 / ; # E.g., tests/ARGV_Test_int .gpj
192
+ $mix =~ s / (\. gpj)$/ _int$1 / ; # E.g., tests/MyTest_int .gpj
185
193
$type = $integrity ; # [INTEGRITY Application]
186
194
}
187
195
$mix .= " \t\t $type$crlf " ;
@@ -228,22 +236,10 @@ sub mix_settings {
228
236
sub write_comps {
229
237
my ($self , $fh ) = @_ ;
230
238
231
- # my $projects = $self->get_projects();
232
- # my @list = $self->sort_dependencies($projects);
233
-
234
- # foreach (@list) {
235
- # print "$_\n";
236
- # }
237
-
238
- # TODO(sonndinh): Looks like the individual project files are produced before this happens.
239
- # And this module relies on them to add contents to the workspace file (default.gpj in case of GHS).
240
-
241
239
# # Print out each project
242
240
foreach my $project ($self -> sort_dependencies($self -> get_projects(), 0)) {
243
241
print $fh $self -> mix_settings($project );
244
242
}
245
243
}
246
244
247
-
248
-
249
245
1;
0 commit comments