Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
canbus
CTU CAN FD IP Core
Commits
e5c9644f
Commit
e5c9644f
authored
Jan 15, 2019
by
Ing. Viktor Fúra
Committed by
Ille, Ondrej, Ing.
Jan 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: add timestamp registers feature test
parent
ccae98dd
Pipeline
#5983
passed with stages
in 12 minutes and 10 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
116 additions
and
1 deletion
+116
-1
test/feature/timestamp_registers_feature_tb.vhd
test/feature/timestamp_registers_feature_tb.vhd
+115
-0
test/tests_debug.yml
test/tests_debug.yml
+1
-1
No files found.
test/feature/timestamp_registers_feature_tb.vhd
0 → 100644
View file @
e5c9644f
--------------------------------------------------------------------------------
--
-- CTU CAN FD IP Core
-- Copyright (C) 2015-2018
--
-- Authors:
-- Ondrej Ille <ondrej.ille@gmail.com>
-- Martin Jerabek <martin.jerabek01@gmail.com>
--
-- Project advisors:
-- Jiri Novak <jnovak@fel.cvut.cz>
-- Pavel Pisa <pisa@cmp.felk.cvut.cz>
--
-- Department of Measurement (http://meas.fel.cvut.cz/)
-- Faculty of Electrical Engineering (http://www.fel.cvut.cz)
-- Czech Technical University (http://www.cvut.cz/)
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this VHDL component and associated documentation files (the "Component"),
-- to deal in the Component without restriction, including without limitation
-- the rights to use, copy, modify, merge, publish, distribute, sublicense,
-- and/or sell copies of the Component, and to permit persons to whom the
-- Component is furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Component.
--
-- THE COMPONENT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHTHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-- FROM, OUT OF OR IN CONNECTION WITH THE COMPONENT OR THE USE OR OTHER DEALINGS
-- IN THE COMPONENT.
--
-- The CAN protocol is developed by Robert Bosch GmbH and protected by patents.
-- Anybody who wants to implement this IP core on silicon has to obtain a CAN
-- protocol license from Bosch.
--
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Purpose:
-- Feature test for Timestamp options on RX frame in RX Buffer!
--
--------------------------------------------------------------------------------
-- Revision History:
--
-- 29.6.2018 Created file
--------------------------------------------------------------------------------
context
work
.
ctu_can_synth_context
;
context
work
.
ctu_can_test_context
;
use
lib
.
pkg_feature_exec_dispath
.
all
;
package
timestamp_registers_feature
is
procedure
timestamp_registers_feature_exec
(
variable
o
:
out
feature_outputs_t
;
signal
so
:
out
feature_signal_outputs_t
;
signal
rand_ctr
:
inout
natural
range
0
to
RAND_POOL_SIZE
;
signal
iout
:
in
instance_outputs_arr_t
;
signal
mem_bus
:
inout
mem_bus_arr_t
;
signal
bus_level
:
in
std_logic
);
end
package
;
package
body
timestamp_registers_feature
is
procedure
timestamp_registers_feature_exec
(
variable
o
:
out
feature_outputs_t
;
signal
so
:
out
feature_signal_outputs_t
;
signal
rand_ctr
:
inout
natural
range
0
to
RAND_POOL_SIZE
;
signal
iout
:
in
instance_outputs_arr_t
;
signal
mem_bus
:
inout
mem_bus_arr_t
;
signal
bus_level
:
in
std_logic
)
is
variable
r_data
:
std_logic_vector
(
31
downto
0
)
:
=
(
OTHERS
=>
'0'
);
variable
ID_1
:
natural
:
=
1
;
variable
diff
:
unsigned
(
63
downto
0
);
variable
ts_input
:
std_logic_vector
(
63
downto
0
);
variable
ts_read
:
std_logic_vector
(
63
downto
0
);
begin
o
.
outcome
:
=
true
;
wait
for
1000
ns
;
for
i
in
0
to
50
loop
------------------------------------------------------------------------
-- Read and save timestamp from registers
------------------------------------------------------------------------
ts_input
:
=
iout
(
1
)
.
stat_bus
(
STAT_TS_HIGH
downto
STAT_TS_LOW
);
------------------------------------------------------------------------
-- Read timestamp with lib function
------------------------------------------------------------------------
CAN_read_timestamp
(
ts_read
,
ID_1
,
mem_bus
(
1
));
------------------------------------------------------------------------
-- Compare both values
------------------------------------------------------------------------
info
(
"Timestamp input: 0x"
&
to_hstring
(
ts_input
));
info
(
"Timestamp read: 0x"
&
to_hstring
(
ts_read
));
diff
:
=
unsigned
(
ts_input
)
-
unsigned
(
ts_read
);
check
(
diff
<
10
,
"Timestamp difference is too big! "
&
"Difference "
&
integer
'image
(
to_integer
(
diff
)));
end
loop
;
end
procedure
;
end
package
body
;
test/tests_debug.yml
View file @
e5c9644f
...
...
@@ -10,4 +10,4 @@ feature:
timeout
:
100 ms
wave
:
feature/feature_env_setup.tcl
tests
:
suspend_transmission
:
timestamp_registers
:
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment