Skip to content

[FIRRTL] Instance Choices with Layers Error Out #8353

Open
@seldridge

Description

@seldridge

I haven't thought through what should happen here, yet.

Consider the following FIRRTL which contains layerblocks under an instance choice:

FIRRTL version 4.2.0
circuit Top :
  option Target :
    X

  layer A, bind :

  extmodule Foo :

  module Bar enablelayer A :

  public module Top enablelayer A :

    instchoice divider of Foo, Target :
      X => Bar

When compiled, this errors out with:

# firtool Foo.fir                                     
Foo.fir:14:5: error: 'firrtl.instance_choice' op layers must be [@A], but got []
    instchoice divider of Foo, Target :
    ^
Foo.fir:14:5: note: see current operation: "firrtl.instance_choice"() <{annotations = [], caseNames = [@Target::@X], layers = [], moduleNames = [@Foo, @Bar], name = "divider", nameKind = #firrtl<name_kind interesting_name>, portAnnotations = [], portDirections = array<i1>, portNames = []}> : () -> ()
Foo.fir:10:3: note: original module declared here
  module Bar enablelayer A :

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions