RE: [sv-bc] [Fwd: Issues with IEEE 1364-2005]

From: Joao Geada <jgeada_at_.....>
Date: Wed Aug 16 2006 - 04:56:56 PDT
 Stu,

SV is much more than just a hardware modelling language. It is also an
environment model/testbench language and both those parts are significantly
more biased to software than hardware "thinking". The reason that
short-circuiting is being discussed is that there are an interesting number
of scenarios in testbench modelling where common software techniques for
avoiding dereferencing invalid handles etc *rely* on short-circuiting
behavior. The hardware side of Verilog clearly does not have this problem
(no handles, cannot synthesize functions with side-effects, ...) so up till
SV this has not been a pressing problem. *BUT* now it is an issue. Verilog
(and Vera and many of the languages used as testbench environments) have
adapted the operators & language feel from C/C++ to a large extent. This
leads to common use of C/C++ idioms in testbench coding and thus it is
important that these work correctly.

Please also note that it was an explicit goal of SV to more seamlessly blend
software and hardware modelling (thus classes, DPI interface, etc), which
would also imply a desirability to have the operators behave "as expected".

Please also note that in any synthesizable case, the behavior of a
short-circuiting operator is indistinguishable from a normal evaluation (as
in such cases handles etc are not legitimate and neither are side-effects;
though both of those rules have to be applied by the synthesis tool, as a
simulator just wouldn't care)

And a last point: regardless of how much fun re-inventing wheels may be,
this particular wheel has been in use in C/C++ and similar languages for a
very long time. It has stood the test of time, it has become part of the
expected programming box-of-tricks. Unless there is a critical
justification for why such tried and tested semantics are inapplicable to SV
(and, for all the arguing, no such have been forthcoming) then
shortcircuiting should be the required behavior. And, btw, C/C++ only
require short-circuiting the logical operators &&, || and the ?: operator.
Any discussion about further short-circuiting operators is, in my opinion,
just a red-herring.

Joao
Received on Wed Aug 16 04:58:45 2006

This archive was generated by hypermail 2.1.8 : Wed Aug 16 2006 - 04:59:06 PDT