- Timestamp:
- Jun 26, 2009, 10:43:23 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/Environment/src/Environment_genMoore.cpp
r127 r128 1 1 #include "../include/Environment.h" 2 #include "../../processor/Morpheo/Common/include/Systemc.h" 2 3 3 4 using namespace morpheo; … … 7 8 void Environment::genMoore (void) 8 9 { 10 _cout(ENVIRONMENT, " [%d] <Environment::genMoore>\n",static_cast<uint32_t>(simulation_cycle())); 11 9 12 //Scan all entity and for each entity scan all port 10 13 for (uint32_t i = 0; i < param->nb_entity; i++) … … 32 35 // init 33 36 for (uint32_t j = 0; j < param->icache_dedicated_nb_port [i]; j ++) 34 icache_rsp_val [i][j] = 0; 37 { 38 icache_rsp_val [i][j] = 0; 39 icache_rsp_num [i][j] = 0; 40 } 35 41 36 _cout(ENVIRONMENT, " buffer_irsp [%d] : nb_slot_use %d\n",i,component_buffer_irsp [i]->nb_slot_use());42 _cout(ENVIRONMENT, " * buffer_irsp [%d] : nb_slot_use %d\n",i,component_buffer_irsp [i]->nb_slot_use()); 37 43 for (uint32_t j = 0; j+1 <= component_buffer_irsp [i]->nb_slot_use(); j ++) 38 44 { … … 45 51 bool val = ((slot._delay == 0) and (icache_rsp_val [i][port] == 0)); 46 52 47 _cout(ENVIRONMENT, " buffer_irsp [%d][%d] - delay %d - port %d\n",i,j,slot._delay,port);53 _cout(ENVIRONMENT, " * buffer_irsp [%d][%d] - delay %d - port %d\n",i,j,slot._delay,port); 48 54 49 55 50 56 if (val) 51 57 { 52 _cout(ENVIRONMENT, " ICACHE_RSP [%d][%d] - respons valid\n",i,port);58 _cout(ENVIRONMENT, " * ICACHE_RSP [%d][%d] - respons valid\n",i,port); 53 59 54 60 icache_rsp_val [i][port] = 1; 61 icache_rsp_num [i][port] = j; 55 62 56 63 ICACHE_RSP_CONTEXT_ID [i][port]->write(slot._data->trdid); // TODO : test if exist … … 93 100 //----------------------------------------------------------------------------- 94 101 { 102 // init 95 103 for (uint32_t j = 0; j < param->dcache_dedicated_nb_port [i]; j ++) 104 { 105 dcache_rsp_val [i][j] = 0; 106 dcache_rsp_num [i][j] = 0; 107 } 108 109 for (uint32_t j = 0; j+1 <= component_buffer_drsp [i]->nb_slot_use(); j ++) 96 110 { 97 // Test the number of element in the respons's buffer 98 if (j >= component_buffer_drsp [i]->nb_slot_use()) 99 { 100 dcache_rsp_val [i][j] = 0; // No respons 101 } 102 else 103 { 104 queue::slot_t<drsp_t*> slot = component_buffer_drsp [i]->read(j); 111 queue::slot_t<drsp_t*> slot = component_buffer_drsp [i]->read(j); 112 113 uint32_t port = slot._data->port; 114 bool val = ((slot._delay == 0) and (dcache_rsp_val [i][port] == 0)); 115 116 if (val) 117 { 118 _cout(ENVIRONMENT, " * DCACHE_RSP [%d][%d] - respons valid\n",i,port); 119 120 dcache_rsp_val [i][port] = 1; 121 dcache_rsp_num [i][port] = j; 122 123 DCACHE_RSP_CONTEXT_ID [i][port]->write(slot._data->trdid); // TODO : test if exist 124 DCACHE_RSP_PACKET_ID [i][port]->write(slot._data->pktid); // TODO : test if exist 125 DCACHE_RSP_ERROR [i][port]->write(slot._data->error); 126 127 Tdcache_data_t data = 0; 128 atoi (slot._data->data[0], data, param->daccess_size_data[i]/8); 129 130 DCACHE_RSP_RDATA [i][port]->write(data); 131 } 132 } 105 133 106 bool val = (slot._delay == 0); // respons if have a result 107 108 dcache_rsp_val [i][j] = (val); // respons if have a result 109 110 if (val) 111 { 112 _cout(ENVIRONMENT, "DCACHE_RSP [%d][%d] - respons valid\n",i,j); 113 114 DCACHE_RSP_CONTEXT_ID [i][j]->write(slot._data->trdid); // TODO : test if exist 115 DCACHE_RSP_PACKET_ID [i][j]->write(slot._data->pktid); // TODO : test if exist 116 DCACHE_RSP_ERROR [i][j]->write(slot._data->error); 117 118 Tdcache_data_t data = 0; 119 atoi (slot._data->data[0], data, param->daccess_size_data[i]/8); 120 121 DCACHE_RSP_RDATA [i][j]->write(data); 122 } 123 } 124 DCACHE_RSP_VAL [i][j]->write (dcache_rsp_val [i][j]); 125 } 134 for (uint32_t j = 0; j < param->dcache_dedicated_nb_port [i]; j ++) 135 DCACHE_RSP_VAL [i][j]->write (dcache_rsp_val [i][j]); 126 136 } 127 137 }
Note: See TracChangeset
for help on using the changeset viewer.