RE: [sv-bc] RE: [sv-ec] Formatting strings using %b ???

From: Jonathan Bromley <jonathan.bromley_at_.....>
Date: Sat Jun 23 2007 - 05:59:20 PDT
> If 'expr' is an expression that returns a string, could you 
> bitstream it before $displaying it?
> 
>       {>>{expr}}

Well... that makes good sense to me; but I think the current
LRM description of {<<{}} effectively says that you can't 
use the result directly, but must first copy it to some 
packed data object - at least, that's my reading of the
following text in D3a clause 11.4.15:

  The result of the pack operation can be assigned 
  directly to any bit-stream type variable. [...]
  The stream is not an integral value; to participate  
  in an expression, a cast is required.

That last sentence is somewhat ungrammatical, but to me 
it says that the data type of the result of {>>{}} is
ambiguous, and it must first be copied or cast to some
appropriate type.  Or, to put it a different way, it
is never appropriate to use {>>{}} in a self-determined
context.  All this is exactly as you describe in Mantis
1526.  It's clear to me that this precludes the use
of {>>{}} as one of the arguments to a formatting
system task.
-- 
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24 1AW, UK
Tel: +44 (0)1425 471223                   Email: jonathan.bromley@doulos.com
Fax: +44 (0)1425 471573                           Web: http://www.doulos.com

The contents of this message may contain personal views which 
are not the views of Doulos Ltd., unless specifically stated.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Sat Jun 23 05:59:56 2007

This archive was generated by hypermail 2.1.8 : Sat Jun 23 2007 - 06:00:31 PDT