summaryrefslogtreecommitdiff
path: root/src/main/scala/chisel3/util/BlackBoxUtils.scala
diff options
context:
space:
mode:
authorChick Markley2020-10-13 10:24:03 -0700
committerGitHub2020-10-13 10:24:03 -0700
commitfd92809eb3fa4497f38cfae4aa0e86106eb033c9 (patch)
tree3a69b66cd6810d00277ad039257302486d7a216f /src/main/scala/chisel3/util/BlackBoxUtils.scala
parent1b15dca5065a1a12c097afbb6eac6a8ff8d8e20a (diff)
ExtModule's lacked support built in support for providing (#1154)
* ExtModule's lacked support built in support for providing the verilog source. This changes creates traits that can be used with ExtModule to provide the support currently found in BlackBox - Add support for ExtModule helpers - HasExtModuleResource to use addResource - HasExtModuleInline to use setInline - HasExtModulePath to use addPath - Add tests of the above support. - Note: These tests use Stage instead of Driver - Added ScalaDoc for HasBlackBoxInline#setInline * Fix the danged trailing commas. * Change to use `.transform` as the correct API for `ChiselStage`
Diffstat (limited to 'src/main/scala/chisel3/util/BlackBoxUtils.scala')
-rw-r--r--src/main/scala/chisel3/util/BlackBoxUtils.scala5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/scala/chisel3/util/BlackBoxUtils.scala b/src/main/scala/chisel3/util/BlackBoxUtils.scala
index 74d99ff8..21bd4dfa 100644
--- a/src/main/scala/chisel3/util/BlackBoxUtils.scala
+++ b/src/main/scala/chisel3/util/BlackBoxUtils.scala
@@ -32,6 +32,11 @@ trait HasBlackBoxResource extends BlackBox {
trait HasBlackBoxInline extends BlackBox {
self: BlackBox =>
+ /** Creates a black box verilog file, from the contents of a local string
+ *
+ * @param blackBoxName The black box module name, to create filename
+ * @param blackBoxInline The black box contents
+ */
def setInline(blackBoxName: String, blackBoxInline: String): Unit = {
val anno = new ChiselAnnotation with RunFirrtlTransform {
def toFirrtl = BlackBoxInlineAnno(self.toNamed, blackBoxName, blackBoxInline)