Last change
on this file since 74 was
71,
checked in by rosiere, 17 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
|
Rev | Line | |
---|
[63] | 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 | |
---|
| 14 | namespace morpheo { |
---|
| 15 | |
---|
| 16 | inline uint32_t log2 (uint32_t value) |
---|
| 17 | { |
---|
| 18 | return static_cast<uint32_t>(ceil(::log2(value))); |
---|
| 19 | } |
---|
| 20 | |
---|
[67] | 21 | inline bool is_log2 (uint32_t value) |
---|
| 22 | { |
---|
| 23 | return (value == static_cast<uint32_t>((1<<(morpheo::log2(value))))); |
---|
| 24 | } |
---|
| 25 | |
---|
[63] | 26 | }; // end namespace morpheo |
---|
| 27 | |
---|
| 28 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.