From 54f68516404d2d40a79c6a2f8dbb70ed7016d147 Mon Sep 17 00:00:00 2001 From: Schuyler Eldridge Date: Thu, 12 Sep 2019 11:58:56 -0400 Subject: Fix BoringUtils.bore for internal boring This fixes a bug where internal boring using BoringUtils.bore would fail because it was using instanceName which cannot be called before the module closes. Previously, this meant that BoringUtils.bore would work for boring instances (which are closed in a parent), but not for boring signals in the current, unclosed module. Signed-off-by: Schuyler Eldridge --- src/main/scala/chisel3/util/experimental/BoringUtils.scala | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/scala/chisel3/util/experimental/BoringUtils.scala b/src/main/scala/chisel3/util/experimental/BoringUtils.scala index da5b3fd0..36b3fb88 100644 --- a/src/main/scala/chisel3/util/experimental/BoringUtils.scala +++ b/src/main/scala/chisel3/util/experimental/BoringUtils.scala @@ -181,8 +181,14 @@ object BoringUtils { * component */ def bore(source: Data, sinks: Seq[Data]): String = { - lazy val genName = addSource(source, source.instanceName, true, true) + val boringName = try { + source.instanceName + } catch { + case _: Exception => "bore" + } + val genName = addSource(source, boringName, true, true) sinks.map(addSink(_, genName, true, true)) genName } + } -- cgit v1.2.3