Commit fec36762 authored by Ille, Ondrej, Ing.'s avatar Ille, Ondrej, Ing.

Code formatting 1

parent e54237d1
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -3,7 +3,7 @@ USE IEEE.std_logic_1164.all; ...@@ -3,7 +3,7 @@ USE IEEE.std_logic_1164.all;
USE IEEE.numeric_std.ALL; USE IEEE.numeric_std.ALL;
USE ieee.std_logic_unsigned.All; USE ieee.std_logic_unsigned.All;
------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- --
-- CAN with Flexible Data-Rate IP Core -- CAN with Flexible Data-Rate IP Core
-- --
...@@ -28,50 +28,51 @@ USE ieee.std_logic_unsigned.All; ...@@ -28,50 +28,51 @@ USE ieee.std_logic_unsigned.All;
-- Revision History: -- Revision History:
-- --
-- 17.1.2016 Created file -- 17.1.2016 Created file
------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- Purpose: -- Purpose:
-- Package for converting between Register format of CAN Identifier and decimal format of Identifier. -- Package for converting between Register format of CAN Identifier and decimal
-- Needed by TX arbitrator and message filter when filtering data based on identifier decimal value. -- format of Identifier. Needed by TX arbitrator and message filter when fil-
-- When acessing CAN Controller from software driver should take care of this conversion! -- tering data based on identifier decimal value. When acessing CAN Controller
--------------------------------------------------------------------------------------------------------------- -- from software driver should take care of this conversion!
--------------------------------------------------------------------------------
package ID_transfer is package ID_transfer is
--Register value to decimal value --Register value to decimal value
procedure ID_reg_to_decimal procedure ID_reg_to_decimal
(signal ID_reg:in std_logic_vector(28 downto 0); (signal ID_reg:in std_logic_vector(28 downto 0);
signal ID_dec:out natural); signal ID_dec : out natural);
--Decimal value to register value --Decimal value to register value
procedure ID_decimal_to_reg procedure ID_decimal_to_reg
(signal ID_dec:in natural; (signal ID_dec : in natural;
signal ID_reg:out std_logic_vector(28 downto 0)); signal ID_reg : out std_logic_vector(28 downto 0));
end package ID_transfer; end package ID_transfer;
package body ID_transfer is package body ID_transfer is
procedure ID_reg_to_decimal procedure ID_reg_to_decimal
(signal ID_reg:in std_logic_vector(28 downto 0); (signal ID_reg : in std_logic_vector(28 downto 0);
signal ID_dec:out natural) is signal ID_dec : out natural) is
variable base:std_logic_vector(10 downto 0); variable base : std_logic_vector(10 downto 0);
variable ext:std_logic_vector(17 downto 0); variable ext : std_logic_vector(17 downto 0);
variable conc:std_logic_vector(28 downto 0); variable conc : std_logic_vector(28 downto 0);
begin begin
base := ID_reg(10 downto 0); base := ID_reg(10 downto 0);
ext := ID_reg(28 downto 11); ext := ID_reg(28 downto 11);
conc := base&ext; conc := base&ext;
ID_dec <= to_integer(unsigned(conc)); ID_dec <= to_integer(unsigned(conc));
end procedure ID_reg_to_decimal; end procedure ID_reg_to_decimal;
procedure ID_decimal_to_reg procedure ID_decimal_to_reg
(signal ID_dec:in natural; (signal ID_dec : in natural;
signal ID_reg:out std_logic_vector(28 downto 0)) is signal ID_reg : out std_logic_vector(28 downto 0)) is
variable vector:std_logic_vector(28 downto 0); variable vector : std_logic_vector(28 downto 0);
begin begin
vector := std_logic_vector(to_unsigned(ID_dec,29)); vector := std_logic_vector(to_unsigned(ID_dec, 29));
ID_reg <= vector(18 downto 0)&vector(28 downto 19); ID_reg <= vector(18 downto 0)&vector(28 downto 19);
end procedure ID_decimal_to_reg; end procedure ID_decimal_to_reg;
end ID_transfer; end ID_transfer;
Library ieee; Library ieee;
use ieee.std_logic_1164.all; use ieee.std_logic_1164.all;
------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- --
-- CAN with Flexible Data-Rate IP Core -- CAN with Flexible Data-Rate IP Core
-- --
...@@ -27,12 +27,12 @@ use ieee.std_logic_1164.all; ...@@ -27,12 +27,12 @@ use ieee.std_logic_1164.all;
-- --
-- 27.11.2017 Created file -- 27.11.2017 Created file
-- --
------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- Purpose: -- Purpose:
-- Asynchronouse reset synchroniser to avoid problems with Reset recovery time. -- Asynchronouse reset synchroniser to avoid problems with Reset recovery time.
------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------
entity rst_sync is entity rst_sync is
port ( port (
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment