Skip to content

Commit ca3ceec

Browse files
committed
Resolve paths for vhier --includes.
1 parent 928b0be commit ca3ceec

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

t/85_vhier_xml.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
</input_files>
2727
<includes>
2828
<file name="verilog/v_hier_top.v">
29-
<inc name="v_hier_inc.vh" />
29+
<inc name="verilog/v_hier_inc.vh" />
3030
</file>
3131
</includes>
3232
<missing_modules>

vhier

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ sub vhier {
137137
$nl->read_libraries();
138138
$fh->print(" <resolve_files>\n") if $Opt_Xml;
139139
foreach my $file (@files) {
140-
if (my $resolved = $nl->resolve_filename ($file, "all")) {
140+
if (my $resolved = $nl->resolve_filename($file, "all")) {
141141
$fh->print( "$resolved\n") if !$Opt_Xml;
142142
$fh->print( " <file>$resolved</file>\n") if $Opt_Xml;
143143
}
@@ -204,10 +204,12 @@ sub vhier {
204204
$fh->print(" <includes>\n") if $Opt_Xml;
205205
foreach my $filename (sort keys %{$Opt->includes}) {
206206
$fh->print(" $filename\n") if !$Opt_Xml;
207-
$fh->print(" <file name=\"$filename\">\n") if $Opt_Xml;
207+
$fh->printf(" <file name=\"%s\">\n",
208+
$Opt->file_path($filename)) if $Opt_Xml;
208209
foreach my $incname (sort keys %{$Opt->{includes}{$filename}}) {
209210
$fh->print(" $incname\n") if !$Opt_Xml;
210-
$fh->print(" <inc name=\"$incname\" />\n") if $Opt_Xml;
211+
$fh->printf(" <inc name=\"%s\" />\n",
212+
$Opt->file_path($incname)) if $Opt_Xml;
211213
}
212214
$fh->print(" </file>\n") if $Opt_Xml;
213215
}
@@ -350,7 +352,7 @@ sub show_hier {
350352
# print the mod instance
351353
$fh->printf("%s<cell name=\"%s\" submodname=\"%s\" hier=\"%s\" filename=\"%s\">\n",
352354
$indent, ($parcell ? $parcell->name : $name), $name, $hier,
353-
$mod->filename)
355+
$Opt->file_path($mod->filename))
354356
if $Opt_Xml;
355357
$fh->printf("%s%s %s\n", $indent, $instance, $name)
356358
if !$Opt_Xml && $Opt_Instance;

0 commit comments

Comments
 (0)