mirror of
https://github.com/verilator/verilator.git
synced 2025-01-06 06:37:45 +00:00
Tests: Allow driver to find 't' signals when not first in file.
This commit is contained in:
parent
5765e099a6
commit
99cd2818a1
@ -1297,14 +1297,23 @@ sub _read_inputs_v {
|
||||
my $filename = $self->top_filename;
|
||||
$filename = "$self->{t_dir}/$filename" if !-r $filename;
|
||||
my $fh = IO::File->new("<$filename") or die "%Error: $! $filename,";
|
||||
my $get_sigs=1;
|
||||
my %inputs;
|
||||
while (defined(my $line = $fh->getline)) {
|
||||
if ($line =~ /^\s*input\s*(\S+)\s*(\/[^\/]+\/|)\s*;/) {
|
||||
$self->{inputs}{$1} = $1;
|
||||
if ($get_sigs) {
|
||||
if ($line =~ /^\s*input\s*(\S+)\s*(\/[^\/]+\/|)\s*;/) {
|
||||
$inputs{$1} = $1;
|
||||
}
|
||||
if ($line =~ /^\s*(function|task|endmodule)/) {
|
||||
$get_sigs = 0;
|
||||
}
|
||||
}
|
||||
if ($line =~ /^\s*(function|task|endmodule)/) {
|
||||
last;
|
||||
if ($line =~ /^\s*module\s+t\b/) { # Ignore any earlier inputs; Module 't' has precedence
|
||||
%inputs = ();
|
||||
$get_sigs = 1;
|
||||
}
|
||||
}
|
||||
$self->{inputs}{$_} = $inputs{$_} foreach keys %inputs;
|
||||
$fh->close();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user