treadle
For each instantiation of an ExtModule the engine needs a separate instance of a BlackBoxImplementation. This factory provides it.
class ExampleBBFactory extends BlackBoxFactory { override def createInstance(instanceName: String, blackBoxName: String): Option[BlackBoxImplementation] = { instanceName match { case "bb1" => Some(add(new BB1Impl)) case "bb2" => Some(add(new BB2Impl)) case "bb3" => Some(add(new BB3Impl)) case _ => throw Exception(s"ExampleBBBFactory does not know how to create " + instanceName) } } }
This function will be called during treadle compilation.
The name of the specific instance being created
The BlackBox implementation name
For each instantiation of an ExtModule the engine needs a separate instance of a BlackBoxImplementation. This factory provides it.