Commit 5f17402c authored by Ille, Ondrej, Ing.'s avatar Ille, Ondrej, Ing.

Re-named CANConstants to can_constants.

parent 4baae14c
......@@ -78,7 +78,7 @@
Library ieee;
USE IEEE.std_logic_1164.all;
USE IEEE.numeric_std.ALL;
USE WORK.CANconstants.ALL;
USE WORK.can_constants.ALL;
use work.can_components.ALL;
use work.CAN_FD_register_map.all;
use work.cmn_lib.all;
......
......@@ -54,7 +54,7 @@
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use work.CANconstants.all;
use work.can_constants.all;
entity apb_ifc is
generic (
......
......@@ -91,7 +91,7 @@
Library ieee;
USE IEEE.std_logic_1164.all;
USE IEEE.numeric_std.ALL;
USE WORK.CANconstants.ALL;
USE WORK.can_constants.ALL;
use work.CAN_FD_register_map.all;
use work.cmn_lib.all;
......
......@@ -79,7 +79,7 @@
library ieee;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
use WORK.CANconstants.all;
use WORK.can_constants.all;
use work.cmn_lib.all;
entity bit_destuffing is
......
......@@ -77,7 +77,7 @@
Library ieee;
USE IEEE.std_logic_1164.all;
USE IEEE.numeric_std.ALL;
USE WORK.CANconstants.ALL;
USE WORK.can_constants.ALL;
use work.cmn_lib.all;
entity bit_stuffing is
......
......@@ -52,7 +52,7 @@
Library ieee;
USE IEEE.std_logic_1164.all;
USE IEEE.numeric_std.ALL;
use work.CANconstants.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;
......
......@@ -89,7 +89,7 @@
Library ieee;
USE IEEE.std_logic_1164.all;
USE IEEE.numeric_std.ALL;
use work.CANconstants.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;
......
......@@ -66,7 +66,7 @@
Library ieee;
USE IEEE.std_logic_1164.all;
USE IEEE.numeric_std.ALL;
use work.CANconstants.all;
use work.can_constants.all;
use work.CAN_FD_register_map.all;
use work.can_components.all;
......
......@@ -56,7 +56,7 @@
Library ieee;
USE IEEE.std_logic_1164.all;
USE IEEE.numeric_std.ALL;
use work.CANconstants.all;
use work.can_constants.all;
use work.CAN_FD_register_map.all;
entity crc_calc is
......
......@@ -59,7 +59,7 @@
Library ieee;
USE IEEE.std_logic_1164.all;
USE IEEE.numeric_std.ALL;
use work.CANconstants.all;
use work.can_constants.all;
use work.CAN_FD_register_map.all;
use work.can_components.all;
......
......@@ -71,7 +71,7 @@
Library ieee;
USE IEEE.std_logic_1164.all;
USE IEEE.numeric_std.ALL;
USE WORK.CANconstants.ALL;
USE WORK.can_constants.ALL;
entity fault_confinement is
PORT(
......
......@@ -58,7 +58,7 @@
Library ieee;
USE IEEE.std_logic_1164.all;
USE IEEE.numeric_std.ALL;
use work.CANconstants.all;
use work.can_constants.all;
use work.CAN_FD_register_map.all;
entity operation_control is
......
......@@ -250,7 +250,7 @@
Library ieee;
USE IEEE.std_logic_1164.all;
USE IEEE.numeric_std.ALL;
use work.CANconstants.all;
use work.can_constants.all;
use work.CAN_FD_frame_format.all;
use work.CAN_FD_register_map.all;
......
......@@ -553,7 +553,7 @@
<spirit:fileType>vhdlSource</spirit:fileType>
</spirit:file>
<spirit:file>
<spirit:name>Libraries/CANconstants.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/CANconstants.vhd</spirit:name>
<spirit:name>Libraries/can_constants.vhd</spirit:name>
<spirit:fileType>vhdlSource</spirit:fileType>
</spirit:file>
<spirit:file>
......
......@@ -86,7 +86,7 @@
Library ieee;
USE IEEE.std_logic_1164.all;
USE IEEE.numeric_std.ALL;
USE WORK.CANconstants.ALL;
USE WORK.can_constants.ALL;
entity event_logger is
generic(
......
......@@ -51,7 +51,7 @@
Library ieee;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.ALL;
use work.CANconstants.all;
use work.can_constants.all;
use work.ID_transfer.all;
entity bit_filter is
......
......@@ -63,7 +63,7 @@
Library ieee;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.ALL;
use work.CANconstants.all;
use work.can_constants.all;
use work.ID_transfer.all;
use work.can_components.ALL;
use work.CAN_FD_frame_format.all;
......
......@@ -51,7 +51,7 @@
Library ieee;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.ALL;
use work.CANconstants.all;
use work.can_constants.all;
use work.ID_transfer.all;
entity range_filter is
......
......@@ -75,7 +75,7 @@
Library ieee;
USE IEEE.std_logic_1164.all;
USE IEEE.numeric_std.ALL;
USE WORK.CANconstants.ALL;
USE WORK.can_constants.ALL;
use work.CAN_FD_register_map.all;
use work.reduce_lib.all;
use work.can_components.all;
......
......@@ -64,7 +64,7 @@
Library ieee;
USE IEEE.std_logic_1164.all;
USE IEEE.numeric_std.ALL;
USE WORK.CANconstants.ALL;
USE WORK.can_constants.ALL;
use work.CAN_FD_register_map.all;
use work.reduce_lib.all;
......
......@@ -59,7 +59,7 @@
library ieee;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
use WORK.CANconstants.all;
use WORK.can_constants.all;
use work.can_registers_pkg.all;
package can_components is
......
......@@ -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 CANconstants 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
......
--------------------------------------------------------------------------------
--
-- 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;
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);
end package;
......@@ -128,7 +128,7 @@
Library ieee;
USE IEEE.std_logic_1164.all;
USE IEEE.numeric_std.ALL;
use work.CANconstants.all;
use work.can_constants.all;
use work.can_components.all;
use work.CAN_FD_register_map.all;
use work.can_registers_pkg.all;
......
......@@ -165,7 +165,7 @@
Library ieee;
USE IEEE.std_logic_1164.all;
USE IEEE.numeric_std.ALL;
USE WORK.CANconstants.ALL;
USE WORK.can_constants.ALL;
entity prescaler is
PORT(
......
......@@ -162,7 +162,7 @@
Library ieee;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.ALL;
use work.CANconstants.all;
use work.can_constants.all;
use work.CAN_FD_frame_format.all;
use work.CAN_FD_register_map.all;
use work.can_components.all;
......
......@@ -51,7 +51,7 @@
Library ieee;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.ALL;
use work.CANconstants.all;
use work.can_constants.all;
use work.CAN_FD_frame_format.all;
use work.CAN_FD_register_map.all;
use work.can_components.all;
......
......@@ -58,7 +58,7 @@
Library ieee;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.ALL;
use work.CANconstants.all;
use work.can_constants.all;
use work.CAN_FD_frame_format.all;
use work.CAN_FD_register_map.all;
use work.can_components.all;
......
......@@ -55,7 +55,7 @@
Library ieee;
USE IEEE.std_logic_1164.all;
USE IEEE.numeric_std.ALL;
use work.CANconstants.all;
use work.can_constants.all;
use work.ID_transfer.all;
entity priority_decoder is
......
......@@ -137,7 +137,7 @@
Library ieee;
USE IEEE.std_logic_1164.all;
USE IEEE.numeric_std.ALL;
use work.CANconstants.all;
use work.can_constants.all;
use work.ID_transfer.all;
use work.can_components.all;
use work.CAN_FD_frame_format.all;
......
......@@ -55,7 +55,7 @@
Library ieee;
USE IEEE.std_logic_1164.all;
USE IEEE.numeric_std.ALL;
use work.CANconstants.all;
use work.can_constants.all;
use work.ID_transfer.all;
use work.can_components.all;
use work.CAN_FD_frame_format.all;
......
......@@ -79,7 +79,7 @@
Library ieee;
USE IEEE.std_logic_1164.all;
USE IEEE.numeric_std.ALL;
use work.CANconstants.all;
use work.can_constants.all;