Re: Confused with "task" keyword.




"Chuck Gales" <cgales@xxxxxxxxx> wrote in message
news:pan.2005.07.27.11.32.05.617539@xxxxxxxxxxxx
> On Tue, 26 Jul 2005 21:37:57 +0800, Confused Frank wrote:
>
>> I wrote a task to feed test vectors to my design, however, I realized
>> some
>> differences between
>> "task" and the normal state machines I used to do. One sample code below,
>> I
>> am expecting the
>> the signal "trd_sample" to be delayed by one cycle of "trc", i.e. 2nd
>> posedge of trc. However,
>> why does the simulation shows on the first posedge of trc?
>>
>
> Frank,
> I am confused as to what behavior you are expecting. Your always@ block
> at the end will make trd_sample equal to trd every time that there is a
> posedge of trc. Since you are using non-blocking assigments, the signals
> are assigned immediately, with no regards to clocks. That also means
> that there is also no 'guarantee' of the order of assignment either. When
> you have three non-blocking assignments in sequence, the simulator might
> not execute them in the same order as written, generating some
> interesting race conditions.
>
> Chuck

Thank you Chuck.
I am done by putting a unit delay at txd & trw, and I have better
understanding
over non/blocking assignment now.


.



Relevant Pages

  • Re: Confused with "task" keyword.
    ... > posedge of trc. ... > why does the simulation shows on the first posedge of trc? ... Since you are using non-blocking assigments, ... that there is also no 'guarantee' of the order of assignment either. ...
    (comp.arch.embedded)
  • Re: Another generics question: List> ls = ?
    ... I was expecting to work the same way. ... However, this time both the add and get are ok, and it's the assignment of ls to al1 that fails. ... This is a pretty hairy edge case, but I can see it coming up if you had a Plugin interface and a list of its implementing classes and wanted to do something with any list of classes: ... public static void main{ ...
    (comp.lang.java.programmer)
  • Re: ordering in Verilog
    ... I thought this would cause a glitch if the next ... if there is no other assignment below. ... always @ (posedge clk) style blocks for synthesis. ... always @(posedge clock or posedge reset) ...
    (comp.lang.verilog)
  • Re: a problem with Socket
    ... > If your prof has set an assignment that requires both then you can rely on ... > that he or she is expecting you to recognise the need for threads and do ... > necessary programming. ...
    (comp.lang.java.programmer)
  • Re: What does `my do?!
    ... cleared at the end of the current scope. ... (Ilya was expecting that, if there be no right-hand side, it ... 'initialization' distinct from ordinary assignment. ...
    (comp.lang.perl.misc)