forked from github/verilator
Fix Ubuntu 17.10 issues, bug1223 partial.
Signed-off-by: Wilson Snyder <wsnyder@wsnyder.org>
This commit is contained in:
parent
4794093aba
commit
c7cbe11ba4
2
Changes
2
Changes
@ -11,6 +11,8 @@ The contributors that suggested a given feature are shown in []. Thanks!
|
||||
|
||||
**** The internal test_verilated test directory is moved to be part of test_regress.
|
||||
|
||||
**** Fix Ubuntu 17.10 issues, bug1223 partial. [John Coiner]
|
||||
|
||||
|
||||
* Verilator 3.912 2017-09-23
|
||||
|
||||
|
@ -1904,7 +1904,8 @@ void EmitCImp::emitInt(AstNodeModule* modp) {
|
||||
bool did = false;
|
||||
for (AstNode* nodep=modp->stmtsp(); nodep; nodep = nodep->nextp()) {
|
||||
if (AstCell* cellp=nodep->castCell()) {
|
||||
if (!did++) {
|
||||
if (!did) {
|
||||
did = true;
|
||||
putsDecoration("// CELLS\n");
|
||||
if (modp->isTop()) puts("// Public to allow access to /*verilator_public*/ items;\n");
|
||||
if (modp->isTop()) puts("// otherwise the application code can consider these internals.\n");
|
||||
|
@ -329,7 +329,10 @@ void EmitCSyms::emitSymHdr() {
|
||||
{ // Scope names
|
||||
bool did = false;
|
||||
for (ScopeNames::iterator it = m_scopeNames.begin(); it != m_scopeNames.end(); ++it) {
|
||||
if (!did++) puts("\n// SCOPE NAMES\n");
|
||||
if (!did) {
|
||||
did = true;
|
||||
puts("\n// SCOPE NAMES\n");
|
||||
}
|
||||
puts("VerilatedScope __Vscope_"+it->second.m_symName+";\n");
|
||||
}
|
||||
}
|
||||
@ -432,7 +435,10 @@ void EmitCSyms::emitSymImp() {
|
||||
{ // Setup scope names
|
||||
bool did = false;
|
||||
for (ScopeNames::iterator it = m_scopeNames.begin(); it != m_scopeNames.end(); ++it) {
|
||||
if (!did++) puts("// Setup scope names\n");
|
||||
if (!did) {
|
||||
did = true;
|
||||
puts("// Setup scope names\n");
|
||||
}
|
||||
puts("__Vscope_"+it->second.m_symName+".configure(this,name(),");
|
||||
putsQuoted(it->second.m_prettyName);
|
||||
puts(");\n");
|
||||
|
@ -1002,13 +1002,14 @@ sub _run {
|
||||
if ($param{expect}) {
|
||||
# Compare
|
||||
my $quoted = quotemeta ($param{expect});
|
||||
my $bad = ($wholefile ne $param{expect}
|
||||
&& $wholefile !~ /$param{expect}/ms
|
||||
&& $wholefile !~ /$quoted/ms);
|
||||
if ($bad) {
|
||||
my $ok = ($wholefile eq $param{expect}
|
||||
|| _try_regex($wholefile, $param{expect}) == 1
|
||||
|| $wholefile =~ /$quoted/ms);
|
||||
if (!$ok) {
|
||||
#print "**BAD $self->{name} $param{logfile} MT $moretry $try\n";
|
||||
next if $moretry;
|
||||
$self->error("Mismatch in output from $param{cmd}[0]\n");
|
||||
$self->error("Might be error in regexp format\n") if $ok<1;
|
||||
print "GOT:\n";
|
||||
print $wholefile;
|
||||
print "ENDGOT\n";
|
||||
@ -1025,6 +1026,24 @@ sub _run {
|
||||
#######################################################################
|
||||
# Little utilities
|
||||
|
||||
sub _try_regex {
|
||||
# Try to eval a regexp
|
||||
# Returns:
|
||||
# 1 if $text ~= /$regex/ms
|
||||
# 0 if no match
|
||||
# -1 if $regex is invalid, doesn't compile
|
||||
my ($text, $regex) = @_;
|
||||
my $result;
|
||||
{
|
||||
local $@;
|
||||
eval {
|
||||
$result = ($text =~ /$regex/ms);
|
||||
};
|
||||
$result = -1 if $@;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub _make_main {
|
||||
my $self = shift;
|
||||
|
||||
|
@ -17,8 +17,8 @@ int main (int argc, char *argv[]) {
|
||||
Verilated::debug(0);
|
||||
|
||||
// Make sure public tag worked
|
||||
if (Vt_enum_public_p3::ZERO || Vt_enum_public_p3::ONE) {}
|
||||
if (Vt_enum_public_p62::ZERO || Vt_enum_public_p62::ALLONE) {}
|
||||
if (Vt_enum_public_p3::ZERO == Vt_enum_public_p3::ONE) {}
|
||||
if (Vt_enum_public_p62::ZERO == Vt_enum_public_p62::ALLONE) {}
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
topp->eval();
|
||||
|
@ -16,7 +16,7 @@ int main (int argc, char *argv[]) {
|
||||
Verilated::debug(0);
|
||||
|
||||
// Make sure public tag worked
|
||||
if (Vt_param_public_p::INPACK) {}
|
||||
if (Vt_param_public_p::INPACK == Vt_param_public_p::INPACK) {}
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
topp->eval();
|
||||
|
Loading…
Reference in New Issue
Block a user