# HDL1039: A reset domain should not use both asynchronous and synchronous resets ## Summary ```{raw} html

Count: 1

ReliabilitySecurityMaintainabilityCode attributeEffort to fixTags
MEDIUM-MEDIUMConsistency | Conventional30minsynthesis, bug-finder, reset, linty-ultra
``` ## Description ```{raw} html

Mixing both synchronous and asynchronous resets within the same reset domain can lead to several complications:

  1. Timing Complexity
  2. Functional Ambiguity
  3. Increased Design Complexity
  4. Potential for Glitches
  5. Synthesis and Implementation Challenges

In conclusion, while there might be specific scenarios where using both reset strategies could seem advantageous, the combination generally introduces unnecessary complexity, timing ambiguities, and verification challenges. It's often better to choose one strategy that fits the design's requirements for all elements within a reset domain to maintain clarity, consistency, and reliability in the design.

Noncompliant code example

architecture rtl of top is
begin
  A: process (clk) is
  begin
   if rising_edge(clk) then
     s1 <= '1';
     if rst = '1' then  -- Synchronous reset
       s1 <= '0';
     end if;
   end if;
  end process;

  B: process(clk, rst) is
  begin
    if rst = '1' then -- Asynchronous reset
      s2 <= '0';
    elsif rising_edge(clk) then
      s2 <= '1';
    end if;
  end process;
end architecture;

Compliant solution

architecture rtl of top is
begin
  A: process (clk) is
  begin
   if rising_edge(clk) then
     s1 <= '1';
     if rst = '1' then  -- Synchronous reset
       s1 <= '0';
     end if;
   end if;
  end process;

  B: process (clk) is
  begin
   if rising_edge(clk) then
     s2 <= '1';
     if rst = '1' then  -- Synchronous reset
       s2 <= '0';
     end if;
   end if;
  end process;
end architecture;
``` ## Parameters No parameters. ```{raw} html ```