Skip to content

Commit

Permalink
Merge pull request #186 from andrefi-eml/master
Browse files Browse the repository at this point in the history
check_stable with specified value
  • Loading branch information
UVVM committed Oct 5, 2022
2 parents fd7f505 + 75c58c8 commit 2194427
Showing 1 changed file with 213 additions and 0 deletions.
213 changes: 213 additions & 0 deletions uvvm_util/src/methods_pkg.vhd
Expand Up @@ -1762,6 +1762,91 @@ package methods_pkg is
constant value_type : string := "real"
);


procedure await_stable_value(
signal target : boolean;
constant expected : boolean;
constant stable_req : time;
constant msg : string;
constant scope : string := C_TB_SCOPE_DEFAULT;
constant msg_id : t_msg_id := ID_POS_ACK;
constant msg_id_panel : t_msg_id_panel := shared_msg_id_panel;
constant caller_name : string := "await_stable_value()";
constant value_type : string := "boolean"
);

procedure await_stable_value(
signal target : std_logic_vector;
constant expected : std_logic_vector;
constant stable_req : time;
constant msg : string;
constant scope : string := C_TB_SCOPE_DEFAULT;
constant msg_id : t_msg_id := ID_POS_ACK;
constant msg_id_panel : t_msg_id_panel := shared_msg_id_panel;
constant caller_name : string := "await_stable_value()";
constant value_type : string := "slv"
);

procedure await_stable_value(
signal target : unsigned;
constant expected : unsigned;
constant stable_req : time;
constant msg : string;
constant scope : string := C_TB_SCOPE_DEFAULT;
constant msg_id : t_msg_id := ID_POS_ACK;
constant msg_id_panel : t_msg_id_panel := shared_msg_id_panel;
constant caller_name : string := "await_stable_value()";
constant value_type : string := "unsigned"
);

procedure await_stable_value(
signal target : signed;
constant expected : signed;
constant stable_req : time;
constant msg : string;
constant scope : string := C_TB_SCOPE_DEFAULT;
constant msg_id : t_msg_id := ID_POS_ACK;
constant msg_id_panel : t_msg_id_panel := shared_msg_id_panel;
constant caller_name : string := "await_stable_value()";
constant value_type : string := "signed"
);

procedure await_stable_value(
signal target : std_logic;
constant expected : std_logic;
constant stable_req : time;
constant msg : string;
constant scope : string := C_TB_SCOPE_DEFAULT;
constant msg_id : t_msg_id := ID_POS_ACK;
constant msg_id_panel : t_msg_id_panel := shared_msg_id_panel;
constant caller_name : string := "await_stable_value()";
constant value_type : string := "std_logic"
);

procedure await_stable_value(
signal target : integer;
constant expected : integer;
constant stable_req : time;
constant msg : string;
constant scope : string := C_TB_SCOPE_DEFAULT;
constant msg_id : t_msg_id := ID_POS_ACK;
constant msg_id_panel : t_msg_id_panel := shared_msg_id_panel;
constant caller_name : string := "await_stable_value()";
constant value_type : string := "integer"
);

procedure await_stable_value(
signal target : real;
constant expected : real;
constant stable_req : time;
constant msg : string;
constant scope : string := C_TB_SCOPE_DEFAULT;
constant msg_id : t_msg_id := ID_POS_ACK;
constant msg_id_panel : t_msg_id_panel := shared_msg_id_panel;
constant caller_name : string := "await_stable_value()";
constant value_type : string := "real"
);

impure function random (
constant length : integer
) return std_logic_vector;
Expand Down Expand Up @@ -6547,6 +6632,134 @@ package body methods_pkg is
check_stable(target, stable_req, error, msg, scope, msg_id, msg_id_panel, caller_name, value_type);
end;


procedure await_stable_value(
signal target : boolean;
constant expected : boolean;
constant stable_req : time;
constant msg : string;
constant scope : string := C_TB_SCOPE_DEFAULT;
constant msg_id : t_msg_id := ID_POS_ACK;
constant msg_id_panel : t_msg_id_panel := shared_msg_id_panel;
constant caller_name : string := "await_stable_value()";
constant value_type : string := "boolean"
) is
begin
check_value(target, expected, error, caller_name & " (" & value_type & ") => initial value was incorrect" & LF & msg, scope, msg_id, msg_id_panel, caller_name);
wait for stable_req;
check_value(target, expected, error, caller_name & " (" & value_type & ") => value was incorrect after " & to_string(stable_req) & "." & LF & msg, scope, msg_id, msg_id_panel, caller_name);
check_stable(target, stable_req, msg, scope, msg_id, msg_id_panel, caller_name, value_type);
end;

procedure await_stable_value(
signal target : std_logic_vector;
constant expected : std_logic_vector;
constant stable_req : time;
constant msg : string;
constant scope : string := C_TB_SCOPE_DEFAULT;
constant msg_id : t_msg_id := ID_POS_ACK;
constant msg_id_panel : t_msg_id_panel := shared_msg_id_panel;
constant caller_name : string := "await_stable_value()";
constant value_type : string := "slv"
) is
begin
check_value(target, expected, error, caller_name & " (" & value_type & ") => initial value was incorrect" & LF & msg, scope, HEX_BIN_IF_INVALID, KEEP_LEADING_0, msg_id, msg_id_panel, caller_name);
wait for stable_req;
check_value(target, expected, error, caller_name & " (" & value_type & ") => value was incorrect after " & to_string(stable_req) & "." & LF & msg, scope, HEX_BIN_IF_INVALID, KEEP_LEADING_0, msg_id, msg_id_panel, caller_name);
check_stable(target, stable_req, msg, scope, msg_id, msg_id_panel, caller_name, value_type);
end;

