|
From: Stephen W. <st...@ic...> - 2008-04-18 21:20:25
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 This sounds intriguing. I think this attribute would better be attached to the NetProc base class because a thorough check for the warning will get better information from elaborated results. For example, elaboration of a process will include precomputing constant expressions and that may allow catching infinite for- and while-loops. Also, task definitions will be available as elaborated NetProc objects. I would sat that non-blocking assignments have zero delay, by the way, because they do not block execution. I think you mean that blocking assignments with internal delays should return has_delay of true, because they do have delay, and they pause the thread. By the way, this handling can also be used to detect the erroneous case of a user defined function that *has* a delay. This is illegal but currently it is not detected and reported. Cary R. wrote: | I have been thinking about this for a while and here is what I have come up with so far. We need to add a new attribute to the P* objects 'has_delay' that the always command can use to print a warning if the block appears to not have some kind of delay. | | The default object type will be no delay. Delay, non-blocking assignment and wait statements will return true. An if or switch statement will only return true if there is a delay in all paths. We don't know the logic so this is the safest choice. Except for a repeat with a constant positive value, loops always return false for the same reason (they may not run). The repeat mentioned above will only return true if it contains a statement that has a delay. Task calls (tasks) and blocks return true if one of their items returns has a delay. | | It could be argued that a forever or a while with a constant true value should also return true, but using them inside an always seems dubious at best. | | For the delay elements we should probably check that the delay is not zero. This should be easy for a constant value. For variable delays I think we just have to trust that the user is doing the right thing and assume the delay is greater than zero. | | Does this make sense? Am I missing anything. The message will be a warning that the always block could create an infinite loop. - -- Steve Williams "The woods are lovely, dark and deep. steve at icarus.com But I have promises to keep, http://www.icarus.com and lines to code before I sleep, http://www.picturel.com And lines to code before I sleep." -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD8DBQFICRCbrPt1Sc2b3ikRAkE9AKDUjoUtzFxECDy7QozGJ6O+RUBCigCgkJl9 cNpL10Hn7Z4QmHIvDQ8vz4Y= =8fAa -----END PGP SIGNATURE----- |