AsFigo / pyslint

SystemVerilog Linter based on pyslang
MIT License
18 stars 21 forks source link

Add a set of CDC Linting rules #200

Open chili-chips-ba opened 1 month ago

chili-chips-ba commented 1 month ago

For starters, we could check the scenarios that mainstream commercial tools address:

There is also this open-source project that can be taken for reference:

Verilator CDC Request Yosys CDC Request Slang CDC Request

ajeethakv commented 1 month ago

Thanks for the interest. I browsed through some of the links you've provided. I don't see a crisp set of rules that can be lint-checked. CDC verification is ofcourse a wider problem involving multitude of techniques and looks like that cdc_snitch is a good start. What exactly do you have in mind for source code level Verilog/SV (or even VHDL) lint checks w.r.t CDC?

ajeethakv commented 1 month ago

Here are some basic conceptual rules. I am looking for more concrete ones to implement via PySlint.

CDC Lint Rules

1. Clock Domain Identification:

2. Synchronous Resets:

3. Single-Bit Signal Synchronization:

4. Multi-Bit Signal Handling:

5. FIFO Usage:

6. Handshake Protocols:

7. Avoid Combinational Logic Between Clock Domains:

8. Metastability Handling:

chili-chips-ba commented 1 month ago

... you may also want to take a look at this @obruendl repo with descriptions of common CDC scenarios and library modules for handling them: