Skip to content

Commit efda9a5

Browse files
committed
Linting and spelling checks of AXI-related files
1 parent 9e1adc3 commit efda9a5

13 files changed

Lines changed: 514 additions & 304 deletions

vunit/vhdl/verification_components/src/axi_lite_master_pkg.vhd

Lines changed: 66 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -21,35 +21,43 @@ package axi_lite_master_pkg is
2121
constant axi_lite_write_msg : msg_type_t := new_msg_type("write axi lite");
2222

2323
-- Blocking: Write the bus
24-
procedure write_axi_lite(signal net : inout network_t;
25-
constant bus_handle : bus_master_t;
26-
constant address : std_logic_vector;
27-
constant data : std_logic_vector;
28-
constant expected_bresp : axi_resp_t := axi_resp_okay;
29-
-- default byte enable is all bytes
30-
constant byte_enable : std_logic_vector := "");
24+
procedure write_axi_lite(
25+
signal net : inout network_t;
26+
constant bus_handle : bus_master_t;
27+
constant address : std_logic_vector;
28+
constant data : std_logic_vector;
29+
constant expected_bresp : axi_resp_t := axi_resp_okay;
30+
-- default byte enable is all bytes
31+
constant byte_enable : std_logic_vector := ""
32+
);
3133

3234
-- Non blocking: Read the bus returning a reference to the future reply
33-
procedure read_axi_lite(signal net : inout network_t;
34-
constant bus_handle : bus_master_t;
35-
constant address : std_logic_vector;
36-
constant expected_rresp : axi_resp_t := axi_resp_okay;
37-
variable reference : inout bus_reference_t);
35+
procedure read_axi_lite(
36+
signal net : inout network_t;
37+
constant bus_handle : bus_master_t;
38+
constant address : std_logic_vector;
39+
constant expected_rresp : axi_resp_t := axi_resp_okay;
40+
variable reference : inout bus_reference_t
41+
);
3842

3943
-- Blocking: read bus with immediate reply
40-
procedure read_axi_lite(signal net : inout network_t;
41-
constant bus_handle : bus_master_t;
42-
constant address : std_logic_vector;
43-
constant expected_rresp : axi_resp_t := axi_resp_okay;
44-
variable data : inout std_logic_vector);
44+
procedure read_axi_lite(
45+
signal net : inout network_t;
46+
constant bus_handle : bus_master_t;
47+
constant address : std_logic_vector;
48+
constant expected_rresp : axi_resp_t := axi_resp_okay;
49+
variable data : inout std_logic_vector
50+
);
4551

4652
-- Blocking: Read bus and check result against expected data
47-
procedure check_axi_lite(signal net : inout network_t;
48-
constant bus_handle : bus_master_t;
49-
constant address : std_logic_vector;
50-
constant expected_rresp : axi_resp_t := axi_resp_okay;
51-
constant expected : std_logic_vector;
52-
constant msg : string := "");
53+
procedure check_axi_lite(
54+
signal net : inout network_t;
55+
constant bus_handle : bus_master_t;
56+
constant address : std_logic_vector;
57+
constant expected_rresp : axi_resp_t := axi_resp_okay;
58+
constant expected : std_logic_vector;
59+
constant msg : string := ""
60+
);
5361

5462
function is_read(msg_type : msg_type_t) return boolean;
5563
function is_write(msg_type : msg_type_t) return boolean;
@@ -59,13 +67,15 @@ end package;
5967

6068
package body axi_lite_master_pkg is
6169

62-
procedure write_axi_lite(signal net : inout network_t;
63-
constant bus_handle : bus_master_t;
64-
constant address : std_logic_vector;
65-
constant data : std_logic_vector;
66-
constant expected_bresp : axi_resp_t := axi_resp_okay;
67-
-- default byte enable is all bytes
68-
constant byte_enable : std_logic_vector := "") is
70+
procedure write_axi_lite(
71+
signal net : inout network_t;
72+
constant bus_handle : bus_master_t;
73+
constant address : std_logic_vector;
74+
constant data : std_logic_vector;
75+
constant expected_bresp : axi_resp_t := axi_resp_okay;
76+
-- default byte enable is all bytes
77+
constant byte_enable : std_logic_vector := ""
78+
) is
6979
variable request_msg : msg_t := new_msg(axi_lite_write_msg);
7080
variable full_data : std_logic_vector(bus_handle.p_data_length - 1 downto 0) := (others => '0');
7181
variable full_address : std_logic_vector(bus_handle.p_address_length - 1 downto 0) := (others => '0');
@@ -89,11 +99,13 @@ package body axi_lite_master_pkg is
8999
send(net, bus_handle.p_actor, request_msg);
90100
end procedure;
91101

