From: Martin W. <mai...@ma...> - 2009-10-13 16:32:58
|
Stephen Williams wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Martin Whitaker wrote: >> Stephen Williams wrote: >>> -----BEGIN PGP SIGNED MESSAGE----- >>> Hash: SHA1 >>> >>> >>> I've been working on some fixes to the tranifX handling in Icarus >>> Verilog. I fixed a couple bugs, but now the tranif1.v test in the >>> ivtest suite no longer works. I've been puzzling over it, and I now >>> think that the test itself is not valid. The meat of the program >>> is here: >>> >>> wire pin; >>> pullup (weak1) (keep1); >>> pulldown (weak0) (keep0); >>> tranif1 (pin, keep1, pin); >>> tranif0 (pin, keep0, pin); > > [...] > >> What you are missing is that tranifs are true (bi-directional) switches. Once >> you turn one of them on, the keeper can drive "pin" through the switch, so >> will hold "pin" at its last value until something stronger drives "pin" to >> another value. > > I am *not* missing that tranifs are true bi-directional switches. > Believe me, I've gone through a lot of pain to make them work, so > I'm well aware. > > In fact, it's their "switch" nature that makes me think this test > is wrong. Ask yourself: > > - what happens when "pin" is driven 0? The node is driven to 0 with strength strong by the source driver. If the tranif1 is currently enabled, the node is being driven to 1 with strength weak1 by the pullup. This resolves to the node being driven to 0, and the tranif1 is turned off. > - what happens when "pin" is driven 1? The node is driven to 1 with strength strong by the source driver. If the tranif0 is currently enabled, the node is being driven to 0 with strength weak0 by the pulldown. This resolves to the node being driven to 1, and the tranif0 is turned off. > - what happens when "pin" is driven X? Not sure about this one. I'd have to consult the standard. I would expect it to resolve to the node being driven to X. > - what happens when "pin" is driven Z? The node is driven to Z with strength *HiZ0* or *HiZ1* by the source driver. If the tranif1 is currently enabled, the node is being driven to 1 with strength weak1 by the pullup. This resolves to the node being driven to 1, and the tranif1 remains turned on. Similarly, if the tranif0 is currently enabled, the node is being driven to 0 with strength weak0 by the pulldown. This resolves to the node being driven to 0, and the tranif0 remains turned on. > and > - Does it make sense for the answer to any of the above to differ > depending on what happened before it? > > You see, the test is relying on a delta delay between an assignment > of Z to the pin and the tranif enable gates responding. If you were > to solve the value of the island of switches based only on the drivers, > you should see this: > > tranif1 (pin=Z, week1, pin=Z); > tranif0 (pin=Z, week0, pin=Z); > > Tell me what that is without invoking delta delays or state machines > or hysteresis. > My argument is that assigning Z to the pin does not actually drive the node to Z - the keeper has a stronger drive strength. This also reflects what happens in real life - which is good! Martin |