[sv-ec] streaming operator - target cast

From: Rich, Dave <Dave_Rich_at_.....>
Date: Wed Mar 04 2009 - 13:15:49 PST
Given the example:

 

module streaming; 
  shortint j; 
  longint str_rev, str; 

 initial begin 
    j = 16'b1010_0011_1100_0101 ; 
    str_rev = { << {j}}; 
    str = { >> {j}}; 

    $displayb(str_rev);

    $displayb(str);
  end 

endmodule

 

I expect this to display

 

1010001111000101000000000000000000000000000000000000000000000000

1010001111000101000000000000000000000000000000000000000000000000

 

But other implementations disagree

 

P1800-2009/D8 says:

If the target is a data object of bit-stream type, the stream created by
the source streaming_concatenation shall be implicitly cast to the type
of the target.


I take "the stream created by the source streaming_concatenation" to
mean that the implicit cast is applied last. This could have been stated
more explicitly.

 

 

Dave

 

 


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Wed Mar 4 13:17:25 2009

This archive was generated by hypermail 2.1.8 : Wed Mar 04 2009 - 13:18:10 PST