<_whitenotifier-4>
[amaranth-lang/amaranth-lang.github.io] whitequark 41f9aa7 - Deploying to main from @ amaranth-lang/rfcs@ac8b977c3bdaf3e3ea43c944a8669e741e9eb1d9 🚀
<whitequark[cis]>
that being said, in many cases, i would recommend doing something slightly different
<whitequark[cis]>
can you tell me more about the exact use case you have?
<RobTaylor[m]>
Thanks! its for modelling jtag with an optional trst
<whitequark[cis]>
TRST# is an input for your IP, right?
<RobTaylor[m]>
yep
<whitequark[cis]>
in this particular case, I would suggest having a fixed signature that always has TRST#, and letting the optimizer rip out reset-related circuitry, which it is guaranteed to do
<RobTaylor[m]>
yeah, that seems sensible to me
<whitequark[cis]>
if you don't like that solution, the second best is a fixed signature as before, and an interface subclass which replaces the Signal in self.trst with a Const(1)
<whitequark[cis]>
in short, having variable signatures can be valuable (especially for things like "variable bitness"), but if it is just for fixed control inputs, you would have to write a bunch of "gasket" IP whose only purpose is to adapt one interface to another. this is annoying
<whitequark[cis]>
as a result, Amaranth allows you to stuff a constant in place of a signal in an interface, and it guarantees that this interface member would only be connected to others where it's either an input, or the same constant
<_whitenotifier-4>
[amaranth-lang/amaranth-lang.github.io] whitequark fa87cc3 - Deploying to main from @ amaranth-lang/playground@698d71fef3ce4ce2c6a2575400515086de2ea2df 🚀