Skip to content

[FIRRTL] Support Domains in LowerLayers #9416

@seldridge

Description

@seldridge

The LowerLayers pass doesn't properly handle domains. Consider the following:

firrtl.circuit "Foo" {
  firrtl.layer @A bind {}
  firrtl.domain @ClockDomain
  firrtl.module private @Bar(
    in %a: !firrtl.domain of @ClockDomain
  ) {
    firrtl.layerblock @A {
      %wire = firrtl.wire : !firrtl.domain
      firrtl.domain.define %wire, %a
    }
  }
  firrtl.extmodule @Foo()
}

When passed through LowerLayers this errors out:

# circt-opt -pass-pipeline='builtin.module(firrtl.circuit(firrtl-lower-layers))' reduced.8.mlir
Assertion failed: (type_isa<BaseTy>(type) && "type must convert to requested type"), function type_cast, file FIRRTLTypes.h, line 481.
PLEASE submit a bug report to https://github.com/llvm/circt and include the crash backtrace.
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  circt-opt                0x0000000100b2cb5c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  circt-opt                0x0000000100b2a9b0 llvm::sys::RunSignalHandlers() + 172
2  circt-opt                0x0000000100b2d604 SignalHandler(int, __siginfo*, void*) + 300
3  libsystem_platform.dylib 0x0000000197ca56a4 _sigtramp + 56
4  libsystem_pthread.dylib  0x0000000197c6b848 pthread_kill + 296
5  libsystem_c.dylib        0x0000000197b749e4 abort + 124
6  libsystem_c.dylib        0x0000000197b73c18 err + 0
7  circt-opt                0x0000000102e18fd4 mlir::OpInterface<circt::firrtl::FModuleLike, circt::firrtl::detail::FModuleLikeInterfaceTraits>::getInterfaceFor(mlir::Operation*) (.cold.2) + 0
8  circt-opt                0x0000000100f4643c circt::firrtl::NodeOp::getRef() + 0
9  circt-opt                0x000000010126ce64 LowerLayersPass::runOnModuleBody(circt::firrtl::FModuleOp, llvm::DenseMap<circt::hw::InnerRefAttr, std::__1::pair<circt::hw::InnerSymAttr, mlir::StringAttr>, llvm::DenseMapInfo<circt::hw::InnerRefAttr, void>, llvm::detail::DenseMapPair<circt::hw::InnerRefAttr, std::__1::pair<circt::hw::InnerSymAttr, mlir::StringAttr>>>&)::$_2::operator()(mlir::Operation*, mlir::Value) const + 492

Metadata

Metadata

Assignees

Labels

FIRRTLInvolving the `firrtl` dialectbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions