根据描述,我知道您想暂停基于信号的刺激生成,因此刺激时间相应于暂停时间延长。
为此,active_time
可以创建具有活动时间(如下所示)的信号,然后可以根据该时间生成刺激。活动时间仅在active_stimuli
TRUE 时运行。
然后可以创建active_wait_for
对应的支持程序(如下命名)以等待请求的活动时间量,以用于刺激生成过程。wait for
代码建议:
architecture syn of tb is
-- Active declarations
signal active_stimuli : boolean := TRUE;
constant ACTIVE_RESOLUTION : time := 1 ps;
signal active_time : time := 0 ps;
-- Wait procedure for active delay
procedure active_wait_for(delay : time) is
variable active_time_start_v : time;
begin
active_time_start_v := active_time;
if delay > 0 ps then
wait until active_time >= active_time_start_v + delay;
end if;
end procedure;
-- Stimuli signal
signal stimuli_a : std_logic;
signal stimuli_b : std_logic;
begin
-- Active time generation
process is
begin
wait for ACTIVE_RESOLUTION;
if active_stimuli then
active_time <= active_time + ACTIVE_RESOLUTION;
else -- Save execution time in loop by wait until
wait until active_stimuli;
end if;
end process;
-- Stimuli generation
process is
begin
stimuli_a <= '0';
stimuli_b <= '0';
wait until active_time >= 2 ns;
stimuli_a <= '1';
active_wait_for(3 ns);
stimuli_b <= '1';
wait;
end process;
...
波形显示操作如下:

请注意,极性与问题中的信号不同,但使用这种极性命名更清楚。