[sv-bc] Formatting strings using %b ???

From: Jonathan Bromley <jonathan.bromley_at_.....>
Date: Thu Jun 21 2007 - 23:37:37 PDT
hi SV-BC,
 
Copied to EC because it may relate to the current discussion of Mantis 1789.
 
I recently saw divergent behaviour between two simulators when I mistakenly
tried to display a SystemVerilog string variable using 
 
  string S = "something";
  $display("%b", S);
 
One simulator evidently cast the string to a vector of bits (traditional Verilog
string) and displayed that in binary.  The other displayed the string as a string.
Clearly, a third possibility would be to throw an error.
 
It's not completely clear to me which behaviour is correct.  Is a string an
unpacked, or a packed array of bytes (characters)? Or neither?
 
Thanks
-- 
Jonathan Bromley
 

-- This message has been scanned for viruses anddangerous content by MailScanner, and isbelieved to be clean.
Received on Thu Jun 21 23:38:11 2007

This archive was generated by hypermail 2.1.8 : Thu Jun 21 2007 - 23:39:27 PDT