Skip to content

Commit

Permalink
rename entities according to spec
Browse files Browse the repository at this point in the history
  • Loading branch information
c-thaler committed Nov 4, 2024
1 parent 8d84a03 commit b156f16
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 57 deletions.
8 changes: 4 additions & 4 deletions vunit/vhdl/verification_components/src/apb_completer.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ library osvvm;
use osvvm.RandomPkg.RandomPType;

use work.memory_pkg.all;
use work.apb_slave_pkg.all;
use work.apb_completer_pkg.all;
use work.logger_pkg.all;

entity apb_slave is
entity apb_completer is
generic (
bus_handle : apb_slave_t
bus_handle : apb_completer_t
);
port (
clk : in std_logic;
Expand All @@ -32,7 +32,7 @@ entity apb_slave is
);
end entity;

architecture a of apb_slave is
architecture a of apb_completer is

begin

Expand Down
16 changes: 8 additions & 8 deletions vunit/vhdl/verification_components/src/apb_completer_pkg.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ use work.logger_pkg.all;
use work.memory_pkg.memory_t;
use work.memory_pkg.to_vc_interface;

package apb_slave_pkg is
package apb_completer_pkg is

type apb_slave_t is record
type apb_completer_t is record
-- Private
p_actor : actor_t;
p_memory : memory_t;
Expand All @@ -27,30 +27,30 @@ package apb_slave_pkg is
p_ready_high_probability : real range 0.0 to 1.0;
end record;

