Skip to content
RAMA-L7Public

About

Web-based SDC tools for synthesis engineers. Checker validates constraint files with 50+ rules across errors, warnings, and best practices. Generator builds complete .sdc files with clocks, I/O delays, AOCV derate, half-cycle paths, and more. Built with Python + Streamlit.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SDC Tools

Open-source SDC constraint development, validation, and verification toolkit for VLSI synthesis engineers.

Version Python License Platform PyPI Docker


What is SDC Tools?

SDC (Synopsys Design Constraints) files are the standard way to define timing, power, and design rule constraints for digital synthesis. A single mistake in an SDC file β€” a missing clock, an incorrect derate, an overly broad wildcard β€” can cause silicon failure or thousands of false timing violations.

SDC Tools is a complete toolkit for the entire SDC lifecycle:

  Write ──▢ Validate ──▢ Generate ──▢ Review ──▢ Signoff
   β”‚            β”‚             β”‚            β”‚            β”‚
   β”‚            β”‚             β”‚            β”‚            β”‚
   β–Ό            β–Ό             β–Ό            β–Ό            β–Ό
  Rules      Checker      Generator    Diff/Matrix   Reports
  Engine                                          + Coverage

πŸš€ Quick Start

Install from PyPI (recommended)

pip install sdc-tools
sdc-tools check sample.sdc          # validate
sdc-tools generate --design MY_CHIP --clock clk=10.0  # generate
sdc-tools --help                     # see all commands

Install from source

git clone https://github.com/RAMA-L7/sdc-tools.git
cd sdc-tools
pip install -e ".[web]"
sdc-tools web                        # launch browser UI

Docker

docker build -t sdc-tools .
docker run -it sdc-tools check sample.sdc         # CLI
docker run -p 8501:8501 ramal7/sdc-tools web      # Web UI

πŸ“‹ Feature Overview (13 Major Features)

# Feature Module CLI Command Description
1 SDC Checker / Validator checker.py sdc-tools check 40+ semantic checks: errors, warnings, best practices
2 SDC Generator generator.py sdc-tools generate Generate complete SDC from parameters in seconds
3 SDC Linter linter.py sdc-tools lint Format & reorganize SDC files with section ordering
4 SDC Converter converter.py sdc-tools convert Parse SDC to structured JSON/YAML for tool integration
5 Batch Processor batch_runner.py sdc-tools batch Process all SDCs in a directory β€” check, lint, report
6 Constraint Change Analyzer constraint_diff.py sdc-tools diff Semantic diff with TCL variable resolution + wildcard drift
7 Clock Relation Analyzer clock_relations.py sdc-tools analyze clock-relations Infer correct clock relationships and detect mismatches
8 Multi-Corner Manager (MMC) corner_manager.py + mmc.py sdc-tools corners PVT corner presets, per-corner SDC generation, ZIP packaging
9 Constraint Coverage Gap Analysis coverage.py sdc-tools coverage 39-item gap analysis across 6 constraint categories
10 Custom Rules Engine custom_rules.py sdc-tools check --custom-rules YAML-based project-specific validation policies
11 Rules Registry rules_registry.py sdc-tools rules Centralized documentation of all 60+ rule codes
12 HTML Signoff Reports reporter.py sdc-tools report Self-contained, zero-dependency HTML reports
13 Streamlit Web UI app.py sdc-tools web Interactive browser UI with 10 visual tabs

πŸ” Check Your SDC

sdc-tools check design.sdc
# Output:
#   Errors:   3    (SDC-001, SDC-005, SDC-006)
#   Warnings: 8    (SDC-024, SDC-030, ...)
#   Info:    12    (best practice suggestions)
#
#   [SDC-001] No create_clock defined β€” all paths unconstrained.
#   [SDC-024] 4 clocks but no set_clock_groups β€” CDC un-flagged.

With JSON output for CI integration:

sdc-tools check design.sdc --json
sdc-tools check design.sdc --junit --output results.xml

With custom rules:

sdc-tools check design.sdc --custom-rules my_policy.yaml --custom-rules team_rules.yaml

With CSV output (for CI/CD):

