Accessing inputs and outputs in sub-modules from testbench

怎甘沉沦 提交于 2019-12-23 12:39:17

问题


My device-under-test (DUT) has many sub-modules and I would like to test some of them.

My test fixture will be the top level of my project - one level higher than the DUT - and since I can only seem to access the inputs and outputs of the modules one level down, I can only access the top-level inputs and outputs of the DUT.

I would like to be able to access signals from the modules two or more levels beneath the test fixture, ideally without having to rewrite any modules to add more outputs so the signals I want to test are connected to the top level.

I could rewrite the device under test but this seems time-consuming and I feel there should be a quicker way.

Is there a way to write a test fixture that can access signals within sub-modules, without rewriting the DUT?


回答1:


If you only need to monitor signals inside your top-level dut module, you can use hierarchical path specifiers to scope down into the dut:

dut.read_data

SystemVerilog also offers the bind statement to do something similar.

If you need to drive internal dut signals, you should create a separate testbench for the sub-module. This is more time-consuming, but gives you better control and allows you to achieve 100% coverage (which can sometimes be difficult at the top-level).



来源:https://stackoverflow.com/questions/19545048/accessing-inputs-and-outputs-in-sub-modules-from-testbench

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!