Re: [myhdl-list] simulation semantics
Brought to you by:
jandecaluwe
From: Geoffrey B. <geo...@in...> - 2009-07-16 14:29:21
|
Sorry, Moore should be Mealy On Thu, Jul 16, 2009 at 10:17 AM, Geoffrey Brown <geo...@in...>wrote: > I've been creating little examples to see if I understand the semantics of > myhdl. > I came across one where the behavior differs completely depending > upon the initial value of a signal (no problem there), but the generated > verilog > is identical -- see the attached and consider two alternatives: > > t = Signal(bool(not state)) > t = Signal(bool(0)) > > In the first case, the simulation does what I expected -- the state > alternates while in > the second case its frozen at its initial value. I can understand why this > might happen, > I'm just not sure it should. The fundamental issue has to do with > initialization of the > simulation. In the second case, the state is inconsistent with the > combinational > logic, but there is no event to trigger the necessary change. > > I was trying to understand how a Moore machine might be coded > and simulated in myhdl. I know this isn't always the design pattern of > choice, > but if you want to implement the handshake of communicating processes, this > is what falls out. > > Geoffrey Brown > > |