llvm / llvm/circt

[LLHD] Add an SSA-style value-to-signal conversion operation

Open
#1,009 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

We currently emit code like the following in a lot of places:
```mlir
%0 = llhd.const [...]
%1 = llhd.const [...] : !llhd.time
%signal = llhd.sig "foo" %0
llhd.drv %signal, %value after %1
```
The intent is to get a signal which has exactly one driver, which continuously drives a value onto the signal with some delay. We should add a new operation to the LLHD dialect, maybe calling it `llhd.output`, that represents this pattern in a more SSA-friendly way:
```mlir
%0 = llhd.const [...] : !llhd.time
%signal = llhd.output "foo" %value after %0
```
Then update the `RTLToLLHD` conversion to use the buffer where it currently materializes a signal.

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 by locating the LLHD dialect operation definitions and the RTLToLLHD conversion. Compare the repeated llhd.sig and llhd.drv pattern with the proposed SSA-style operation, then update the conversion to use it; done means the conversion emits the new value-to-signal form while preserving the value and delay semantics.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.