Skip to content

Commit 2123165

Browse files
author
Stepan Friedl
committed
feat(rxmac): control registers are using MI side reset to survive Eth reset
1 parent 05e27af commit 2123165

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

comp/nic/mac_lite/rx_mac_lite/comp/ctrl_unit/ctrl_unit.vhd

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ architecture FULL of RX_MAC_LITE_CTRL_UNIT is
202202
constant CMD_SW_BASE_REG : std_logic_vector(2 downto 0) := "011"; -- 0x03
203203
constant CMD_SM_CNT_CLEAR : std_logic_vector(2 downto 0) := "100"; -- 0x04
204204

205+
-- reset of control logic
206+
signal ctrl_reset : std_logic;
207+
205208
-- MI32 slave interface signals
206209
signal s_mi_dwr : std_logic_vector(31 downto 0);
207210
signal s_mi_addr : std_logic_vector(31 downto 0);
@@ -296,6 +299,20 @@ architecture FULL of RX_MAC_LITE_CTRL_UNIT is
296299

297300
begin
298301

302+
-- Generate separate reset signal for logic that shouldn't be affected by the network
303+
-- side resets
304+
ctrl_reset_sync_i : entity work.ASYNC_RESET
305+
generic map (
306+
TWO_REG => false,
307+
OUT_REG => true,
308+
REPLICAS => 1
309+
)
310+
port map (
311+
CLK => CLK,
312+
ASYNC_RST => MI_RESET,
313+
OUT_RST(0) => ctrl_reset
314+
);
315+
299316
-- =========================================================================
300317
-- MI32 ASYNC
301318
-- =========================================================================
@@ -440,7 +457,7 @@ begin
440457
reg_enable_p : process (CLK)
441458
begin
442459
if (rising_edge(CLK)) then
443-
if (RESET = '1') then
460+
if (ctrl_reset = '1') then
444461
s_reg_enable <= '0';
445462
elsif (s_reg_enable_we = '1') then
446463
s_reg_enable <= s_mi_dwr(0);
@@ -452,7 +469,7 @@ begin
452469
reg_error_mask_p : process (CLK)
453470
begin
454471
if (rising_edge(CLK)) then
455-
if (RESET = '1') then
472+
if (ctrl_reset = '1') then
456473
s_reg_error_mask <= (others => '1');
457474
elsif (s_reg_error_mask_we = '1') then
458475
s_reg_error_mask <= s_mi_dwr(4 downto 0);
@@ -487,7 +504,7 @@ begin
487504
reg_min_frame_len_p : process (CLK)
488505
begin
489506
if (rising_edge(CLK)) then
490-
if (RESET = '1') then
507+
if (ctrl_reset = '1') then
491508
s_reg_min_frame_len <= std_logic_vector(to_unsigned(64,LEN_WIDTH));
492509
elsif (s_reg_min_frame_len_we = '1') then
493510
s_reg_min_frame_len <= s_mi_dwr(LEN_WIDTH-1 downto 0);
@@ -507,7 +524,7 @@ begin
507524
reg_max_frame_len_p : process (CLK)
508525
begin
509526
if (rising_edge(CLK)) then
510-
if (RESET = '1') then
527+
if (ctrl_reset = '1') then
511528
s_reg_max_frame_len <= std_logic_vector(to_unsigned(1526,LEN_WIDTH));
512529
elsif (s_reg_max_frame_len_we = '1') then
513530
s_reg_max_frame_len <= s_mi_dwr(LEN_WIDTH-1 downto 0);
@@ -527,7 +544,7 @@ begin
527544
reg_mac_check_mode_p : process (CLK)
528545
begin
529546
if (rising_edge(CLK)) then
530-
if (RESET = '1') then
547+
if (ctrl_reset = '1') then
531548
s_reg_mac_check_mode <= (others => '0');
532549
elsif (s_reg_mac_check_mode_we = '1') then
533550
s_reg_mac_check_mode <= s_mi_dwr(1 downto 0);
@@ -752,7 +769,7 @@ begin
752769
reg_sel_register_out_p : process (CLK)
753770
begin
754771
if (rising_edge(CLK)) then
755-
if (RESET = '1') then
772+
if (ctrl_reset = '1') then
756773
-- Select base register field by default
757774
s_reg_sel_register_out <= '0';
758775
elsif (s_cmd_switch_rfc_reg = '1') then

0 commit comments

Comments
 (0)