How to drive /*verilator public*/ signals #835
Labels
area: usability
Issue involves general usability
resolution: no fix needed
Closed; no fix required (not a bug)
Author Name: Jonathon Donaldson
Original Redmine Issue: 835 from https://www.veripool.org
Original Date: 2014-11-01
I realize there are other forum posts and the wiki FAQ on this topic and they actually did help a lot. But I think I've exhausted the available existing resources at this point.
I have some internal signals in my design that I want to drive from my SystemC testbench. I have added the /verilator public/ as I'm supposed to and I see the signals show up in the verilated C++ code. I have also added the appropriate header files from the top all the way down (as is mentioned in one of the forum posts) so that I can compile the design without getting those "forward class declaration" errors. So I have something that looks like this:
The above syntax compiles and doesn't generate any errors or warnings.
However, my problem right now is that whenever I try to actually do anything with the signal, like read/write it the application keeps seg-faulting. For example, if I do either of these I get a core dump due to seg-fault:
I know I'm really close I just need a little bit more info...I'm sure I'm just doing something silly.
I'm new to SystemC so I'm wondering if I'm supposed to cast my_pub_signal to an sc_signal before using it or something? In the verilated code it is declared as a VL_SIG8 if that's helpful.
In the verilated my_submodule .h header file it looks like this:
Any ideas what I might be doing wrong?
The text was updated successfully, but these errors were encountered: