Skip to content

Commit

Permalink
Update lit tests with partially specified option
Browse files Browse the repository at this point in the history
  • Loading branch information
prithayan committed Dec 5, 2024
1 parent 43463f1 commit 383b91b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 33 deletions.
37 changes: 37 additions & 0 deletions test/Dialect/FIRRTL/specialize-option-errors.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,40 @@ firrtl.option @Platform {
firrtl.option_case @ASIC
}
}

//===----------------------------------------------------------------------===//
// Partially specified options
//===----------------------------------------------------------------------===//


firrtl.circuit "Foo" attributes {
select_inst_choice = ["Platform=FPGA"]
}
{
firrtl.option @Platform {
firrtl.option_case @FPGA
firrtl.option_case @ASIC
}
firrtl.option @Performance {
firrtl.option_case @Fast
firrtl.option_case @Small
}

firrtl.module private @DefaultTarget() {}
firrtl.module private @FPGATarget() {}
firrtl.module private @ASICTarget() {}
firrtl.module private @FastTarget() {}

firrtl.module @Foo() {
firrtl.instance_choice inst_fpga @DefaultTarget alternatives @Platform
{ @FPGA -> @FPGATarget, @ASIC -> @ASICTarget } ()

firrtl.instance_choice inst_default @DefaultTarget alternatives @Platform
{ @ASIC -> @ASICTarget } ()

// expected-error @below {{missing specialization for option "Performance"}}
firrtl.instance_choice inst_perf @DefaultTarget alternatives @Performance
{ @Fast -> @FastTarget } ()
}

}
33 changes: 0 additions & 33 deletions test/Dialect/FIRRTL/specialize-option-omit.mlir

This file was deleted.

0 comments on commit 383b91b

Please sign in to comment.