Why is this an issue?

While rising edge clocks are more commonly used, there are specific scenarios where a falling edge (negative edge) might be preferred:

  1. Power and Noise Considerations:
  2. Timing and Skew:
  3. Design Symmetry and Simplicity:
  4. <
  5. Testing and Debug:
  6. Legacy or Standard Practices:

Drawbacks of Using Falling Edge Clocks:

In conclusion, while falling edge clocks have their advantages in specific contexts, the choice largely depends on system requirements, power constraints, noise sensitivity, timing, and compatibility. Rising edge clocks remain the norm due to convention, support, and simplicity unless there's a significant reason to opt for falling edges.

How to fix it

Code examples

Noncompliant code example

process(clk) is
begin
  if(clk'event and clk='1') then -- Noncompliant: Rising
    xr <= not xr;
  end if;

  if(not clk'stable and clk='1') then -- Noncompliant: Rising
    xr <= not xr;
  end if;

  if(rising_edge(clk)) then -- Noncompliant: Rising
    xr <= not xr;
  end if;
end process;

Compliant solution

process(clk) is
begin
  if(clk'event and clk='0') then -- Compliant: Falling
    xr <= not xr;
  end if;

  if(not clk'stable and clk='0') then -- Compliant: Falling
    xr <= not xr;
  end if;

  if(falling_edge(clk)) then -- Compliant: Falling
    xr <= not xr;
  end if;
end process;

Resources

Related rules