Commit 043983a0 authored by Ille, Ondrej, Ing.'s avatar Ille, Ondrej, Ing.

Updated rx buffer to integer instead of natural to allow

for negative values.
parent d3d4f250
......@@ -321,12 +321,12 @@ package can_components is
signal inc_extra_wr_ptr :in std_logic;
signal read_increment :in std_logic;
signal drv_bus :in std_logic_vector(1023 downto 0);
signal read_pointer :out natural range 0 to buff_size - 1;
signal read_pointer_inc_1 :out natural range 0 to buff_size - 1;
signal write_pointer :out natural range 0 to buff_size - 1;
signal write_pointer_raw :out natural range 0 to buff_size - 1;
signal write_pointer_extra_ts :out natural range 0 to buff_size - 1;
signal rx_mem_free_int :out natural range -1 to buff_size + 1
signal read_pointer :out integer range 0 to buff_size - 1;
signal read_pointer_inc_1 :out integer range 0 to buff_size - 1;
signal write_pointer :out integer range 0 to buff_size - 1;
signal write_pointer_raw :out integer range 0 to buff_size - 1;
signal write_pointer_extra_ts :out integer range 0 to buff_size - 1;
signal rx_mem_free_int :out integer range -1 to buff_size + 1
);
end component;
......
......@@ -309,32 +309,32 @@ architecture rtl of rx_buffer is
----------------------------------------------------------------------------
-- Read Pointer (access from SW)
signal read_pointer : natural range 0 to buff_size - 1;
signal read_pointer : integer range 0 to buff_size - 1;
-- Read pointer incremented by 1 (combinationally)
signal read_pointer_inc_1 : natural range 0 to buff_size - 1;
signal read_pointer_inc_1 : integer range 0 to buff_size - 1;
-- Write pointer (committed, available to SW, after frame was stored)
signal write_pointer : natural range 0 to buff_size - 1;
signal write_pointer : integer range 0 to buff_size - 1;
-- Write pointer RAW. Changing during frame, as frame is continously stored
-- to the buffer. When frame is sucesfully received, it is updated to
-- write pointer!
signal write_pointer_raw : natural range 0 to buff_size - 1;
signal write_pointer_raw : integer range 0 to buff_size - 1;
-- Extra write pointer which is used for storing timestamp at the end of
-- data frame!
signal write_pointer_extra_ts : natural range 0 to buff_size - 1;
signal write_pointer_extra_ts : integer range 0 to buff_size - 1;
-- Final pointer to memory. "write_pointer_raw" and
-- "write_pointer_extra_ts" are multiplexed based on RX FSM!
signal memory_write_pointer : natural range 0 to buff_size - 1;
signal memory_write_pointer : integer range 0 to buff_size - 1;
-- Data that will be written to the RX Buffer memory!
signal memory_write_data : std_logic_vector(31 downto 0);
-- Number of free memory words available to SW after frame was committed.
signal rx_mem_free_int : natural range -1 to buff_size + 1;
signal rx_mem_free_int : integer range -1 to buff_size + 1;
----------------------------------------------------------------------------
----------------------------------------------------------------------------
......
......@@ -113,28 +113,28 @@ entity rx_buffer_pointers is
-- Pointer outputs
------------------------------------
-- Read Pointer (access from SW)
signal read_pointer :out natural range 0 to buff_size - 1;
signal read_pointer :out integer range 0 to buff_size - 1;
-- Read pointer incremented by 1 (combinationally)
signal read_pointer_inc_1 :out natural range 0 to buff_size - 1;
signal read_pointer_inc_1 :out integer range 0 to buff_size - 1;
-- Write pointer (committed, available to SW, after frame was stored)
signal write_pointer :out natural range 0 to buff_size - 1;
signal write_pointer :out integer range 0 to buff_size - 1;
-- Write pointer RAW. Changing during frame, as frame is continously stored
-- to the buffer. When frame is sucesfully received, it is updated to
-- write pointer!
signal write_pointer_raw :out natural range 0 to buff_size - 1;
signal write_pointer_raw :out integer range 0 to buff_size - 1;
-- Extra write pointer which is used for storing timestamp at the end of
-- data frame!
signal write_pointer_extra_ts :out natural range 0 to buff_size - 1;
signal write_pointer_extra_ts :out integer range 0 to buff_size - 1;
------------------------------------
-- Mem. free outputs
------------------------------------
-- Number of free memory words available for user
signal rx_mem_free_int :out natural range -1 to buff_size + 1
signal rx_mem_free_int :out integer range -1 to buff_size + 1
);
end entity;
......@@ -152,19 +152,19 @@ architecture rtl of rx_buffer_pointers is
signal drv_erase_rx : std_logic;
-- Raw value of number of free memory words.
signal rx_mem_free_raw : natural range -1 to buff_size + 1;
signal rx_mem_free_raw : integer range -1 to buff_size + 1;
-- Number of free memory words calculated during frame storing before commit
-- combinationally incremented by 1.
signal rx_mem_free_raw_inc_1 : natural range -1 to buff_size + 1;
signal rx_mem_free_raw_inc_1 : integer range -1 to buff_size + 1;
-- Number of free memory words calculated during frame storing before commit
-- combinationally decremented by 1.
signal rx_mem_free_raw_dec_1 : natural range -1 to buff_size + 1;
signal rx_mem_free_raw_dec_1 : integer range -1 to buff_size + 1;
-- Number of free memory words available to SW, combinationally icnremented
-- by 1.
signal rx_mem_free_int_inc_1 : natural range -1 to buff_size + 1;
signal rx_mem_free_int_inc_1 : integer range -1 to buff_size + 1;
begin
......
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