92-
procedure read_axi_lite(signal net : inout network_t;
93-
constant bus_handle : bus_master_t;
94-
constant address : std_logic_vector;
95-
constant expected_rresp : axi_resp_t := axi_resp_okay;
96-
variable reference : inout bus_reference_t) is
102+
procedure read_axi_lite(
103+
signal net : inout network_t;
104+
constant bus_handle : bus_master_t;
105+
constant address : std_logic_vector;
106+
constant expected_rresp : axi_resp_t := axi_resp_okay;
107+
variable reference : inout bus_reference_t
108+
) is
97109
variable full_address : std_logic_vector(bus_handle.p_address_length - 1 downto 0) := (others => '0');
98110
alias request_msg : msg_t is reference;
99111
begin
@@ -104,25 +116,29 @@ package body axi_lite_master_pkg is
104116
send(net, bus_handle.p_actor, request_msg);
105117
end procedure;
106118

107-
procedure read_axi_lite(signal net : inout network_t;
108-
constant bus_handle : bus_master_t;
109-
constant address : std_logic_vector;
110-
constant expected_rresp : axi_resp_t := axi_resp_okay;
111-
variable data : inout std_logic_vector) is
119+
procedure read_axi_lite(
120+
signal net : inout network_t;
121+
constant bus_handle : bus_master_t;
122+
constant address : std_logic_vector;
123+
constant expected_rresp : axi_resp_t := axi_resp_okay;
124+
variable data : inout std_logic_vector
125+
) is
112126
variable reference : bus_reference_t;
113127
begin
114128
read_axi_lite(net, bus_handle, address, expected_rresp, reference);
115129
await_read_bus_reply(net, reference, data);
116130
end procedure;
117131

118-
procedure check_axi_lite(signal net : inout network_t;
119-
constant bus_handle : bus_master_t;
120-
constant address : std_logic_vector;
121-
constant expected_rresp : axi_resp_t := axi_resp_okay;
122-
constant expected : std_logic_vector;
123-
constant msg : string := "") is
132+
procedure check_axi_lite(
133+
signal net : inout network_t;
134+
constant bus_handle : bus_master_t;
135+
constant address : std_logic_vector;
136+
constant expected_rresp : axi_resp_t := axi_resp_okay;
137+
constant expected : std_logic_vector;
138+
constant msg : string := ""
139+
) is
124140
variable data : std_logic_vector(bus_handle.p_data_length - 1 downto 0);
125-
variable edata : std_logic_vector(data'range) := (others => '0');
141+
variable expected_data : std_logic_vector(data'range) := (others => '0');
126142

127143
impure function error_prefix return string is
128144
begin
@@ -135,14 +151,14 @@ package body axi_lite_master_pkg is
135151

136152
impure function base_error return string is
137153
begin
138-
return error_prefix & " - Got x""" & to_hstring(data) & """ expected x""" & to_hstring(edata) & """";
154+
return error_prefix & " - Got x""" & to_hstring(data) & """ expected x""" & to_hstring(expected_data) & """";
139155
end;
140156
begin
141157

142-
edata(expected'length - 1 downto 0) := expected;
158+
expected_data(expected'length - 1 downto 0) := expected;
143159

144160
read_axi_lite(net, bus_handle, address, expected_rresp, data);
145-
if not std_match(data, edata) then
161+
if not std_match(data, expected_data) then
146162
failure(bus_handle.p_logger, base_error);
147163
end if;
148164
end procedure;

vunit/vhdl/verification_components/src/axi_pkg.vhd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,12 @@ package axi_pkg is
2323
constant max_axi4_burst_length : natural := 2**axi4_len_t'length;
2424
subtype axi4_size_t is std_logic_vector(2 downto 0);
2525

26+
-- This policy controls what value the bus signals are assigned when not driving valid
27+
-- data. All zeros, all ones, all unknown values, or holding last valid value.
28+
29+
-- 'X' violates the all lower case naming rule but is kept to match the corresponding
30+
-- std_logic value it represents.
31+
-- vsg_off type_500
2632
type inactive_bus_policy_t is ('0', '1', 'X', hold);
33+
-- vsg_on
2734
end package;

vunit/vhdl/verification_components/src/axi_read_slave.vhd

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,10 @@ begin
163163
num_beats := num_beats_now;
164164

165165
if self.should_check_well_behaved and size /= self.data_size and len /= 0 then
166-
self.fail("Burst not well behaved, axi size = " & to_string(size) & " but bus data width allows " & to_string(self.data_size));
166+
self.fail(
167+
"Burst not well behaved, axi size = " & to_string(size) & " but bus data width allows " &
168+
to_string(self.data_size)
169+
);
167170
end if;
168171
end if;
169172

0 commit comments

Comments
 (0)