Uvvm lite using block_flag, unblock_flag, await_unblock_flag and getting unexpected timeout

I am using block_flags for the fist time with UVVM Lite. I am getting a timeout that I do not expect. This is the stripped down code. I also have a signal global_trigger : std_logic :=‘Z’; Can you tell me what I am doing wrong?

UVVM: *** ERROR #1 ***

UVVM: 1020 ns TB seq.

UVVM: check_value() => Failed. Boolean was false. ‘F1 timed out. ‘waiting for CMD_ACTIVATE to complete’’

TX_0_PROC : process is
begin
wait for 10 ns;
block_flag(“F1”,“blocking during CMD_ACTIVATE”);
–do something 1
wait for 100 ns;
unblock_flag(“F1”,“unblock after CMD_ACTIVATE completed”,global_trigger);
wait;
end process TX_0_PROC ;

RX_0_PROC : process is
begin
wait for 20 ns;
await_unblock_flag(“F1”,1000 ns,“waiting for CMD_ACTIVATE to complete”);
block_flag(“F2”,“blocking during STAT_ACTIVATE_CONFIRM”);
– do something 2
wait for 100 ns;
unblock_flag(“F2”,“unblock after STAT_ACTIVATE_CONFIRM completed”,global_trigger);
wait;
end process RX_0_PROC;

Hi,

You should try removing your signal global_trigger. The global signal that the procedures use is already defined in global_signals_and_shared_variables_pkg.

I removed the signal global_trigger from my TB and the await_flag still reaches a timeout. The gen_pulse in the unblock_flag is set to 0 ns, and the detection of global_trigger in await_unblock_flag is on rising_edge. I though that this might be OK and use a default or time tick but no luck. So as an experiment I used the code below and the block_flag, await_unblock_flag and unblock_flag work as expected. So unless there is a reason not to I am going to change the gen_pulse in unlock_flag to 1ns.
FLAG_BLOCK_PROC : process is
begin
wait for 1 ns;
block_flag(“FTEST”,“CMD_ACTIVATE”);
wait for 100 ns;
unblock_flag(“FTEST”,“CMD_ACTIVATE”,global_trigger);
gen_pulse(global_trigger, 1 ns, “pulsing global_trigger”, “”, ID_BFM);
wait;
end process FLAG_BLOCK_PROC;

FLAG_UNBLOCK_PROC : process is
begin
wait for 10 ns;
await_unblock_flag(“FTEST”,1000 ns,“CMD_ACTIVATE”);
wait;
end process FLAG_UNBLOCK_PROC;

Hi,
Can you paste your complete testbench? Then we can try to run your simulations and better see what is the problem.

Br,
Marius

Hi, Thanks. I created a smaller TB and the code works as advertised. Here is the transcript and TB.

– Time: 1 ns Iteration: 0 Instance: /uvvm_flag_tb
– UVVM: ID_BLOCKING 1.0 ns TB seq. FTEST: New blocked synchronization flag added. ‘CMD : block_flag’
– UVVM: ID_BLOCKING 10.0 ns TB seq. FTEST: Waiting to be unblocked. ‘CMD : await_unblock_flag’
– UVVM: ID_BLOCKING 101.0 ns TB seq. FTEST: Unblocking flag. ‘CMD : unblock_flag’
– UVVM: ID_BLOCKING 101.0 ns TB seq. FTEST: Has been unblocked.
– UVVM: ID_SEQUENCER 101.0 ns TB seq. past await_unblock_flag

– libraries
library ieee;
use ieee.std_logic_1164.all;
use std.textio.all;
use ieee.numeric_std.all;
use ieee.std_logic_textio.all;
use ieee.math_real.all;

library uvvm_util;
context uvvm_util.uvvm_util_context;

entity uvvm_flag_tb is
end entity uvvm_flag_tb;

architecture tb of uvvm_flag_tb is

begin

FLAG_BLOCK_PROC : process is
begin
wait for 1 ns;
block_flag(“FTEST”,“CMD : block_flag”);
wait for 100 ns;
unblock_flag(“FTEST”,“CMD : unblock_flag”,global_trigger);

wait;
end process FLAG_BLOCK_PROC;

FLAG_UNBLOCK_PROC : process is
begin
wait for 10 ns;
await_unblock_flag(“FTEST”, 1000 ns, “CMD : await_unblock_flag”);
log(“past await_unblock_flag”);
wait;
end process FLAG_UNBLOCK_PROC;

end architecture tb;