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
43b0e865
Commit
43b0e865
authored
Jul 10, 2018
by
Ille, Ondrej, Ing.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added printout of sanity test parameters.
parent
da87c2bb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
125 additions
and
18 deletions
+125
-18
test/lib/CANtestLib.vhd
test/lib/CANtestLib.vhd
+100
-17
test/sanity/sanity_test.vhd
test/sanity/sanity_test.vhd
+25
-1
No files found.
test/lib/CANtestLib.vhd
View file @
43b0e865
...
...
@@ -495,6 +495,20 @@ package CANtestLib is
constant
f100_MHZ
:
natural
:
=
10000
;
----------------------------------------------------------------------------
----------------------------------------------------------------------------
-- sanity test Stuff; must be in a package
----------------------------------------------------------------------------
----------------------------------------------------------------------------
constant
NODE_COUNT
:
natural
:
=
4
;
type
bus_matrix_type
is
array
(
1
to
NODE_COUNT
,
1
to
NODE_COUNT
)
of
real
;
type
anat_t
is
array
(
integer
range
<>
)
of
natural
;
subtype
anat_nc_t
is
anat_t
(
1
to
NODE_COUNT
);
subtype
epsilon_type
is
anat_nc_t
;
subtype
trv_del_type
is
anat_nc_t
;
subtype
timing_config_t
is
anat_t
(
1
to
10
);
----------------------------------------------------------------------------
----------------------------------------------------------------------------
...
...
@@ -932,6 +946,31 @@ package CANtestLib is
);
----------------------------------------------------------------------------
-- Print Bus timing configuration of CTU CAN FD Core.
-- (duration of bit phases, synchronisation jump width, baud-rate prescaler)
--
-- Arguments:
-- bus_timing Bus timing structure that will be printed in simulator.
-- ID Index of CTU CAN FD Core instance
-- mem_bus Avalon memory bus to execute the access on.
----------------------------------------------------------------------------
procedure
CAN_print_timing
(
constant
bus_timing
:
in
bit_time_config_type
);
----------------------------------------------------------------------------
-- Print Bus matrix from sanity test configuration.
--
-- Arguments:
-- bus_matrix Bus Matrix to be printed.
----------------------------------------------------------------------------
procedure
CAN_print_bus_matrix
(
constant
bus_matrix
:
in
bus_matrix_type
);
----------------------------------------------------------------------------
-- Turn on/off CTU_CAN_FD Core.
--
...
...
@@ -1565,23 +1604,6 @@ package CANtestLib is
signal
mem_bus
:
inout
Avalon_mem_type
);
----------------------------------------------------------------------------
----------------------------------------------------------------------------
-- sanity test Stuff; must be in a package
----------------------------------------------------------------------------
----------------------------------------------------------------------------
constant
NODE_COUNT
:
natural
:
=
4
;
type
bus_matrix_type
is
array
(
1
to
NODE_COUNT
,
1
to
NODE_COUNT
)
of
real
;
type
anat_t
is
array
(
integer
range
<>
)
of
natural
;
subtype
anat_nc_t
is
anat_t
(
1
to
NODE_COUNT
);
subtype
epsilon_type
is
anat_nc_t
;
subtype
trv_del_type
is
anat_nc_t
;
subtype
timing_config_t
is
anat_t
(
1
to
10
);
----------------------------------------------------------------------------
----------------------------------------------------------------------------
-- Component declarations
...
...
@@ -2345,6 +2367,67 @@ package body CANtestLib is
end
procedure
;
procedure
CAN_print_timing
(
constant
bus_timing
:
in
bit_time_config_type
)
is
variable
msg
:
line
;
begin
write
(
msg
,
string
'
(
"Nominal Bit timing: "
));
-- Baud Rate Prescaler
write
(
msg
,
string
'
(
"BRP: "
&
integer
'image
(
bus_timing
.
tq_nbt
)
&
" "
));
-- Propagation segment
write
(
msg
,
string
'
(
"PROP: "
&
integer
'image
(
bus_timing
.
prop_nbt
)
&
" "
));
-- Phase 1 segment
write
(
msg
,
string
'
(
"PH1: "
&
integer
'image
(
bus_timing
.
ph1_nbt
)
&
" "
));
-- Phase 2 segment
write
(
msg
,
string
'
(
"PH2: "
&
integer
'image
(
bus_timing
.
ph2_nbt
)
&
" "
));
-- SJW
write
(
msg
,
string
'
(
"SJW: "
&
integer
'image
(
bus_timing
.
sjw_nbt
)
&
" "
));
write
(
msg
,
string
'
(
"Data Bit timing: "
));
-- Baud Rate Prescaler - FD
write
(
msg
,
string
'
(
"BRP: "
&
integer
'image
(
bus_timing
.
tq_dbt
)
&
" "
));
-- Propagation segment - FD
write
(
msg
,
string
'
(
"PROP: "
&
integer
'image
(
bus_timing
.
prop_dbt
)
&
" "
));
-- Phase 1 segment - FD
write
(
msg
,
string
'
(
"PH1: "
&
integer
'image
(
bus_timing
.
ph1_dbt
)
&
" "
));
-- Phase 2 segment - FD
write
(
msg
,
string
'
(
"PH2: "
&
integer
'image
(
bus_timing
.
ph2_dbt
)
&
" "
));
-- SJW - FD
write
(
msg
,
string
'
(
"SJW: "
&
integer
'image
(
bus_timing
.
sjw_dbt
)
&
" "
));
writeline
(
output
,
msg
);
end
procedure
;
procedure
CAN_print_bus_matrix
(
constant
bus_matrix
:
in
bus_matrix_type
)
is
variable
msg
:
line
;
begin
write
(
msg
,
string
'
(
"Bus matrix: "
));
writeline
(
output
,
msg
);
for
i
in
1
to
NODE_COUNT
loop
for
j
in
1
to
NODE_COUNT
loop
write
(
msg
,
string
'
(
integer
'image
(
bus_matrix
(
i
,
j
)
&
" "
)));
end
loop
;
writeline
(
output
,
msg
);
end
loop
;
end
procedure
;
procedure
CAN_turn_controller
(
constant
turn_on
:
in
boolean
;
constant
ID
:
in
natural
range
0
to
15
;
...
...
test/sanity/sanity_test.vhd
View file @
43b0e865
...
...
@@ -825,8 +825,32 @@ begin
variable
step_done
:
boolean
:
=
false
;
begin
print_test_info
(
iterations
,
log_level
,
error_beh
,
error_tol
);
-- TODO: print sanity test params
------------------------------------------------------------------------
-- Print Test configuration
------------------------------------------------------------------------
log
(
"Sanity test configuration:"
,
info_l
,
log_level
);
log
(
"Clock jitters (ppm): "
&
epsilon_v
(
1
)
&
" "
&
epsilon_v
(
2
)
&
" "
&
epsilon_v
(
3
)
&
" "
&
epsilon_v
(
4
)
&
" "
,
info_l
,
log_level
);
log
(
"Transceiver delays (ns): "
&
trv_del_v
(
1
)
&
" "
&
trv_del_v
(
2
)
&
" "
&
trv_del_v
(
3
)
&
" "
&
trv_del_v
(
4
)
&
" "
,
info_l
,
log_level
);
log
(
" Noise width (mean): "
&
nw_mean
(
1
)
&
" Noise width (var): "
&
nw_var
(
1
)
&
" Noise gap (mean): "
&
ng_mean
(
1
)
&
" Noise gap (var): "
&
ng_var
(
1
),
info_l
,
log_level
);
log
(
"Bus topology: "
&
topology
,
info_l
,
log_level
);
CAN_print_timing
(
timing_config
);
CAN_print_bus_matrix
(
bus_matrix
);
------------------------------------------------------------------------
-- Execute test reset
------------------------------------------------------------------------
wait
for
5
ns
;
do_restart_mem_if
<=
(
OTHERS
=>
false
);
wait
for
5
ns
;
...
...
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