Re: Next priority: Maximum value of simulation time

From: <john.aynsley@doulos.com>
Date: Mon Sep 13 2010 - 08:18:05 PDT

All,

Having discussed this internally, we've realized that a const does not
work because the time resolution can be changed during elaboration. The
following definition works, with the caveat that its value will change if
the time resolution is changed. Its value cannot change during simulation.

namespace sc_core {

  const sc_core::sc_time sc_max_time()
  {
     return
sc_core::sc_time(double(~0ULL)/sc_core::sc_get_time_resolution().to_seconds(),
sc_core::SC_SEC);
  }

}

John A

From:
David Long/doulos
To:
john.aynsley@doulos.com
Cc:
owner-systemc-p1666-technical@eda.org, systemc-p1666-technical@eda.org
Date:
13/09/2010 15:23
Subject:
Re: Next priority: Maximum value of simulation time

John,

I was thinking of something along the lines of:

Constant SC_MAX_TIME represents the maximum simulated time that may be
reached.

The definition could be implementation-defined. Alternatively it could be
implemented by something like:

const sc_time SC_MAX_TIME =
sc_time(double(~0ULL)/sc_get_time_resolution().to_seconds(), SC_SEC);

There is a constant UINT64_ZERO in sc_nbdefs.cpp that could be used in
place of 0ULL but that is not mentioned in IEEE 1666-2005.

Dave

From:
john.aynsley@doulos.com
To:
david.long@doulos.com, systemc-p1666-technical@eda.org
Date:
13/09/2010 13:46
Subject:
Next priority: Maximum value of simulation time
Sent by:
owner-systemc-p1666-technical@eda.org

Dave,

You wrote:

"5.10.1 states that time shall be represented internally by an unsigned
integer of at least 64 bits. However, it does not provide any method to
create an sc_time object that corresponds to the largest representable
time (the sc_time constructor that takes a numeric value has double
sc_time_unit arguments). One way to represent the maximum time would be to
declare a "constant" sc_time object (e.g. SC_MAX_TIME) that took acount of
the global time resolution that applies to the current simulation."

Could you provide a spec and/or implementation for what you propose?

Thanks,

John A

-- 
This message has been scanned for viruses and 
dangerous content by MailScanner, and is 
believed to be clean. 
-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Mon Sep 13 08:18:34 2010

This archive was generated by hypermail 2.1.8 : Mon Sep 13 2010 - 08:18:37 PDT