Jump to content

Search the Community

Showing results for tags 'sc_time'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Accellera Systems Initiative
    • Information
    • Announcements
    • In the News
  • SystemC
    • SystemC Language
    • SystemC AMS (Analog/Mixed-Signal)
    • SystemC TLM (Transaction-level Modeling)
    • SystemC Verification (UVM-SystemC, SCV, CRAVE, FC4SC)
    • SystemC CCI (Configuration, Control & Inspection)
    • SystemC Datatypes
  • UVM (Universal Verification Methodology)
    • UVM (IEEE 1800.2) - Methodology and BCL Forum
    • UVM SystemVerilog Discussions
    • UVM Simulator Specific Issues
    • UVM Commercial Announcements
    • UVM (Pre-IEEE) Methodology and BCL Forum
  • Portable Stimulus
    • Portable Stimulus Discussion
    • Portable Stimulus 2.0 Public Review Feedback
  • IP Security
    • SA-EDI Standard Discussion
    • IP Security Assurance Whitepaper Discussion
  • IP-XACT
    • IP-XACT Discussion
  • SystemRDL
    • SystemRDL Discussion
  • IEEE 1735/IP Encryption
    • IEEE 1735/IP Encryption Discussion
  • Commercial Announcements
    • Announcements

Categories

  • SystemC
  • UVM
  • UCIS
  • IEEE 1735/IP Encryption

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Biography


Location


Interests


Occupation


Company

Found 1 result

  1. The time at which a packet is generated is stored in the header of the packet. The header allocates only 32 bits for this timestamp. For any variable of type sc_time T_start, T_start.to_default_time_unit() will return the number of clock cycles if default time unit is configured to (CLK_PERIOD, SC_NS). The question here is how to convert sc_time values to 32 bits unsigned integer without large loss of precision. At the producer side this piece of code runs each time is generated: sc_time t_start = sc_time_stamp(); double magnitude = t_start.to_default_time_unit(); // number of clock cycles since the start of the simulation until this time (is this correct?) unsigned int t_start_u_32 = (unsigned int) std::round(magnitude); // possible loss of precision if magnitude is too large to be presented in 32 bits // store t_start_u_32 in the correspondent packet header field. At the consumer side (an arbiter that selects packets depending on their age) double t_start_ret = t_start_u_32 * CLK_PERIOD; sc_time t_start(t_start_ret, SC_NS); sc_time packet_age = sc_time_stamp() - t_start; Is there any good way to manipulate sc_time variables, default time unit, round/cast operations without loosing precision under the constraint of 32 bits?
×
×
  • Create New...