InOut in Signature #1521
-
I'm creating a signature for a bus with a bidirectional data. With verilog I'd normally mark this as inout and create some comb to set the direction based on the current operation. I know I can use an IoBufferInstance to handle connecting the appropriate lines to the bus with a tristate option. My question is, how do I indicate that it's an inout in the Signature? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
You can't. For buses that need to transfer data in both directions, use two members, like |
Beta Was this translation helpful? Give feedback.
In those cases you should use
IOBufferInstance
(for communicating with other modules that useinout
), orlib.io.Buffer
(for external pins, especially if you are using the Amaranth platform interface).Note that not all FPGA synthesis toolchains support internal
inout
signals. In particular Yosys has never had a complete implementation, and I wouldn't recommend using internalinout
s. (I realize this may not always be possible, and some cases will work fine, but there is a good chance you will encounter issues).The reason Amaranth doesn't have first-class support for bidirectional signals within the device is because modern FPGAs don't have them at all, and similarly their use in modern AS…