Changeset 689 for trunk


Ignore:
Timestamp:
May 14, 2014, 5:15:58 PM (10 years ago)
Author:
porquet
Message:

hard_linux_monocluster: display simulation frequency

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/platforms/linux_monocluster/top.cpp

    r667 r689  
    581581        }
    582582    } else {
    583         sc_start();
     583        uint64_t n;
     584        struct timeval t1, t2;
     585
     586        gettimeofday(&t1, NULL);
     587
     588        for (n = 1; ; n++) {
     589            /* stats display */
     590            if ((n % 5000000) == 0) {
     591                gettimeofday(&t2, NULL);
     592
     593                uint64_t ms1 = (uint64_t)t1.tv_sec * 1000ULL +
     594                    (uint64_t)t1.tv_usec / 1000;
     595                uint64_t ms2 = (uint64_t)t2.tv_sec * 1000ULL +
     596                    (uint64_t)t2.tv_usec / 1000;
     597                std::cerr << "platform clock frequency "
     598                    << (double)5000000 / (double)(ms2 - ms1) << "Khz" << std::endl;
     599
     600                gettimeofday(&t1, NULL);
     601            }
     602
     603            sc_start(sc_core::sc_time(1, SC_NS));
     604        };
    584605    }
    585606
Note: See TracChangeset for help on using the changeset viewer.