You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to how perl fork behaves, @verilog::Std::std@ can return no SystemVerilog std package definition. Additionally if the standards mode of Verilog::Perl is changed at runtime the std package for some Verilog versions can be blank.
In my program this happens because the @DaTa@ filehandle behaves unexpectedly after a call to fork and seems to share the filehandle seek pointer with the child process, but it's possible to reproduce without fork. The @DaTa@ filehandle in Verilog::Std is getting advanced and not reset, this results in the SystemVerilog std package not being defined for some Verilog::Perl parses.
This program should reproduce and produce the FAILED message.
use Verilog::Std;
use Verilog::Language;
my $pid = fork();
if ($pid == 0) {
printf "Standard is %d bytes long.\n", length Verilog::Std::std();
exit 0;
} else {
waitpid $pid, 0;
}
my $stdLen = length Verilog::Std::std();
if ($stdLen == 0) {
print "FAILED standard is blank!\n";
exit 0;
} else {
printf "PASSED standard is %d bytes long\n", $stdLen;
exit 1;
}
However this simpler case also reproduces:
use Verilog::Std;
use Verilog::Language;
length Verilog::Std::std('1800-2009');
my $stdLen = length Verilog::Std::std();
if ($stdLen == 0) {
print "FAILED standard is blank!\n";
exit 0;
} else {
printf "PASSED standard is %d bytes long\n", $stdLen;
exit 1;
}
Instead of the @DATA@ section possibly a here-document could be used, should be good back to Perl 5.8.8 at-least?
my $stdHeader = <<'EOF';
...
import std::*;
EOF
The text was updated successfully, but these errors were encountered:
Author Name: Corey Teffetalor
Original Redmine Issue: 1394 from https://www.veripool.org
Original Assignee: Wilson Snyder (@wsnyder)
Due to how perl
fork
behaves, @verilog::Std::std@ can return no SystemVerilog std package definition. Additionally if the standards mode of Verilog::Perl is changed at runtime the std package for some Verilog versions can be blank.In my program this happens because the @DaTa@ filehandle behaves unexpectedly after a call to
fork
and seems to share the filehandle seek pointer with the child process, but it's possible to reproduce withoutfork
. The @DaTa@ filehandle in Verilog::Std is getting advanced and not reset, this results in the SystemVerilog std package not being defined for some Verilog::Perl parses.This program should reproduce and produce the FAILED message.
However this simpler case also reproduces:
Instead of the @DATA@ section possibly a here-document could be used, should be good back to Perl 5.8.8 at-least?
The text was updated successfully, but these errors were encountered: