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
5f17402c
Commit
5f17402c
authored
Dec 28, 2018
by
Ille, Ondrej, Ing.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-named CANConstants to can_constants.
parent
4baae14c
Changes
81
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
81 changed files
with
618 additions
and
443 deletions
+618
-443
src/CAN_top_level.vhd
src/CAN_top_level.vhd
+1
-1
src/apb/apb_ifc.vhd
src/apb/apb_ifc.vhd
+1
-1
src/bus_sampling/bus_sampling.vhd
src/bus_sampling/bus_sampling.vhd
+1
-1
src/can_core/bit_destuffing/bit_destuffing.vhd
src/can_core/bit_destuffing/bit_destuffing.vhd
+1
-1
src/can_core/bit_stuffing/bit_stuffing.vhd
src/can_core/bit_stuffing/bit_stuffing.vhd
+1
-1
src/can_core/bus_traffic_counters/bus_traffic_counters.vhd
src/can_core/bus_traffic_counters/bus_traffic_counters.vhd
+1
-1
src/can_core/can_core.vhd
src/can_core/can_core.vhd
+1
-1
src/can_core/crc/can_crc.vhd
src/can_core/crc/can_crc.vhd
+1
-1
src/can_core/crc/crc_calc.vhd
src/can_core/crc/crc_calc.vhd
+1
-1
src/can_core/crc/crc_wrapper.vhd
src/can_core/crc/crc_wrapper.vhd
+1
-1
src/can_core/fault_confinement/fault_confinement.vhd
src/can_core/fault_confinement/fault_confinement.vhd
+1
-1
src/can_core/operation_control/operation_control.vhd
src/can_core/operation_control/operation_control.vhd
+1
-1
src/can_core/protocol_control/protocol_control.vhd
src/can_core/protocol_control/protocol_control.vhd
+1
-1
src/component.xml
src/component.xml
+2
-2
src/event_logger/event_logger.vhd
src/event_logger/event_logger.vhd
+1
-1
src/frame_filters/bit_filter.vhd
src/frame_filters/bit_filter.vhd
+1
-1
src/frame_filters/frame_filters.vhd
src/frame_filters/frame_filters.vhd
+1
-1
src/frame_filters/range_filter.vhd
src/frame_filters/range_filter.vhd
+1
-1
src/interrupts/int_manager.vhd
src/interrupts/int_manager.vhd
+1
-1
src/interrupts/int_module.vhd
src/interrupts/int_module.vhd
+1
-1
src/lib/can_components.vhd
src/lib/can_components.vhd
+1
-1
src/lib/can_constants.vhd
src/lib/can_constants.vhd
+4
-157
src/lib/can_types.vhd
src/lib/can_types.vhd
+216
-0
src/memory_registers/memory_registers.vhd
src/memory_registers/memory_registers.vhd
+1
-1
src/prescaler/prescaler.vhd
src/prescaler/prescaler.vhd
+1
-1
src/rx_buffer/rx_buffer.vhd
src/rx_buffer/rx_buffer.vhd
+1
-1
src/rx_buffer/rx_buffer_fsm.vhd
src/rx_buffer/rx_buffer_fsm.vhd
+1
-1
src/rx_buffer/rx_buffer_pointers.vhd
src/rx_buffer/rx_buffer_pointers.vhd
+1
-1
src/tx_arbitrator/priority_decoder.vhd
src/tx_arbitrator/priority_decoder.vhd
+1
-1
src/tx_arbitrator/tx_arbitrator.vhd
src/tx_arbitrator/tx_arbitrator.vhd
+1
-1
src/tx_arbitrator/tx_arbitrator_fsm.vhd
src/tx_arbitrator/tx_arbitrator_fsm.vhd
+1
-1
src/txt_buffer/txt_buffer.vhd
src/txt_buffer/txt_buffer.vhd
+1
-1
src/txt_buffer/txt_buffer_fsm.vhd
src/txt_buffer/txt_buffer_fsm.vhd
+1
-1
synthesis/Vivado/xilinx_benchmark/xilinx_benchmark.runs/Benchmark:Minimal_configuration/vivado.pb
..._benchmark.runs/Benchmark:Minimal_configuration/vivado.pb
+0
-0
synthesis/Vivado/xilinx_benchmark/xilinx_benchmark.xpr
synthesis/Vivado/xilinx_benchmark/xilinx_benchmark.xpr
+319
-207
test/feature/abort_transmittion_feature_tb.vhd
test/feature/abort_transmittion_feature_tb.vhd
+1
-1
test/feature/arbitration_feature_tb.vhd
test/feature/arbitration_feature_tb.vhd
+1
-1
test/feature/bus_start_feature_tb.vhd
test/feature/bus_start_feature_tb.vhd
+1
-1
test/feature/byte_enable_feature_tb.vhd
test/feature/byte_enable_feature_tb.vhd
+1
-1
test/feature/data_length_code_feature_tb.vhd
test/feature/data_length_code_feature_tb.vhd
+1
-1
test/feature/data_overrun_clear_feature_tb.vhd
test/feature/data_overrun_clear_feature_tb.vhd
+1
-1
test/feature/fault_confinement_feature_tb.vhd
test/feature/fault_confinement_feature_tb.vhd
+1
-1
test/feature/forbid_fd_feature_tb.vhd
test/feature/forbid_fd_feature_tb.vhd
+1
-1
test/feature/interrupt_feature_tb.vhd
test/feature/interrupt_feature_tb.vhd
+1
-1
test/feature/invalid_configs_feature_tb.vhd
test/feature/invalid_configs_feature_tb.vhd
+1
-1
test/feature/message_filter_feature_tb.vhd
test/feature/message_filter_feature_tb.vhd
+1
-1
test/feature/overload_feature_tb.vhd
test/feature/overload_feature_tb.vhd
+1
-1
test/feature/pkg_feature_exec_dispatch.vhd
test/feature/pkg_feature_exec_dispatch.vhd
+1
-1
test/feature/retr_limit_feature_tb.vhd
test/feature/retr_limit_feature_tb.vhd
+1
-1
test/feature/rtr_pref_feature_tb.vhd
test/feature/rtr_pref_feature_tb.vhd
+1
-1
test/feature/rx_status_feature_tb.vhd
test/feature/rx_status_feature_tb.vhd
+1
-1
test/feature/spec_mode_feature_tb.vhd
test/feature/spec_mode_feature_tb.vhd
+1
-1
test/feature/suspend_transmission_feature_tb.vhd
test/feature/suspend_transmission_feature_tb.vhd
+1
-1
test/feature/tb_feature.vhd
test/feature/tb_feature.vhd
+2
-2
test/feature/timestamp_options_feature_tb.vhd
test/feature/timestamp_options_feature_tb.vhd
+1
-1
test/feature/traf_meas_feature_tb.vhd
test/feature/traf_meas_feature_tb.vhd
+1
-1
test/feature/tran_delay_feature_tb.vhd
test/feature/tran_delay_feature_tb.vhd
+1
-1
test/feature/tx_arb_time_tran_feature_tb.vhd
test/feature/tx_arb_time_tran_feature_tb.vhd
+1
-1
test/feature/txtb_state_feature_tb.vhd
test/feature/txtb_state_feature_tb.vhd
+1
-1
test/lib/CANtestLib.vhd
test/lib/CANtestLib.vhd
+1
-1
test/lib/bit_generator.vhd
test/lib/bit_generator.vhd
+1
-1
test/others/CAN_top_level_tb.vhd
test/others/CAN_top_level_tb.vhd
+1
-1
test/others/busSync_tb_edge.vhd
test/others/busSync_tb_edge.vhd
+1
-1
test/others/busSync_tb_sample.vhd
test/others/busSync_tb_sample.vhd
+1
-1
test/others/registers_tb.vhd
test/others/registers_tb.vhd
+1
-1
test/reference/tb_reference.vhd
test/reference/tb_reference.vhd
+1
-1
test/sanity/sanity_test.vhd
test/sanity/sanity_test.vhd
+1
-1
test/testfw/data/pkg_feature_exec_dispath-body.vhd
test/testfw/data/pkg_feature_exec_dispath-body.vhd
+1
-1
test/unit/APB/APB_tb.vhd
test/unit/APB/APB_tb.vhd
+1
-1
test/unit/Bit_Stuffing/Bit_Stuffing_tb.vhd
test/unit/Bit_Stuffing/Bit_Stuffing_tb.vhd
+1
-1
test/unit/Bus_Sampling/Bus_Sync_tb.vhd
test/unit/Bus_Sampling/Bus_Sync_tb.vhd
+1
-1
test/unit/CRC/CRC_tb.vhd
test/unit/CRC/CRC_tb.vhd
+1
-1
test/unit/Evnt_Logger/Event_logger_tb.vhd
test/unit/Evnt_Logger/Event_logger_tb.vhd
+1
-1
test/unit/Fault_confinement/Fault_confinement_tb.vhd
test/unit/Fault_confinement/Fault_confinement_tb.vhd
+1
-1
test/unit/Int_Manager/Int_Manager_tb.vhd
test/unit/Int_Manager/Int_Manager_tb.vhd
+1
-1
test/unit/Message_filter/message_filter_tb.vhd
test/unit/Message_filter/message_filter_tb.vhd
+1
-1
test/unit/Prescaler/Prescaler_tb.vhd
test/unit/Prescaler/Prescaler_tb.vhd
+1
-1
test/unit/Protocol_Control/Protocol_Control_tb.vhd
test/unit/Protocol_Control/Protocol_Control_tb.vhd
+1
-1
test/unit/RX_Buffer/RX_Buffer_tb.vhd
test/unit/RX_Buffer/RX_Buffer_tb.vhd
+1
-1
test/unit/TX_Arbitrator/TX_Arbitrator_tb.vhd
test/unit/TX_Arbitrator/TX_Arbitrator_tb.vhd
+1
-1
test/unit/TX_Buffer/Tx_Buffer_tb.vhd
test/unit/TX_Buffer/Tx_Buffer_tb.vhd
+1
-1
No files found.
src/CAN_top_level.vhd
View file @
5f17402c
...
...
@@ -78,7 +78,7 @@
Library
ieee
;
USE
IEEE
.
std_logic_1164
.
all
;
USE
IEEE
.
numeric_std
.
ALL
;
USE
WORK
.
CAN
constants
.
ALL
;
USE
WORK
.
can_
constants
.
ALL
;
use
work
.
can_components
.
ALL
;
use
work
.
CAN_FD_register_map
.
all
;
use
work
.
cmn_lib
.
all
;
...
...
src/apb/apb_ifc.vhd
View file @
5f17402c
...
...
@@ -54,7 +54,7 @@
library
ieee
;
use
ieee
.
std_logic_1164
.
all
;
use
ieee
.
numeric_std
.
all
;
use
work
.
CAN
constants
.
all
;
use
work
.
can_
constants
.
all
;
entity
apb_ifc
is
generic
(
...
...
src/bus_sampling/bus_sampling.vhd
View file @
5f17402c
...
...
@@ -91,7 +91,7 @@
Library
ieee
;
USE
IEEE
.
std_logic_1164
.
all
;
USE
IEEE
.
numeric_std
.
ALL
;
USE
WORK
.
CAN
constants
.
ALL
;
USE
WORK
.
can_
constants
.
ALL
;
use
work
.
CAN_FD_register_map
.
all
;
use
work
.
cmn_lib
.
all
;
...
...
src/can_core/bit_destuffing/bit_destuffing.vhd
View file @
5f17402c
...
...
@@ -79,7 +79,7 @@
library
ieee
;
use
IEEE
.
std_logic_1164
.
all
;
use
IEEE
.
numeric_std
.
all
;
use
WORK
.
CAN
constants
.
all
;
use
WORK
.
can_
constants
.
all
;
use
work
.
cmn_lib
.
all
;
entity
bit_destuffing
is
...
...
src/can_core/bit_stuffing/bit_stuffing.vhd
View file @
5f17402c
...
...
@@ -77,7 +77,7 @@
Library
ieee
;
USE
IEEE
.
std_logic_1164
.
all
;
USE
IEEE
.
numeric_std
.
ALL
;
USE
WORK
.
CAN
constants
.
ALL
;
USE
WORK
.
can_
constants
.
ALL
;
use
work
.
cmn_lib
.
all
;
entity
bit_stuffing
is
...
...
src/can_core/bus_traffic_counters/bus_traffic_counters.vhd
View file @
5f17402c
...
...
@@ -52,7 +52,7 @@
Library
ieee
;
USE
IEEE
.
std_logic_1164
.
all
;
USE
IEEE
.
numeric_std
.
ALL
;
use
work
.
CAN
constants
.
all
;
use
work
.
can_
constants
.
all
;
use
work
.
can_components
.
ALL
;
use
work
.
CAN_FD_frame_format
.
ALL
;
use
work
.
CAN_FD_frame_format
.
all
;
...
...
src/can_core/can_core.vhd
View file @
5f17402c
...
...
@@ -89,7 +89,7 @@
Library
ieee
;
USE
IEEE
.
std_logic_1164
.
all
;
USE
IEEE
.
numeric_std
.
ALL
;
use
work
.
CAN
constants
.
all
;
use
work
.
can_
constants
.
all
;
use
work
.
can_components
.
ALL
;
use
work
.
CAN_FD_frame_format
.
ALL
;
use
work
.
CAN_FD_frame_format
.
all
;
...
...
src/can_core/crc/can_crc.vhd
View file @
5f17402c
...
...
@@ -66,7 +66,7 @@
Library
ieee
;
USE
IEEE
.
std_logic_1164
.
all
;
USE
IEEE
.
numeric_std
.
ALL
;
use
work
.
CAN
constants
.
all
;
use
work
.
can_
constants
.
all
;
use
work
.
CAN_FD_register_map
.
all
;
use
work
.
can_components
.
all
;
...
...
src/can_core/crc/crc_calc.vhd
View file @
5f17402c
...
...
@@ -56,7 +56,7 @@
Library
ieee
;
USE
IEEE
.
std_logic_1164
.
all
;
USE
IEEE
.
numeric_std
.
ALL
;
use
work
.
CAN
constants
.
all
;
use
work
.
can_
constants
.
all
;
use
work
.
CAN_FD_register_map
.
all
;
entity
crc_calc
is
...
...
src/can_core/crc/crc_wrapper.vhd
View file @
5f17402c
...
...
@@ -59,7 +59,7 @@
Library
ieee
;
USE
IEEE
.
std_logic_1164
.
all
;
USE
IEEE
.
numeric_std
.
ALL
;
use
work
.
CAN
constants
.
all
;
use
work
.
can_
constants
.
all
;
use
work
.
CAN_FD_register_map
.
all
;
use
work
.
can_components
.
all
;
...
...
src/can_core/fault_confinement/fault_confinement.vhd
View file @
5f17402c
...
...
@@ -71,7 +71,7 @@
Library
ieee
;
USE
IEEE
.
std_logic_1164
.
all
;
USE
IEEE
.
numeric_std
.
ALL
;
USE
WORK
.
CAN
constants
.
ALL
;
USE
WORK
.
can_
constants
.
ALL
;
entity
fault_confinement
is
PORT
(
...
...
src/can_core/operation_control/operation_control.vhd
View file @
5f17402c
...
...
@@ -58,7 +58,7 @@
Library
ieee
;
USE
IEEE
.
std_logic_1164
.
all
;
USE
IEEE
.
numeric_std
.
ALL
;
use
work
.
CAN
constants
.
all
;
use
work
.
can_
constants
.
all
;
use
work
.
CAN_FD_register_map
.
all
;
entity
operation_control
is
...
...
src/can_core/protocol_control/protocol_control.vhd
View file @
5f17402c
...
...
@@ -250,7 +250,7 @@
Library
ieee
;
USE
IEEE
.
std_logic_1164
.
all
;
USE
IEEE
.
numeric_std
.
ALL
;
use
work
.
CAN
constants
.
all
;
use
work
.
can_
constants
.
all
;
use
work
.
CAN_FD_frame_format
.
all
;
use
work
.
CAN_FD_register_map
.
all
;
...
...
src/component.xml
View file @
5f17402c
...
...
@@ -553,7 +553,7 @@
<spirit:fileType>
vhdlSource
</spirit:fileType>
</spirit:file>
<spirit:file>
<spirit:name>
Libraries/
CAN
constants.vhd
</spirit:name>
<spirit:name>
Libraries/
can_
constants.vhd
</spirit:name>
<spirit:fileType>
vhdlSource
</spirit:fileType>
</spirit:file>
<spirit:file>
...
...
@@ -673,7 +673,7 @@
<spirit:fileType>
vhdlSource
</spirit:fileType>
</spirit:file>
<spirit:file>
<spirit:name>
Libraries/
CAN
constants.vhd
</spirit:name>
<spirit:name>
Libraries/
can_
constants.vhd
</spirit:name>
<spirit:fileType>
vhdlSource
</spirit:fileType>
</spirit:file>
<spirit:file>
...
...
src/event_logger/event_logger.vhd
View file @
5f17402c
...
...
@@ -86,7 +86,7 @@
Library
ieee
;
USE
IEEE
.
std_logic_1164
.
all
;
USE
IEEE
.
numeric_std
.
ALL
;
USE
WORK
.
CAN
constants
.
ALL
;
USE
WORK
.
can_
constants
.
ALL
;
entity
event_logger
is
generic
(
...
...
src/frame_filters/bit_filter.vhd
View file @
5f17402c
...
...
@@ -51,7 +51,7 @@
Library
ieee
;
use
IEEE
.
std_logic_1164
.
all
;
use
IEEE
.
numeric_std
.
ALL
;
use
work
.
CAN
constants
.
all
;
use
work
.
can_
constants
.
all
;
use
work
.
ID_transfer
.
all
;
entity
bit_filter
is
...
...
src/frame_filters/frame_filters.vhd
View file @
5f17402c
...
...
@@ -63,7 +63,7 @@
Library
ieee
;
use
IEEE
.
std_logic_1164
.
all
;
use
IEEE
.
numeric_std
.
ALL
;
use
work
.
CAN
constants
.
all
;
use
work
.
can_
constants
.
all
;
use
work
.
ID_transfer
.
all
;
use
work
.
can_components
.
ALL
;
use
work
.
CAN_FD_frame_format
.
all
;
...
...
src/frame_filters/range_filter.vhd
View file @
5f17402c
...
...
@@ -51,7 +51,7 @@
Library
ieee
;
use
IEEE
.
std_logic_1164
.
all
;
use
IEEE
.
numeric_std
.
ALL
;
use
work
.
CAN
constants
.
all
;
use
work
.
can_
constants
.
all
;
use
work
.
ID_transfer
.
all
;
entity
range_filter
is
...
...
src/interrupts/int_manager.vhd
View file @
5f17402c
...
...
@@ -75,7 +75,7 @@
Library
ieee
;
USE
IEEE
.
std_logic_1164
.
all
;
USE
IEEE
.
numeric_std
.
ALL
;
USE
WORK
.
CAN
constants
.
ALL
;
USE
WORK
.
can_
constants
.
ALL
;
use
work
.
CAN_FD_register_map
.
all
;
use
work
.
reduce_lib
.
all
;
use
work
.
can_components
.
all
;
...
...
src/interrupts/int_module.vhd
View file @
5f17402c
...
...
@@ -64,7 +64,7 @@
Library
ieee
;
USE
IEEE
.
std_logic_1164
.
all
;
USE
IEEE
.
numeric_std
.
ALL
;
USE
WORK
.
CAN
constants
.
ALL
;
USE
WORK
.
can_
constants
.
ALL
;
use
work
.
CAN_FD_register_map
.
all
;
use
work
.
reduce_lib
.
all
;
...
...
src/lib/can_components.vhd
View file @
5f17402c
...
...
@@ -59,7 +59,7 @@
library
ieee
;
use
IEEE
.
std_logic_1164
.
all
;
use
IEEE
.
numeric_std
.
all
;
use
WORK
.
CAN
constants
.
all
;
use
WORK
.
can_
constants
.
all
;
use
work
.
can_registers_pkg
.
all
;
package
can_components
is
...
...
src/lib/
CAN
constants.vhd
→
src/lib/
can_
constants.vhd
View file @
5f17402c
...
...
@@ -54,18 +54,19 @@
-- 20.1.2018 Removed CAN Frame constants FRAME_BASIC and FRAME_EXTENDED
-- Properly only signals from CAN_FD_frame_format package
-- BASE and EXTENDED should be used!
-- 28.12.2018 Separated "can_types", "drv_stat_pkg".
--------------------------------------------------------------------------------
Library
ieee
;
use
ieee
.
std_logic_1164
.
all
;
package
CAN
constants
is
package
can_
constants
is
-- IP Core version related constants
constant
CTU_CAN_FD_VERSION_MINOR
:
std_logic_vector
(
7
downto
0
)
:
=
x"01"
;
constant
CTU_CAN_FD_VERSION_MAJOR
:
std_logic_vector
(
7
downto
0
)
:
=
x"02"
;
--Active value of asynchronous reset
--
Active value of asynchronous reset
constant
ACT_RESET
:
std_logic
:
=
'0'
;
--Definition of basic logic levels for CAN bus
...
...
@@ -121,20 +122,7 @@ package CANconstants is
-- Common definitions should not be generic at the moment
constant
TXT_BUFFER_COUNT
:
natural
:
=
4
;
constant
INT_COUNT
:
natural
:
=
12
;
----------------------------------------------------------------------------
-- DLC Types
----------------------------------------------------------------------------
type
dlc_type
is
array
(
0
to
15
)
of
std_logic_vector
(
3
downto
0
);
type
length_type
is
array
(
0
to
15
)
of
natural
;
constant
dlc_codes
:
dlc_type
:
=
(
"0000"
,
"0001"
,
"0010"
,
"0011"
,
"0100"
,
"0101"
,
"0110"
,
"0111"
,
"1000"
,
"1001"
,
"1010"
,
"1011"
,
"1100"
,
"1101"
,
"1110"
,
"1111"
);
constant
dlc_length
:
length_type
:
=
(
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
12
,
16
,
20
,
24
,
32
,
48
,
64
);
constant
INT_COUNT
:
natural
:
=
12
;
constant
ZERO
:
std_logic
:
=
'0'
;
constant
NO_ACTION
:
std_logic
:
=
'0'
;
...
...
@@ -163,147 +151,6 @@ package CANconstants is
constant
CRC17_POL
:
std_logic_vector
(
19
downto
0
)
:
=
x"3685B"
;
constant
CRC21_POL
:
std_logic_vector
(
23
downto
0
)
:
=
x"302899"
;
----------------------------------------------------------------------------
-- State Machine types
----------------------------------------------------------------------------
-- Error state of node
type
error_state_type
is
(
error_active
,
error_passive
,
bus_off
);
-- Operation mode of the Node
type
oper_mode_type
is
(
integrating
,
idle
,
transciever
,
reciever
);
-- Protocol control
type
protocol_type
is
(
sof
,
arbitration
,
control
,
data
,
crc
,
delim_ack
,
eof
,
interframe
,
overload
,
error
,
off
);
-- Note: two bits are two bits between Base and Extended identifier
-- Note: one bit is the last remaining bit after the identifier extension
type
arb_type
is
(
base_id
,
two_bits
,
ext_id
,
one_bit
);
-- Within ISO CAN FD new field stuff count is needed!
type
crc_type
is
(
stuff_count
,
real_crc
);
-- Intermission field sub-State
type
interm_spc_type
is
(
intermission
,
suspend
,
interm_idle
);
-- Error frame subtype
type
err_frame_type
is
(
err_flg_sup
,
err_delim
);
-- Overload frame subtype
type
ovr_frame_type
is
(
ovr_flg_sup
,
ovr_delim
);
type
bit_time_type
is
(
sync
,
prop
,
ph1
,
ph2
,
h_sync
,
reset
);
-- Logger state machine type
type
logger_state_type
is
(
config
,
ready
,
running
);
-- RX Buffer loader type
type
rx_buf_fsm_type
is
(
rxb_idle
,
rxb_store_frame_format
,
rxb_store_identifier
,
rxb_store_beg_ts_low
,
rxb_store_beg_ts_high
,
rxb_store_end_ts_low
,
rxb_store_end_ts_high
,
rxb_store_data
);
-- TX arbitrator state type
type
tx_arb_state_type
is
(
arb_sel_low_ts
,
arb_sel_upp_ts
,
arb_sel_ffw
,
arb_locked
);
-- TXT buffer state type
type
txt_fsm_type
is
(
txt_empty
,
txt_ready
,
txt_tx_prog
,
txt_ab_prog
,
txt_ok
,
txt_error
,
txt_aborted
);
----------------------------------------------------------------------------
-- TXT Buffer types
----------------------------------------------------------------------------
type
txtb_priorities_type
is
array
(
0
to
TXT_BUFFER_COUNT
-
1
)
of
std_logic_vector
(
2
downto
0
);
type
txtb_output_type
is
array
(
0
to
TXT_BUFFER_COUNT
-
1
)
of
std_logic_vector
(
31
downto
0
);
type
txtb_state_type
is
array
(
0
to
TXT_BUFFER_COUNT
-
1
)
of
std_logic_vector
(
3
downto
0
);
type
txt_sw_cmd_type
is
record
set_rdy
:
std_logic
;
set_ety
:
std_logic
;
set_abt
:
std_logic
;
end
record
;
type
txt_hw_cmd_type
is
record
lock
:
std_logic
;
unlock
:
std_logic
;
valid
:
std_logic
;
err
:
std_logic
;
arbl
:
std_logic
;
failed
:
std_logic
;
end
record
;
----------------------------------------------------------------------------
-- Driving bus signal ranges
...
...
src/lib/can_types.vhd
0 → 100644
View file @
5f17402c
--------------------------------------------------------------------------------
--
-- 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:
-- Package with type definitions for CTU CAN FD.
--------------------------------------------------------------------------------
-- Revision History:
-- 28.12.2018 Created file, separated from "can_constants" package.
--------------------------------------------------------------------------------
Library
ieee
;
use
ieee
.
std_logic_1164
.
all
;
package
can_types
is
----------------------------------------------------------------------------
-- State Machine types
----------------------------------------------------------------------------
-- Error state of node
type
error_state_type
is
(
error_active
,
error_passive
,
bus_off
);
-- Operation mode of the Node
type
oper_mode_type
is
(
integrating
,
idle
,
transciever
,
reciever
);
-- Protocol control FSM
type
protocol_type
is
(
sof
,
arbitration
,
control
,
data
,
crc
,
delim_ack
,
eof
,
interframe
,
overload
,
error
,
off
);
-- Note: two bits are two bits between Base and Extended identifier
-- Note: one bit is the last remaining bit after the identifier extension
type
arb_type
is
(
base_id
,
two_bits
,
ext_id
,
one_bit
);
-- Within ISO CAN FD new field stuff count is needed!
type
crc_type
is
(
stuff_count
,
real_crc
);
-- Intermission field sub-State
type
interm_spc_type
is
(
intermission
,
suspend
,
interm_idle
);
-- Error frame subtype
type
err_frame_type
is
(
err_flg_sup
,
err_delim
);
-- Overload frame subtype
type
ovr_frame_type
is
(
ovr_flg_sup
,
ovr_delim
);
type
bit_time_type
is
(
sync
,
prop
,
ph1
,
ph2
,
h_sync
,
reset
);
-- Logger state machine type
type
logger_state_type
is
(
config
,
ready
,
running
);
-- RX Buffer loader type
type
rx_buf_fsm_type
is
(
rxb_idle
,
rxb_store_frame_format
,
rxb_store_identifier
,
rxb_store_beg_ts_low
,
rxb_store_beg_ts_high
,
rxb_store_end_ts_low
,
rxb_store_end_ts_high
,
rxb_store_data
);
-- TX arbitrator state type
type
tx_arb_state_type
is
(
arb_sel_low_ts
,
arb_sel_upp_ts
,
arb_sel_ffw
,
arb_locked
);
-- TXT buffer state type
type
txt_fsm_type
is
(
txt_empty
,
txt_ready
,
txt_tx_prog
,
txt_ab_prog
,
txt_ok
,
txt_error
,
txt_aborted
);
----------------------------------------------------------------------------
-- TXT Buffer types
----------------------------------------------------------------------------
-- Priorities of TXT Buffers
type
txtb_priorities_type
is
array
(
0
to
TXT_BUFFER_COUNT
-
1
)
of
std_logic_vector
(
2
downto
0
);
-- Memory outputs of TXT Buffer
type
txtb_output_type
is
array
(
0
to
TXT_BUFFER_COUNT
-
1
)
of
std_logic_vector
(
31
downto
0
);
-- States of Buffer
type
txtb_state_type
is
array
(
0
to
TXT_BUFFER_COUNT
-
1
)
of
std_logic_vector
(
3
downto
0
);
-- SW commands
type
txt_sw_cmd_type
is
record
set_rdy
:
std_logic
;
set_ety
:
std_logic
;
set_abt
:
std_logic
;
end
record
;
-- HW commands
type
txt_hw_cmd_type
is
record
lock
:
std_logic
;
unlock
:
std_logic
;
valid
:
std_logic
;
err
:
std_logic
;
arbl
:
std_logic
;
failed
:
std_logic
;
end
record
;
----------------------------------------------------------------------------
-- DLC Types
----------------------------------------------------------------------------
type
dlc_type
is
array
(
0
to
15
)
of
std_logic_vector
(
3
downto
0
);
type
length_type
is
array
(
0
to
15
)
of
natural
;