Skip to content

Commit

Permalink
Added unexpected message type policy - rule 10
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidMartinPhios committed Nov 26, 2024
1 parent b5ecdc8 commit 81d9f64
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion vunit/vhdl/verification_components/src/axi_master.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use work.log_levels_pkg.all;
use work.logger_pkg.all;
use work.queue_pkg.all;
use work.sync_pkg.all;
use work.vc_pkg.all;

entity axi_master is
generic (
Expand Down Expand Up @@ -92,7 +93,9 @@ begin
end if;
handle_wait_until_idle(net, msg_type, request_msg);
else
unexpected_msg_type(msg_type);
if axi_master_handle.p_unexpected_msg_type_policy = fail then
unexpected_msg_type(msg_type);
end if;
end if;
end process;

Expand Down
10 changes: 8 additions & 2 deletions vunit/vhdl/verification_components/src/axi_master_pkg.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ use ieee.numeric_std.all;

use work.axi_pkg.all;
use work.bus_master_pkg.all;
use work.com_pkg.send;
use work.com_pkg.all;
use work.com_types_pkg.all;
use work.logger_pkg.all;
use work.id_pkg.all;
use work.queue_pkg.all;
use work.vc_pkg.all;

package axi_master_pkg is

Expand All @@ -29,6 +30,7 @@ package axi_master_pkg is
p_drive_invalid_val : std_logic;
p_write_high_probability : real range 0.0 to 1.0;
p_read_high_probability : real range 0.0 to 1.0;
p_unexpected_msg_type_policy : unexpected_msg_type_policy_t;
end record;

impure function new_axi_master(
Expand All @@ -38,6 +40,7 @@ package axi_master_pkg is
byte_length : natural := 8;
logger : logger_t := bus_logger;
actor : actor_t := null_actor;
unexpected_msg_type_policy : unexpected_msg_type_policy_t := fail;
drive_invalid : boolean := true;
drive_invalid_val : std_logic := 'X';
write_high_probability : real := 1.0;
Expand Down Expand Up @@ -152,6 +155,7 @@ package body axi_master_pkg is
byte_length : natural := 8;
logger : logger_t := bus_logger;
actor : actor_t := null_actor;
unexpected_msg_type_policy : unexpected_msg_type_policy_t := fail;
drive_invalid : boolean := true;
drive_invalid_val : std_logic := 'X';
write_high_probability : real := 1.0;
Expand Down Expand Up @@ -186,7 +190,9 @@ package body axi_master_pkg is
p_drive_invalid => drive_invalid,
p_drive_invalid_val => drive_invalid_val,
p_write_high_probability => write_high_probability,
p_read_high_probability => read_high_probability);
p_read_high_probability => read_high_probability,
p_unexpected_msg_type_policy => unexpected_msg_type_policy
);
end;

procedure write_axi(signal net : inout network_t;
Expand Down

0 comments on commit 81d9f64

Please sign in to comment.