sdc-tools check design.sdc --format csv > results.csv
sdc-tools check design.sdc --format markdown > report.md

πŸ“ Lint & Format SDC

sdc-tools lint design.sdc                    # preview formatted output
sdc-tools lint design.sdc --fix              # fix in-place
sdc-tools lint design.sdc --check            # exit 1 if not clean
sdc-tools lint design.sdc --output clean.sdc # write to file

πŸ”„ Convert SDC

sdc-tools convert design.sdc --format json
sdc-tools convert design.sdc --format yaml --output constraints.yaml

πŸ“¦ Batch Process

sdc-tools batch check ./sdc_files/           # check all SDCs in directory
sdc-tools batch lint ./sdc_files/ --fix      # lint all files in-place
sdc-tools batch report coverage ./sdc_files/ -o ./reports/

βš™οΈ Generate SDC

sdc-tools generate \
  --design MY_CHIP \
  --clock clk_core=5.0:sys_clk \
  --clock clk_slow=20.0:slow_clk \
  --uncertainty 0.15 \
  --operating-condition WORST \
  --derate \
  --propagated \
  --output my_chip.sdc

πŸ” Compare SDC Versions

sdc-tools diff old.sdc new.sdc \
  --linked-v1 params_v1.tcl \
  --linked-v2 params_v2.tcl \
  --verbose
# Output:
#   FATAL  [CHG-FP-001]  False path removed β€” timing now checked on this path
#   WARN   [CHG-CK-001]  Clock period decreased from 5ns to 4ns
#   INFO   [CHG-GEN-001] New constraint added

πŸ• Clock Relation Analysis

sdc-tools analyze clock-relations design.sdc
# Output:
#   Clocks: 4    Pairs: 6    Mismatches: 2
#   [SDC-060] WARNING  CLKA vs CLKB
#     Specified: -asynchronous
#     Expected:  -physically_exclusive

πŸ”² Multi-Corner SDC Generation

sdc-tools corners list                            # see presets
sdc-tools corners show "Classic 3-corner"        # view details
# Generate per-corner SDCs via the Web UI
sdc-tools web
# β†’ MMC Corner Manager tab β†’ load preset β†’ generate

πŸ“Š Constraint Coverage

sdc-tools coverage design.sdc
# Output:
#   Overall Coverage: 56.4% (22/39 items)
#
#   πŸ• Clocks: 78%       [#####.....] (7/9)
#   πŸ”Œ I/O: 67%          [####......] (4/6)
#   ⚠️ Exceptions: 71%   [#####.....] (5/7)
#   πŸ“ Design Rules: 83% [######....] (5/6)
#   πŸ“Š AOCV/Derate: 0%   [..........] (0/5) ← critical gap
#   ⚑ Power/DFT: 33%    [###.......] (2/6)

sdc-tools coverage design.sdc --missing-only    # compact view
sdc-tools coverage design.sdc --json            # for automation

πŸ“‹ Rules Lookup

sdc-tools rules list                             # all 60+ rules
sdc-tools rules list --severity error             # errors only
sdc-tools rules list --search derate              # search by keyword
sdc-tools rules show SDC-060                      # single rule details

πŸ“‹ Custom Rules YAML

# my_policy.yaml
name: My Team Policies
version: "1.0"
rules:
  - id: MY-001
    name: "Clock period ≀ 10ns"
    severity: warning
    command: create_clock
    condition: value_above
    field: period
    threshold: 10.0
    message: "Clock period {value}ns exceeds 10ns limit"

  - id: MY-002
    name: "Propagated clock required"
    severity: error
    command: set_propagated_clock
    condition: present
    message: "No set_propagated_clock β€” required by policy"

πŸ“‹ HTML Signoff Reports

sdc-tools report check design.sdc -o quality_report.html
sdc-tools report diff old.sdc new.sdc -o diff_report.html
sdc-tools report clock-relations design.sdc -o clock_report.html
sdc-tools report coverage design.sdc -o coverage_report.html

πŸ“¦ Project Structure

