Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
veripoolbot opened this issue Jan 15, 2018 · 6 comments
Closed

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

veripoolbot opened this issue Jan 15, 2018 · 6 comments
Assignees

Comments

@veripoolbot
Copy link

@veripoolbot veripoolbot commented Jan 15, 2018


Author Name: Alex Solomatnikov
Original Redmine Issue: 1264 from https://www.veripool.org

Original Assignee: Wilson Snyder (@wsnyder)


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

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Jan 17, 2018


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2018-01-17T00:33:36Z


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

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Jan 23, 2018


Original Redmine Comment
Author Name: Alex Solomatnikov
Original Date: 2018-01-23T01:27:15Z


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

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Jan 27, 2018


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2018-01-27T20:12:45Z


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

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Feb 1, 2018


Original Redmine Comment
Author Name: Alex Solomatnikov
Original Date: 2018-02-01T23:39:53Z


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


@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Feb 2, 2018


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2018-02-02T01:08:46Z


Thanks for the test, fixed in git towards 3.919.

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Feb 2, 2018


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2018-02-02T01:17:20Z


In 3.920.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.