Skip to content
Snippets Groups Projects

Resolve HPR-86

Merged Reinier van der Walle requested to merge HPR-86 into master
8 unresolved threads

Closes HPR-86

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
18
19 -- Author:
20 -- . Reinier van der Walle
21 -- Purpose:
22 -- . Bridge between AXI4 stream and DP stream interfaces.
23 -- Description:
24 -- . This core consists of:
25 -- . Combinatorial translation of one interface to the other.
26 -- . SOP insertion for AXI4 -> DP as AXI4 does not have a SOP equivalent.
27 -- . Implementation for deriving dp.empty from axi4.tkeep (see details).
28 -- . Ready latency adapters.
29 -- . Details:
30 -- . g_nof_bytes is used to indicate the number of bytes in the data field. Only
31 -- used for deriving the DP empty field.
32 -- . g_use_empty: when true, it will derive the DP empty field from the AXI4 tkeep signal.
33 -- tkeep is the AXI4 signal that indicates with a bit for each byte of the data wheter
  • 28 -- . Ready latency adapters.
    29 -- . Details:
    30 -- . g_nof_bytes is used to indicate the number of bytes in the data field. Only
    31 -- used for deriving the DP empty field.
    32 -- . g_use_empty: when true, it will derive the DP empty field from the AXI4 tkeep signal.
    33 -- tkeep is the AXI4 signal that indicates with a bit for each byte of the data wheter
    34 -- it is considered a valid or null byte. '1' for a valid byte or '0' for a null byte.
    35 -- The DP empty field is derived by counting the number of '0' bits in
    36 -- tkeep(g_nof_bytes DOWNTO 0). This means that it is only possible to derive the empty
    37 -- field correctly when tkeep only has bits set to '0' at the end of the vector. For example:
    38 -- . tkeep = "11111000" is valid and will translate to empty = 0011 (3 Decimal).
    39 -- . tkeep = "11011101" is not valid.
    40 -- . g_axi4_rl is the ready latency of the axi4_in/out interfaces.
    41 -- . g_dp_rl is the ready latency of the dp_in/out interfaces.
    42 -- . g_active_low_rst should be set to TRUE when in_rst is active low. This is useful as an
    43 -- AXI4 interface oftem comes with an active-low reset while DP comes with an active-high
  • 24 -- . This core consists of:
    25 -- . Combinatorial translation of one interface to the other.
    26 -- . SOP insertion for AXI4 -> DP as AXI4 does not have a SOP equivalent.
    27 -- . Implementation for deriving dp.empty from axi4.tkeep (see details).
    28 -- . Ready latency adapters.
    29 -- . Details:
    30 -- . g_nof_bytes is used to indicate the number of bytes in the data field. Only
    31 -- used for deriving the DP empty field.
    32 -- . g_use_empty: when true, it will derive the DP empty field from the AXI4 tkeep signal.
    33 -- tkeep is the AXI4 signal that indicates with a bit for each byte of the data wheter
    34 -- it is considered a valid or null byte. '1' for a valid byte or '0' for a null byte.
    35 -- The DP empty field is derived by counting the number of '0' bits in
    36 -- tkeep(g_nof_bytes DOWNTO 0). This means that it is only possible to derive the empty
    37 -- field correctly when tkeep only has bits set to '0' at the end of the vector. For example:
    38 -- . tkeep = "11111000" is valid and will translate to empty = 0011 (3 Decimal).
    39 -- . tkeep = "11011101" is not valid.
  • 19 -- Author:
    20 -- . Reinier van der Walle
    21 -- Purpose:
    22 -- . Bridge between AXI4 stream and DP stream interfaces.
    23 -- Description:
    24 -- . This core consists of:
    25 -- . Combinatorial translation of one interface to the other.
    26 -- . SOP insertion for AXI4 -> DP as AXI4 does not have a SOP equivalent.
    27 -- . Implementation for deriving dp.empty from axi4.tkeep (see details).
    28 -- . Ready latency adapters.
    29 -- . Details:
    30 -- . g_nof_bytes is used to indicate the number of bytes in the data field. Only
    31 -- used for deriving the DP empty field.
    32 -- . g_use_empty: when true, it will derive the DP empty field from the AXI4 tkeep signal.
    33 -- tkeep is the AXI4 signal that indicates with a bit for each byte of the data wheter
    34 -- it is considered a valid or null byte. '1' for a valid byte or '0' for a null byte.
  • 51 USE dp_lib.dp_stream_pkg.ALL;
    52 USE work.axi4_stream_pkg.ALL;
    53
    54 ENTITY axi4_stream_dp_bridge IS
    55 GENERIC (
    56 g_nof_bytes : NATURAL := 64; -- Max = 64 bytes
    57 g_use_empty : BOOLEAN := FALSE; -- When True the dp empty field is derived from axi4 tkeep.
    58 g_axi4_rl : NATURAL := 0;
    59 g_dp_rl : NATURAL := 1;
    60 g_active_low_rst : BOOLEAN := FALSE -- When True, in_rst is interpreted as active-low.
    61 );
    62 PORT (
    63 in_clk : IN STD_LOGIC := '0';
    64 in_rst : IN STD_LOGIC := is_true(g_active_low_rst); -- Default state is "not in reset".
    65
    66 aclk : OUT STD_LOGIC := '0'; -- AXI4 clk
  • 92 SIGNAL dp_from_axi4_siso : t_dp_siso;
    93
    94 TYPE t_reg IS RECORD
    95 r_eop : STD_LOGIC;
    96 dp_from_axi4_sosi : t_dp_sosi;
    97 END RECORD;
    98
    99 CONSTANT c_reg_init : t_reg := ('1', c_dp_sosi_rst) ;
    100
    101 -- Registers
    102 SIGNAL d_reg : t_reg := c_reg_init;
    103 SIGNAL q_reg : t_reg := c_reg_init;
    104
    105 BEGIN
    106 i_rst <= NOT in_rst WHEN g_active_low_rst ELSE in_rst;
    107 aclk <= in_clk;
  • 7 -- This program is free software: you can redistribute it and/or modify
    8 -- it under the terms of the GNU General Public License as published by
    9 -- the Free Software Foundation, either version 3 of the License, or
    10 -- (at your option) any later version.
    11 --
    12 -- This program is distributed in the hope that it will be useful,
    13 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
    14 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    15 -- GNU General Public License for more details.
    16 --
    17 -- You should have received a copy of the GNU General Public License
    18 -- along with this program. If not, see <http://www.gnu.org/licenses/>.
    19 --
    20 --------------------------------------------------------------------------------
    21
    22 LIBRARY IEEE, common_lib, dp_lib;
    • LIBRARY, USE deel liever na de description.

      In description nof toevoegen:

      Author: Jij en link naar git repo van Gemini Purpose: General AXI4 stream record definition Description: Lange regels iets inkorten, bijv 100 char / line

    • Please register or sign in to reply
  • 123 -- Sync interval
    124 proc_dp_sync_interval(clk, sync);
    125
    126 -- Input data
    127 cnt_val <= in_ready AND cnt_en;
    128
    129 proc_dp_cnt_dat(rst, clk, cnt_val, cnt_dat);
    130 proc_dp_tx_data(g_dp_rl, rst, clk, cnt_val, cnt_dat, tx_data, tx_val, in_data, in_val);
    131 proc_dp_tx_ctrl(c_tx_offset_sync, c_tx_period_sync, in_data, in_val, in_sync);
    132 proc_dp_tx_ctrl(c_tx_offset_sop, c_tx_period_sop, in_data, in_val, in_sop);
    133 proc_dp_tx_ctrl(c_tx_offset_eop, c_tx_period_eop, in_data, in_val, in_eop);
    134 in_empty <= RESIZE_UVEC(INCR_UVEC(in_data, c_empty_offset)(c_max_empty_w-1 DOWNTO 0), c_dp_stream_empty_w) WHEN in_eop = '1' ELSE (OTHERS => '0');
    135 in_channel <= RESIZE_UVEC(INCR_UVEC(in_data, c_channel_offset)(c_max_channel_w-1 DOWNTO 0), c_dp_stream_channel_w);
    136
    137 -- Stimuli control
    138 proc_dp_count_en(rst, clk, sync, lfsr1, state, verify_done, tb_end, cnt_en);
    • Je test alleen met random flow control ? Meestal test ik met e_active, e_pulse en e_random. Random is het moeilijkst, daarom is e_avtive nuttig om mee te beginnen.

    • proc_dp_count_en en proc_dp_out_ready in tb_dp_pkg.vhd testen niet enkel random flow control maar hebben een aantal verschillende intervallen waarvan random er 1 is maar ook "pulse" en "chirp" bijvoorbeeld.

    • Please register or sign in to reply
  • added 1 commit

    Compare with previous version

  • Eric Kooistra mentioned in commit bd37f0f3

    mentioned in commit bd37f0f3

  • merged

  • Please register or sign in to reply
    Loading