p_main: process
– variable v_ready : std_logic ;
– variable v_done : std_logic;
variable v_result : std_logic_vector(15 downto 0);
begin
wait for 50 ns;
alu_write(ALU_INTF_VVCT,1,“00000011”,“00000010”,“001”,‘1’,“ALU_INTF_WRITE”, C_SCOPE);
alu_read(ALU_INTF_VVCT,1,v_result,“input data result”, C_SCOPE);
await_completion(ALU_INTF_VVCT,1,100 ns, “wait till finish”);
wait for 100 ns;
alu_write(ALU_INTF_VVCT,1,“00000111”,“00000101”,“010”,‘1’,“ALU_INTF_WRITE”, C_SCOPE);
alu_read(ALU_INTF_VVCT,1,v_result,“input data result”, C_SCOPE);
await_completion(ALU_INTF_VVCT,1,100 ns, “wait till finish”);
wait for 100 ns;
alu_write(ALU_INTF_VVCT,1,“00000111”,“00000101”,“011”,‘1’,“ALU_INTF_WRITE”, C_SCOPE);
alu_read(ALU_INTF_VVCT,1,v_result,“input data result”, C_SCOPE);
await_completion(ALU_INTF_VVCT,1,100 ns, “wait till finish”);
wait for 100 ns;
alu_write(ALU_INTF_VVCT,1,“00001010”,“00000010”,“100”,‘1’,“ALU_INTF_WRITE”, C_SCOPE);
alu_read(ALU_INTF_VVCT,1,v_result,“input data result”, C_SCOPE);
await_completion(ALU_INTF_VVCT,1,100 ns, “wait till finish”);
this is what I was trying to do in my test sequencer
procedure alu_intf_read(
variable data_value : out std_logic_vector;
constant msg : in string;
signal clk : in std_logic;
signal alu_intf_if : inout t_alu_intf_if;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_alu_intf_bfm_config := C_ALU_INTF_BFM_CONFIG_DEFAULT
) is
begin
-- wait until alu_intf_if.done = '1';
data_value := alu_intf_if.rslt;
end procedure;
this is in bfm package
procedure alu_read(
signal VVCT : inout t_vvc_target_record;
constant vvc_instance_idx : in integer;
variable data_out : out std_logic_vector;
constant msg : in string;
constant scope : in string := C_VVC_CMD_SCOPE_DEFAULT
) is
constant proc_name : string := “alu_read”;
constant proc_call : string := proc_name & “(” & to_string(VVCT, vvc_instance_idx) – First part common for all
& ", " & to_string(data_out) & “)”;
variable v_msg_id_panel : t_msg_id_panel := shared_msg_id_panel;
begin
– Create command by setting common global ‘VVCT’ signal record and dedicated VVC ‘shared_vvc_cmd’ record
– locking semaphore in set_general_target_and_command_fields to gain exclusive right to VVCT and shared_vvc_cmd
– semaphore gets unlocked in await_cmd_from_sequencer of the targeted VVC
set_general_target_and_command_fields(VVCT, vvc_instance_idx, proc_call, msg, QUEUED, ALU_INTF_READ);
shared_vvc_cmd.operation := ALU_INTF_READ;
data_out := shared_vvc_cmd.rslt;
– data_out := shared_vvc_response.result;
-- shared_vvc_cmd.parent_msg_id_panel := parent_msg_id_panel;
-- if parent_msg_id_panel /= C_UNUSED_MSG_ID_PANEL then
-- v_msg_id_panel := parent_msg_id_panel;
-- end if;
send_command_to_vvc(VVCT, std.env.resolution_limit, scope, v_msg_id_panel);
end procedure;
this is in the methods package
when ALU_INTF_READ =>
-- Call the corresponding procedure in the BFM package.
alu_intf_read(data_value => v_result,
msg => format_msg(v_cmd),
clk => clk,
alu_intf_if => alu_intf_vvc_if,
scope => C_SCOPE,
msg_id_panel => v_msg_id_panel,
config => vvc_config.bfm_config);
this is an instantiation of bfm i had done in my VVC
Best Regards,
Riyaz