aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/firrtl/options/Registration.scala
blob: 481c095b26c3333b28cf4cde68b2640548ab0f9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// See LICENSE for license details.

package firrtl.options

import firrtl.{AnnotationSeq, Transform}

import scopt.OptionParser

/** Indicates that this class/object includes options (but does not add these as a registered class)
  */
trait HasScoptOptions {

  /** This method will be called to add options to an OptionParser
    * @param p an option parser
    */
  def addOptions(p: OptionParser[AnnotationSeq]): Unit
}

/** A [[Transform]] that includes options that should be exposed at the top level.
  *
  * @note To complete registration, include an entry in
  * src/main/resources/META-INF/services/firrtl.options.RegisteredTransform */
trait RegisteredTransform extends HasScoptOptions { this: Transform => }

/** A class that includes options that should be exposed as a group at the top level.
  *
  * @note To complete registration, include an entry in
  * src/main/resources/META-INF/services/firrtl.options.RegisteredLibrary */
trait RegisteredLibrary extends HasScoptOptions {

  /** The name of this library.
    *
    * This will be used when generating help text.
    */
  def name: String
}