sdc-tools-main/
β”‚
β”œβ”€β”€ core modules ──────────────────────────────
β”‚   β”œβ”€β”€ checker.py           # SDC validation (40+ checks)
β”‚   β”œβ”€β”€ generator.py         # SDC generation from params
β”‚   β”œβ”€β”€ linter.py            # SDC formatter + section reorganization
β”‚   β”œβ”€β”€ converter.py         # SDC β†’ JSON/YAML parser
β”‚   β”œβ”€β”€ batch_runner.py      # Directory-wide batch processing
β”‚   β”œβ”€β”€ constraint_diff.py   # Semantic SDC diff + change rules
β”‚   β”œβ”€β”€ clock_relations.py   # Clock relation inference + mismatches
β”‚   β”œβ”€β”€ corner_manager.py    # PVT corner data model + presets
β”‚   β”œβ”€β”€ mmc.py               # Multi-corner SDC operations
β”‚   β”œβ”€β”€ coverage.py          # Constraint coverage gap analysis
β”‚   β”œβ”€β”€ custom_rules.py      # YAML-based custom validation rules
β”‚   β”œβ”€β”€ rules_registry.py    # Central rule code documentation (60+)
β”‚   β”œβ”€β”€ reporter.py          # HTML signoff report generator
β”‚   β”œβ”€β”€ tcl_resolver.py      # TCL $variable resolution
β”‚   └── wildcard_analyzer.py # Wildcard pattern risk analysis
β”‚
β”œβ”€β”€ interfaces ─────────────────────────────────
β”‚   β”œβ”€β”€ cli.py               # Command-line interface (12 commands)
β”‚   β”œβ”€β”€ app.py               # Streamlit web UI (10 tabs)
β”‚   └── ui/                  # Tab modules (modular UI)
β”‚       β”œβ”€β”€ components.py    # Shared CSS, helpers, dark mode
β”‚       β”œβ”€β”€ tab_linter.py    # Linter tab
β”‚       β”œβ”€β”€ tab_converter.py # Converter tab
β”‚       └── tab_rules.py     # Rules Reference tab
β”‚
β”œβ”€β”€ packaging & deployment ─────────────────────
β”‚   β”œβ”€β”€ pyproject.toml       # PyPI package configuration
β”‚   β”œβ”€β”€ Dockerfile           # Container image (Python 3.11-slim)
β”‚   β”œβ”€β”€ .dockerignore        # Docker build exclusions
β”‚   └── __init__.py          # Package init
β”‚
β”œβ”€β”€ sample files ───────────────────────────────
β”‚   β”œβ”€β”€ samples/
β”‚   β”‚   β”œβ”€β”€ example.sdc                 # Full example SDC file
β”‚   β”‚   β”œβ”€β”€ constraint_diff_v1.sdc      # Diff demo: version 1
β”‚   β”‚   β”œβ”€β”€ constraint_diff_v2.sdc      # Diff demo: version 2
β”‚   β”‚   └── clock_relations.sdc         # Clock relations demo
β”‚   └── custom_rules_example.yaml       # 10 example custom rules
β”‚
β”œβ”€β”€ git hooks & CI ─────────────────────────────
β”‚   β”œβ”€β”€ .pre-commit-config.yaml         # Pre-commit framework config
β”‚   β”œβ”€β”€ .pre-commit-hooks/sdc-check.sh  # Standalone git hook
β”‚   └── sdc-tools.cmd                   # Windows CLI wrapper
β”‚
β”œβ”€β”€ documentation ──────────────────────────────
β”‚   β”œβ”€β”€ README.md                       # This file
β”‚   └── docs/features/                  # Detailed feature docs
β”‚       β”œβ”€β”€ README-01-checker.md         # SDC Checker / Validator
β”‚       β”œβ”€β”€ README-02-generator.md       # SDC Generator
β”‚       β”œβ”€β”€ README-03-diff.md            # Constraint Change Analyzer
β”‚       β”œβ”€β”€ README-04-clock-relations.md # Clock Relation Analyzer
β”‚       β”œβ”€β”€ README-05-mmc.md             # Multi-Corner Manager
β”‚       β”œβ”€β”€ README-06-coverage.md        # Constraint Coverage Gap
β”‚       β”œβ”€β”€ README-07-custom-rules.md    # Custom Rules Engine
β”‚       β”œβ”€β”€ README-08-rules-registry.md  # Rules Registry
β”‚       β”œβ”€β”€ README-09-reports.md         # HTML Signoff Reports
β”‚       └── README-10-web-ui.md          # Streamlit Web UI
β”‚
β”œβ”€β”€ MIT License                          # Open-source (MIT)
└── .gitignore                           # Git exclusions

