llvm / llvm/circt

Using SVA properties for sv.assert.property

Open
#4,772 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
2.2k
Forks
524
Avg merge
3d 2h
Merged PRs (30d)
46

Description

Hi there, I saw in the docs and found [this example](https://github.com/llvm/circt/blob/8321cc1f9aa8956ef2556be946689f5f87a0a199/test/ExportVerilog/sv-dialect.mlir#L174) that the `sv` dialect supports properties.

I'm wondering if it's possible to use `cond` to refer to an SVA property. For example, I could use `sv.verbatim` to define a property, but I'm not sure if I can associate this to an MLIR bool value that I can the use in the `sv.assert.concurrent` operation (we can't just assign it to a "boolean" wire in verilog like a simpler logic expression). Naturally I could go about defining the assertion inside the verbatim entirely, but I figured this might be a good incremental step towards property support. Are there any examples of defining properties using SVA? Alternatively, if this is not currently supported, is there any work in progress on or plans for adding support for SVA style assertions?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the documentation and test/ExportVerilog/sv-dialect.mlir around line 174, then inspect the sv.assert.property and sv.assert.concurrent operations and the sv.verbatim use described. Done would require a documented, tested answer about whether an SVA property can be connected to cond, or a scoped implementation plan if it cannot.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.