Proposal for Group O (Issue 44), SystemC Flavor of PSL

From: Erich Marschner <erichm@cadence.com>
Date: Tue Dec 28 2004 - 06:23:06 PST

Proposal for Group O (Issue 44), SystemC Flavor of PSL
===========================================

The following proposal presents a sketch of the definition of a SystemC flavor of PSL.

1. Flavor macros

The flavor macros would be extended with the following definitions, which follow the Verilog flavor for the most part, but also include references to a C++ nonterminal (constant_expression) and to SystemC class names:
 
DEF_SYM: '='
RANGE_SYM: ','
AND_OP: '&&'
OR_OP: '||'
NOT_OP: '!'
MIN_VAL: '0'
MAX_VAL: 'inf'
HDL_EXPR: /C++/_constant_expression
HDL_CLK_EXPR: SystemC_Event_Expr
HDL_UNIT: /SystemC_class/_sc_module
HDL_MOD_NAME: /SystemC_class/_sc_module_name
HDL_DECL: /SystemC/_declaration (needs further definition)
HDL_STMT: /SystemC/_statement (needs further definition)
HDL_RANGE: N/A
LEFT_SYM: '('
RIGHT_SYM: ')'

SystemC_Event_Expr would include the following:
   sc_event, sc_event *,
   sc_event_finder, sc_event_finder *,
   sc_event_and_list, sc_event_and_list *,
   sc_event_or_list, sc_event_or_list *,
   sc_signal, sc_port

2. Data types

In the SystemC flavor, PSL type classes Bit, Boolean, BitVector, Numeric, and String would include the set of SystemC types shown in each case:

Bit:
 bool,
 sc_bit,
 sc_logic

Boolean:
 built in data types:
  bool,
  char,
  unsigned char,
  signed char,
  short,
  unsigned short,
  int,
  unsigned int,
  long,
  unsigned long,
  long long,
  unsigned long long
 SystemC data types:
  sc_bit,
  sc_int,
  sc_uint,
  sc_bigint,
  sc_biguint
  sc_logic

BitVector:
 sc_bv,
 sc_lv,
 sc_int,
 sc_uint,
 sc_bigint,
 sc_biguint

Note that in SystemC, sc_bv and sc_lv do not have an implicit conversion to bool, which means that they can't be interpreted as true or false.

Numeric:
 Same as Boolean

3. Event expression forms that can be used as clock expressions:

HDL_CLK_EXPR (above)
rose, fell (where the argument is a port or signal of bool or sc_logic)

4. SystemC types returned by endpoints and built-in functions:

bool (with the exception of prev()).

Possible Issues
============

There is a grammar conflict between PSL and C++. The following PSL/SystemC boolean expression is ambiguous:

a -> b

It could mean either "a implies b" or "member b of object pointed to by a". This conflict can only arise if someone writes a boolean expression using a pointer to a data structure that contains a member with the same name as another identifier in scope. In such a case, the "HDL" interpretation (member reference) should take precedence over the PSL interpretation (implication) to resolve the conflict. The user can rename their variables to avoid the conflict if it ever arises.
Received on Tue Dec 28 06:23:11 2004

This archive was generated by hypermail 2.1.8 : Tue Dec 28 2004 - 06:23:11 PST