Hello again,
It seems prudent to highlight that my advice regarding discrepancies
between VHDL simulations and synthesized VHDL was intended for someone
(named Mike Silva) who I suspected would not have been aware of how
common this is, who said in
(which is a different subthread on comp.lang.ada and so does not
appear in References fields on comp.lang.vhdl):
"[..]
Well, I did pick up a VHDL book a while back. Maybe it's a sign.
But first I want to get Ada running on a SBC."
Sorry if this caused confusion. Having said that, I would prefer
simulations to reflect reality (but I appreciate that less accuracy
for higher speed can be acceptable if you know what you are
sacrificing and what you are doing).
In timestamped Fri, 02 Mar 2007 15:55:46
+0000, Martin Thompson <
[email protected]> posted:
Colin Paul Gloster said:
What do you mean by this? The VHDL I simulate behaves the same as the
FPGA, unless I do something bad like doing asynchronous design, or
miss a timing constraint."
Or if you use the enumeration encoding attribute and it is not supported
by both the simulation tool and the synthesis tool;
Well, attributes are all a bit tool specific, I'm not sure this is
important. The sim and the synth will *behave* the same, but the
numbers used to represent states might not be what you expect. Or am
I misunderstanding what you are getting at?"
You seem to have understood it but to not be aware of what I have read
on the matter, which may be just scaremongering, I have never actually
checked whether a simulation tool and a synthesis tool differ on this.
Many attributes are tool-specific, but not all. The attribute
ENUM_ENCODING is located somewhere in between: it was introduced in
IEEE Std 1076.6-1999, "IEEE Standard for VHDL Register
Transfer Level (RTL) Synthesis", and is still present in IEEE Std
TM
1076.6 -2004,
HTTP://IEEEXplore.IEEE.org/search/s...estds&query=((1076.6-1999)<in>metadata)&pos=0
which contains in 7.1.8 Enumeration encoding attribute:
"[..]
NOTE-Use of this attribute may lead to simulation mismatches, e.g.,
with use of relational operators.
[..]"
E.g. from page 13 of Synopsys's pvhdl_2.pdf :
"[..]
You can override the automatic enumeration encodings and specify
your own enumeration encodings with the ENUM_ENCODING
attribute. This interpretation is specific to Presto VHDL, and
overriding might result in a simulation/synthesis mismatch. [..]
[..]"
You can see how "a simulation/synthesis mismatch" would result from
page 15 of pvhdl_7.pdf :
"[..]
Example 7-3 Using the ENUM_ENCODING Attribute
attribute ENUM_ENCODING: STRING;
-- Attribute definition
type COLOR is (RED, GREEN, YELLOW, BLUE, VIOLET);
attribute ENUM_ENCODING of
COLOR: type is "010 000 011 100 001";
-- Attribute declaration
The enumeration values are encoded as follows:
RED = "010"
GREEN = "000"
YELLOW = "011"
BLUE = "100"
VIOLET = "001"
The result is GREEN < VIOLET < RED < YELLOW < BLUE.
Note:
The interpretation of the ENUM_ENCODING attribute is specific to
Presto VHDL. Other VHDL tools, such as simulators, use the
standard encoding (ordering).
[..]"
In timestamped Fri, 02 Mar 2007 15:55:46
+0000, Martin Thompson <
[email protected]> posted:
"[..]
Never used buffers, so I dunno about that!"
Apparently almost nobody used them. I never used them, I do not use
them.
"[..]
'Z' not being treated as high impedance by a synthesis tool;
It will be if the thing you are targetting has tristates. Either as
IOBs or internally."
Maybe Synplify does. Synopsys's pvhdl_5.pdf warns instead:
"5
Inferring Three-State Logic 5
Presto VHDL infers a three-state buffer when you assign the value of
Z to a signal or variable. The Z value represents the high-impedance
state. Presto VHDL infers one three-state buffer per process. You
can assign high-impedance values to single-bit or bused signals (or
variables). [..]
[..]
You cannot use the z value in an expression, except for
concatenation and comparison with z, such as in
if (IN_VAL = .Z.) then y<=0 endif;
This is an example of permissible use of the z value in an
expression, but it always evaluates to false. So it is also a
simulation/
synthesis mismatch.
[..]
Be careful when using expressions that compare with the z value.
Design Compiler always evaluates these expressions to false, and
the pre-synthesis and post-synthesis simulation results might differ.
For this reason, Presto VHDL issues a warning when it synthesizes
such comparisons."
In timestamped Fri, 02 Mar 2007 15:55:46
+0000 said:
values being ignored for synthesis;
Works in my tools."
In case someone tries to coerce you into using Synopsys: from
pvhdl_c.pdf :
"[..]
subprogram
Default values for parameters are unsupported. [..]
[..]"
In timestamped Fri, 02 Mar 2007 15:55:46
+0000, Martin Thompson <
[email protected]> posted:
"[..]
sensitivity lists being ignored for synthesis;
That depends on the tool.
Well, that covers a lot ;-)"
Needless to say ...
"[..]
This may be too much to expect for timing constraints, but I -- perhaps
naively -- do not see why an asynchronous design should be so dismissable.
How hard could it be to replace tools' warnings that a referenced signal
needs to be added to a sensitivity list with a rule in the language standard
which makes the omission from the sensitivity list illegal?
Because it might be handy for simulating something? I dunno to be
honest.
[..]"
I doubt it.
"[I am not an async expert but...] You can do async design in VHDL and
with synthesis, but proving correctness by simulation does not work
out as I understand it."
I do not have a clue.
"[..]
You may rightly deem that claim of mine to be unwarranted, but outside
of testbenches, I do not see what use the language is if it is not
transferrable to actual hardware.
What?! "Outside of testbenches, I do not see what use..." *Inside* of
testbenches is where I spend most of my coding time! The whole point
of having a rich language is to make running simulations easy.
The fact that we has a synthesisable subset is not a bad thing, just
how real life gets in the way. [..]"
It is possible to write testbenches for VHDL in a language other than
VHDL. I do not argue whether testbenches in VHDL or another language
are better. It is possible to synthesize code in a language other than
a dedicated hardware description language, and we interpret which of
synthesizable and unsynthesizable code are a side effect of
practicalities of reality. I am not trying to convince you on this
point, we simply think about it differently.
"I wish VHDL had *more* non synthesisable features
(like dynamic array sizing for example)."
I am aware of an initiative to add a feature, which may or may not be
synthesizable, to VHDL to aid verification, but I do not believe I had
heard a desire for VHDL to have "*more* non synthesisable features"
before .
" I'd like to write my
testbenches in Python
"
So why don't you?
HTTP://MyHDL.JanDecaluwe.com/doku.php
"[..]
Martin J. Thompson wrote:
"Multi dimensional arrays have worked (even in synthesis) for years in
my experience.
[..]"
Not always, and not with all tools. E.g. last month, someone
mentioned in
: "Using 2D-Arrays as I/O signals _may_ be a problem for some synthesis
tools. [..]"
Well, that's a bit weak ("*may* be a problem") - what tools do they
currently not work in?"
Ask the author of (Ralf
Hildebrandt). I am not personally aware of any.
Martin J. Thompson wrote:
"> I admit my next example is historical, but Table 7.1-1 Supported and
Unsupported Synthesis Constructs of Ben Cohen's second (1998) edition of
"VHDL Answers to Frequently Asked Questions" contains:
"[..]
[..] multidimensional arrays are not allowed
[..]"
Cheers,
C. P. G.
Yes, in the past it has been a problem. [..]"
By coincidence I was checking something else in the book Luca Fanucci,
"Digital Sistems Design Using VHDL", SEU, 2002 last week and it was
mentioned therein that multidimensional arrays are not
synthesizable. I do not know whether or not they actually were
supported for synthesis at that time.
Regards,
C.P.G.