procedure await_stable_value(
signal target : unsigned;
constant expected : unsigned;
constant stable_req : time;
constant msg : string;
constant scope : string := C_TB_SCOPE_DEFAULT;
constant msg_id : t_msg_id := ID_POS_ACK;
constant msg_id_panel : t_msg_id_panel := shared_msg_id_panel;
constant caller_name : string := "await_stable_value()";
constant value_type : string := "unsigned"
) is
begin
check_value(target, expected, error, caller_name & " (" & value_type & ") => initial value was incorrect" & LF & msg, scope, HEX_BIN_IF_INVALID, KEEP_LEADING_0, msg_id, msg_id_panel, caller_name);
wait for stable_req;
check_value(target, expected, error, caller_name & " (" & value_type & ") => value was incorrect after " & to_string(stable_req) & "." & LF & msg, scope, HEX_BIN_IF_INVALID, KEEP_LEADING_0, msg_id, msg_id_panel, caller_name);
check_stable(target, stable_req, msg, scope, msg_id, msg_id_panel, caller_name, value_type);
end;

procedure await_stable_value(
signal target : signed;
constant expected : signed;
constant stable_req : time;
constant msg : string;
constant scope : string := C_TB_SCOPE_DEFAULT;
constant msg_id : t_msg_id := ID_POS_ACK;
constant msg_id_panel : t_msg_id_panel := shared_msg_id_panel;
constant caller_name : string := "await_stable_value()";
constant value_type : string := "signed"
) is
begin
check_value(target, expected, error, caller_name & " (" & value_type & ") => initial value was incorrect" & LF & msg, scope, HEX_BIN_IF_INVALID, KEEP_LEADING_0, msg_id, msg_id_panel, caller_name);
wait for stable_req;
check_value(target, expected, error, caller_name & " (" & value_type & ") => value was incorrect after " & to_string(stable_req) & "." & LF & msg, scope, HEX_BIN_IF_INVALID, KEEP_LEADING_0, msg_id, msg_id_panel, caller_name);
check_stable(target, stable_req, msg, scope, msg_id, msg_id_panel, caller_name, value_type);
end;

procedure await_stable_value(
signal target : std_logic;
constant expected : std_logic;
constant stable_req : time;
constant msg : string;
constant scope : string := C_TB_SCOPE_DEFAULT;
constant msg_id : t_msg_id := ID_POS_ACK;
constant msg_id_panel : t_msg_id_panel := shared_msg_id_panel;
constant caller_name : string := "await_stable_value()";
constant value_type : string := "std_logic"
) is
begin
check_value(target, expected, error, caller_name & " (" & value_type & ") => initial value was incorrect" & LF & msg, scope, msg_id, msg_id_panel, caller_name);
wait for stable_req;
check_value(target, expected, error, caller_name & " (" & value_type & ") => value was incorrect after " & to_string(stable_req) & "." & LF & msg, scope, msg_id, msg_id_panel, caller_name);
check_stable(target, stable_req, msg, scope, msg_id, msg_id_panel, caller_name, value_type);
end;

procedure await_stable_value(
signal target : integer;
constant expected : integer;
constant stable_req : time;
constant msg : string;
constant scope : string := C_TB_SCOPE_DEFAULT;
constant msg_id : t_msg_id := ID_POS_ACK;
constant msg_id_panel : t_msg_id_panel := shared_msg_id_panel;
constant caller_name : string := "await_stable_value()";
constant value_type : string := "integer"
) is
begin
check_value(target, expected, error, caller_name & " (" & value_type & ") => initial value was incorrect" & LF & msg, scope, msg_id, msg_id_panel, caller_name);
wait for stable_req;
check_value(target, expected, error, caller_name & " (" & value_type & ") => value was incorrect after " & to_string(stable_req) & "." & LF & msg, scope, msg_id, msg_id_panel, caller_name);
check_stable(target, stable_req, msg, scope, msg_id, msg_id_panel, caller_name, value_type);
end;

procedure await_stable_value(
signal target : real;
constant expected : real;
constant stable_req : time;
constant msg : string;
constant scope : string := C_TB_SCOPE_DEFAULT;
constant msg_id : t_msg_id := ID_POS_ACK;
constant msg_id_panel : t_msg_id_panel := shared_msg_id_panel;
constant caller_name : string := "await_stable_value()";
constant value_type : string := "real"
) is
begin
check_value(target, expected, error, caller_name & " (" & value_type & ") => initial value was incorrect" & LF & msg, scope, msg_id, msg_id_panel, caller_name);
wait for stable_req;
check_value(target, expected, error, caller_name & " (" & value_type & ") => value was incorrect after " & to_string(stable_req) & "." & LF & msg, scope, msg_id, msg_id_panel, caller_name);
check_stable(target, stable_req, msg, scope, msg_id, msg_id_panel, caller_name, value_type);
end;


----------------------------------------------------------------------------
-- check_time_window is used to check if a given condition occurred between
-- min_time and max_time
Expand Down

0 comments on commit 2194427

Please sign in to comment.