A
Amir
Guest
Hi,
does "posedge" samples the transition from "x" to "1" or only from "0"
to "1" ?
Thanks
-Amir
does "posedge" samples the transition from "x" to "1" or only from "0"
to "1" ?
Thanks
-Amir
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Anything in a vaguely upward direction. 0->X, X->1, 0->1 all countdoes "posedge" samples the transition from "x" to "1" or only from "0"
to "1" ?
Both 'x' to '1' and 'z' to '1' should be detected as posedge inHi,
does "posedge" samples the transition from "x" to "1" or only from "0"
to "1" ?
To be an accurate simulation, it should randomly triggerOn Mon, 14 Mar 2011 02:29:30 -0700 (PDT), Amir <sting.t2@gmail.com
wrote:
does "posedge" samples the transition from "x" to "1" or only from "0"
to "1" ?
Both 'x' to '1' and 'z' to '1' should be detected as posedge in
addition to '0' to 'x' and '0' to 'z'.
Jonathan -On Mon, 14 Mar 2011 02:29:30 -0700 (PDT), Amir wrote:
does "posedge" samples the transition from "x" to "1" or only from "0"
to "1" ?
Anything in a vaguely upward direction. 0->X, X->1, 0->1 all count
as a posedge.
I don't see what this has to do with Verilog.Muzaffer Kal <kal@dspia.com> wrote:
Both 'x' to '1' and 'z' to '1' should be detected as posedge in
addition to '0' to 'x' and '0' to 'z'.
To be an accurate simulation, it should randomly trigger
on changes to/from 'x' or 'z'...
If the input has enough pull-up, though, it will trigger on
an output going to 'z'.
(then I wrote)Muzaffer Kal <kal@dspia.com> wrote:
Both 'x' to '1' and 'z' to '1' should be detected as posedge in
addition to '0' to 'x' and '0' to 'z'.
I completely agree. If one has a design that triggersTo be an accurate simulation, it should randomly trigger
on changes to/from 'x' or 'z'...
If the input has enough pull-up, though, it will trigger on
an output going to 'z'.
I don't see what this has to do with Verilog.
No digital simulator can ever possibly claim to do
"accurate simulation". The simulator implements a
programming language, following the defined rules
of that language.
Yes. I was trying to point out differences betweenMuzaffer Kal (and I, less
thoroughly) outlined those rules. For sure,
they do not represent "accurate simulation" (see
my little anecdote about jittery clocks). But
they're what any Verilog simulator is required
to do, by the language rules. Of course, the
language is designed to provide a useful
approximation to "accurate simulation"; but
if you want accuracy you need Spice![]()
TTL inputs usually have enough pull-up to go high,As far as pullup is concerned, it might be worth
mentioning again how Z works in Verilog. If you
provide a pullup on a net (for example by connecting
a pullup() primitive to it), and then drive the net
with a Z value from some other driver, the net's
value will become 1 and a posedge operator on the
net would have no need to deal with a Z at all.
But if there is no pullup on the net, and you
drive the net with Z, then the net's value really
will be Z.
I wouldn't agree with that. I would like to see any transition thatOn Mon, 14 Mar 2011 02:29:30 -0700 (PDT), Amir <sting...@gmail.com
wrote:
Hi,
does "posedge" samples the transition from "x" to "1" or only from "0"
to "1" ?
Both 'x' to '1' and 'z' to '1' should be detected as posedge in
addition to '0' to 'x' and '0' to 'z'.
--
Muzaffer Kal
DSPIA INC.
ASIC/FPGA Design Services
http://www.dspia.com
What I stated was not a personal opinion but a statement of fact asOn Mar 15, 1:57 am, Muzaffer Kal <k...@dspia.com> wrote:
On Mon, 14 Mar 2011 02:29:30 -0700 (PDT), Amir <sting...@gmail.com
wrote:
Hi,
does "posedge" samples the transition from "x" to "1" or only from "0"
to "1" ?
Both 'x' to '1' and 'z' to '1' should be detected as posedge in
addition to '0' to 'x' and '0' to 'z'.
I wouldn't agree with that.
Various IEEE P1800 (aka SystemVerilog, aka Verilog as we know itI would like to see any transition that
doesn't have a defined logic level at both ends cause the output of a
FF to assume an 'x' or 'u' value.
That's how it's defined in the Verilog specification. posedge isOn Mar 15, 1:57Â am, Muzaffer Kal <k...@dspia.com> wrote:
On Mon, 14 Mar 2011 02:29:30 -0700 (PDT), Amir <sting...@gmail.com
wrote:
Hi,
does "posedge" samples the transition from "x" to "1" or only from "0"
to "1" ?
Both 'x' to '1' and 'z' to '1' should be detected as posedge in
addition to '0' to 'x' and '0' to 'z'.
--
Muzaffer Kal
DSPIA INC.
ASIC/FPGA Design Services
http://www.dspia.com
I wouldn't agree with that. I would like to see any transition that
doesn't have a defined logic level at both ends cause the output of a
FF to assume an 'x' or 'u' value. I'm not sure Verilog has a 'u'
value, but I assume it does. I'm more familiar with VHDL.
[Muzaffer Kal]that
doesn't have a defined logic level at both ends cause the output of a
FF to assume an 'x' or 'u' value.
There certainly won't be a 'u' value, ever!Various IEEE P1800 (aka SystemVerilog, aka Verilog as we know it
today) subcommittees are in session right now; you might want to take
it up with them but I think it's unlikely that there'll be a change in
this regard.
Many of us felt that it was putting too much application-specific
stuff into what should be a general-purpose language; after all, you
can already model such things [FFs] perfectly well with UDPs, and
people who write gate-level cell models certainly do that.
Yes, this also needs to be considered. All the complicating factors arehi Cary
For the interested here's the remaining problem.
Given a FF with a defined D input that is opposite the current Q value a
0->X on the clock should produce an X on the output but a subsequent
x->1 should correctly latch the value because at this point in time you
know an edge has occurred. You could actually code this in the UDP as
x->1 latches the D input, but that doesn't work since a 1->x followed by
a x->1 doesn't work correctly (should be undefined). I believe with a
second UDP I can record the previous transition type and then restrict
the x->1 latching to the case where it was proceeded by a 0->x. Even
better is a C model linked into the simulator, but I want to get this
straight with basic Verilog (which is portable) first.
Sounds cool. But I'm not sure... I think you
also need to model the effect of changes on
D during (clock===X), because X->1 on the
clock after that D change does not necessarily
mean that there's been an active clock during
the time when D had its new value.
Thanks, If I was implementing this with behavioral code I'm sure I'dAnyways, I could offer something like this.
Sounds cool. But I'm not sure... I think youFor the interested here's the remaining problem.
Given a FF with a defined D input that is opposite the current Q value a
0->X on the clock should produce an X on the output but a subsequent
x->1 should correctly latch the value because at this point in time you
know an edge has occurred. You could actually code this in the UDP as
x->1 latches the D input, but that doesn't work since a 1->x followed by
a x->1 doesn't work correctly (should be undefined). I believe with a
second UDP I can record the previous transition type and then restrict
the x->1 latching to the case where it was proceeded by a 0->x. Even
better is a C model linked into the simulator, but I want to get this
straight with basic Verilog (which is portable) first.
When you say "should be" that sounds like an opinion to me. But I getOn Wed, 16 Mar 2011 22:24:42 -0700 (PDT), rickman <gnu...@gmail.com
wrote:
On Mar 15, 1:57 am, Muzaffer Kal <k...@dspia.com> wrote:
On Mon, 14 Mar 2011 02:29:30 -0700 (PDT), Amir <sting...@gmail.com
wrote:
Hi,
does "posedge" samples the transition from "x" to "1" or only from "0"
to "1" ?
Both 'x' to '1' and 'z' to '1' should be detected as posedge in
addition to '0' to 'x' and '0' to 'z'.
I wouldn't agree with that.
What I stated was not a personal opinion but a statement of fact as
far as 1364 is concerned.
It wouldn't be their first mistake! It is just obvious to me that youI would like to see any transition that
doesn't have a defined logic level at both ends cause the output of a
FF to assume an 'x' or 'u' value.
Various IEEE P1800 (aka SystemVerilog, aka Verilog as we know it
today) subcommittees are in session right now; you might want to take
it up with them but I think it's unlikely that there'll be a change in
this regard.
"application specific"??? Verilog is for logic, no? The whole xCliff Cummings proposed a new set of special keywords -
something like "always_x", "always_ff_x" etc, but I'm
not sure of the details - to provide built-in modelling
for this kind of X-management. Many of us felt that it
was putting too much application-specific stuff into
Yes, that is just what I want to do. Rather than the languagewhat should be a general-purpose language; after all,
you can already model such things perfectly well with
UDPs, and people who write gate-level cell models
certainly do that. Anyway, for better or worse it
didn't make the cut for things to consider in the
2012 revision of IEEE-1800.
There is a far cry from treating a transition between a booleanNote that the usual VHDL flipflop modelling style
does nothing at all if there's an X or U on the
clock - it certainly doesn't drive the FF's
output to X. And, once again, it's easy to provide
such modelling explicitly if you can be bothered
to do so.
Sure there can always be issues that are hard to fix. This isn't oneThe usual RTL abstraction, in either VHDL or Verilog,
is intended for the modelling, simulation and
synthesis of functional behaviour at the clock
cycle level. It has many well-known limitations,
of which this is only one. For most of us,
though, the benefits massively outweigh those
limitations, and we have tools (both automated
and mental) for coping with the limitations.
I don't know that there is much value in providing this sort ofOn 3/17/2011 2:58 AM, Jonathan Bromley wrote:
Many of us felt that it was putting too much application-specific
stuff into what should be a general-purpose language; after all, you
can already model such things [FFs] perfectly well with UDPs, and
people who write gate-level cell models certainly do that.
I would say you can adequately model a FF with a well crafted UDP, but
it's amazing how many cell libraries only provide the basic
functionality and hardly any pessimism. I have developed what I consider
the definitive UDP that models a FF with asynchronous set/reset and even
it is not as good as I would like. It's fundamentally limited by the
functionality available in a UDP. I think with a second helper UDP I can
get all the functionality I desire, but I've been busy with other things
so I have not finished this.
For the interested here's the remaining problem.
Given a FF with a defined D input that is opposite the current Q value a
0->X on the clock should produce an X on the output but a subsequent
x->1 should correctly latch the value because at this point in time you
know an edge has occurred. You could actually code this in the UDP as
x->1 latches the D input, but that doesn't work since a 1->x followed by
a x->1 doesn't work correctly (should be undefined). I believe with a
second UDP I can record the previous transition type and then restrict
the x->1 latching to the case where it was proceeded by a 0->x. Even
better is a C model linked into the simulator, but I want to get this
straight with basic Verilog (which is portable) first.
In reality you shouldn't have an X in your clock tree, so this is really
a personal experiment to see how far you can push things.
Cary
[Rickman]Note that the usual VHDL flipflop modelling style
does nothing at all if there's an X or U on the
clock - it certainly doesn't drive the FF's
output to X.
No, there isn't. Some people still write their VHDL flopsThere is a far cry from treating a transition between a boolean
undefined state and a 1 as a rising clock edge and ignoring the
transition altogether.
I disagree, but I'm fully aware that many peopleSure there can always be issues that are hard
to fix. This isn't one of them.
Last time I checked out gate level simulation (which isA simulation language's X value, in any of its various
flavours, is a trick to make Boolean algebra work even
when you have certain unknowable conditions.