Error When Connecting Analog-Only Bundle to Verilog Blackbox
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず example2.scala と firtool 1.75.0 で失敗を再現し、生成された FIRRTL と中間 IR を example1.scala と比較します。アナログ専用 bundle の接続を attach のセマンティクスを保持せずに firrtl.strictconnect に変換している FIRRTL lowering のステップを追跡します。完了条件は、アナログ専用のケースが lowering され、アナログ接続エラーなしで Verilog を出力することです。
索引モデルが issue の本文から書いたものです。
説明
@seldridge bringing from chisel:matrix.org
Type of issue: Bug Report
Please provide the steps to reproduce the problem:
- Define a Verilog blackbox with inout signals.
- Connect these inout signals to Chisel Analog IO.
- Use a bundle in IO that consists only of Analog signals.
- Run the build process, converting .fir to .sv.
- Observe the error during FIRRTL lowering.
Error messages
error: analog types may not be connected
note: see current operation: "firrtl.strictconnect"(%172, %arg90) : (!firrtl.bundle<signal_0: analog<1>, signal_1: analog<1>>, !firrtl.bundle<signal_0: analog<1>, signal_1: analog<1>>) -> ()
What is the current behavior?
- If the IO bundle contains only Analog signals, the build fails.
- The .fir output appears correct, showing attach statements.
- However, in intermediate IRs, strictconnect is used instead of attach, leading to an error.
- This issue occurs regardless of whether attach or bulk connections are used.
What is the expected behavior?
- The Analog-only bundle should be correctly handled, similar to when Analog is mixed with regular Chisel IO.
- The FIRRTL lowering process should preserve attach semantics without causing an error.
Please tell us about your environment:
I will provide example code.
- example1.scala: Works fine because the bundle contains a mix of Analog and regular Chisel IO signals.
//> using scala "2.13.12"
//> using dep "org.chipsalliance::chisel::6.5.0"
//> using options "-language:reflectiveCalls", "-deprecation", "-feature", "-Xcheckinit", "-Xmaxerrs", "1500", "-Ymacro-annotations",
import chisel3._
import chisel3.experimental.{Analog, attach}
import chisel3.stage.ChiselStage
class PhyMixedInterface extends Bundle {
val analog_signal_0 = Analog(1.W)
val analog_signal_1 = Analog(1.W)
val digital_signal = Output(UInt(1.W))
}
class PhyInterfaceIO extends Bundle {
val mixed = new PhyMixedInterface
}
// BlackBox implementation
class PhyImpl extends BlackBox with HasBlackBoxPath {
override val desiredName = "phy_impl"
val io = IO(new Bundle {
val phy = new PhyInterfaceIO
})
addPath("phy_impl.v")
}
// Wrapper module that contains the BlackBox
class PhyWrapper extends Module {
val io = IO(new PhyInterfaceIO)
val impl = Module(new PhyImpl)
io.mixed <> impl.io.phy.mixed
}
object Main extends App {
(new chisel3.stage.ChiselStage).emitVerilog(new PhyWrapper)
}
- example2.scala: Fails because the bundle (PhyAnalogInterface) consists only of Analog signals.
//> using scala "2.13.12"
//> using dep "org.chipsalliance::chisel::6.5.0"
//> using options "-language:reflectiveCalls", "-deprecation", "-feature", "-Xcheckinit", "-Xmaxerrs", "1500", "-Ymacro-annotations",
import chisel3._
import chisel3.experimental.{Analog, attach}
import chisel3.stage.ChiselStage
// Interface definition
class PhyAnalogInterface extends Bundle {
val signal_0 = Analog(1.W)
val signal_1 = Analog(1.W)
}
class PhyDigitalInterface extends Bundle {
val signal = Output(UInt(1.W))
}
class PhyInterfaceIO extends Bundle {
val digital = new PhyDigitalInterface
val analog = new PhyAnalogInterface
}
// BlackBox implementation
class PhyImpl extends BlackBox with HasBlackBoxPath {
override val desiredName = "phy_impl"
val io = IO(new Bundle {
val phy = new PhyInterfaceIO
})
addPath("phy_impl.v")
}
// Wrapper module that contains the BlackBox
class PhyWrapper extends Module {
val io = IO(new PhyInterfaceIO)
val impl = Module(new PhyImpl)
io.digital.signal := impl.io.phy.digital.signal
// Connect analog signals using attach
attach(io.analog.signal_0, impl.io.phy.analog.signal_0)
attach(io.analog.signal_1, impl.io.phy.analog.signal_1)
}
object Main extends App {
(new chisel3.stage.ChiselStage).emitVerilog(new PhyWrapper)
}
- example3.scala: bulk connection is used instead of attach, but the result is same (also fails)
//> using scala "2.13.12"
//> using dep "org.chipsalliance::chisel::6.5.0"
//> using options "-language:reflectiveCalls", "-deprecation", "-feature", "-Xcheckinit", "-Xmaxerrs", "1500", "-Ymacro-annotations",
import chisel3._
import chisel3.experimental.{Analog, attach}
import chisel3.stage.ChiselStage
// Interface definition
class PhyAnalogInterface extends Bundle {
val signal_0 = Analog(1.W)
val signal_1 = Analog(1.W)
}
class PhyDigitalInterface extends Bundle {
val signal = Output(UInt(1.W))
}
class PhyInterfaceIO extends Bundle {
val digital = new PhyDigitalInterface
val analog = new PhyAnalogInterface
}
// BlackBox implementation
class PhyImpl extends BlackBox with HasBlackBoxPath {
override val desiredName = "phy_impl"
val io = IO(new Bundle {
val phy = new PhyInterfaceIO
})
addPath("phy_impl.v")
}
// Wrapper module that contains the BlackBox
class PhyWrapper extends Module {
val io = IO(new PhyInterfaceIO)
val impl = Module(new PhyImpl)
io.digital.signal := impl.io.phy.digital.signal
// Connect analog signals using bulk connection
io.analog <> impl.io.phy.analog
}
object Main extends App {
(new chisel3.stage.ChiselStage).emitVerilog(new PhyWrapper)
}
- phy_impl.v: blackbox verilog code
// blackbox
module phy_impl (
output wire digital_signal,
// Analog interface
inout wire signal_0,
inout wire signal_1
);
// Empty module implementation
assign digital_signal = 1'b0;
endmodule
Other Information
Please note that I am not using scala-cli, so my build might not exactly match the standard setup.
And I used firtool 1.75.0.
If there are any additional details I should provide about my environment to help reproduce the issue, please let me know. Thanks!
What is the use case for changing the behavior?
- 主要言語
- Scala
- スター
- 4.8k
- フォーク
- 669
- 平均マージ
- 1日 12時間
- マージ済み PR(30日)
- 25
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
chipsalliance/chisel のほかの issue
-
`addAttribute` cannot be used on RawModule対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
chipsalliance/chisel#5570 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
chipsalliance/chisel#5499 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 54/100
chipsalliance/chisel#5430 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
MultiClockSpec chiselTest fails with recent Verilator version対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
chipsalliance/chisel#5418 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 50/100
chipsalliance/chisel#5411 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
chipsalliance/chisel の issue をすべて見る
似ている issue
-
[Bug][NewCSR] vsstatus.SDT latches writes while DTE=0, exposing illegal (vsstatus.SDT=1 && vsstatus.SIE=1)対応中かも @docluka77 が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
OpenXiangShan/XiangShan#7134 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1時間未満 初心者へのやさしさ 83/100
rchillyard/TableParser#230 ·
メンテナーはふだん 1 日以内に返信
-
AI Generated CI/CD ⚒️ Flaky-tests 🐦 python 🐍
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
valkey-io/valkey-glide#8012 ·
メンテナーはふだん 3 日以内に返信
-
Agent Workspace Python guidance: the agent can choose an interpreter without magda-python-runtime plan対応中かも @chandrasahith が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
magda-io/magda#4007 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] Iceberg v3 read test fails during schema setup with a zero decimal default対応中かも @res-life が 1 日前に担当しました。 オープンbot_watch bug
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
NVIDIA/cudf-spark#17288 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信