Re: Ambiguities in certain combinations of SystemC sc_int/sc_fixed datatypes

From: <john.aynsley@doulos.com>
Date: Thu Dec 02 2010 - 20:43:24 PST

Philipp,

Could you please summarize for me the LRM changes needed here? Is it literally just two "explicit"s?

Thanks,

John A

-----"Philipp A. Hartmann" <philipp.hartmann@offis.de> wrote: -----
To: Andy Goodrich <acg@forteds.com>
From: "Philipp A. Hartmann" <philipp.hartmann@offis.de>
Date: 12/01/2010 10:23PM
Cc: John Aynsley <john.aynsley@doulos.com>, Bishnupriya Bhattacharya <bpriya@cadence.com>, David Long <david.long@doulos.com>, "Michael (Mac) McNamara" <mcnamara@cadence.com>, SystemC P1666 Technical <systemc-p1666-technical@eda.org>
Subject: Ambiguities in certain combinations of SystemC sc_int/sc_fixed datatypes

Andy,

on the P1666 technical reflector [1], Bishnupriya brought up a quite
long-standing issue related to unwanted operator ambiguities for
sc_(u)int(_base), that can arise when enabling the fixed-point types via
SC_INCLUDE_FX.

  As one of the possible solutions, I have then suggested to make the
conversion constructors from the builtin types of sc_fxval(_fast)
explicit, since seems to fix the issue (with some minor backwards
compatibility limitations), see [2] for a summary.

  There has been a side discussion with Mac, that there may be other
cases of ambiguities (longer expressions, purely containing sc_fixed),
which I could not reproduce with the reference simulator.

  Attached is an archive with a patch against the latest OSCI internal
version of the reference implementation providing the proposed change.
Would you please have a look at this issue and the proposed solution?
I'm afraid, that we might be missing some subtle corner case here...

Thanks,
  Philipp

1.
http://www.eda.org/systemc/systemc-p1666/systemc-p1666-technical/hm/0815.html
2.
http://www.eda.org/systemc/systemc-p1666/systemc-p1666-technical/hm/0828.html

Contents of attached archive:

sc_fxval_test.cpp

  quick test for some of the problematic expressions

0001-sc_fxval-_fast-make-ctors-explicit.patch

  patch to make some of the constructors of sc_fxval(_fast)
  explicit, unless SC_FXVAL_IMPLICIT_CONV is defined
  (for backwards compatibility, as suggested by David).

0001-fix-tests-for-sc_fxval-explicit-constructors.patch

  patch against the SystemC regression tests to fix the
  backwards compatibility issues in some of the fixed-point
  tests

0002-sc_dt-div_scfx_rep-fix-default-max-word-length.patch

  patch, fixing a bug in SystemC 2.3.09jul10_beta, where
  the default argument of the sc_dt::div_scfx_rep function
  has been broken (unrelated)

-- 
Philipp A. Hartmann
Hardware/Software Design Methodology Group
OFFIS Institute for Information Technology
R&D Division Transportation · FuE-Bereich Verkehr
Escherweg 2 · 26121 Oldenburg · Germany · http://offis.de/en/
Phone/Fax: +49-441-9722-420/282 · PGP: 0x9161A5C0 · Skype: phi.har
 
[attachment "sc_fxval_explicit.zip" removed by John Aynsley/doulos]
-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Thu Dec 2 20:43:58 2010

This archive was generated by hypermail 2.1.8 : Thu Dec 02 2010 - 20:43:59 PST