Time stamp in VHDL

和自甴很熟 提交于 2019-12-06 03:31:20

问题


is there any function in VHDL which is used to get current simulation time at which a process is running? May be same like the function in systemC sc_time_stamp()


回答1:


Yes there is. Use the keyword now.

You can print the simulation time using VHDL Attributes:

report "current time = " & time'image(now);

You can also store the current time to a variable:

variable v_TIME : time := 0 ns;
v_TIME := now;
-- STUFF HAPPENS
v_TIME := now - V_TIME; --used to find delta time



回答2:


If you want to know the time within your synthesised design, you will have to manage that yourself. For example, a free-running counter clocked from the same clock as the rest of your logic can be used to capture the time of particular events into registers. You could then transfer those registers periodically over some interface to a host PC or similar, or use an embedded logic analyser.

now is a purely simulation only construct, which tells you the simulation time to whatever resolution the simulator is set to. The real hardware has no concept of real time, only clock cycles, and has no standardised interface for accessing a console, so being able to synthesise report time'image(now) is not even remotely an option.



来源:https://stackoverflow.com/questions/20355021/time-stamp-in-vhdl

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