Project

General

Profile

[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  IPC::Locker
  Parallel::Forker
  Voneline
General Info
  Papers

Issue #1264

verilator generates bad C++ with --public for module binds

Added by Alex Solomatnikov almost 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
TranslationError
% Done:

0%


Description

Verilog:

  bind mem_ext          deserialize_hex2ram_if  #(.MEM_HIER(sifive_etc_pkg::mem_ext_e))         i_hex2ram (.trigger(!TestDriver.reset));

  bind testharness_ext  deserialize_hex2ram_if  #(.MEM_HIER(sifive_etc_pkg::testharness_ext_e)) i_hex2ram (.trigger(!TestDriver.reset));
  bind testharness_ext  serialize_ram2hex_if                                                    i_ram2hex ();

clang++ errors:

In file included from VTestDriver__ALLcls.cpp:364:
./VTestDriver__94__Slow.cpp:14848:5: error: use of undeclared identifier 'TestDriver__DOT__testHarness__DOT__UCoreIPSubsystem__DOT__testIndicator__DOT__i_TF__Viftop'
    TestDriver__DOT__testHarness__DOT__UCoreIPSubsystem__DOT__testIndicator__DOT__i_TF__Viftop = VL_RAND_RESET_I(1);
    ^
In file included from VTestDriver__ALLcls.cpp:368:
./VTestDriver__98__Slow.cpp:562:5: error: use of undeclared identifier 'TestDriver__DOT__testHarness__DOT__testRAM__DOT__sram__DOT__testharness__DOT__testharness_ext__DOT__i_hex2ram__Viftop'; did you mean '__PVT__TestDriver__DOT__testHarness__DOT__testRAM__DOT__sram__DOT__testharness__DOT__testharness_ext__DOT__i_hex2ram'?
    TestDriver__DOT__testHarness__DOT__testRAM__DOT__sram__DOT__testharness__DOT__testharness_ext__DOT__i_hex2ram__Viftop = VL_RAND_RESET_I(1);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    __PVT__TestDriver__DOT__testHarness__DOT__testRAM__DOT__sram__DOT__testharness__DOT__testharness_ext__DOT__i_hex2ram
./VTestDriver.h:433:45: note: '__PVT__TestDriver__DOT__testHarness__DOT__testRAM__DOT__sram__DOT__testharness__DOT__testharness_ext__DOT__i_hex2ram' declared here
    VTestDriver_deserialize_hex2ram_if__M0*     __PVT__TestDriver__DOT__testHarness__DOT__testRAM__DOT__sram__DOT__testharness__DOT__testharness_ext__DOT__i_hex2ram;
                                                ^
In file included from VTestDriver__ALLcls.cpp:368:
./VTestDriver__98__Slow.cpp:562:125: error: assigning to 'VTestDriver_deserialize_hex2ram_if__M0 *' from incompatible type 'IData' (aka 'unsigned int')
    TestDriver__DOT__testHarness__DOT__testRAM__DOT__sram__DOT__testharness__DOT__testharness_ext__DOT__i_hex2ram__Viftop = VL_RAND_RESET_I(1);
                                                                                                                            ^~~~~~~~~~~~~~~~~~
./VTestDriver__98__Slow.cpp:563:5: error: use of undeclared identifier 'TestDriver__DOT__testHarness__DOT__testRAM__DOT__sram__DOT__testharness__DOT__testharness_ext__DOT__i_ram2hex__Viftop'
    TestDriver__DOT__testHarness__DOT__testRAM__DOT__sram__DOT__testharness__DOT__testharness_ext__DOT__i_ram2hex__Viftop = VL_RAND_RESET_I(1);
    ^
1 warning and 4 errors generated.
make: *** [VTestDriver__ALLcls.o] Error 1

t_interface_bind_public.v (3.69 KB) Alex Solomatnikov, 02/01/2018 11:37 PM

t_interface_bind_public.pl View (501 Bytes) Alex Solomatnikov, 02/01/2018 11:37 PM

History

#1 Updated by Wilson Snyder almost 2 years ago

  • Category set to TranslationError
  • Status changed from New to AskedReporter

Can you please provide a standalone test case in "test_regress" format?

#2 Updated by Alex Solomatnikov almost 2 years ago

The testcase is the same as in #1260 but with -Og -Wno-fatal --public

#3 Updated by Wilson Snyder almost 2 years ago

The testcase is too large for me to compile on my machine, can you please create a small example, thanks.

#4 Updated by Alex Solomatnikov almost 2 years ago

Apparently there is no any tests for bind of interface.

Testcase is attached.

Output with compile error:

t/t_interface_bind_public.pl
======================================================================
vlt/t_interface_bind_public: ==================================================
vlt/t_interface_bind_public: Compile
    perl ../bin/verilator --prefix Vt_interface_bind_public --x-assign unique -cc -Mdir obj_dir/t_interface_bind_public -OD --debug-check --comp-limit-members 10 -public --clk clk  -f input.vc t/t_interface_bind_public.v    > obj_dir/t_interface_bind_public/vlt_compile.log
vlt/t_interface_bind_public: GCC
    make -C obj_dir/t_interface_bind_public -f /scratch/sols/verilator/test_regress/Makefile_obj VM_PREFIX=Vt_interface_bind_public CPPFLAGS_DRIVER=-DT_INTERFACE_BIND_PUBLIC    Vt_interface_bind_public    > obj_dir/t_interface_bind_public/vlt_gcc.log
make: Entering directory '/scratch/sols/verilator/test_regress/obj_dir/t_interface_bind_public'
/usr/bin/perl /scratch/sols/verilator/test_regress/../bin/verilator_includer -DVL_INLINE_OPT=inline Vt_interface_bind_public__main.cpp /scratch/sols/verilator/test_regress/../include/verilated.cpp Vt_interface_bind_public.cpp Vt_interface_bind_public___024unit.cpp Vt_interface_bind_public_deserialize_hex2ram_if.cpp Vt_interface_bind_public__Syms.cpp > Vt_interface_bind_public__ALLboth.cpp
g++  -I.  -MMD -I/scratch/sols/verilator/test_regress/../include -I/scratch/sols/verilator/test_regress/../include/vltstd -DVL_PRINTF=printf -DVM_COVERAGE=0 -DVM_SC=0 -DVM_TRACE=0 -Wno-sign-compare -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable -Wno-shadow      -DVERILATOR=1 -DVL_DEBUG=1 -DVM_PREFIX=Vt_interface_bind_public -DVM_PREFIX_INCLUDE="<Vt_interface_bind_public.h>" -DT_INTERFACE_BIND_PUBLIC    -c -o Vt_interface_bind_public__ALLboth.o Vt_interface_bind_public__ALLboth.cpp
In file included from Vt_interface_bind_public__ALLboth.cpp:5:0:
Vt_interface_bind_public.cpp: In member function ‘void Vt_interface_bind_public::_ctor_var_reset()’:
Vt_interface_bind_public.cpp:646:5: error: ‘t__DOT__testHarness__DOT__testharness_ext__DOT__i_hex2ram__Viftop’ was not declared in this scope
     t__DOT__testHarness__DOT__testharness_ext__DOT__i_hex2ram__Viftop = VL_RAND_RESET_I(1);
     ^
/scratch/sols/verilator/test_regress/Makefile_obj:69: recipe for target 'Vt_interface_bind_public__ALLboth.o' failed
make: *** [Vt_interface_bind_public__ALLboth.o] Error 1
make: Leaving directory '/scratch/sols/verilator/test_regress/obj_dir/t_interface_bind_public'
%Warning: vlt/t_interface_bind_public: Exec of make failed

vlt/t_interface_bind_public: %Error: Exec of make failed
vlt/t_interface_bind_public: FAILED: ************************************************************
==SUMMARY: Left NO-FORKER  Passed 0  Unsup 0  Skipped 0  Failed 1

======================================================================
TESTS Passed 0  Unsup 0  Skipped 0  Failed 1  Time 0:01
    #vlt/t_interface_bind_public: %Error: Exec of make failed
        make && test_regress/t/t_interface_bind_public.pl 
TESTS Passed 0  Unsup 0  Skipped 0  Failed 1  Time 0:01

#5 Updated by Wilson Snyder almost 2 years ago

  • Status changed from AskedReporter to Resolved
  • Assignee set to Wilson Snyder

Thanks for the test, fixed in git towards 3.919.

#6 Updated by Wilson Snyder almost 2 years ago

  • Status changed from Resolved to Closed

In 3.920.

Also available in: Atom