Last change
on this file since 131 was
81,
checked in by rosiere, 16 years ago
|
- Finish Environment (and test)
- Continue predictor_unit
- Add external tools
- svn keyword "Id" set
|
-
Property svn:keywords set to
Id
|
File size:
830 bytes
|
Line | |
---|
1 | #include "../include/Cache_OneLevel.h" |
---|
2 | |
---|
3 | namespace environment { |
---|
4 | namespace cache { |
---|
5 | namespace cache_onelevel { |
---|
6 | |
---|
7 | Address Cache_OneLevel::translate_address (uint32_t address) |
---|
8 | { |
---|
9 | Address address_translated; |
---|
10 | uint32_t shift; |
---|
11 | |
---|
12 | address_translated.offset = (address & ((uint32_t)-1 >> (32-(size_address.offset )))); |
---|
13 | address -= address_translated.offset; |
---|
14 | shift = size_address.offset; |
---|
15 | address_translated.familly = (address & ((uint32_t)-1 >> (32-(size_address.familly + shift))))>>shift; |
---|
16 | address -= address_translated.familly; |
---|
17 | shift += size_address.familly; |
---|
18 | address_translated.tag = (address & ((uint32_t)-1 >> (32-(size_address.tag + shift))))>>shift; |
---|
19 | |
---|
20 | return address_translated; |
---|
21 | } |
---|
22 | |
---|
23 | }; |
---|
24 | }; |
---|
25 | }; |
---|
Note: See
TracBrowser
for help on using the repository browser.