llvm / llvm/circt

[Arc] Support hw.wires of aggregate types

Open
#6,373 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

When i run `arcilator` with `$ ./arcilator a.mlir --state-file=a.json` i get the following error:
```
a.mlir:9:23: error: 'arc.tap' op operand #0 must be signless integer, but got '!hw.struct'
%_registers_0_T = hw.wire %2 sym @sym_0 : !hw.struct
^
a.mlir:9:23: note: see current operation: "arc.tap"(%5) {name = "_registers_0_T"} : (!hw.struct) -> ()
```

`a.mlir`:
```
module {
hw.module @Barrier(in %clock : !seq.clock, in %reset : i1, in %io_input : !hw.array<1xstruct>, out io_output : !hw.array<1xstruct>) {
%false = hw.constant false
%0 = hw.array_get %io_input[%false] : !hw.array<1xstruct>, i1
%valid = hw.struct_extract %0["valid"] : !hw.struct
%registers = seq.firreg %3 clock %clock sym @sym {firrtl.random_init_start = 0 : ui64} : !hw.array<1xstruct>
%1 = hw.array_get %registers[%false] : !hw.array<1xstruct>, i1
%2 = comb.mux bin %valid, %0, %1 : !hw.struct
%_registers_0_T = hw.wire %2 sym @sym_0 : !hw.struct
%3 = hw.array_create %_registers_0_T : !hw.struct
hw.output %registers : !hw.array<1xstruct>
}
}
```

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

Reproduce the failure with arcilator using the provided a.mlir input and inspect the hw.wire and arc.tap operations involved in the diagnostic. Trace how aggregate operands are handled, then verify that the same input no longer rejects the !hw.struct value and add or run a regression test if the relevant test location can be identified.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.