source: trunk/IPs/systemC/processor/Morpheo/Common/include/Address.h @ 88

Last change on this file since 88 was 88, checked in by rosiere, 15 years ago

Almost complete design
with Test and test platform

  • Property svn:keywords set to Id
File size: 901 bytes
Line 
1#ifndef Morpheo_Address_h
2#define Morpheo_Address_h
3
4/*
5 * $Id: Address.h 88 2008-12-10 18:31:39Z rosiere $
6 *
7 * [ Description ]
8 *
9 */
10
11namespace morpheo              {
12
13  // get_tag, get_index, get_offset ...............
14  template <typename T>
15  T get_tag    (T value, uint32_t size_tag, uint32_t size_index, uint32_t size_offset) 
16  {
17    const T mask = gen_mask<T>(size_tag   ); 
18    return (value >> (size_index+size_offset)) & mask;
19  }
20 
21  template <typename T>
22  T get_index  (T value, uint32_t size_tag, uint32_t size_index, uint32_t size_offset) 
23  {
24    const T mask = gen_mask<T>(size_index ); 
25    return (value >> (           size_offset)) & mask;
26  }
27 
28  template <typename T>
29  T get_offset (T value, uint32_t size_tag, uint32_t size_index, uint32_t size_offset) 
30  {
31    const T mask = gen_mask<T>(size_offset); 
32    return (value                            ) & mask;
33  }
34
35}; // end namespace morpheo             
36
37#endif
Note: See TracBrowser for help on using the repository browser.