Changeset 101 for trunk/IPs/systemC/Environment
- Timestamp:
- Jan 15, 2009, 6:19:08 PM (16 years ago)
- Location:
- trunk/IPs/systemC/Environment
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/Environment/Cache/include/Cache_OneLevel.h
r81 r101 32 32 33 33 34 public : void reset (void); 35 public : void transition (void); 36 private : void update_lru (uint32_t familly, uint32_t num_associativity); 37 private : uint32_t index_victim (uint32_t familly); 38 private : Address translate_address (uint32_t address); 39 public : type_rsp_cache_t access (uint32_t num_port, uint32_t address, uint32_t trdid, type_req_cache_t type, direction_req_cache_t dir); 40 private : type_rsp_cache_t access_cached (uint32_t num_port, uint32_t address, uint32_t trdid, direction_req_cache_t dir); 41 private : type_rsp_cache_t access_uncached (uint32_t num_port, uint32_t address, uint32_t trdid); 42 private : type_rsp_cache_t access_invalidate (uint32_t num_port, uint32_t address, uint32_t trdid); 43 private : type_rsp_cache_t access_flush (uint32_t num_port, uint32_t address, uint32_t trdid); 44 private : uint32_t hit_write_buffer (uint32_t trdid, Address address); 45 private : uint32_t hit_cache (uint32_t trdid, Address address); 46 private : uint32_t hit_access_port (uint32_t trdid, Address address); 47 public : uint32_t need_slot (void); 48 public : uint32_t latence (uint32_t num_port); 49 public : uint32_t update_latence (uint32_t num_port, uint32_t latence); 50 public : std::string information (uint32_t depth); 34 public : void reset (void); 35 public : void transition (void); 36 private : void update_lru (uint32_t familly, uint32_t num_associativity); 37 private : uint32_t index_victim (uint32_t familly); 38 private : Address translate_address (uint32_t address); 39 public : type_rsp_cache_t access (uint32_t num_port, uint32_t address, uint32_t trdid, type_req_cache_t type, direction_req_cache_t dir); 40 private : type_rsp_cache_t access_cached (uint32_t num_port, uint32_t address, uint32_t trdid, direction_req_cache_t dir); 41 private : type_rsp_cache_t access_uncached (uint32_t num_port, uint32_t address, uint32_t trdid); 42 private : type_rsp_cache_t access_invalidate (uint32_t num_port, uint32_t address, uint32_t trdid); 43 private : type_rsp_cache_t access_flush (uint32_t num_port, uint32_t address, uint32_t trdid); 44 private : type_rsp_cache_t access_lock (uint32_t num_port, uint32_t address, uint32_t trdid); 45 private : type_rsp_cache_t access_prefetch (uint32_t num_port, uint32_t address, uint32_t trdid); 46 private : type_rsp_cache_t access_synchronization (uint32_t num_port, uint32_t address, uint32_t trdid); 47 private : uint32_t hit_write_buffer (uint32_t trdid, Address address); 48 private : uint32_t hit_cache (uint32_t trdid, Address address); 49 private : uint32_t hit_access_port (uint32_t trdid, Address address); 50 public : uint32_t need_slot (void); 51 public : uint32_t latence (uint32_t num_port); 52 public : uint32_t update_latence (uint32_t num_port, uint32_t latence); 53 public : std::string information (uint32_t depth); 51 54 52 55 public : friend std::ostream& operator<< (std::ostream& output, Cache_OneLevel & x); -
trunk/IPs/systemC/Environment/Cache/include/Types.h
r81 r101 32 32 typedef enum 33 33 { 34 CACHED , // address can be in the cache 35 UNCACHED , // Always miss (not address in cache) 36 INVALIDATE , // The direction is not used 37 PREFETCH , // The direction is not used 38 FLUSH // The direction is not used 34 CACHED , // address can be in the cache 35 UNCACHED , // Always miss (not address in cache) 36 INVALIDATE , // The direction is not used 37 PREFETCH , // The direction is not used 38 FLUSH , // The direction is not used 39 LOCK , // The direction is not used 40 SYNCHRONIZATION // The direction is not used 39 41 } type_req_cache_t; 40 42 -
trunk/IPs/systemC/Environment/Cache/src/Cache_OneLevel_access.cpp
r81 r101 20 20 // << " * direction : " << dir << std::endl; 21 21 22 // no difference with the simple read cached (have no add a prefetch cache) 22 23 switch (type) 23 24 { 24 case UNCACHED : return access_uncached (num_port,address,trdid ); break; 25 case INVALIDATE : return access_invalidate (num_port,address,trdid ); break; 26 case FLUSH : return access_flush (num_port,address,trdid ); break; 27 case PREFETCH : // no difference with the simple read cached (have no add a prefetch cache) 28 case CACHED : return access_cached (num_port,address,trdid,dir); break; 29 default : std::cout << "<Cache_Onelevel.access> unknow type : " << std::endl; exit(1); break; 25 case UNCACHED : return access_uncached (num_port,address,trdid ); break; 26 case INVALIDATE : return access_invalidate (num_port,address,trdid ); break; 27 case FLUSH : return access_flush (num_port,address,trdid ); break; 28 case PREFETCH : return access_prefetch (num_port,address,trdid ); break; 29 case LOCK : return access_lock (num_port,address,trdid ); break; 30 case SYNCHRONIZATION : return access_synchronization (num_port,address,trdid ); break; 31 case CACHED : return access_cached (num_port,address,trdid,dir); break; 32 default : std::cout << "<Cache_Onelevel.access> unknow type : " << std::endl; exit(1); break; 30 33 } 31 34 } -
trunk/IPs/systemC/Environment/Data/src/Data_entity.cpp
r81 r101 1 1 #include "../include/Data.h" 2 #include "../../Common/include/Debug.h" 2 3 3 4 namespace environment { … … 6 7 Entity Data::entity (uint32_t address, uint32_t size) 7 8 { 9 // _cout(DATA, " * Data::entity\n"); 10 // _cout(DATA, " * address : %.8x\n",address); 11 // _cout(DATA, " * size : %d\n" ,size ); 12 8 13 for (uint32_t num_seg = 0; num_seg < nb_seg; num_seg ++) 9 14 if (segment[num_seg]->test (address,size) == true) -
trunk/IPs/systemC/Environment/Data/src/Segment_test.cpp
r81 r101 1 1 #include "../include/Segment.h" 2 #include "../../Common/include/Debug.h" 2 3 3 4 namespace environment { … … 11 12 bool Segment::test (uint32_t address, uint32_t size) 12 13 { 14 // _cout(DATA," * Segment::test\n"); 15 // _cout(DATA," * address : %.8x\n",address ); 16 // _cout(DATA," * size : %d\n" ,size ); 17 // _cout(DATA," * segment base : %.8x\n",this->base); 18 // _cout(DATA," * segment size : %.8x\n",this->size); 19 13 20 bool res = (((address ) >= (this->base )) and 14 21 ((address+size) <= (this->base+this->size))); -
trunk/IPs/systemC/Environment/src/Cache_Access_dreq_type2cache_type.cpp
r81 r101 10 10 switch (dreq_type) 11 11 { 12 case DCACHE_TYPE_LOAD_8 : direction=cache::READ ; type=((uncached==true)?cache::UNCACHED:cache::CACHED); nb_bytes = 1;break;13 case DCACHE_TYPE_LOAD_16 : direction=cache::READ ; type=((uncached==true)?cache::UNCACHED:cache::CACHED); nb_bytes = 2;break;14 case DCACHE_TYPE_LOAD_32 : direction=cache::READ ; type=((uncached==true)?cache::UNCACHED:cache::CACHED); nb_bytes = 4;break;15 case DCACHE_TYPE_LOAD_64 : direction=cache::READ ; type=((uncached==true)?cache::UNCACHED:cache::CACHED); nb_bytes = 8;break;16 case DCACHE_TYPE_INVALIDATE : direction=cache::NONE ; type=cache::INVALIDATE ; nb_bytes = 1;break;17 case DCACHE_TYPE_FLUSH : direction=cache::NONE ; type=cache::FLUSH ; nb_bytes = 1;break;18 case DCACHE_TYPE_PREFETCH : direction=cache::NONE ; type=cache::INVALIDATE ; nb_bytes = 1;break;19 // case DCACHE_TYPE_STORE_8_ACK : direction=cache::WRITE; type=((uncached==true)?cache::UNCACHED:cache::CACHED); nb_bytes = 1;break;20 case DCACHE_TYPE_STORE_8 : direction=cache::WRITE; type=((uncached==true)?cache::UNCACHED:cache::CACHED); nb_bytes = 1;break;21 case DCACHE_TYPE_STORE_16 : direction=cache::WRITE; type=((uncached==true)?cache::UNCACHED:cache::CACHED); nb_bytes = 2;break;22 case DCACHE_TYPE_STORE_32 : direction=cache::WRITE; type=((uncached==true)?cache::UNCACHED:cache::CACHED); nb_bytes = 4;break;23 case DCACHE_TYPE_STORE_64 : direction=cache::WRITE; type=((uncached==true)?cache::UNCACHED:cache::CACHED); nb_bytes = 8;break;24 case DCACHE_TYPE_ LOCK :25 case DCACHE_TYPE_ SYNCHRONIZATION :12 case DCACHE_TYPE_LOAD_8 : direction=cache::READ ;type=((uncached==true)?cache::UNCACHED:cache::CACHED);nb_bytes = 1;break; 13 case DCACHE_TYPE_LOAD_16 : direction=cache::READ ;type=((uncached==true)?cache::UNCACHED:cache::CACHED);nb_bytes = 2;break; 14 case DCACHE_TYPE_LOAD_32 : direction=cache::READ ;type=((uncached==true)?cache::UNCACHED:cache::CACHED);nb_bytes = 4;break; 15 case DCACHE_TYPE_LOAD_64 : direction=cache::READ ;type=((uncached==true)?cache::UNCACHED:cache::CACHED);nb_bytes = 8;break; 16 case DCACHE_TYPE_INVALIDATE : direction=cache::NONE ;type=cache::INVALIDATE ;nb_bytes = 1;break; 17 case DCACHE_TYPE_FLUSH : direction=cache::NONE ;type=cache::FLUSH ;nb_bytes = 1;break; 18 case DCACHE_TYPE_PREFETCH : direction=cache::NONE ;type=cache::PREFETCH ;nb_bytes = 1;break; 19 // case DCACHE_TYPE_STORE_8_ACK : direction=cache::WRITE;type=((uncached==true)?cache::UNCACHED:cache::CACHED);nb_bytes = 1;break; 20 case DCACHE_TYPE_STORE_8 : direction=cache::WRITE;type=((uncached==true)?cache::UNCACHED:cache::CACHED);nb_bytes = 1;break; 21 case DCACHE_TYPE_STORE_16 : direction=cache::WRITE;type=((uncached==true)?cache::UNCACHED:cache::CACHED);nb_bytes = 2;break; 22 case DCACHE_TYPE_STORE_32 : direction=cache::WRITE;type=((uncached==true)?cache::UNCACHED:cache::CACHED);nb_bytes = 4;break; 23 case DCACHE_TYPE_STORE_64 : direction=cache::WRITE;type=((uncached==true)?cache::UNCACHED:cache::CACHED);nb_bytes = 8;break; 24 case DCACHE_TYPE_SYNCHRONIZATION : direction=cache::NONE ;type=cache::SYNCHRONIZATION ;nb_bytes = 1;break; 25 case DCACHE_TYPE_LOCK : direction=cache::NONE ;type=cache::LOCK ;nb_bytes = 1;break; 26 26 default : {std::cerr << "<ireq_type2cache_type> Unkown type (" << dreq_type << ")" << std::endl; exit(1);} 27 27 } -
trunk/IPs/systemC/Environment/src/Cache_Access_ireq_type2cache_type.cpp
r81 r101 13 13 case ICACHE_TYPE_INVALIDATE : {direction=cache::NONE ; type=cache::INVALIDATE; break;} 14 14 case ICACHE_TYPE_PREFETCH : {direction=cache::NONE ; type=cache::PREFETCH ; break;} 15 case ICACHE_TYPE_LOCK : 15 case ICACHE_TYPE_LOCK : {direction=cache::NONE ; type=cache::LOCK ; break;} 16 16 default : {std::cerr << "<ireq_type2cache_type> Unkown type (" << ireq_type << ")" << std::endl; exit(1);} 17 17 } -
trunk/IPs/systemC/Environment/src/Environment_transition.cpp
r88 r101 1 1 #include "../include/Environment.h" 2 3 #define CYCLE_MAX 0 4 #include "../../processor/Morpheo/Common/include/Test.h" 2 5 3 6 using namespace morpheo; … … 171 174 uint32_t size = param->daccess_size_data [i]/8; 172 175 173 // _cout(ENVIRONMENT," * information\n"); 174 // _cout(ENVIRONMENT," * context : %d\n" ,static_cast<uint32_t>(context)); 175 // _cout(ENVIRONMENT," * packet : %d\n" ,static_cast<uint32_t>(packet )); 176 // _cout(ENVIRONMENT," * address : %.x\n",static_cast<uint32_t>(address)); 177 // _cout(ENVIRONMENT," * type : %d\n" ,static_cast<uint32_t>(type )); 178 // _cout(ENVIRONMENT," * size : %d\n" ,static_cast<uint32_t>(size )); 179 180 // search the entity 181 data::Entity entity = component_data->entity(static_cast<uint32_t>(address),size); 182 183 std::cout << entity << std::endl; 176 _cout(ENVIRONMENT," * information\n"); 177 _cout(ENVIRONMENT," * context : %d\n" ,static_cast<uint32_t>(context)); 178 _cout(ENVIRONMENT," * packet : %d\n" ,static_cast<uint32_t>(packet )); 179 _cout(ENVIRONMENT," * address : %.x\n",static_cast<uint32_t>(address)); 180 _cout(ENVIRONMENT," * type : %d\n" ,static_cast<uint32_t>(type )); 181 _cout(ENVIRONMENT," * size : %d\n" ,static_cast<uint32_t>(size )); 184 182 185 183 bool uncached = false; … … 209 207 default :{ must_read=false; must_write=false; must_ack=false; must_ack_on_error=false; break;} 210 208 } 209 210 // search the entity 211 data::Entity entity = component_data->entity(static_cast<uint32_t>(address),nb_bytes); 212 213 std::cout << entity << std::endl; 211 214 212 215 // Test the type of the address … … 250 253 ,static_cast<uint32_t>((wdata>> 0)&0xff) 251 254 ); 255 256 if (wdata == 0) 257 std::cout << STR_OK << std::endl; 258 else 259 std::cout << STR_KO << std::endl; 252 260 253 261 stop (context); … … 289 297 // Read 290 298 _cout(ENVIRONMENT," * Read (%d bytes)\n",size); 291 bus_error |= !component_data->read(address, size,read_dram[0]); // always read a complete word299 bus_error |= !component_data->read(address,nb_bytes,read_dram[0]); // always read a complete word 292 300 293 301 _cout(ENVIRONMENT," * Rdata : "); 294 for (uint32_t i=0; i< size; i++)302 for (uint32_t i=0; i<nb_bytes; i++) 295 303 _cout(ENVIRONMENT,"%.2x",0xff&static_cast<uint32_t>(read_dram[0][i])); 296 304 _cout(ENVIRONMENT,".\n");
Note: See TracChangeset
for help on using the changeset viewer.