Hi,
I was looking for function coverage support in my existing verilog testbench. One way to achieve this is using System verilog coverage constructs. I was wondering if I can write SV coverage constructs under SV program /module and integrate this module inside verilog testbench. Will it work? For SV constructs to be implemented, do we need to have top testbench in SV or verilog 2k will do?
Dhananjay,
SV covergroup can be inside module/interface/program/class etc. If I understand your setup correctly, you have an existing Verilog TB + DUT and want to add covergroup. Easiest option will be to use SV's bind feature to achieve this.
Hope this gives you the hint. Feel free to contact me at ajeetha <> gmail.com if you need more. My company specializes in SystemVerilog adoption to our customers based in Bangalore, please see: www.noveldv.com.
Thanks for your solution. I've exact same setup. Now the only constraint is you should have all signals available in top level TB module port lists that you want to use. Suppose I want to use some signal from submodule then that signal has to bring out to top though corresponding module port list. Right?
Thanks for your solution. I've exact same setup. Now the only constraint is you should have all signals available in top level TB module port lists that you want to use. Suppose I want to use some signal from submodule then that signal has to bring out to top though corresponding module port list. Right?
Now the only constraint is you should have all signals available in top level TB module port lists that you want to use. Suppose I want to use some signal from submodule then that signal has to bring out to top though corresponding module port list. Right?
No not really true. SV Bind attaches to the target module - in my example "dut_controller". Say it is instantiated under:
top_tb.dut.block_1.control_0
Even then it will work - that's the beauty of SV bind. If you have signals in submodule that are inside dut_controller, you can use regaul XMR as if you are inside dut_controller scope.