llvm / llvm/circt

[LLHD] Switch from hw.inout to a custom signal reference type

Open
#8,825 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

A while ago, we have switched the LLHD dialect from a custom !llhd.sig wrapper type to !hw.inout in order to represent a reference to a signal slot that can be probed and driven. To support Verilog's time values, we have to be able to store an !llhd.time value in a variable and read and write that variable. Variables are effectively signals, and Verilog variables get mapped to llhd.sig allocation operations. These return a reference type. This prevents us from creating time variables today, since !hw.inout forces isHWValueType on the inner type, which llhd::TimeType is not.

Ideally, we'd create something like an !llhd.ref<T> type to represent a reference to a signal. In the future, we might want to add additional types for multi-driver nets.

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 tracing the LLHD dialect's use of !hw.inout and the llhd.sig allocation operations described in the issue. Review how signal references are represented and how !llhd.time variables would need to be stored and read; done means replacing this representation with a custom reference type that supports non-HW inner types.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.