Fix tristate enables for -fno-inline (#7016) (#7019)

This commit is contained in:
Leela Pakanati 2026-02-08 21:47:09 -06:00 committed by GitHub
parent 5a236dd35d
commit e36838ad8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 1 deletions

View File

@ -1645,7 +1645,8 @@ class TristateVisitor final : public TristateBaseVisitor {
AstPin* const enpinp
= new AstPin{nodep->fileline(), nodep->pinNum(),
enModVarp->name(), // should be {var}"__en"
new AstVarRef{nodep->fileline(), enVarp, VAccess::WRITE}};
new AstVarRef{nodep->fileline(), enVarp,
inDeclProcessing ? VAccess::READ : VAccess::WRITE}};
enpinp->modVarp(enModVarp);
UINFO(9, " newpin " << enpinp);
enpinp->user2Or(U2_BOTH); // don't iterate the pin later

View File

@ -0,0 +1,19 @@
#!/usr/bin/env python3
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
# 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-FileCopyrightText: 2026 Wilson Snyder
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
import vltest_bootstrap
test.scenarios('vlt_all')
test.top_filename = "t/t_altera_lpm.v"
module = re.sub(r'.*t_altera_', '', test.name)
module = re.sub(r'_noinl', '', module)
test.compile(verilator_flags2=["--top-module", module, "-fno-inline"])
test.passes()