Skip to content

Commit

Permalink
- Added the ability to convert bus masters to sync handles
Browse files Browse the repository at this point in the history
- Added the ability to specify actor for AXI stream masters and slaves
  • Loading branch information
LarsAsplund committed Jun 4, 2018
1 parent b2eb711 commit 7e49623
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
22 changes: 16 additions & 6 deletions vunit/vhdl/verification_components/src/axi_stream_pkg.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ package axi_stream_pkg is

constant axi_stream_logger : logger_t := get_logger("vunit_lib:axi_stream_pkg");
impure function new_axi_stream_master(data_length : natural;
logger : logger_t := axi_stream_logger) return axi_stream_master_t;
logger : logger_t := axi_stream_logger;
actor : actor_t := null_actor) return axi_stream_master_t;
impure function new_axi_stream_slave(data_length : natural;
logger : logger_t := axi_stream_logger) return axi_stream_slave_t;
logger : logger_t := axi_stream_logger;
actor : actor_t := null_actor) return axi_stream_slave_t;
impure function data_length(master : axi_stream_master_t) return natural;
impure function data_length(master : axi_stream_slave_t) return natural;
impure function as_stream(master : axi_stream_master_t) return stream_master_t;
Expand All @@ -51,17 +53,25 @@ end package;
package body axi_stream_pkg is

impure function new_axi_stream_master(data_length : natural;
logger : logger_t := axi_stream_logger) return axi_stream_master_t is
logger : logger_t := axi_stream_logger;
actor : actor_t := null_actor) return axi_stream_master_t is
variable p_actor : actor_t;
begin
return (p_actor => new_actor,
p_actor := actor when actor /= null_actor else new_actor;

return (p_actor => p_actor,
p_data_length => data_length,
p_logger => logger);
end;

impure function new_axi_stream_slave(data_length : natural;
logger : logger_t := axi_stream_logger) return axi_stream_slave_t is
logger : logger_t := axi_stream_logger;
actor : actor_t := null_actor) return axi_stream_slave_t is
variable p_actor : actor_t;
begin
return (p_actor => new_actor,
p_actor := actor when actor /= null_actor else new_actor;

return (p_actor => p_actor,
p_data_length => data_length,
p_logger => logger);
end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,11 @@ package body bus_master_pkg is
wait_until_read_equals(net, bus_handle, addr, data, timeout, msg);
end;

impure function as_sync(bus_master : bus_master_t) return sync_handle_t is
begin
return bus_master.p_actor;
end;

procedure wait_until_idle(signal net : inout network_t;
bus_handle : bus_master_t) is
begin
Expand Down
3 changes: 3 additions & 0 deletions vunit/vhdl/verification_components/src/bus_master_pkg.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use ieee.std_logic_1164.all;

use work.logger_pkg.all;
context work.com_context;
use work.sync_pkg.all;

package bus_master_pkg is

Expand Down Expand Up @@ -128,6 +129,8 @@ package bus_master_pkg is
timeout : delay_length := delay_length'high;
msg : string := "");

-- Convert a bus master to a sync handle
impure function as_sync(bus_master : bus_master_t) return sync_handle_t;

-- Wait until all operations scheduled before this command has finished
procedure wait_until_idle(signal net : inout network_t;
Expand Down

0 comments on commit 7e49623

Please sign in to comment.