Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CTU CAN FD IP Core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
14
Issues
14
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
canbus
CTU CAN FD IP Core
Commits
45cbe656
Commit
45cbe656
authored
Jan 18, 2019
by
Ille, Ondrej, Ing.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: VUnit use "check" library.
parent
cd8426b6
Changes
37
Hide whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
387 additions
and
955 deletions
+387
-955
test/feature/abort_transmittion_feature_tb.vhd
test/feature/abort_transmittion_feature_tb.vhd
+2
-12
test/feature/arbitration_feature_tb.vhd
test/feature/arbitration_feature_tb.vhd
+23
-27
test/feature/bus_start_feature_tb.vhd
test/feature/bus_start_feature_tb.vhd
+6
-14
test/feature/byte_enable_feature_tb.vhd
test/feature/byte_enable_feature_tb.vhd
+35
-95
test/feature/data_length_code_feature_tb.vhd
test/feature/data_length_code_feature_tb.vhd
+5
-16
test/feature/data_overrun_clear_feature_tb.vhd
test/feature/data_overrun_clear_feature_tb.vhd
+5
-7
test/feature/fault_confinement_feature_tb.vhd
test/feature/fault_confinement_feature_tb.vhd
+11
-31
test/feature/forbid_fd_feature_tb.vhd
test/feature/forbid_fd_feature_tb.vhd
+7
-19
test/feature/interrupt_feature_tb.vhd
test/feature/interrupt_feature_tb.vhd
+15
-57
test/feature/invalid_configs_feature_tb.vhd
test/feature/invalid_configs_feature_tb.vhd
+7
-14
test/feature/message_filter_feature_tb.vhd
test/feature/message_filter_feature_tb.vhd
+14
-27
test/feature/overload_feature_tb.vhd
test/feature/overload_feature_tb.vhd
+4
-10
test/feature/retr_limit_feature_tb.vhd
test/feature/retr_limit_feature_tb.vhd
+6
-21
test/feature/rtr_pref_feature_tb.vhd
test/feature/rtr_pref_feature_tb.vhd
+5
-25
test/feature/rx_status_feature_tb.vhd
test/feature/rx_status_feature_tb.vhd
+19
-51
test/feature/spec_mode_feature_tb.vhd
test/feature/spec_mode_feature_tb.vhd
+10
-32
test/feature/suspend_transmission_feature_tb.vhd
test/feature/suspend_transmission_feature_tb.vhd
+12
-30
test/feature/timestamp_options_feature_tb.vhd
test/feature/timestamp_options_feature_tb.vhd
+3
-13
test/feature/traf_meas_feature_tb.vhd
test/feature/traf_meas_feature_tb.vhd
+5
-13
test/feature/tran_delay_feature_tb.vhd
test/feature/tran_delay_feature_tb.vhd
+3
-7
test/feature/tx_arb_time_tran_feature_tb.vhd
test/feature/tx_arb_time_tran_feature_tb.vhd
+3
-15
test/feature/txtb_state_feature_tb.vhd
test/feature/txtb_state_feature_tb.vhd
+24
-60
test/reference/tb_reference.vhd
test/reference/tb_reference.vhd
+7
-17
test/sanity/sanity_test.vhd
test/sanity/sanity_test.vhd
+5
-16
test/unit/APB/APB_tb.vhd
test/unit/APB/APB_tb.vhd
+17
-15
test/unit/Bit_Stuffing/Bit_Stuffing_tb.vhd
test/unit/Bit_Stuffing/Bit_Stuffing_tb.vhd
+6
-25
test/unit/Bus_Sampling/Bus_Sync_tb.vhd
test/unit/Bus_Sampling/Bus_Sync_tb.vhd
+9
-24
test/unit/CRC/CRC_tb.vhd
test/unit/CRC/CRC_tb.vhd
+3
-20
test/unit/Evnt_Logger/Event_logger_tb.vhd
test/unit/Evnt_Logger/Event_logger_tb.vhd
+8
-27
test/unit/Fault_confinement/Fault_confinement_tb.vhd
test/unit/Fault_confinement/Fault_confinement_tb.vhd
+20
-17
test/unit/Int_Manager/Int_Manager_tb.vhd
test/unit/Int_Manager/Int_Manager_tb.vhd
+11
-35
test/unit/Message_filter/message_filter_tb.vhd
test/unit/Message_filter/message_filter_tb.vhd
+18
-35
test/unit/Prescaler/Prescaler_tb.vhd
test/unit/Prescaler/Prescaler_tb.vhd
+28
-67
test/unit/Protocol_Control/Protocol_Control_tb.vhd
test/unit/Protocol_Control/Protocol_Control_tb.vhd
+17
-24
test/unit/RX_Buffer/RX_Buffer_tb.vhd
test/unit/RX_Buffer/RX_Buffer_tb.vhd
+8
-18
test/unit/TX_Arbitrator/TX_Arbitrator_tb.vhd
test/unit/TX_Arbitrator/TX_Arbitrator_tb.vhd
+2
-6
test/unit/TX_Buffer/Tx_Buffer_tb.vhd
test/unit/TX_Buffer/Tx_Buffer_tb.vhd
+4
-13
No files found.
test/feature/abort_transmittion_feature_tb.vhd
View file @
45cbe656
...
...
@@ -173,12 +173,7 @@ package body abort_transmittion_feature is
end
loop
;
get_controller_status
(
status
,
ID_1
,
mem_bus
(
1
));
if
(
status
.
transmitter
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
error
(
"Unit did not abort the transmission!"
);
-- LCOV_EXCL_STOP
end
if
;
check_false
(
status
.
transmitter
,
"Unit did not abort the transmission!"
);
--------------------------------------------------------------------
-- Now wait until unit 2 starts transmitting error frame! Note that
...
...
@@ -208,12 +203,7 @@ package body abort_transmittion_feature is
-- Check that unit is now idle since it is after transmittion already
--------------------------------------------------------------------
get_controller_status
(
status
,
ID_1
,
mem_bus
(
1
));
if
(
not
status
.
bus_status
)
then
-- LCOV_EXCL_START
error
(
"Unit is not Idle!"
);
o
.
outcome
:
=
false
;
-- LCOV_EXCL_STOP
end
if
;
check
(
status
.
bus_status
,
"Unit is not Idle!"
);
end
if
;
...
...
test/feature/arbitration_feature_tb.vhd
View file @
45cbe656
...
...
@@ -304,24 +304,22 @@ package body Arbitration_feature is
end
if
;
end
loop
;
------------------------------------------------------------------------
-- Print Frame info
------------------------------------------------------------------------
info
(
"Frame 1:"
);
CAN_print_frame
(
frame_1
,
info_l
);
info
(
"Frame 2:"
);
CAN_print_frame
(
frame_2
,
info_l
);
------------------------------------------------------------------------
-- Check whether expected winner is the unit which lost the arbitration
------------------------------------------------------------------------
if
(
unit_rec
=
1
and
exp_winner
=
0
)
or
(
unit_rec
=
2
and
exp_winner
=
1
)
then
-- LCOV_EXCL_START
info
(
"Frame 1:"
);
CAN_print_frame
(
frame_1
,
info_l
);
info
(
"Frame 2:"
);
CAN_print_frame
(
frame_2
,
info_l
);
error
(
"Wrong unit lost arbitration. Expected: "
&
integer
'image
(
exp_winner
)
&
" Real: "
&
integer
'image
(
unit_rec
));
o
.
outcome
:
=
false
;
-- LCOV_EXCL_STOP
end
if
;
check_false
((
unit_rec
=
1
and
exp_winner
=
0
)
or
(
unit_rec
=
2
and
exp_winner
=
1
),
"Wrong unit lost arbitration. Expected: "
&
integer
'image
(
exp_winner
)
&
" Real: "
&
integer
'image
(
unit_rec
));
------------------------------------------------------------------------
-- Send abort transmission to both frames so that no unit will
...
...
@@ -342,20 +340,18 @@ package body Arbitration_feature is
end
if
;
------------------------------------------------------------------------
--
If error frame is transmitted and collision not have appeared
--
Print Frame info
------------------------------------------------------------------------
if
(
unit_rec
=
3
and
exp_winner
/=
2
)
then
-- LCOV_EXCL_START
info
(
"Frame 1:"
);
CAN_print_frame
(
frame_1
,
info_l
);
info
(
"Frame 2:"
);
CAN_print_frame
(
frame_2
,
info_l
);
info
(
"Frame 1:"
);
CAN_print_frame
(
frame_1
,
info_l
);
info
(
"Frame 2:"
);
CAN_print_frame
(
frame_2
,
info_l
);
error
(
"Collision should have appeared"
);
o
.
outcome
:
=
false
;
-- LCOV_EXCL_STOP
end
if
;
------------------------------------------------------------------------
-- If error frame is transmitted and collision not have appeared
------------------------------------------------------------------------
check_false
(
unit_rec
=
3
and
exp_winner
/=
2
,
"Collision should have appeared"
)
;
wait
for
100000
ns
;
end
procedure
;
...
...
test/feature/bus_start_feature_tb.vhd
View file @
45cbe656
...
...
@@ -203,22 +203,14 @@ package body bus_start_feature is
get_rx_buf_state
(
rx_state
,
ID_1
,
mem_bus
(
1
));
info
(
"Read RX Buffer state"
);
if
(
rx_state
.
rx_empty
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
error
(
"RX Buffer is empty, but Frame should be received!"
);
-- LCOV_EXCL_STOP
end
if
;
check_false
(
rx_state
.
rx_empty
,
"RX Buffer is empty, but Frame should be received!"
);
CAN_frame
.
identifier
:
=
0
;
CAN_read_frame
(
CAN_frame
,
ID_1
,
mem_bus
(
1
));
if
(
CAN_frame
.
identifier
/=
513
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
error
(
"Wrong Identifier received by Node 1. Expected: 513 , Real: "
&
integer
'image
(
CAN_frame
.
identifier
));
-- LCOV_EXCL_STOP
end
if
;
check
(
CAN_frame
.
identifier
=
513
,
"Wrong Identifier received by Node 1! Expected: 513 , Real: "
&
integer
'image
(
CAN_frame
.
identifier
));
------------------------------------------------------------------------
-- Now wait until Node 1 transmitts frame which lost the arbitration
...
...
@@ -230,4 +222,4 @@ package body bus_start_feature is
end
procedure
;
end
package
body
;
end
package
body
;
\ No newline at end of file
test/feature/byte_enable_feature_tb.vhd
View file @
45cbe656
...
...
@@ -91,12 +91,7 @@ package body byte_enable_feature is
address
:
=
YOLO_REG_ADR
;
CAN_read
(
data
,
address
,
ID
,
mem_bus
(
1
),
BIT_32
);
if
(
data
/=
x"DEADBEEF"
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
error
(
"32 bit read error"
);
-- LCOV_EXCL_STOP
end
if
;
check
(
data
=
x"DEADBEEF"
,
"32 bit read error"
);
------------------------------------------------------------------------
-- Now read per half word (16 BIT)
...
...
@@ -108,24 +103,13 @@ package body byte_enable_feature is
CAN_read
(
data
,
address
,
ID
,
mem_bus
(
1
),
BIT_16
);
-- Checking if valid 2 bytes match register value
if
(
data
(
16
*
i
+
15
downto
16
*
i
)
/=
YOLO_VAL_RSTVAL
(
16
*
i
+
15
downto
16
*
i
))
then
-- LCOV_EXCL_START
info
(
"Read error - 16 bit access (valid byte), Index:"
);
error
(
integer
'image
(
i
));
o
.
outcome
:
=
false
;
-- LCOV_EXCL_STOP
end
if
;
check
(
data
(
16
*
i
+
15
downto
16
*
i
)
=
YOLO_VAL_RSTVAL
(
16
*
i
+
15
downto
16
*
i
),
"Read error - 16 bit access (valid byte), Index:"
);
-- Checking invalid 2 bytes are 0
if
(
data
(
16
*
(
1
-
i
)
+
15
downto
16
*
(
1
-
i
))
/=
x"0000"
)
then
-- LCOV_EXCL_START
info
(
"Read error -16 bit access (empty byte), Index :"
);
error
(
integer
'image
(
i
));
o
.
outcome
:
=
false
;
-- LCOV_EXCL_STOP
end
if
;
check
(
data
(
16
*
(
1
-
i
)
+
15
downto
16
*
(
1
-
i
))
=
x"0000"
,
"Read error -16 bit access (empty byte), Index :"
);
end
loop
;
------------------------------------------------------------------------
...
...
@@ -138,50 +122,27 @@ package body byte_enable_feature is
CAN_read
(
data
,
address
,
ID
,
mem_bus
(
1
),
BIT_8
);
-- Checking if valid 1 byte matches register value
if
(
data
(
8
*
i
+
7
downto
8
*
i
)
/=
YOLO_VAL_RSTVAL
(
8
*
i
+
7
downto
8
*
i
))
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
info
(
"Read error - 8 bit access (valid byte), Index :"
);
error
(
Integer
'image
(
i
));
-- LCOV_EXCL_STOP
end
if
;
check
(
data
(
8
*
i
+
7
downto
8
*
i
)
=
YOLO_VAL_RSTVAL
(
8
*
i
+
7
downto
8
*
i
),
"Read error - 8 bit access (valid byte), Index :"
);
-- Checking if other bytes are 0
case
i
is
when
0
=>
if
(
data
(
31
downto
8
)
/=
x"000000"
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
error
(
"Read error - 8 bit (Empty byte 0)"
);
-- LCOV_EXCL_STOP
end
if
;
check
(
data
(
31
downto
8
)
=
x"000000"
,
"Read error - 8 bit (Empty byte 0)"
);
when
1
=>
if
(
data
(
31
downto
16
)
/=
x"0000"
or
data
(
7
downto
0
)
/=
x"00"
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
error
(
"Read error - 8 bit (Empty byte 1)"
);
-- LCOV_EXCL_STOP
end
if
;
check
(
data
(
31
downto
16
)
=
x"0000"
and
data
(
7
downto
0
)
=
x"00"
,
"Read error - 8 bit (Empty byte 1)"
);
when
2
=>
if
(
data
(
31
downto
24
)
/=
x"00"
or
data
(
15
downto
0
)
/=
x"0000"
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
error
(
"Read error - 8 bit (Empty byte 2)"
);
-- LCOV_EXCL_STOP
end
if
;
check
(
data
(
31
downto
24
)
=
x"00"
and
data
(
15
downto
0
)
=
x"0000"
,
"Read error - 8 bit (Empty byte 2)"
);
when
3
=>
if
(
data
(
23
downto
0
)
/=
x"000000"
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
error
(
"Read error - 8 bit (Empty byte 3)"
);
-- LCOV_EXCL_STOP
end
if
;
check
(
data
(
23
downto
0
)
=
x"000000"
,
"Read error - 8 bit (Empty byte 3)"
);
when
others
=>
error
(
"Invalid byte index"
);
-- LCOV_EXCL_LINE
end
case
;
...
...
@@ -209,48 +170,27 @@ package body byte_enable_feature is
CAN_read
(
data
,
address
,
ID
,
mem_bus
(
1
),
BIT_8
);
-- Checking if one written byte was written OK!
if
(
data
(
8
*
i
+
7
downto
8
*
i
)
/=
x"0A"
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
info
(
"Write error - 8 bit (valid byte), Index :"
);
error
(
Integer
'image
(
i
));
-- LCOV_EXCL_STOP
end
if
;
check
(
data
(
8
*
i
+
7
downto
8
*
i
)
=
x"0A"
,
"Write error - 8 bit (valid byte), Index :"
);
-- Checking if other bytes are 0
case
i
is
when
0
=>
if
(
data
(
31
downto
8
)
/=
x"000000"
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
error
(
"Write error - 8 bit (Empty byte 0)"
);
-- LCOV_EXCL_STOP
end
if
;
check
(
data
(
31
downto
8
)
=
x"000000"
,
"Write error - 8 bit (Empty byte 0)"
);
when
1
=>
if
(
data
(
31
downto
16
)
/=
x"0000"
or
data
(
7
downto
0
)
/=
x"00"
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
error
(
"Write error - 8 bit (Empty byte 1)"
);
-- LCOV_EXCL_STOP
end
if
;
check
(
data
(
31
downto
16
)
=
x"0000"
and
data
(
7
downto
0
)
=
x"00"
,
"Write error - 8 bit (Empty byte 1)"
);
when
2
=>
if
(
data
(
31
downto
24
)
/=
x"00"
or
data
(
15
downto
0
)
/=
x"0000"
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
error
(
"Write error - 8 bit (Empty byte 2)"
);
-- LCOV_EXCL_STOP
end
if
;
check
(
data
(
31
downto
24
)
=
x"00"
and
data
(
15
downto
0
)
=
x"0000"
,
"Write error - 8 bit (Empty byte 2)"
);
when
3
=>
if
(
data
(
23
downto
0
)
/=
x"000000"
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
error
(
"Write error - 8 bit (Empty byte 3)"
);
-- LCOV_EXCL_STOP
end
if
;
check
(
data
(
23
downto
0
)
=
x"000000"
,
"Write error - 8 bit (Empty byte 3)"
);
when
others
=>
error
(
"Invalid byte index"
);
-- LCOV_EXCL_LINE
end
case
;
...
...
@@ -258,4 +198,4 @@ package body byte_enable_feature is
end
procedure
;
end
package
body
;
end
package
body
;
\ No newline at end of file
test/feature/data_length_code_feature_tb.vhd
View file @
45cbe656
...
...
@@ -119,23 +119,12 @@ package body data_length_code_feature is
-- to 8!). Thus RWCNT field should be 5!
------------------------------------------------------------------------
CAN_read_frame
(
CAN_frame_2
,
ID_2
,
mem_bus
(
2
));
if
(
CAN_frame_2
.
rwcnt
/=
5
or
CAN_frame_2
.
dlc
/=
CAN_frame
.
dlc
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
CAN_print_frame
(
CAN_frame_2
,
info_l
);
error
(
"Invalid DLC received!"
);
-- LCOV_EXCL_STOP
end
if
;
check
(
CAN_frame_2
.
dlc
=
CAN_frame
.
dlc
,
"Invalid DLC received!"
);
check
(
CAN_frame_2
.
rwcnt
=
5
,
"Invalid DLC received!"
);
for
i
in
8
to
63
loop
if
(
CAN_frame_2
.
data
(
i
)
/=
"00000000"
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
error
(
"Byte index "
&
integer
'image
(
i
)
&
" not zero!"
);
-- LCOV_EXCL_STOP
end
if
;
check
(
CAN_frame_2
.
data
(
i
)
=
"00000000"
,
"Byte index "
&
integer
'image
(
i
)
&
" not zero!"
);
end
loop
;
end
procedure
;
...
...
test/feature/data_overrun_clear_feature_tb.vhd
View file @
45cbe656
...
...
@@ -133,7 +133,7 @@ package body data_overrun_clear_feature is
CAN_wait_frame_sent
(
ID_1
,
mem_bus
(
1
));
get_controller_status
(
status
,
ID_1
,
mem_bus
(
1
));
if
(
status
.
data_overrun
)
then
error
(
"Overrun Flag Detected!"
);
info
(
"Overrun Flag Detected!"
);
exit
;
end
if
;
end
loop
;
...
...
@@ -142,9 +142,8 @@ package body data_overrun_clear_feature is
-- Check Interrupt Status on Data Overrun!
------------------------------------------------------------------------
read_int_status
(
interrupts
,
ID_1
,
mem_bus
(
1
));
if
(
not
interrupts
.
data_overrun_int
)
then
error
(
"Data overrun Interrupt not captured as expected!"
);
end
if
;
check
(
interrupts
.
data_overrun_int
,
"Data overrun Interrupt not captured as expected!"
);
------------------------------------------------------------------------
-- Clear data overrun flag and clear data overrun interrupt!
...
...
@@ -158,9 +157,8 @@ package body data_overrun_clear_feature is
-- Read interrupt status and check data overrun was cleared!
------------------------------------------------------------------------
read_int_status
(
interrupts
,
ID_1
,
mem_bus
(
1
));
if
(
interrupts
.
data_overrun_int
)
then
error
(
"Data overrun Interrupt was not cleared!"
);
end
if
;
check_false
(
interrupts
.
data_overrun_int
,
"Data overrun Interrupt was not cleared!"
);
end
procedure
;
...
...
test/feature/fault_confinement_feature_tb.vhd
View file @
45cbe656
...
...
@@ -122,19 +122,11 @@ package body fault_confinement_feature is
------------------------------------------------------------------------
get_fault_thresholds
(
fault_th_2
,
ID_1
,
mem_bus
(
1
));
if
(
fault_th
.
ewl
/=
fault_th_2
.
ewl
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
error
(
"Error warning limit threshold was not set properly!"
);
-- LCOV_EXCL_START
end
if
;
check
(
fault_th
.
ewl
=
fault_th_2
.
ewl
,
"Error warning limit threshold was not set properly!"
);
if
(
fault_th
.
erp
/=
fault_th_2
.
erp
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
error
(
"Error passive threshold was not set properly!"
);
-- LCOV_EXCL_STOP
end
if
;
check
(
fault_th
.
erp
=
fault_th_2
.
erp
,
"Error passive threshold was not set properly!"
);
------------------------------------------------------------------------
-- Read fault confinement state
...
...
@@ -144,30 +136,18 @@ package body fault_confinement_feature is
if
(
err_counters
.
tx_counter
>
255
or
err_counters
.
rx_counter
>
255
)
then
if
(
fault_state
/=
fc_bus_off
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
error
(
"Unit not Bus off as expected!"
);
-- LCOV_EXCL_STOP
end
if
;
check
(
fault_state
/=
fc_bus_off
,
"Unit not Bus off as expected!"
);
elsif
(
err_counters
.
tx_counter
<
fault_th
.
ewl
and
err_counters
.
rx_counter
<
fault_th
.
ewl
)
then
if
(
fault_state
/=
fc_error_active
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
error
(
"Unit not Error Active as expected!"
);
-- LCOV_EXCL_STOP
end
if
;
check
(
fault_state
=
fc_error_active
,
"Unit not Error Active as expected!"
);
else
if
(
fault_state
/=
fc_error_passive
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
error
(
"Unit not Error Passive as expected!"
);
-- LCOV_EXCL_STOP
end
if
;
check
(
fault_state
=
fc_error_passive
,
"Unit not Error Passive as expected!"
);
end
if
;
end
procedure
;
end
package
body
;
end
package
body
;
\ No newline at end of file
test/feature/forbid_fd_feature_tb.vhd
View file @
45cbe656
...
...
@@ -135,12 +135,8 @@ package body forbid_fd_feature is
read_error_counters
(
err_counters_2
,
ID_1
,
mem_bus
(
1
));
-- Counter should be increased
if
((
err_counters_1
.
rx_counter
+
1
+
8
)
/=
err_counters_2
.
rx_counter
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
error
(
"RX Error counter not incremented as expected!"
);
-- LCOV_EXCL_STOP
end
if
;
check
((
err_counters_1
.
rx_counter
+
1
+
8
)
=
err_counters_2
.
rx_counter
,
"RX Error counter not incremented as expected!"
);
------------------------------------------------------------------------
-- Now send the same frame, but not the FD type. Wait until bus is idle
...
...
@@ -159,12 +155,8 @@ package body forbid_fd_feature is
-- But it should be increased by 8 since it is the first node that
-- detected the error!
------------------------------------------------------------------------
if
((
err_counters_1
.
rx_counter
+
8
)
/=
err_counters_2
.
rx_counter
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
error
(
"RX Error counter not incremented as expected!"
);
-- LCOV_EXCL_STOP
end
if
;
check
((
err_counters_1
.
rx_counter
+
8
)
=
err_counters_2
.
rx_counter
,
"RX Error counter not incremented as expected!"
);
------------------------------------------------------------------------
-- Now enable the FD support of Node 1
...
...
@@ -189,12 +181,8 @@ package body forbid_fd_feature is
-- Counter should be less than the value read now or both should be
-- zeroes when counter cannnot already be lowered...
------------------------------------------------------------------------
if
((
err_counters_1
.
rx_counter
+
7
)
/=
err_counters_2
.
rx_counter
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
error
(
"RX Error counter not decremented as expected!"
);
-- LCOV_EXCL_STOP
end
if
;
check
((
err_counters_1
.
rx_counter
+
7
)
=
err_counters_2
.
rx_counter
,
"RX Error counter not decremented as expected!"
);
------------------------------------------------------------------------
-- Since counter is incremented more than decremented, after many
...
...
@@ -210,4 +198,4 @@ package body forbid_fd_feature is
end
if
;
end
procedure
;
end
package
body
;
end
package
body
;
\ No newline at end of file
test/feature/interrupt_feature_tb.vhd
View file @
45cbe656
...
...
@@ -164,18 +164,11 @@ package body interrupt_feature is
-- Check that interrupt was generated
------------------------------------------------------------------------
read_int_status
(
int_stat
,
ID_1
,
mem_bus
(
1
));
if
(
not
int_stat
.
receive_int
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
error
(
"RX Interrupt not present!"
);
-- LCOV_EXCL_STOP
end
if
;
check
(
int_stat
.
receive_int
,
"RX Interrupt not present!"
);
clear_int_status
(
int_stat
,
ID_1
,
mem_bus
(
1
));
read_int_status
(
int_stat
,
ID_2
,
mem_bus
(
2
));
if
(
not
int_stat
.
transmitt_int
)
then
o
.
outcome
:
=
false
;
end
if
;
check
(
int_stat
.
transmitt_int
,
"TX Interrupt not present"
);
clear_int_status
(
int_stat
,
ID_2
,
mem_bus
(
2
));
------------------------------------------------------------------------
...
...
@@ -209,21 +202,11 @@ package body interrupt_feature is
-- Detect interrupt error flag
------------------------------------------------------------------------
read_int_status
(
int_stat
,
ID_1
,
mem_bus
(
1
));
if
(
not
int_stat
.
bus_error_int
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
error
(
"Bus error Interrput not present (Node 1)"
);
-- LCOV_EXCL_STOP
end
if
;
check
(
int_stat
.
bus_error_int
,
"Bus error Interrput not present (Node 1)"
);
clear_int_status
(
int_stat
,
ID_1
,
mem_bus
(
1
));
read_int_status
(
int_stat
,
ID_2
,
mem_bus
(
2
));
if
(
not
int_stat
.
bus_error_int
)
then
-- LCOV_EXCL_START
error
(
"Bus error Interrupt no present (Node 2)"
);
o
.
outcome
:
=
false
;
-- LCOV_EXCL_STOP
end
if
;
check
(
int_stat
.
bus_error_int
,
"Bus error Interrupt no present (Node 2)"
);
CAN_wait_frame_sent
(
ID_1
,
mem_bus
(
1
));
clear_int_status
(
int_stat
,
ID_2
,
mem_bus
(
2
));
wait
for
15000
ns
;
...
...
@@ -254,7 +237,7 @@ package body interrupt_feature is
------------------------------------------------------------------------
get_rx_buf_state
(
buf_info
,
ID_2
,
mem_bus
(
2
));
--report "Buffer size: " & Integer'image(buf_info.rx_buff_size
);
info
(
"Buffer size: "
&
Integer
'image
(
buf_info
.
rx_buff_size
)
);
-- Send RTR frames till we fill the buffer
CAN_frame
.
rtr
:
=
RTR_FRAME
;
...
...
@@ -267,15 +250,10 @@ package body interrupt_feature is
-- On last frame RX Buffer should be full. Check if interrupt was
-- fired and clear it!
if
(
i
=
(
buf_info
.
rx_buff_size
/
4
))
then
if
(
iout
(
2
)
.
irq
=
'0'
)
then
-- LCOV_EXCL_START
error
(
"RX Buffer Full interrupt is not active!"
);
o
.
outcome
:
=
false
;
-- LCOV_EXCL_STOP
else
read_int_status
(
int_stat
,
ID_2
,
mem_bus
(
2
));
clear_int_status
(
int_stat
,
ID_2
,
mem_bus
(
2
));
end
if
;
check_false
(
iout
(
2
)
.
irq
=
'0'
,
"RX Buffer Full interrupt is not active!"
);
read_int_status
(
int_stat
,
ID_2
,
mem_bus
(
2
));
clear_int_status
(
int_stat
,
ID_2
,
mem_bus
(
2
));
end
if
;
end
loop
;
...
...
@@ -285,19 +263,9 @@ package body interrupt_feature is
------------------------------------------------------------------------
read_int_status
(
int_stat
,
ID_2
,
mem_bus
(
2
));
if
(
not
int_stat
.
rx_buffer_full_int
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
error
(
"RX Buffer Full Interrupt not present!"
);
-- LCOV_EXCL_STOP
end
if
;
if
(
not
int_stat
.
data_overrun_int
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
error
(
"Data overrun Interrupt not present!"
);
-- LCOV_EXCL_STOP
end
if
;
check
(
int_stat
.
rx_buffer_full_int
,
"RX Buffer Full Interrupt not present!"
);
check
(
int_stat
.
data_overrun_int
,
"Data overrun Interrupt not present!"
);
clear_int_status
(
int_stat
,
ID_2
,
mem_bus
(
2
));
wait
for
30000
ns
;
...
...
@@ -329,12 +297,7 @@ package body interrupt_feature is
-- Detect the Bit rate shift interrupt flag
------------------------------------------------------------------------
read_int_status
(
int_stat
,
ID_2
,
mem_bus
(
2
));
if
(
not
int_stat
.
bit_rate_shift_int
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
error
(
"Bit Rate shift interrupt not present"
);
-- LCOV_EXCL_STOP
end
if
;
check
(
int_stat
.
bit_rate_shift_int
,
"Bit Rate shift interrupt not present"
);
CAN_wait_frame_sent
(
ID_2
,
mem_bus
(
2
));
clear_int_status
(
int_stat
,
ID_2
,
mem_bus
(
2
));
...
...
@@ -365,12 +328,7 @@ package body interrupt_feature is
wait
until
rising_edge
(
iout
(
1
)
.
irq
);
read_int_status
(
int_stat
,
ID_1
,
mem_bus
(
1
));
if
(
not
int_stat
.
arb_lost_int
)
then
-- LCOV_EXCL_START
o
.
outcome
:
=
false
;
error
(
"Arbitration Lost Interrupt not present!"
);
-- LCOV_EXCL_STOP
end
if
;
check
(
int_stat
.
arb_lost_int
,
"Arbitration Lost Interrupt not present!"
);
clear_int_status
(
int_stat
,
ID_1
,
mem_bus
(
1
));
-- Send abort command on node that lost arbitration so that it does
...
...
@@ -393,4 +351,4 @@ package body interrupt_feature is
end
procedure
;
end
package
body
;
end
package
body
;
\ No newline at end of file
test/feature/invalid_configs_feature_tb.vhd
View file @
45cbe656
...
...
@@ -111,13 +111,10 @@ package body invalid_configs_feature is
-- Read frame. CAN 2.0 frame with no BRS bit should be received.