constant apb_slave_logger : logger_t := get_logger("vunit_lib:apb_slave_pkg");
impure function new_apb_slave(
constant apb_completer_logger : logger_t := get_logger("vunit_lib:apb_completer_pkg");
impure function new_apb_completer(
memory : memory_t;
logger : logger_t := null_logger;
actor : actor_t := null_actor;
drive_invalid : boolean := true;
drive_invalid_val : std_logic := 'X';
ready_high_probability : real := 1.0)
return apb_slave_t;
return apb_completer_t;

constant slave_write_msg : msg_type_t := new_msg_type("apb slave write");
constant slave_read_msg : msg_type_t := new_msg_type("apb slave read");
end package;

package body apb_slave_pkg is
package body apb_completer_pkg is

impure function new_apb_slave(
impure function new_apb_completer(
memory : memory_t;
logger : logger_t := null_logger;
actor : actor_t := null_actor;
drive_invalid : boolean := true;
drive_invalid_val : std_logic := 'X';
ready_high_probability : real := 1.0)
return apb_slave_t is
return apb_completer_t is
variable actor_tmp : actor_t := null_actor;
variable logger_tmp : logger_t := null_logger;
begin
Expand Down
8 changes: 4 additions & 4 deletions vunit/vhdl/verification_components/src/apb_requester.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ use work.runner_pkg.all;
use work.run_pkg.all;
use work.run_types_pkg.all;
use work.log_levels_pkg.all;
use work.apb_master_pkg.all;
use work.apb_requester_pkg.all;

entity apb_master is
entity apb_requester is
generic (
bus_handle : apb_master_t
bus_handle : apb_requester_t
);
port (
clk : in std_logic;
Expand All @@ -38,7 +38,7 @@ entity apb_master is
);
end entity;

architecture behav of apb_master is
architecture behav of apb_requester is
constant message_queue : queue_t := new_queue;
signal idle_bus : boolean := true;

Expand Down
66 changes: 33 additions & 33 deletions vunit/vhdl/verification_components/src/apb_requester_pkg.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -16,71 +16,71 @@ use work.sync_pkg.all;
use work.memory_pkg.memory_t;
use work.memory_pkg.to_vc_interface;

package apb_master_pkg is
package apb_requester_pkg is

type apb_master_t is record
type apb_requester_t is record
-- Private
p_bus_handle : bus_master_t;
p_drive_invalid : boolean;
p_drive_invalid_val : std_logic;
end record;

impure function new_apb_master(
impure function new_apb_requester(
data_length : natural;
address_length : natural;
logger : logger_t := null_logger;
actor : actor_t := null_actor;
drive_invalid : boolean := true;
drive_invalid_val : std_logic := 'X'
) return apb_master_t;
) return apb_requester_t;

function get_logger(bus_handle : apb_master_t) return logger_t;
function get_logger(bus_handle : apb_requester_t) return logger_t;

-- Blocking: Write the bus
procedure write_bus(signal net : inout network_t;
constant bus_handle : apb_master_t;
constant bus_handle : apb_requester_t;
constant address : std_logic_vector;
constant data : std_logic_vector;
-- default byte enable is all bytes
constant byte_enable : std_logic_vector := "");
procedure write_bus(signal net : inout network_t;
constant bus_handle : apb_master_t;
constant bus_handle : apb_requester_t;
constant address : natural;
constant data : std_logic_vector;
-- default byte enable is all bytes
constant byte_enable : std_logic_vector := "");

-- Non blocking: Read the bus returning a reference to the future reply
procedure read_bus(signal net : inout network_t;
constant bus_handle : apb_master_t;
constant bus_handle : apb_requester_t;
constant address : std_logic_vector;
variable reference : inout bus_reference_t);

procedure read_bus(signal net : inout network_t;
constant bus_handle : apb_master_t;
constant bus_handle : apb_requester_t;
constant address : natural;
variable reference : inout bus_reference_t);

-- Blocking: read bus with immediate reply
procedure read_bus(signal net : inout network_t;
constant bus_handle : apb_master_t;
constant bus_handle : apb_requester_t;
constant address : std_logic_vector;
variable data : inout std_logic_vector);

procedure read_bus(signal net : inout network_t;
constant bus_handle : apb_master_t;
constant bus_handle : apb_requester_t;
constant address : natural;
variable data : inout std_logic_vector);

-- Blocking: Read bus and check result against expected data
procedure check_bus(signal net : inout network_t;
constant bus_handle : apb_master_t;
constant bus_handle : apb_requester_t;
constant address : std_logic_vector;
constant expected : std_logic_vector;
constant msg : string := "");

procedure check_bus(signal net : inout network_t;
constant bus_handle : apb_master_t;
constant bus_handle : apb_requester_t;
constant address : natural;
constant expected : std_logic_vector;
constant msg : string := "");
Expand All @@ -89,7 +89,7 @@ package apb_master_pkg is
-- std_match If timeout is reached error with msg
procedure wait_until_read_equals(
signal net : inout network_t;
bus_handle : apb_master_t;
bus_handle : apb_requester_t;
addr : std_logic_vector;
value : std_logic_vector;
timeout : delay_length := delay_length'high;
Expand All @@ -99,32 +99,32 @@ package apb_master_pkg is
-- index set to value If timeout is reached error with msg
procedure wait_until_read_bit_equals(
signal net : inout network_t;
bus_handle : apb_master_t;
bus_handle : apb_requester_t;
addr : std_logic_vector;
idx : natural;
value : std_logic;
timeout : delay_length := delay_length'high;
msg : string := "");

procedure wait_until_idle(signal net : inout network_t;
handle : apb_master_t;
handle : apb_requester_t;
timeout : delay_length := max_timeout);

procedure wait_for_time(signal net : inout network_t;
handle : apb_master_t;
handle : apb_requester_t;
delay : delay_length);
end package;

package body apb_master_pkg is
package body apb_requester_pkg is

impure function new_apb_master(
impure function new_apb_requester(
data_length : natural;
address_length : natural;
logger : logger_t := null_logger;
actor : actor_t := null_actor;
drive_invalid : boolean := true;
drive_invalid_val : std_logic := 'X'
) return apb_master_t is
) return apb_requester_t is
impure function create_bus (logger : logger_t) return bus_master_t is
begin
return new_bus(
Expand All @@ -148,14 +148,14 @@ package body apb_master_pkg is
);
end;

function get_logger(bus_handle : apb_master_t) return logger_t is
function get_logger(bus_handle : apb_requester_t) return logger_t is
begin
return get_logger(bus_handle.p_bus_handle);
end function;

-- Blocking: Write the bus
procedure write_bus(signal net : inout network_t;
constant bus_handle : apb_master_t;
constant bus_handle : apb_requester_t;
constant address : std_logic_vector;
constant data : std_logic_vector;
-- default byte enable is all bytes
Expand All @@ -165,7 +165,7 @@ package body apb_master_pkg is
end procedure;

procedure write_bus(signal net : inout network_t;
constant bus_handle : apb_master_t;
constant bus_handle : apb_requester_t;
constant address : natural;
constant data : std_logic_vector;
-- default byte enable is all bytes
Expand All @@ -176,31 +176,31 @@ package body apb_master_pkg is

-- Blocking: read bus with immediate reply
procedure read_bus(signal net : inout network_t;
constant bus_handle : apb_master_t;
constant bus_handle : apb_requester_t;
constant address : std_logic_vector;
variable data : inout std_logic_vector) is
begin
read_bus(net, bus_handle.p_bus_handle, address, data);
end procedure;

procedure read_bus(signal net : inout network_t;
constant bus_handle : apb_master_t;
constant bus_handle : apb_requester_t;
constant address : natural;
variable data : inout std_logic_vector) is
begin
read_bus(net, bus_handle.p_bus_handle, address, data);
end procedure;

procedure read_bus(signal net : inout network_t;
constant bus_handle : apb_master_t;
constant bus_handle : apb_requester_t;
constant address : natural;
variable reference : inout bus_reference_t) is
begin
read_bus(net, bus_handle.p_bus_handle, address, reference);
end procedure;

procedure read_bus(signal net : inout network_t;
constant bus_handle : apb_master_t;
constant bus_handle : apb_requester_t;
constant address : std_logic_vector;
variable reference : inout bus_reference_t) is
begin
Expand All @@ -209,7 +209,7 @@ package body apb_master_pkg is

-- Blocking: Read bus and check result against expected data
procedure check_bus(signal net : inout network_t;
constant bus_handle : apb_master_t;
constant bus_handle : apb_requester_t;
constant address : std_logic_vector;
constant expected : std_logic_vector;
constant msg : string := "") is
Expand All @@ -218,7 +218,7 @@ package body apb_master_pkg is
end procedure;

procedure check_bus(signal net : inout network_t;
constant bus_handle : apb_master_t;
constant bus_handle : apb_requester_t;
constant address : natural;
constant expected : std_logic_vector;
constant msg : string := "") is
Expand All @@ -230,7 +230,7 @@ package body apb_master_pkg is
-- std_match If timeout is reached error with msg
procedure wait_until_read_equals(
signal net : inout network_t;
bus_handle : apb_master_t;
bus_handle : apb_requester_t;
addr : std_logic_vector;
value : std_logic_vector;
timeout : delay_length := delay_length'high;
Expand All @@ -243,7 +243,7 @@ package body apb_master_pkg is
-- index set to value If timeout is reached error with msg
procedure wait_until_read_bit_equals(
signal net : inout network_t;
bus_handle : apb_master_t;
bus_handle : apb_requester_t;
addr : std_logic_vector;
idx : natural;
value : std_logic;
Expand All @@ -254,14 +254,14 @@ package body apb_master_pkg is
end procedure;

procedure wait_until_idle(signal net : inout network_t;
handle : apb_master_t;
handle : apb_requester_t;
timeout : delay_length := max_timeout) is
begin
wait_until_idle(net, handle.p_bus_handle.p_actor, timeout);
end procedure;

procedure wait_for_time(signal net : inout network_t;
handle : apb_master_t;
handle : apb_requester_t;
delay : delay_length) is
begin
wait_for_time(net, handle.p_bus_handle.p_actor, delay);
Expand Down
Loading

0 comments on commit b156f16

Please sign in to comment.