Fix LHS is not a lvalue when using tristate with -Oi.

This commit is contained in:
Wilson Snyder 2020-11-25 21:09:25 -05:00
parent f2d8e45d72
commit de931d6a97
2 changed files with 23 additions and 0 deletions

View File

@ -1107,6 +1107,7 @@ class TristateVisitor final : public TristateBaseVisitor {
AstVar* enVarp = new AstVar(nodep->fileline(), AstVarType::MODULETEMP,
nodep->name() + "__en" + cvtToStr(m_unique++),
VFlagBitPacked(), enModVarp->width());
enModVarp->direction(VDirection::INPUT);
UINFO(9, " newenv " << enVarp << endl);
AstPin* enpinp
= new AstPin(nodep->fileline(), nodep->pinNum(),

View File

@ -0,0 +1,22 @@
#!/usr/bin/env perl
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
# Copyright 2003 by Wilson Snyder. This program is free software; you
# can redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
scenarios(vlt_all => 1);
top_filename("t/t_altera_lpm.v");
(my $module = $Self->{name}) =~ s/.*t_altera_//;
$module =~ s/_noinl//;
compile(
verilator_flags2 => ["--top-module ${module}", "-Oi"]
);
ok(1);
1;