πŸ–₯️ CLI Reference

Command Purpose Key Flags
check Validate SDC --json, --junit, --custom-rules, --verbose, --format
generate Generate SDC --clock, --design, --derate, --operating-condition
diff Semantic diff --linked-v1, --linked-v2, --json, --verbose
corners Manage corners list, show <name>
analyze Deep analysis clock-relations, --json
rules Rule lookup list, show <code>, --module, --severity, --search
coverage Gap analysis --json, --missing-only
lint Format/reorganize SDC --check, --fix, --output
convert SDC to JSON/YAML --format, --output
batch Directory-wide processing check, lint, report, --fix
report HTML reports check, diff, clock-relations, coverage
web Launch browser UI (opens http://localhost:8501)

πŸ—οΈ Design Principles

  1. Zero external dependencies for core validation (stdlib only)
  2. Single Python files β€” no complex package hierarchies
  3. Fail-fast on errors β€” CLI exits with code 1 if any errors found
  4. Graceful optional features β€” YAML (PyYAML optional), Web (Streamlit optional)
  5. CI-friendly β€” JUnit XML, JSON output, exit codes, pre-commit hooks
  6. Self-contained reports β€” HTML with inline CSS, no CDN, no JS

πŸ“š Documentation

Detailed feature documentation β€” each feature has its own README with:

  • Why it's needed (problem statement)
  • How it was implemented (technical architecture)
  • Use cases (when/why to use it)
  • Structural view (ASCII diagrams)
  • Flow diagrams (step-by-step)
  • CLI usage examples
  • Python API examples
  • Configuration reference

β†’ Feature Documentation Index


πŸ§ͺ Test Samples

# Run all available samples through the checker
sdc-tools check samples/example.sdc --verbose
sdc-tools coverage samples/example.sdc
sdc-tools analyze clock-relations samples/clock_relations.sdc
sdc-tools diff samples/constraint_diff_v1.sdc samples/constraint_diff_v2.sdc

# New samples with intentional bugs
sdc-tools check samples/buggy_no_clocks.sdc
sdc-tools check samples/warning_heavy.sdc

# Lint & convert
sdc-tools lint samples/example.sdc
sdc-tools convert samples/example.sdc --format json

# Run the full test suite
python -m pytest tests/ -q

🀝 Contributing

Contributions welcome! The project is organized for easy extension:

  • Add a new checker rule: Edit checker.py (add condition) + rules_registry.py (add documentation)
  • Add a new custom condition: Edit custom_rules.py (add @_cond("name") handler)
  • Add a new coverage item: Edit coverage.py (add to appropriate category)
  • Add a new report section: Edit reporter.py (add generator function)
  • Add a new tab: Create ui/tab_<name>.py and add to app.py tab list
  • Add a new Streamlit tab: Edit app.py (add to st.tabs() list)

πŸ“œ License

MIT License β€” free for commercial and non-commercial use.


πŸ™ Acknowledgments

Built with deep respect for:

  • Ausdia β€” TimeVision constraint analysis tool and their excellent blog posts on SDC pitfalls
  • Synopsys β€” SDC standard and tool documentation
  • OpenCores β€” open-source digital design community

SDC Tools is an open-source project by RAMA-L7 β€” an MIT-licensed open-core VLSI constraint toolkit.

About

Web-based SDC tools for synthesis engineers. Checker validates constraint files with 50+ rules across errors, warnings, and best practices. Generator builds complete .sdc files with clocks, I/O delays, AOCV derate, half-cycle paths, and more. Built with Python + Streamlit.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages