Commit 46373fcb authored by Ille, Ondrej, Ing.'s avatar Ille, Ondrej, Ing.

src: Re-name signals to have only "Timestamp write pointer"

parent 9afb98d9
......@@ -3585,21 +3585,21 @@ package can_components is
-- Intent to write to RX Buffer RAM
write_raw_intent :out std_logic;
-- Write Extra Timestamp to RX Buffer RAM memory
write_extra_ts :out std_logic;
-- Write Timestamp to RX Buffer RAM memory
write_ts :out std_logic;
-- Storing of extra Timestamp from end of frame has ended.
store_extra_ts_end :out std_logic;
-- Storing of Timestamp from end of frame has ended.
stored_ts :out std_logic;
-- Data selector for selection of memory word to be stored in RX Buffer
-- RAM (one hot coded)
data_selector :out std_logic_vector(4 downto 0);
-- Load extra write pointer from regular write pointer
store_extra_wr_ptr :out std_logic;
-- Load timestamp write pointer from regular write pointer
store_ts_wr_ptr :out std_logic;
-- Increment extra write pointer by 1
inc_extra_wr_ptr :out std_logic;
-- Increment timestamp write pointer by 1
inc_ts_wr_ptr :out std_logic;
-- Reset internal overrun flag
reset_overrun_flag :out std_logic
......@@ -3643,11 +3643,11 @@ package can_components is
-- last stored write_pointer value.
commit_overrun_abort :in std_logic;
-- RX Buffer FSM signals to store write pointer to extra write pointer
store_extra_wr_ptr :in std_logic;
-- RX Buffer FSM signals to store write pointer to timestamp write pointer
store_ts_wr_ptr :in std_logic;
-- RX Buffer FSM signals to increment extra write pointer
inc_extra_wr_ptr :in std_logic;
-- RX Buffer FSM signals to increment timestamp write pointer
inc_ts_wr_ptr :in std_logic;
-- RX Buffer RAM is being read by SW
read_increment :in std_logic;
......@@ -3675,9 +3675,8 @@ package can_components is
-- write pointer!
write_pointer_raw :out std_logic_vector(11 downto 0);
-- Extra write pointer which is used for storing timestamp at the end of
-- data frame!
write_pointer_extra_ts :out std_logic_vector(11 downto 0);
-- Timestamp write pointer
write_pointer_ts :out std_logic_vector(11 downto 0);
-- Number of free memory words available for user
rx_mem_free_i :out std_logic_vector(12 downto 0)
......
......@@ -216,9 +216,9 @@ architecture rtl of rx_buffer is
-- write pointer!
signal write_pointer_raw : std_logic_vector(11 downto 0);
-- Extra write pointer which is used for storing timestamp at the end of
-- Timestamp write pointer which is used for storing timestamp at the end of
-- data frame!
signal write_pointer_extra_ts : std_logic_vector(11 downto 0);
signal write_pointer_ts : std_logic_vector(11 downto 0);
-- Number of free memory words available to SW after frame was committed.
signal rx_mem_free_i : std_logic_vector(12 downto 0);
......@@ -304,21 +304,20 @@ architecture rtl of rx_buffer is
-- word to RX Buffer memory!
signal write_raw_intent : std_logic;
-- Indicates that FSM is in one of states for writing timestmap from end of
-- frame to the memory.
signal write_extra_ts : std_logic;
-- Indicates that FSM is in one of states for writing timestamp
signal write_ts : std_logic;
-- Storing of extra timestamp is at the end.
signal store_extra_ts_end : std_logic;
-- Storing of timestamp is at the end.
signal stored_ts : std_logic;
-- Data write selector
signal data_selector : std_logic_vector(4 downto 0);
-- Signals that write pointer should be stored to extra write pointer
signal store_extra_wr_ptr : std_logic;
-- Signals that write pointer should be stored to timestamp write pointer
signal store_ts_wr_ptr : std_logic;
-- Increment extra write pointer
signal inc_extra_wr_ptr : std_logic;
-- Increment timestamp write pointer
signal inc_ts_wr_ptr : std_logic;
-- Restart overrun flag upon start of new frame
signal reset_overrun_flag : std_logic;
......@@ -445,11 +444,11 @@ begin
drv_bus => drv_bus, -- IN
write_raw_intent => write_raw_intent, -- OUT
write_extra_ts => write_extra_ts, -- OUT
store_extra_ts_end => store_extra_ts_end, -- OUT
write_ts => write_ts, -- OUT
stored_ts => stored_ts, -- OUT
data_selector => data_selector, -- OUT
store_extra_wr_ptr => store_extra_wr_ptr, -- OUT
inc_extra_wr_ptr => inc_extra_wr_ptr, -- OUT
store_ts_wr_ptr => store_ts_wr_ptr, -- OUT
inc_ts_wr_ptr => inc_ts_wr_ptr, -- OUT
reset_overrun_flag => reset_overrun_flag -- OUT
);
......@@ -469,8 +468,8 @@ begin
commit_rx_frame => commit_rx_frame, -- IN
write_raw_OK => write_raw_OK, -- IN
commit_overrun_abort => commit_overrun_abort, -- IN
store_extra_wr_ptr => store_extra_wr_ptr, -- IN
inc_extra_wr_ptr => inc_extra_wr_ptr, -- IN
store_ts_wr_ptr => store_ts_wr_ptr, -- IN
inc_ts_wr_ptr => inc_ts_wr_ptr, -- IN
read_increment => read_increment, -- IN
drv_bus => drv_bus, -- IN
......@@ -478,7 +477,7 @@ begin
read_pointer_inc_1 => read_pointer_inc_1, -- OUT
write_pointer => write_pointer, -- OUT
write_pointer_raw => write_pointer_raw, -- OUT
write_pointer_extra_ts => write_pointer_extra_ts, -- OUT
write_pointer_ts => write_pointer_ts, -- OUT
rx_mem_free_i => rx_mem_free_i -- OUT
);
......@@ -527,7 +526,7 @@ begin
----------------------------------------------------------------------------
-- Overrun condition. Following conditions must be met:
-- 1. FSM wants to write to memory either to the position of
-- "write_pointer_raw". Note that "write_pointer_extra_ts" writes to
-- "write_pointer_raw". Note that "write_pointer_ts" writes to
-- words which were already written, thus there is no need to watch
-- for overrun!
-- 2. There is no free word in the memory remaining!
......@@ -693,7 +692,7 @@ begin
elsif (rising_edge(clk_sys)) then
if (store_extra_ts_end = '1') then
if (stored_ts = '1') then
if (data_overrun_i = '0') then
commit_rx_frame <= '1';
else
......@@ -790,20 +789,18 @@ begin
port_b_data_out => RAM_data_out -- OUT
);
-- Memory written either on regular write or Extra timestamp write
-- Memory written either on regular write or timestamp write
RAM_write <= '1' when (write_raw_OK = '1' or
(write_extra_ts = '1' and data_overrun_i = '0' and
(write_ts = '1' and data_overrun_i = '0' and
overrun_condition = '0'))
else
'0';
----------------------------------------------------------------------------
-- Memory write address is multiplexed between "write_pointer_raw" for
-- regular writes and "write_pointer_extra_ts" for writes of timestamp
-- in the end of frame!
-- regular writes and "write_pointer_ts" for writes of timestamp!
----------------------------------------------------------------------------
RAM_write_address <= write_pointer_extra_ts when (write_extra_ts = '1')
else
RAM_write_address <= write_pointer_ts when (write_ts = '1') else
write_pointer_raw;
----------------------------------------------------------------------------
......@@ -929,8 +926,8 @@ begin
-- psl rx_buf_overrun_clear_cov :
-- cover (drv_clr_ovr = '1');
--
-- psl rx_buf_write_extra_ts_cov :
-- cover (write_extra_ts = '1');
-- psl rx_buf_write_ts_cov :
-- cover (write_ts = '1');
--
-- psl rx_buf_release_receive_buffer_cov :
-- cover (drv_erase_rx = '1');
......
......@@ -109,21 +109,21 @@ entity rx_buffer_fsm is
-- Intent to write to RX Buffer RAM
write_raw_intent :out std_logic;
-- Write Extra Timestamp to RX Buffer RAM memory
write_extra_ts :out std_logic;
-- Write Timestamp to RX Buffer RAM memory
write_ts :out std_logic;
-- Storing of extra Timestamp from end of frame has ended.
store_extra_ts_end :out std_logic;
-- Storing of Timestamp has ended.
stored_ts :out std_logic;
-- Data selector for selection of memory word to be stored in RX Buffer
-- RAM (one hot coded)
data_selector :out std_logic_vector(4 downto 0);
-- Load extra write pointer from regular write pointer
store_extra_wr_ptr :out std_logic;
-- Load timestamp write pointer from regular write pointer
store_ts_wr_ptr :out std_logic;
-- Increment extra write pointer by 1
inc_extra_wr_ptr :out std_logic;
-- Increment timestamp write pointer by 1
inc_ts_wr_ptr :out std_logic;
-- Reset internal overrun flag
reset_overrun_flag :out std_logic
......@@ -253,11 +253,11 @@ begin
curr_state_proc : process(curr_state, store_data_f)
begin
write_raw_intent <= '0';
write_extra_ts <= '0';
write_ts <= '0';
data_selector <= (OTHERS => '0');
store_extra_ts_end <= '0';
store_extra_wr_ptr <= '0';
inc_extra_wr_ptr <= '0';
stored_ts <= '0';
store_ts_wr_ptr <= '0';
inc_ts_wr_ptr <= '0';
reset_overrun_flag <= '0';
case curr_state is
......@@ -268,26 +268,26 @@ begin
write_raw_intent <= '1';
data_selector <= "00001";
-- Storing extra write pointer is done early enough so that there is
-- enough time to increment it to be pointing to first(higher)
-- timestamp word
store_extra_wr_ptr <= '1';
-- Storing timestamp write pointer is done early enough so that
-- there is enough time to increment it to be pointing to first
-- (higher) timestamp word
store_ts_wr_ptr <= '1';
when s_rxb_store_identifier =>
write_raw_intent <= '1';
data_selector <= "00010";
-- Incrementing extra write pointer is done twice so that when lower
-- timestamp word is beigin stored, extra write pointer is pointing to
-- Incrementing timestamp write pointer is done twice so that when lower
-- timestamp word is being stored, timestamp write pointer is pointing to
-- lower timestamp word address.
inc_extra_wr_ptr <= '1';
inc_ts_wr_ptr <= '1';
when s_rxb_skip_ts_low =>
write_raw_intent <= '1';
-- Extra write pointer is incremented once more when lower
-- Timestamp write pointer is incremented once more when lower
-- timestamp word was stored, to point to higher timestamp word.
inc_extra_wr_ptr <= '1';
inc_ts_wr_ptr <= '1';
when s_rxb_skip_ts_high =>
write_raw_intent <= '1';
......@@ -302,23 +302,21 @@ begin
when s_rxb_store_end_ts_low =>
data_selector <= "01000";
-- Extra write pointer is incremented once more when lower
-- Timestamp write pointer is incremented once more when lower
-- timestamp word was stored, to point to higher timestamp word.
inc_extra_wr_ptr <= '1';
inc_ts_wr_ptr <= '1';
-- Signalling that extra timestamp is stored to memory. Timestamp from
-- end of frame is stored extra.
write_extra_ts <= '1';
-- Signalling that timestamp is stored to memory.
write_ts <= '1';
when s_rxb_store_end_ts_high =>
data_selector <= "10000";
-- Storing of extra timestamp has ended and frame can be committed.
store_extra_ts_end <= '1';
-- Storing of timestamp is ending and frame can be committed.
stored_ts <= '1';
-- Signalling that extra timestamp is stored to memory. Timestamp from
-- end of frame is stored extra.
write_extra_ts <= '1';
-- Signalling that timestamp is stored to memory.
write_ts <= '1';
end case;
end process;
......
......@@ -49,7 +49,7 @@
-- 1. Read pointer
-- 2. Write pointer raw
-- 3. Write pointer (regular, commited)
-- 4. Write pointer for storing extra timestamp from end of frame.
-- 4. Write pointer for storing timestamp.
-- Counters for free memory:
-- 1. RX mem free internal for control of storing and overrun
-- 2. RX mem free available to user.
......@@ -108,11 +108,12 @@ entity rx_buffer_pointers is
-- last stored write_pointer value.
commit_overrun_abort :in std_logic;
-- RX Buffer FSM signals to store write pointer to extra write pointer
store_extra_wr_ptr :in std_logic;
-- RX Buffer FSM signals to store regular write pointer to timestamp
-- write pointer
store_ts_wr_ptr :in std_logic;
-- RX Buffer FSM signals to increment extra write pointer
inc_extra_wr_ptr :in std_logic;
-- RX Buffer FSM signals to increment timestamp write pointer
inc_ts_wr_ptr :in std_logic;
-- RX Buffer RAM is being read by SW
read_increment :in std_logic;
......@@ -140,9 +141,8 @@ entity rx_buffer_pointers is
-- write pointer!
write_pointer_raw :out std_logic_vector(11 downto 0);
-- Extra write pointer which is used for storing timestamp at the end of
-- data frame!
write_pointer_extra_ts :out std_logic_vector(11 downto 0);
-- Timestamp write pointer
write_pointer_ts :out std_logic_vector(11 downto 0);
-- Number of free memory words available for user
rx_mem_free_i :out std_logic_vector(12 downto 0)
......@@ -182,9 +182,9 @@ architecture rtl of rx_buffer_pointers is
signal write_pointer_raw_d : unsigned(C_PTR_WIDTH - 1 downto 0);
signal write_pointer_raw_ce : std_logic;
signal write_pointer_extra_ts_i : unsigned(C_PTR_WIDTH - 1 downto 0);
signal write_pointer_extra_ts_d : unsigned(C_PTR_WIDTH - 1 downto 0);
signal write_pointer_extra_ts_ce : std_logic;
signal write_pointer_ts_i : unsigned(C_PTR_WIDTH - 1 downto 0);
signal write_pointer_ts_d : unsigned(C_PTR_WIDTH - 1 downto 0);
signal write_pointer_ts_ce : std_logic;
signal rx_mem_free_i_i : unsigned(C_FREE_MEM_WIDTH - 1 downto 0);
......@@ -212,7 +212,7 @@ begin
read_pointer_inc_1 <= std_logic_vector(resize(read_pointer_inc_1_i, 12));
write_pointer <= std_logic_vector(resize(write_pointer_i, 12));
write_pointer_raw <= std_logic_vector(resize(write_pointer_raw_i, 12));
write_pointer_extra_ts <= std_logic_vector(resize(write_pointer_extra_ts_i, 12));
write_pointer_ts <= std_logic_vector(resize(write_pointer_ts_i, 12));
rx_mem_free_i <= std_logic_vector(resize(rx_mem_free_i_i, 13));
......@@ -276,24 +276,23 @@ begin
----------------------------------------------------------------------------
-- Extra write pointer for storing value of timestamp from end of frame.
-- Timestamp write pointer.
----------------------------------------------------------------------------
write_pointer_extra_ts_d <= write_pointer_i when (store_extra_wr_ptr = '1')
else
write_pointer_extra_ts_i + 1;
write_pointer_ts_d <= write_pointer_i when (store_ts_wr_ptr = '1') else
write_pointer_ts_i + 1;
-- Tick only when it should be incremented or stored
write_pointer_extra_ts_ce <= '1' when (store_extra_wr_ptr = '1') else
'1' when (inc_extra_wr_ptr = '1') else
'0';
write_pointer_ts_ce <= '1' when (store_ts_wr_ptr = '1') else
'1' when (inc_ts_wr_ptr = '1') else
'0';
extra_write_ptr_proc : process(clk_sys, rx_buf_res_q)
timestamp_write_ptr_proc : process(clk_sys, rx_buf_res_q)
begin
if (rx_buf_res_q = G_RESET_POLARITY) then
write_pointer_extra_ts_i <= (OTHERS => '0');
write_pointer_ts_i <= (OTHERS => '0');
elsif (rising_edge(clk_sys)) then
if (write_pointer_extra_ts_ce = '1') then
write_pointer_extra_ts_i <= write_pointer_extra_ts_d;
if (write_pointer_ts_ce = '1') then
write_pointer_ts_i <= write_pointer_ts_d;
end if;
end if;
end process;
......
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