source: trunk/IPs/systemC/processor/Morpheo/Common/include/Log2.h @ 71

Last change on this file since 71 was 71, checked in by rosiere, 16 years ago

Modification of Statisctics
Add a new systemC component : Load_Store_Queue (tested with one benchmark and one configuration). Store don't supported the Data Buss Error (Load is supported)

File size: 434 bytes
Line 
1#ifndef morpheo_Log2
2#define morpheo_Log2
3
4/*
5 * $Id$
6 *
7 * [ Description ]
8 *
9 */
10
11#include <stdint.h>
12#include <math.h>
13
14namespace morpheo              {
15
16  inline uint32_t log2 (uint32_t value)
17  {
18    return static_cast<uint32_t>(ceil(::log2(value)));
19  }
20
21  inline bool is_log2 (uint32_t value)
22  {
23    return (value == static_cast<uint32_t>((1<<(morpheo::log2(value)))));
24  }
25
26}; // end namespace morpheo             
27
28#endif
Note: See TracBrowser for help on using the repository browser.