I'm diving into VHDL and I couldn't really grasp the idea(?) of weak signals.
I understand that '0' and '1' are (strong) signals. This is quite common knowledge from my point of view.
How do weak signals now enter the arena?
I'm diving into VHDL and I couldn't really grasp the idea(?) of weak signals.
I understand that '0' and '1' are (strong) signals. This is quite common knowledge from my point of view.
How do weak signals now enter the arena?
VHDL had by default a 2-valued logic known as types bit and bit_vector. With IEEE Std. 1164, which was incorporated into VHDL itself, it got a 9-valued logic. In comparison, Verilog has only a fixed 4-valued logic (X, 0, 1, Z).
VHDL's std_ulogic type has:
U - uninitializedX - strong unknown (error)0 - strong low1 - strong highZ - tri stateW - weak unknown (error)L - weak lowH - weak high- - Don't careAll objects are initialized with type'left if no default value is given. There are multiple subtypes like x01z with are compatible to the Verilog logic system.
Weak signals are intended to model pullups and pulldowns. Thus it's possible to simulate OneWire, I²C and similar busses with pullups and pulldowns.
Using strong and weak signals makes mostly sense when signals are driven by multiple sources. In such a cases, the type use should be based on std_logic, which adds a resolution function to the base type. A resolution function computes the effective values from multiple sources.
Example: H and 0 results in 0 (pullups and ground is ground).
'1' is Vcc and 'H' is almost Vcc. Same for '0', which is ground and 'L' is almost ground. The voltage at a pullup or pulldown isn't exactly Vcc nor Gnd. VHDL allows you to model 4 values from Gnd via Low and High to Vcc. With this and a feature called resolution function, you can simulate in VHDL not only digital in-chip, but also board-level. If you have a VHDL file with this line SDA <= 'H';, it adds a pullup driver ('H') to the SDA line for an I²C communication link. When your chip drives 'Z', SDA will be 'H', but if you drive '0' it's '0'. Another chip will read low.
– Paebbels
Dec 20 '20 at 22:21