- Timestamp:
- Dec 4, 2007, 2:31:54 PM (17 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural
- Files:
-
- 11 added
- 3 deleted
- 65 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/src/test.cpp
r59 r62 10 10 #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/include/test.h" 11 11 #include "Common/include/Test.h" 12 #include "Common/include/BitManipulation.h" 12 13 13 14 #define NB_ITERATION 1 … … 43 44 44 45 46 //========================================================={MemoryRequest_t} 45 47 class MemoryRequest_t 46 48 { … … 146 148 return os << "<" << toString(x._cycle) << "> : " 147 149 << "{" << toString(static_cast<uint32_t>(x._packet_id)) << "}" << endl 148 << "\t * " << toString(static_cast<uint32_t>(x._context_id)) << endl149 << "\t * " << toString(static_cast<uint32_t>(x._operation)) << " " << toString(static_cast<uint32_t>(x._type)) << " " << toString(static_cast<uint32_t>(x._write_spec_ko)) << endl150 << "\t * " << toString(static_cast<uint32_t>(x._store_queue_ptr_write)) << " " << toString(static_cast<uint32_t>(x._load_queue_ptr_write)) << endl151 << "\t * " << toString(static_cast<uint32_t>(x._immediat)) << " - " << toString(static_cast<uint32_t>(x._data_ra)) << " - " << toString(static_cast<uint32_t>(x._data_rb)) << endl152 << "\t * " << toString(static_cast<uint32_t>(x._write_rd)) << " " << toString(static_cast<uint32_t>(x._num_reg_rd)) << endl;150 << "\t * context_id : " << toString(static_cast<uint32_t>(x._context_id)) << endl 151 << "\t * operation / type / write_spec_ko : " << toString(static_cast<uint32_t>(x._operation)) << " " << toString(static_cast<uint32_t>(x._type)) << " " << toString(static_cast<uint32_t>(x._write_spec_ko)) << endl 152 << "\t * ptr_write store/load : " << toString(static_cast<uint32_t>(x._store_queue_ptr_write)) << " " << toString(static_cast<uint32_t>(x._load_queue_ptr_write)) << endl 153 << "\t * immediat / data_ra / data_rb : " << toString(static_cast<uint32_t>(x._immediat)) << " - " << toString(static_cast<uint32_t>(x._data_ra)) << " - " << toString(static_cast<uint32_t>(x._data_rb)) << endl 154 << "\t * write_rd / num_reg_rd : " << toString(static_cast<uint32_t>(x._write_rd)) << " " << toString(static_cast<uint32_t>(x._num_reg_rd)) << endl; 153 155 } 154 156 157 //================================================================{Memory_t} 158 class Memory_t 159 { 160 private : const uint32_t _nb_context; 161 private : const uint32_t _nb_word ; 162 private : const uint32_t _size_data ; 163 private : const Tdcache_address_t _mask_addr ; 164 private : Tdcache_data_t ** _data; 165 166 public : Memory_t (uint32_t nb_context, 167 uint32_t nb_word, 168 uint32_t size_data): 169 _nb_context (nb_context), 170 _nb_word (nb_word ), 171 _size_data (size_data ), 172 _mask_addr (gen_mask<Tdcache_address_t>(static_cast<uint32_t>(log2(ceil(static_cast<double>(size_data)))))) 173 { 174 _data = new Tdcache_data_t * [nb_context]; 175 176 for (uint32_t i=0; i<nb_context; i++) 177 { 178 _data [i] = new Tdcache_data_t [nb_word]; 179 180 for (uint32_t j=0; j<nb_word; j++) 181 _data [i][j] = rand()%(size_data); 182 } 183 } 184 185 public : ~Memory_t (void) 186 { 187 delete [] _data; 188 } 189 190 public : Tdcache_data_t access (uint32_t context, 191 Tdcache_address_t address, 192 Tdcache_type_t type, 193 Tdcache_data_t data) 194 { 195 return 0; 196 } 197 198 public : Tdcache_data_t read (uint32_t context, 199 Tdcache_address_t address, 200 Tdcache_type_t type) 201 { 202 // Address's Read must be aligned 203 204 if ((address & _mask_addr) != 0) 205 TEST_KO("<Memory_t::read> Address is not aligned"); 206 207 if (context>_nb_context) 208 TEST_KO("<Memory_t::read> nb context is too high"); 209 210 if (address>_nb_word) 211 TEST_KO("<Memory_t::read> address is too high"); 212 213 return _data [context][address]; 214 } 215 216 public : void write (uint32_t context, 217 Tdcache_address_t address, 218 Tdcache_type_t type, 219 Tdcache_data_t data) 220 { 221 if (context>_nb_context) 222 TEST_KO("<Memory_t::read> nb context is too high"); 223 224 if (address>_nb_word) 225 TEST_KO("<Memory_t::read> address is too high"); 226 227 Tdcache_address_t LSB = address & _mask; 228 Tdcache_address_t MSB = address & ~_mask; 229 230 Tdcache_data_t write_data = data; 231 Tdcache_data_t read_data = _data [context][MSB]; 232 233 // exemple to size_data = 32b 234 // LSB index_min 235 // 0 0 236 // 1 8 237 // 2 16 238 // 3 24 239 uint32_t index_min = LSB<<3; 240 uint32_t index_max = index_min; 241 // index max, dependant of access's size 242 243 switch (type) 244 { 245 246 247 } 248 } 249 }; 250 251 //===================================================================={test} 155 252 void test (string name, 156 253 morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Parameters * _param) … … 252 349 (*(_Load_store_unit-> in_MEMORY_IN_PACKET_ID ))(*( in_MEMORY_IN_PACKET_ID )); 253 350 (*(_Load_store_unit-> in_MEMORY_IN_OPERATION ))(*( in_MEMORY_IN_OPERATION )); 254 (*(_Load_store_unit-> in_MEMORY_IN_TYPE ))(*( in_MEMORY_IN_TYPE ));255 351 (*(_Load_store_unit-> in_MEMORY_IN_STORE_QUEUE_PTR_WRITE))(*( in_MEMORY_IN_STORE_QUEUE_PTR_WRITE)); 256 352 (*(_Load_store_unit-> in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE ))(*( in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE )); … … 269 365 (*(_Load_store_unit->out_MEMORY_OUT_CONTEXT_ID ))(*(out_MEMORY_OUT_CONTEXT_ID )); 270 366 (*(_Load_store_unit->out_MEMORY_OUT_PACKET_ID ))(*(out_MEMORY_OUT_PACKET_ID )); 271 (*(_Load_store_unit->out_MEMORY_OUT_OPERATION ))(*(out_MEMORY_OUT_OPERATION ));272 (*(_Load_store_unit->out_MEMORY_OUT_TYPE ))(*(out_MEMORY_OUT_TYPE ));273 367 (*(_Load_store_unit->out_MEMORY_OUT_WRITE_RD ))(*(out_MEMORY_OUT_WRITE_RD )); 274 368 (*(_Load_store_unit->out_MEMORY_OUT_NUM_REG_RD ))(*(out_MEMORY_OUT_NUM_REG_RD )); … … 322 416 const uint32_t nb_word = nb_request; 323 417 324 const uint32_t cst_max_cycle = 2; 325 326 const int32_t percent_transaction_memory_in = 100; 418 //const int32_t percent_transaction_memory_in = 100; 327 419 const int32_t percent_transaction_memory_out = 100; 328 420 const int32_t percent_transaction_dcache = 100; … … 331 423 const int32_t percent_type_load = 0; 332 424 const int32_t percent_type_store = 100; 333 const int32_t percent_miss_spec = 100;425 const int32_t percent_miss_spec = 0; 334 426 335 427 if ((percent_type_load + … … 337 429 TEST_KO("sum of percent_type > 100"); 338 430 339 const int32_t seuil_type_load = seuil_type_load;340 const int32_t seuil_type_store = seuil_type_store+percent_type_load;431 const int32_t seuil_type_load = percent_type_load; 432 const int32_t seuil_type_store = percent_type_store+percent_type_load; 341 433 342 434 uint32_t nb_request_memory_in ; … … 347 439 priority_queue<MemoryRequest_t> fifo_request; 348 440 441 // emulation of cache 349 442 Tdcache_data_t cache_data [_param->_nb_context][nb_word]; 350 443 … … 371 464 for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++) 372 465 { 466 LABEL("Iteration "+toString(iteration)); 467 468 LABEL("Structure's initialisation"); 469 373 470 nb_request_memory_in = 0; 374 471 nb_request_memory_out = 0; 375 472 nb_request_dcache = 0; 376 473 377 LABEL("Iteration "+toString(iteration));378 379 474 // Fill the request_queue 380 475 … … 390 485 load_queue_use [i] = false; 391 486 392 double store_queue_cycle [_param->_size_store_queue];393 double load_queue_cycle [_param->_size_load_queue ];394 487 double current_cycle = sc_simulation_time(); 395 396 for (uint32_t i=0; i<_param->_size_store_queue; i++) 397 store_queue_cycle [i] = current_cycle; 398 for (uint32_t i=0; i<_param->_size_load_queue ; i++) 399 load_queue_cycle [i] = current_cycle; 400 488 double cycle_min = current_cycle; 489 490 LABEL("Fifo request initialisation"); 401 491 // Init fifo_request 402 492 for (uint32_t i=0; i<nb_request; i++) 403 493 { 404 double cycle = current_cycle+(rand()%(cst_max_cycle*nb_request));494 double cycle; 405 495 Tcontext_t context_id = rand () % _param->_nb_context; 406 496 Tpacket_t packet_id = i; … … 411 501 int32_t percent = rand()%100; 412 502 413 if (percent < seuil_type_load) 503 uint32_t size_queue; 504 505 if (percent <= seuil_type_load) 414 506 { 415 operation = OPERATION_MEMORY_LOAD_16_S; 416 load_queue_ptr_write = (load_queue_ptr_write+1) % (_param->_size_load_queue); 417 } 418 else 419 if (percent < seuil_type_store) 420 { 421 operation = OPERATION_MEMORY_STORE_16; 422 store_queue_ptr_write = (store_queue_ptr_write+1) % (_param->_size_store_queue); 423 } 424 else 425 { 426 operation = OPERATION_MEMORY_PREFETCH; 427 load_queue_ptr_write = (load_queue_ptr_write+1) % (_param->_size_load_queue); 428 } 429 430 // Valid nb cycle ? 431 if (is_operation_memory_store(operation)) 432 { 433 if (cycle <= store_queue_cycle[packet_id]) 434 cycle = store_queue_cycle[packet_id]+1; 507 // LABEL(" * LOAD"); 508 operation = OPERATION_MEMORY_LOAD_16_S; 509 size_queue = _param->_size_load_queue; 510 load_queue_ptr_write = (load_queue_ptr_write+1) % (size_queue); 435 511 } 436 512 else 437 513 { 438 if (cycle <= load_queue_cycle[packet_id]) 439 cycle = load_queue_cycle[packet_id]+1; 514 if (percent <= seuil_type_store) 515 { 516 // LABEL(" * STORE"); 517 operation = OPERATION_MEMORY_STORE_16; 518 size_queue = _param->_size_store_queue; 519 store_queue_ptr_write = (store_queue_ptr_write+1) % (size_queue); 520 } 521 else 522 { 523 // LABEL(" * OTHERS"); 524 operation = OPERATION_MEMORY_PREFETCH; 525 size_queue = _param->_size_load_queue; 526 load_queue_ptr_write = (load_queue_ptr_write+1) % (size_queue); 527 } 440 528 } 441 529 530 cycle = cycle_min; 531 cycle_min ++; 532 442 533 Ttype_t type = TYPE_MEMORY; 443 444 Tgeneral_data_t address = rand()%(1<<_param->_size_general_data); 445 Tgeneral_data_t offset = rand()%(1<<_param->_size_general_data); 534 Tgeneral_data_t address = rand()%(nb_word); 535 Tgeneral_data_t offset = rand()%(nb_word); 446 536 447 537 percent = rand()%100; … … 474 564 ); 475 565 566 cout << tab_request [i] << endl; 567 476 568 fifo_request.push(tab_request [i]); 477 569 570 double cycle_head = 0; 571 478 572 if (is_operation_memory_store(operation)) 479 573 { 480 cycle = cycle+((rand()%(10))-4); 481 482 if (cycle <= store_queue_cycle[packet_id]) 483 cycle = store_queue_cycle[packet_id]+1; 484 485 fifo_request.push(MemoryRequest_t(cycle, 574 cycle_head = cycle_min; 575 cycle_min ++; 576 577 cout << " * Write head : " << toString(cycle_head) 578 << endl 579 << endl; 580 581 fifo_request.push(MemoryRequest_t(cycle_head, 486 582 context_id, 487 583 packet_id, … … 497 593 write_spec_ko)); 498 594 } 499 500 // update nb cycle ? 501 if (is_operation_memory_store(operation)) 502 { 503 store_queue_cycle[packet_id] = cycle; 504 } 505 else 506 { 507 load_queue_cycle [packet_id] = cycle; 508 } 509 } 510 595 } 596 597 LABEL("Simulation of this iteration ..."); 598 511 599 while (nb_request_memory_out < nb_request) 512 600 { 601 // ***** MEMORY_IN ***** 602 603 // memory_in_val depends of three factors : 604 // 1) request's fifo is not empty ? 605 // 2) the slot destination is free ? 606 // 3) The head of request's fifo can be issue : the number of cycle is more than current cycle 607 513 608 bool can_execute = false; 514 609 … … 535 630 536 631 in_MEMORY_OUT_ACK->write((rand()%100)<percent_transaction_memory_out); 537 632 633 // ***** DCACHE_REQ ***** 634 in_DCACHE_REQ_ACK->write((rand()%100)<percent_transaction_dcache); 635 538 636 SC_START(0); 539 637 … … 541 639 542 640 LABEL("MEMORY_IN : "+toString(in_MEMORY_IN_VAL ->read())+" - "+toString(out_MEMORY_IN_ACK ->read())); 641 LABEL(" * fifo_request.empty : "+toString(fifo_request.empty())); 642 LABEL(" * fifo_request.top.cycle : "+toString(fifo_request.top()._cycle)); 643 LABEL(" * fifo_request.top.store_queue_ptr_write : "+toString(static_cast<uint32_t>(fifo_request.top()._store_queue_ptr_write))); 644 LABEL(" * fifo_request.top.load_queue_ptr_write : "+toString(static_cast<uint32_t>(fifo_request.top()._load_queue_ptr_write))); 645 LABEL(" * fifo_request.top.operation : "+toString(static_cast<uint32_t>(fifo_request.top()._operation ))); 646 LABEL(" * can_execute : "+toString(can_execute)); 647 543 648 if ( in_MEMORY_IN_VAL ->read() and out_MEMORY_IN_ACK ->read()) 544 649 { … … 562 667 if (out_MEMORY_OUT_VAL->read() and in_MEMORY_OUT_ACK->read()) 563 668 { 564 LABEL(" * Accepted MEMORY_OUT : " + toString( out_MEMORY_OUT_PACKET_ID->read()));669 LABEL(" * Accepted MEMORY_OUT : " + toString(static_cast<uint32_t>(out_MEMORY_OUT_PACKET_ID->read()))); 565 670 566 671 if (is_operation_memory_store(tab_request[out_MEMORY_OUT_PACKET_ID->read()]._operation)) … … 571 676 nb_request_memory_out ++; 572 677 } 678 679 LABEL("DCACHE_REQ : "+toString(out_DCACHE_REQ_VAL->read())+" - "+toString(in_DCACHE_REQ_ACK ->read())); 680 if (out_DCACHE_REQ_VAL->read() and in_DCACHE_REQ_ACK->read()) 681 { 682 LABEL(" * Accepted DCACHE_REQ : " + toString(static_cast<uint32_t>(out_DCACHE_REQ_PACKET_ID->read()))); 683 684 // test type : send or not a respons ! 685 } 686 573 687 } 574 688 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Load_store_unit.h
r59 r62 7 7 * [ Description ] 8 8 * 9 * Ce composant peut être amélioré en placant deux ptr de lecture au lieu d'un : un pour l'accès au cache et un pour le commit 9 10 */ 10 11 … … 12 13 #include "systemc.h" 13 14 #endif 14 15 #define HAVE_MEMORY_OUT_OPERATION16 #define HAVE_MEMORY_OUT_TYPE17 15 18 16 #include <iostream> … … 79 77 public : SC_IN (Tpacket_t ) * in_MEMORY_IN_PACKET_ID ; 80 78 public : SC_IN (Toperation_t ) * in_MEMORY_IN_OPERATION ; 81 #ifdef HAVE_MEMORY_OUT_TYPE82 public : SC_IN (Ttype_t ) * in_MEMORY_IN_TYPE ;83 #endif84 79 public : SC_IN (Tlsq_ptr_t ) * in_MEMORY_IN_STORE_QUEUE_PTR_WRITE; 85 80 public : SC_IN (Tlsq_ptr_t ) * in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE; … … 99 94 public : SC_OUT(Tcontext_t ) * out_MEMORY_OUT_CONTEXT_ID; 100 95 public : SC_OUT(Tpacket_t ) * out_MEMORY_OUT_PACKET_ID ; 101 #ifdef HAVE_MEMORY_OUT_OPERATION102 public : SC_OUT(Toperation_t ) * out_MEMORY_OUT_OPERATION ;103 #endif104 #ifdef HAVE_MEMORY_OUT_TYPE105 public : SC_OUT(Ttype_t ) * out_MEMORY_OUT_TYPE ;106 #endif107 96 public : SC_OUT(Tcontrol_t ) * out_MEMORY_OUT_WRITE_RD ; // = (operation==load) 108 97 public : SC_OUT(Tgeneral_address_t) * out_MEMORY_OUT_NUM_REG_RD; // destination (load) … … 154 143 // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 155 144 145 // Registers 156 146 public : Tlsq_ptr_t internal_MEMORY_STORE_QUEUE_PTR_READ; 157 public : Tlsq_ptr_t internal_MEMORY_LOAD_QUEUE_PTR_READ; 158 147 public : Tlsq_ptr_t internal_MEMORY_LOAD_QUEUE_PTR_READ ; 148 149 // signal 159 150 private : Tcontrol_t internal_MEMORY_IN_ACK; 160 151 private : Tcontrol_t internal_MEMORY_OUT_VAL; 161 152 private : Tselect_queue_t internal_MEMORY_OUT_SELECT_QUEUE; 153 154 private : Tcontrol_t internal_DCACHE_REQ_VAL; 155 private : Tselect_queue_t internal_DCACHE_REQ_SELECT_QUEUE; 162 156 #endif 163 157 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Parameters.h
r59 r62 26 26 { 27 27 //-----[ fields ]------------------------------------------------------------ 28 public : const uint32_t _size_store_queue ;29 public : const uint32_t _size_load_queue ;28 public : const uint32_t _size_store_queue ; 29 public : const uint32_t _size_load_queue ; 30 30 public : const uint32_t _size_speculative_access_queue; 31 public : const uint32_t _nb_port_check ; 32 public : const Tspeculative_load_t _speculative_load ; 33 public : const uint32_t _nb_context ; 34 public : const uint32_t _nb_packet ; 35 public : const uint32_t _size_general_data ; 36 public : const uint32_t _nb_general_register ; 37 public : const uint32_t _nb_operation ; 38 public : const uint32_t _nb_type ; 31 public : const uint32_t _nb_port_check ; 32 public : const Tspeculative_load_t _speculative_load ; 33 //public : const uint32_t _nb_cache_port ; 34 public : const uint32_t _nb_context ; 35 public : const uint32_t _nb_packet ; 36 public : const uint32_t _size_general_data ; 37 public : const uint32_t _nb_general_register ; 38 public : const uint32_t _nb_operation ; 39 public : const uint32_t _nb_type ; 39 40 40 41 public : const uint32_t _size_address_store_queue ; 41 42 public : const uint32_t _size_address_load_queue ; 42 43 public : const uint32_t _size_address_speculative_access_queue; 43 public : const uint32_t _size_context_id ;44 public : const uint32_t _size_packet_id ;45 public : const uint32_t _size_general_register ;46 public : const uint32_t _size_operation ;47 public : const uint32_t _size_type ;44 public : const uint32_t _size_context_id ; 45 public : const uint32_t _size_packet_id ; 46 public : const uint32_t _size_general_register ; 47 public : const uint32_t _size_operation ; 48 public : const uint32_t _size_type ; 48 49 49 50 //-----[ methods ]----------------------------------------------------------- … … 60 61 uint32_t nb_type 61 62 ); 63 62 64 public : Parameters (Parameters & param) ; 63 65 public : ~Parameters () ; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Types.h
r59 r62 56 56 public : Tcontext_t _context_id ; 57 57 public : Tpacket_t _packet_id ; 58 public : T access_t _access;58 public : Tdcache_type_t _dcache_type ; 59 59 public : Tcontrol_t _uncached ; 60 #ifdef HAVE_MEMORY_OUT_OPERATION61 public : Toperation_t _operation ;62 #endif63 #ifdef HAVE_MEMORY_OUT_TYPE64 public : Ttype_t _type ;65 #endif66 60 public : Tlsq_ptr_t _load_queue_ptr_write; 67 61 public : Tdcache_data_t _address ; … … 70 64 //public : Tgeneral_address_t _num_reg_rd ; 71 65 public : Texception_t _exception ; 66 67 friend ostream & operator << (ostream& os, const Tstore_queue_entry_t & x) 68 { 69 return os << " * state : " << x._state << endl 70 << " * packet - context_id : " << toString(static_cast<uint32_t>(x._packet_id )) << " - " << toString(static_cast<uint32_t>(x._context_id)) << endl 71 << " * type - uncached : " << toString(static_cast<uint32_t>(x._dcache_type )) << " - " << toString(static_cast<uint32_t>(x._uncached )) << endl 72 << " * load_ptr - execption : " << toString(static_cast<uint32_t>(x._load_queue_ptr_write)) << " - " << toString(static_cast<uint32_t>(x._exception )) << endl 73 << " * address - wdata : " << toString(static_cast<uint32_t>(x._address )) << " - " << toString(static_cast<uint32_t>(x._wdata )) << endl; 74 } 72 75 }; 76 77 73 78 74 79 // ---------------------------------------------------------- … … 91 96 public : Tcontrol_t _uncached ; 92 97 public : Tcontrol_t _sign_extension ; 93 #ifdef HAVE_MEMORY_OUT_OPERATION94 public : Toperation_t _operation ;95 #endif96 #ifdef HAVE_MEMORY_OUT_TYPE97 public : Ttype_t _type ;98 #endif99 98 public : Tlsq_ptr_t _load_queue_ptr_write ; 100 99 public : Tlsq_ptr_t _store_queue_ptr_write; … … 128 127 public : Tcontrol_t _uncached ; 129 128 public : Tcontrol_t _sign_extension ; 130 #ifdef HAVE_MEMORY_OUT_OPERATION131 public : Toperation_t _operation ;132 #endif133 #ifdef HAVE_MEMORY_OUT_TYPE134 public : Ttype_t _type ;135 #endif136 129 public : Tlsq_ptr_t _store_queue_ptr_write; 137 130 public : Tdcache_address_t _address ; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_allocation.cpp
r59 r62 67 67 in_MEMORY_IN_PACKET_ID = interface->set_signal_in <Tpacket_t > ("packet_id" ,_param->_size_packet_id ); 68 68 in_MEMORY_IN_OPERATION = interface->set_signal_in <Toperation_t > ("operation" ,_param->_size_operation ); 69 #ifdef HAVE_MEMORY_OUT_TYPE70 in_MEMORY_IN_TYPE = interface->set_signal_in <Ttype_t > ("type" ,_param->_size_type );71 #endif72 69 in_MEMORY_IN_STORE_QUEUE_PTR_WRITE = interface->set_signal_in <Tlsq_ptr_t > ("store_queue_ptr_write" ,_param->_size_address_store_queue); 73 70 in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE = interface->set_signal_in <Tlsq_ptr_t > ("load_queue_ptr_write" ,_param->_size_address_load_queue ); … … 97 94 out_MEMORY_OUT_CONTEXT_ID = interface->set_signal_out <Tcontext_t > ("context_id" ,_param->_size_context_id ); 98 95 out_MEMORY_OUT_PACKET_ID = interface->set_signal_out <Tpacket_t > ("packet_id" ,_param->_size_packet_id ); 99 #ifdef HAVE_MEMORY_OUT_OPERATION100 out_MEMORY_OUT_OPERATION = interface->set_signal_out <Toperation_t > ("operation" ,_param->_size_operation );101 #endif102 #ifdef HAVE_MEMORY_OUT_TYPE103 out_MEMORY_OUT_TYPE = interface->set_signal_out <Ttype_t > ("type" ,_param->_size_type );104 #endif105 96 out_MEMORY_OUT_WRITE_RD = interface->set_signal_out <Tcontrol_t > ("write_rd" ,1 ); 106 97 out_MEMORY_OUT_NUM_REG_RD = interface->set_signal_out <Tgeneral_address_t> ("num_reg_rd" ,_param->_size_general_register ); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_deallocation.cpp
r59 r62 38 38 delete in_MEMORY_IN_PACKET_ID ; 39 39 delete in_MEMORY_IN_OPERATION ; 40 #ifdef HAVE_MEMORY_OUT_TYPE41 delete in_MEMORY_IN_TYPE ;42 #endif43 40 delete in_MEMORY_IN_STORE_QUEUE_PTR_WRITE; 44 41 delete in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE ; … … 57 54 delete out_MEMORY_OUT_CONTEXT_ID; 58 55 delete out_MEMORY_OUT_PACKET_ID ; 59 #ifdef HAVE_MEMORY_OUT_OPERATION60 delete out_MEMORY_OUT_OPERATION ;61 #endif62 #ifdef HAVE_MEMORY_OUT_TYPE63 delete out_MEMORY_OUT_TYPE ;64 #endif65 56 delete out_MEMORY_OUT_WRITE_RD ; 66 57 delete out_MEMORY_OUT_NUM_REG_RD; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_function_speculative_load_commit_genMoore.cpp
r59 r62 28 28 // ~~~~~[ Interface "memory_out" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 29 29 30 // Test store and load queue31 30 Tcontext_t memory_out_context_id = 0; 32 31 Tpacket_t memory_out_packet_id = 0; 33 #ifdef HAVE_MEMORY_OUT_OPERATION34 Toperation_t memory_out_operation = 0;35 #endif36 #ifdef HAVE_MEMORY_OUT_TYPE37 Ttype_t memory_out_type = 0;38 #endif39 32 Tcontrol_t memory_out_write_rd = 0; 40 33 Tgeneral_address_t memory_out_num_reg_rd = 0; … … 47 40 internal_MEMORY_OUT_VAL = 0; 48 41 49 // TODO : now only store queue 42 // Test store and load queue 43 // TODO : il faut d'abord tester si un elment de l'access queue n'est pas commitable !!!!!!! 50 44 51 45 // Test an store must be commited. 52 53 54 46 if (_store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._state == STORE_QUEUE_COMMIT) 55 47 { … … 59 51 memory_out_context_id= _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._context_id; 60 52 memory_out_packet_id = _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._packet_id ; 61 #ifdef HAVE_MEMORY_OUT_OPERATION62 memory_out_operation = _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._operation;63 #endif64 #ifdef HAVE_MEMORY_OUT_TYPE65 memory_out_type = _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._type;66 #endif67 53 // memory_out_write_rd 68 54 // memory_out_num_reg_rd … … 71 57 } 72 58 59 // write output 73 60 PORT_WRITE(out_MEMORY_OUT_VAL , internal_MEMORY_OUT_VAL); 74 61 75 62 PORT_WRITE(out_MEMORY_OUT_CONTEXT_ID, memory_out_context_id); 76 63 PORT_WRITE(out_MEMORY_OUT_PACKET_ID , memory_out_packet_id ); 77 #ifdef HAVE_MEMORY_OUT_OPERATION78 PORT_WRITE(out_MEMORY_OUT_OPERATION , memory_out_operation );79 #endif80 #ifdef HAVE_MEMORY_OUT_TYPE81 PORT_WRITE(out_MEMORY_OUT_TYPE , memory_out_type );82 #endif83 64 PORT_WRITE(out_MEMORY_OUT_WRITE_RD , memory_out_write_rd ); 84 65 PORT_WRITE(out_MEMORY_OUT_NUM_REG_RD, memory_out_num_reg_rd); … … 89 70 PORT_WRITE(out_MEMORY_OUT_EXCEPTION , memory_out_exception ); 90 71 72 // ~~~~~[ Interface "dache_req" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 91 73 74 Tcontext_t dcache_req_context_id; 75 Tpacket_t dcache_req_packet_id ; 76 Tdcache_address_t dcache_req_address ; 77 Tdcache_type_t dcache_req_type ; 78 Tcontrol_t dcache_req_uncached ; 79 Tdcache_data_t dcache_req_wdata ; 80 81 internal_DCACHE_REQ_VAL = 0; 82 83 // Test store and load queue 84 85 // TODO : il faut d'abord tester si un elment de l'access queue n'est pas commitable !!!!!!! 86 87 // Test an store must be commited. 88 if (_store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._state == STORE_QUEUE_VALID_NO_SPECULATIVE) 89 { 90 internal_DCACHE_REQ_VAL = 1; 91 internal_DCACHE_REQ_SELECT_QUEUE = SELECT_STORE_QUEUE; 92 93 dcache_req_context_id = _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._context_id; 94 dcache_req_packet_id = _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._packet_id ; 95 dcache_req_address = _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._address ; 96 dcache_req_type = _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._dcache_type; 97 dcache_req_uncached = _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._uncached ; 98 dcache_req_wdata = _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._wdata ; 99 } 100 101 PORT_WRITE(out_DCACHE_REQ_VAL , internal_DCACHE_REQ_VAL); 102 PORT_WRITE(out_DCACHE_REQ_CONTEXT_ID, dcache_req_context_id); 103 PORT_WRITE(out_DCACHE_REQ_PACKET_ID , dcache_req_packet_id ); 104 PORT_WRITE(out_DCACHE_REQ_ADDRESS , dcache_req_address ); 105 PORT_WRITE(out_DCACHE_REQ_TYPE , dcache_req_type ); 106 PORT_WRITE(out_DCACHE_REQ_UNCACHED , dcache_req_uncached ); 107 PORT_WRITE(out_DCACHE_REQ_WDATA , dcache_req_wdata ); 108 92 109 log_printf(FUNC,Load_store_unit,FUNCTION,"End"); 93 110 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_function_speculative_load_commit_transition.cpp
r59 r62 57 57 // others in speculation_access_queue 58 58 59 Toperation_t operation = PORT_READ(in_MEMORY_IN_OPERATION); 60 Tgeneral_data_t address = (PORT_READ(in_MEMORY_IN_IMMEDIAT) + 61 PORT_READ(in_MEMORY_IN_DATA_RA )); 62 63 bool exception_alignement= (mask_memory_access(operation) & address) != 0; 59 Toperation_t operation = PORT_READ(in_MEMORY_IN_OPERATION); 60 Tgeneral_data_t address = (PORT_READ(in_MEMORY_IN_IMMEDIAT) + 61 PORT_READ(in_MEMORY_IN_DATA_RA )); 62 bool exception_alignement = (mask_memory_access(operation) & address) != 0; 64 63 65 64 if (is_operation_memory_store(operation) == true) … … 159 158 _store_queue [index]._context_id = PORT_READ(in_MEMORY_IN_CONTEXT_ID ); 160 159 _store_queue [index]._packet_id = PORT_READ(in_MEMORY_IN_PACKET_ID ); 161 #ifdef HAVE_MEMORY_OUT_OPERATION 162 _store_queue [index]._operation = operation; 163 #endif 164 #ifdef HAVE_MEMORY_OUT_TYPE 165 _store_queue [index]._type = PORT_READ(in_MEMORY_IN_TYPE ); 166 #endif 160 _store_queue [index]._dcache_type = operation_to_dcache_type(operation); 161 _store_queue [index]._uncached = 0; // is the MMU that have this info 167 162 _store_queue [index]._load_queue_ptr_write = PORT_READ(in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE); 168 163 _store_queue [index]._address = address; … … 217 212 } 218 213 } 214 215 //================================================================ 216 // Interface "DCACHE_REQ" 217 //================================================================ 218 if (( internal_DCACHE_REQ_VAL == 1) and 219 (PORT_READ(in_DCACHE_REQ_ACK) == 1)) 220 { 221 switch (internal_DCACHE_REQ_SELECT_QUEUE) 222 { 223 case SELECT_STORE_QUEUE : 224 { 225 // ======================= 226 // ===== STORE_QUEUE ===== 227 // ======================= 228 229 // Entry flush and increase the read pointer 230 231 _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._state = STORE_QUEUE_COMMIT; 232 233 break; 234 } 235 case SELECT_LOAD_QUEUE : 236 case SELECT_LOAD_QUEUE_SPECULATIVE : 237 break; 238 } 239 } 240 241 #if DEBUG>=DEBUG_TRACE 242 // ***** dump store queue 243 cout << "Dump store queue" << endl 244 << "ptr_read : " << toString(static_cast<uint32_t>(internal_MEMORY_STORE_QUEUE_PTR_READ)) << endl; 245 246 for (uint32_t i=0; i<_param->_size_store_queue; i++) 247 { 248 uint32_t j = (internal_MEMORY_STORE_QUEUE_PTR_READ+i)%_param->_size_store_queue; 249 cout << "{" << j << "}" << endl 250 << _store_queue[j] << endl; 251 } 252 #endif 219 253 } 220 254 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/SelfTest/src/test.cpp
r60 r62 112 112 sc_signal<Tspecial_address_t> *** in_RETIRE_ROB_RE_NEW_NUM_REG ; 113 113 114 string rename ;114 string rename = "signal"; 115 115 116 116 in_CLOCK = new sc_clock ("clock", 1.0, 0.5); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/src/Register_unit_allocation.cpp
r60 r62 370 370 #endif 371 371 372 _component->port_map(name_component,"in_CLOCK" , _name, "in_CLOCK");373 _component->port_map(name_component,"in_NRESET" , _name, "in_NRESET");372 _component->port_map(name_component,"in_CLOCK" , _name, "in_CLOCK"); 373 _component->port_map(name_component,"in_NRESET" , _name, "in_NRESET"); 374 374 375 375 for (uint32_t j=0; j<_param->_nb_gpr_read; j++) … … 733 733 _component->port_map(name_component,"in_CLOCK" , _name, "in_CLOCK" ); 734 734 _component->port_map(name_component,"in_NRESET", _name, "in_NRESET"); 735 735 _component->port_map(name_component,"out_CONST_0"); 736 _component->port_map(name_component,"out_CONST_1"); 737 736 738 for (uint32_t j=0; j<_param->_nb_gpr_read; j++) 737 739 { -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/src/test.cpp
r57 r62 79 79 (*(registerfile-> in_READ_VAL [i])) (READ_VAL [i]); 80 80 (*(registerfile->out_READ_ACK [i])) (READ_ACK [i]); 81 if (_param->_have_port_address) 81 82 (*(registerfile-> in_READ_ADDRESS [i])) (READ_ADDRESS [i]); 82 83 (*(registerfile->out_READ_DATA [i])) (READ_DATA [i]); … … 86 87 (*(registerfile-> in_WRITE_VAL [i])) (WRITE_VAL [i]); 87 88 (*(registerfile->out_WRITE_ACK [i])) (WRITE_ACK [i]); 89 if (_param->_have_port_address) 88 90 (*(registerfile-> in_WRITE_ADDRESS [i])) (WRITE_ADDRESS [i]); 89 91 (*(registerfile-> in_WRITE_DATA [i])) (WRITE_DATA [i]); … … 94 96 (*(registerfile->out_READ_WRITE_ACK [i])) (READ_WRITE_ACK [i]); 95 97 (*(registerfile-> in_READ_WRITE_RW [i])) (READ_WRITE_RW [i]); 98 if (_param->_have_port_address) 96 99 (*(registerfile-> in_READ_WRITE_ADDRESS [i])) (READ_WRITE_ADDRESS [i]); 97 100 (*(registerfile-> in_READ_WRITE_WDATA [i])) (READ_WRITE_WDATA [i]); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Parameters.h
r55 r62 27 27 public : const uint32_t _size_word ; 28 28 public : const uint32_t _size_address ; 29 public : const bool _have_port_address; 29 30 30 31 public : Parameters (uint32_t nb_port_read , -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/Parameters.cpp
r55 r62 25 25 _nb_word (nb_word ), 26 26 _size_word (size_word ), 27 _size_address (static_cast<uint32_t>(log2(_nb_word))) 27 _size_address (static_cast<uint32_t>(log2(_nb_word))), 28 _have_port_address (_size_address != 0) 29 28 30 { 29 31 test(); … … 36 38 _nb_word (param._nb_word ), 37 39 _size_word (param._size_word ), 38 _size_address (param._size_address ) 40 _size_address (param._size_address ), 41 _have_port_address (param._have_port_address) 39 42 { 40 43 test(); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/Parameters_msg_error.cpp
r55 r62 50 50 msg += " * nb_port_read_write : " + toString(_nb_port_read_write) + "\n"; 51 51 } 52 if (_nb_word < 2)53 {54 msg += " - nb_word must be >= 2\n";55 msg += " * nb_word : " + toString(_nb_word) + "\n";56 }52 // if (_nb_word < 2) 53 // { 54 // msg += " - nb_word must be >= 2\n"; 55 // msg += " * nb_word : " + toString(_nb_word) + "\n"; 56 // } 57 57 58 58 return msg; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic.cpp
r58 r62 58 58 sensitive_neg << *(in_CLOCK); 59 59 for (uint32_t i=0; i<_param->_nb_port_read; i++) 60 sensitive << *(in_READ_VAL [i]) 61 << *(in_READ_ADDRESS [i]); 60 { 61 sensitive << *(in_READ_VAL [i]); 62 if (_param->_have_port_address) 63 sensitive << *(in_READ_ADDRESS [i]); 64 } 62 65 for (uint32_t i=0; i<_param->_nb_port_read_write; i++) 63 sensitive << *(in_READ_WRITE_VAL [i]) 64 << *(in_READ_WRITE_RW [i]) 65 << *(in_READ_WRITE_ADDRESS [i]); 66 { 67 sensitive << *(in_READ_WRITE_VAL [i]) 68 << *(in_READ_WRITE_RW [i]); 69 if (_param->_have_port_address) 70 sensitive << *(in_READ_WRITE_ADDRESS [i]); 71 } 66 72 67 73 # ifdef SYSTEMCASS_SPECIFIC … … 70 76 { 71 77 (*(out_READ_DATA [i])) (*( in_READ_VAL [i])); 72 (*(out_READ_DATA [i])) (*( in_READ_ADDRESS [i])); 78 if (_param->_have_port_address) 79 (*(out_READ_DATA [i])) (*( in_READ_ADDRESS [i])); 73 80 } 74 81 for (uint32_t i=0; i<_param->_nb_port_read_write; i++) … … 76 83 (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_VAL [i])); 77 84 (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_RW [i])); 78 (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_ADDRESS [i])); 85 if (_param->_have_port_address) 86 (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_ADDRESS [i])); 79 87 } 80 88 # endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_allocation.cpp
r57 r62 44 44 in_READ_VAL = new SC_IN (Tcontrol_t) * [_param->_nb_port_read]; 45 45 out_READ_ACK = new SC_OUT(Tcontrol_t) * [_param->_nb_port_read]; 46 if (_param->_have_port_address) 46 47 in_READ_ADDRESS = new SC_IN (Taddress_t) * [_param->_nb_port_read]; 47 48 out_READ_DATA = new SC_OUT(Tdata_t ) * [_param->_nb_port_read]; … … 59 60 in_READ_VAL [i] = interface->set_signal_valack_in ("val" , VAL); 60 61 out_READ_ACK [i] = interface->set_signal_valack_out ("ack" , ACK); 62 if (_param->_have_port_address) 61 63 in_READ_ADDRESS [i] = interface->set_signal_in <Taddress_t> ("address", _param->_size_address); 62 64 out_READ_DATA [i] = interface->set_signal_out <Tdata_t > ("data" , _param->_size_word); … … 67 69 in_WRITE_VAL = new SC_IN (Tcontrol_t) * [_param->_nb_port_write]; 68 70 out_WRITE_ACK = new SC_OUT(Tcontrol_t) * [_param->_nb_port_write]; 71 if (_param->_have_port_address) 69 72 in_WRITE_ADDRESS = new SC_IN (Taddress_t) * [_param->_nb_port_write]; 70 73 in_WRITE_DATA = new SC_IN (Tdata_t ) * [_param->_nb_port_write]; … … 82 85 in_WRITE_VAL [i] = interface->set_signal_valack_in ("val" , VAL); 83 86 out_WRITE_ACK [i] = interface->set_signal_valack_out ("ack" , ACK); 87 if (_param->_have_port_address) 84 88 in_WRITE_ADDRESS [i] = interface->set_signal_in <Taddress_t> ("address", _param->_size_address); 85 89 in_WRITE_DATA [i] = interface->set_signal_in <Tdata_t > ("data" , _param->_size_word); … … 91 95 out_READ_WRITE_ACK = new SC_OUT(Tcontrol_t) * [_param->_nb_port_read_write]; 92 96 in_READ_WRITE_RW = new SC_IN (Tcontrol_t) * [_param->_nb_port_read_write]; 97 if (_param->_have_port_address) 93 98 in_READ_WRITE_ADDRESS = new SC_IN (Taddress_t) * [_param->_nb_port_read_write]; 94 99 in_READ_WRITE_WDATA = new SC_IN (Tdata_t ) * [_param->_nb_port_read_write]; … … 108 113 out_READ_WRITE_ACK [i] = interface->set_signal_valack_out ("ack" , ACK); 109 114 in_READ_WRITE_RW [i] = interface->set_signal_valack_in ("rw" , VAL); 115 if (_param->_have_port_address) 110 116 in_READ_WRITE_ADDRESS [i] = interface->set_signal_in <Taddress_t> ("address", _param->_size_address); 111 117 in_READ_WRITE_WDATA [i] = interface->set_signal_in <Tdata_t > ("wdata" , _param->_size_word); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_deallocation.cpp
r57 r62 25 25 delete [] in_READ_VAL ; 26 26 delete [] out_READ_ACK ; 27 if (_param->_have_port_address) 27 28 delete [] in_READ_ADDRESS; 28 29 delete [] out_READ_DATA ; … … 31 32 delete [] in_WRITE_VAL ; 32 33 delete [] out_WRITE_ACK ; 34 if (_param->_have_port_address) 33 35 delete [] in_WRITE_ADDRESS; 34 36 delete [] in_WRITE_DATA ; … … 38 40 delete [] out_READ_WRITE_ACK ; 39 41 delete [] in_READ_WRITE_RW ; 42 if (_param->_have_port_address) 40 43 delete [] in_READ_WRITE_ADDRESS; 41 44 delete [] in_READ_WRITE_WDATA ; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_genMealy_read.cpp
r55 r62 28 28 if ( PORT_READ(in_READ_VAL [i]) == 1) 29 29 { 30 Taddress_t address = PORT_READ(in_READ_ADDRESS[i]); 30 Taddress_t address; 31 if (_param->_have_port_address) 32 address = PORT_READ(in_READ_ADDRESS[i]); 33 else 34 address = 0; 31 35 Tdata_t data = REGISTER_READ(reg_DATA[address]); 32 36 … … 55 59 ) 56 60 { 57 Taddress_t address = PORT_READ(in_READ_WRITE_ADDRESS[i]); 61 Taddress_t address; 62 if (_param->_have_port_address) 63 address = PORT_READ(in_READ_WRITE_ADDRESS[i]); 64 else 65 address = 0; 58 66 59 67 data = REGISTER_READ(reg_DATA[address]); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_transition.cpp
r55 r62 30 30 #endif 31 31 32 Taddress_t address = PORT_READ(in_WRITE_ADDRESS[i]); 32 Taddress_t address; 33 if (_param->_have_port_address) 34 address = PORT_READ(in_WRITE_ADDRESS[i]); 35 else 36 address = 0; 37 33 38 Tdata_t data = PORT_READ(in_WRITE_DATA [i]); 34 39 … … 49 54 #endif 50 55 51 Taddress_t address = PORT_READ(in_READ_WRITE_ADDRESS[i]); 56 Taddress_t address; 57 if (_param->_have_port_address) 58 address = PORT_READ(in_READ_WRITE_ADDRESS[i]); 59 else 60 address = 0; 52 61 Tdata_t data = PORT_READ(in_READ_WRITE_WDATA [i]); 53 62 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl_body.cpp
r55 r62 37 37 38 38 for (uint32_t i = 0; i < _param->_nb_port_read; i++) 39 vhdl->set_body ("out_READ_"+toString(i)+"_DATA <= reg_DATA (conv_integer(in_READ_"+toString(i)+"_ADDRESS)) when in_READ_"+toString(i)+"_VAL = '1' else "+std_logic_others(_param->_size_word,0)+";"); 39 { 40 string str_address; 41 if (_param->_have_port_address) 42 str_address = "conv_integer(in_READ_"+toString(i)+"_ADDRESS)"; 43 else 44 str_address = "0"; 40 45 46 vhdl->set_body ("out_READ_"+toString(i)+"_DATA <= reg_DATA ("+str_address+") when in_READ_"+toString(i)+"_VAL = '1' else "+std_logic_others(_param->_size_word,0)+";"); 47 } 41 48 for (uint32_t i = 0; i < _param->_nb_port_read_write; i++) 42 vhdl->set_body ("out_READ_WRITE_"+toString(i)+"_RDATA <= reg_DATA (conv_integer(in_READ_WRITE_"+toString(i)+"_ADDRESS)) when in_READ_WRITE_"+toString(i)+"_VAL = '1' and in_READ_WRITE_"+toString(i)+"_RW = '"+toString(RW_READ)+"' else "+std_logic_others(_param->_size_word,0)+";"); 49 { 50 string str_address; 51 if (_param->_have_port_address) 52 str_address = "conv_integer(in_READ_WRITE_"+toString(i)+"_ADDRESS)"; 53 else 54 str_address = "0"; 55 vhdl->set_body ("out_READ_WRITE_"+toString(i)+"_RDATA <= reg_DATA ("+str_address+") when in_READ_WRITE_"+toString(i)+"_VAL = '1' and in_READ_WRITE_"+toString(i)+"_RW = '"+toString(RW_READ)+"' else "+std_logic_others(_param->_size_word,0)+";"); 56 } 43 57 44 58 vhdl->set_body (""); … … 54 68 for (uint32_t i = 0; i < _param->_nb_port_write; i++) 55 69 { 56 vhdl->set_body ("\t\tif (in_WRITE_"+toString(i)+"_VAL = '1') then"); 57 vhdl->set_body ("\t\t\treg_DATA(conv_integer(in_WRITE_"+toString(i)+"_ADDRESS)) <= in_WRITE_"+toString(i)+"_DATA;"); 58 vhdl->set_body ("\t\tend if;"); 70 string str_address; 71 if (_param->_have_port_address) 72 str_address = "conv_integer(in_WRITE_"+toString(i)+"_ADDRESS)"; 73 else 74 str_address = "0"; 75 76 vhdl->set_body ("\t\tif (in_WRITE_"+toString(i)+"_VAL = '1') then"); 77 vhdl->set_body ("\t\t\treg_DATA("+str_address+") <= in_WRITE_"+toString(i)+"_DATA;"); 78 vhdl->set_body ("\t\tend if;"); 59 79 } 60 80 for (uint32_t i = 0; i < _param->_nb_port_read_write; i++) 61 81 { 62 vhdl->set_body ("\t\tif (in_READ_WRITE_"+toString(i)+"_VAL = '1' and in_READ_WRITE_"+toString(i)+"_RW = '"+toString(RW_WRITE)+"') then"); 63 vhdl->set_body ("\t\t\treg_DATA(conv_integer(in_READ_WRITE_"+toString(i)+"_ADDRESS)) <= in_READ_WRITE_"+toString(i)+"_WDATA;"); 64 vhdl->set_body ("\t\tend if;"); 82 string str_address; 83 if (_param->_have_port_address) 84 str_address = "conv_integer(in_READ_WRITE_"+toString(i)+"_ADDRESS)"; 85 else 86 str_address = "0"; 87 88 vhdl->set_body ("\t\tif (in_READ_WRITE_"+toString(i)+"_VAL = '1' and in_READ_WRITE_"+toString(i)+"_RW = '"+toString(RW_WRITE)+"') then"); 89 vhdl->set_body ("\t\t\treg_DATA("+str_address+") <= in_READ_WRITE_"+toString(i)+"_WDATA;"); 90 vhdl->set_body ("\t\tend if;"); 65 91 } 66 92 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest/src/test.cpp
r58 r62 80 80 (*(_RegisterFile_Multi_Banked-> in_READ_VAL [i])) (READ_VAL [i]); 81 81 (*(_RegisterFile_Multi_Banked->out_READ_ACK [i])) (READ_ACK [i]); 82 if (_param->_have_port_address==true) 82 83 (*(_RegisterFile_Multi_Banked-> in_READ_ADDRESS [i])) (READ_ADDRESS [i]); 83 84 (*(_RegisterFile_Multi_Banked->out_READ_DATA [i])) (READ_DATA [i]); … … 88 89 (*(_RegisterFile_Multi_Banked-> in_WRITE_VAL [i])) (WRITE_VAL [i]); 89 90 (*(_RegisterFile_Multi_Banked->out_WRITE_ACK [i])) (WRITE_ACK [i]); 91 if (_param->_have_port_address==true) 90 92 (*(_RegisterFile_Multi_Banked-> in_WRITE_ADDRESS [i])) (WRITE_ADDRESS [i]); 91 93 (*(_RegisterFile_Multi_Banked-> in_WRITE_DATA [i])) (WRITE_DATA [i]); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Parameters.h
r57 r62 71 71 public : const uint32_t _nb_word_by_bank ; 72 72 73 public : const bool _have_port_address ; 74 public : const bool _have_bank_port_address; 75 73 76 // A lot of table to the partial crossbar 74 77 public : uint32_t * _link_port_read_to_bank_read ; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/Parameters.cpp
r57 r62 42 42 _num_reg_shift (0), 43 43 _num_reg_mask (gen_mask<Taddress_t>(_size_address_by_bank)), 44 _nb_word_by_bank (_nb_word / _nb_bank) 44 _nb_word_by_bank (_nb_word / _nb_bank), 45 _have_port_address (_size_address != 0), 46 _have_bank_port_address(_size_address_by_bank != 0) 45 47 { 46 48 log_printf(FUNC,RegisterFile_Multi_Banked,"Parameters","Begin"); … … 48 50 if (_crossbar == PARTIAL_CROSSBAR) 49 51 { 50 log_printf( NONE,RegisterFile_Multi_Banked,"Parameters","Case : _crossbar == PARTIAL_CROSSBAR");52 log_printf(TRACE,RegisterFile_Multi_Banked,"Parameters","Case : _crossbar == PARTIAL_CROSSBAR"); 51 53 52 54 // All port_src is connected with one port_dest on each bank … … 68 70 69 71 70 log_printf( NONE,RegisterFile_Multi_Banked,"Parameters"," * _link_port_read_to_bank_read");72 log_printf(TRACE,RegisterFile_Multi_Banked,"Parameters"," * _link_port_read_to_bank_read"); 71 73 for (uint32_t i=0; i<_nb_port_read ;i++) 72 74 { 73 log_printf(NONE,RegisterFile_Multi_Banked,"Parameters"," * Read in [%d] to out [%d]",i,_link_port_read_to_bank_read [i]); 74 printf(" * Read in [%d] to out [%d]\n",i,_link_port_read_to_bank_read [i]); 75 log_printf(TRACE,RegisterFile_Multi_Banked,"Parameters"," * Read in [%d] to out [%d]",i,_link_port_read_to_bank_read [i]); 75 76 } 76 log_printf( NONE,RegisterFile_Multi_Banked,"Parameters"," * _link_port_write_to_bank_write");77 log_printf(TRACE,RegisterFile_Multi_Banked,"Parameters"," * _link_port_write_to_bank_write"); 77 78 for (uint32_t i=0; i<_nb_port_write ;i++) 78 79 { 79 log_printf(NONE,RegisterFile_Multi_Banked,"Parameters"," * Write in [%d] to out [%d]",i,_link_port_write_to_bank_write [i]); 80 printf(" * Write in [%d] to out [%d]\n",i,_link_port_write_to_bank_write [i]); 80 log_printf(TRACE,RegisterFile_Multi_Banked,"Parameters"," * Write in [%d] to out [%d]",i,_link_port_write_to_bank_write [i]); 81 81 } 82 82 } … … 102 102 _num_reg_shift (param._num_reg_shift ), 103 103 _num_reg_mask (param._num_reg_mask ), 104 _nb_word_by_bank (param._nb_word_by_bank ) 104 _nb_word_by_bank (param._nb_word_by_bank ), 105 _have_port_address (param._have_port_address ), 106 _have_bank_port_address(param._have_bank_port_address) 105 107 { 106 108 log_printf(FUNC,RegisterFile_Multi_Banked,"Parameters (copy)","Begin"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked.cpp
r57 r62 85 85 sensitive_neg << *(in_CLOCK); 86 86 for (uint32_t i=0; i<_param->_nb_port_read; i++) 87 sensitive << *( in_READ_VAL [i]) 88 << *( in_READ_ADDRESS [i]); 87 { 88 sensitive << *( in_READ_VAL [i]); 89 if (_param->_have_port_address == true) 90 sensitive << *( in_READ_ADDRESS [i]); 91 } 89 92 90 93 #ifdef SYSTEMCASS_SPECIFIC … … 93 96 { 94 97 (*(out_READ_ACK [i])) (*( in_READ_VAL [i])); 98 if (_param->_have_port_address == true) 95 99 (*(out_READ_ACK [i])) (*( in_READ_ADDRESS [i])); 96 100 (*(out_READ_DATA [i])) (*( in_READ_VAL [i])); 101 if (_param->_have_port_address == true) 97 102 (*(out_READ_DATA [i])) (*( in_READ_ADDRESS [i])); 98 103 } … … 109 114 sensitive_neg << *(in_CLOCK); 110 115 for (uint32_t i=0; i<_param->_nb_port_write; i++) 111 sensitive << *( in_WRITE_VAL [i]) 112 << *( in_WRITE_ADDRESS [i]) 113 << *( in_WRITE_DATA [i]); 116 { 117 sensitive << *( in_WRITE_VAL [i]) 118 << *( in_WRITE_DATA [i]); 119 if (_param->_have_port_address == true) 120 sensitive << *( in_WRITE_ADDRESS [i]); 121 } 114 122 115 123 #ifdef SYSTEMCASS_SPECIFIC … … 118 126 { 119 127 (*(out_WRITE_ACK [i])) (*( in_WRITE_VAL [i])); 128 if (_param->_have_port_address == true) 120 129 (*(out_WRITE_ACK [i])) (*( in_WRITE_ADDRESS [i])); 121 130 (*(out_WRITE_ACK [i])) (*( in_WRITE_DATA [i])); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_allocation.cpp
r57 r62 50 50 in_READ_VAL = new SC_IN (Tcontrol_t) * [_param->_nb_port_read]; 51 51 out_READ_ACK = new SC_OUT(Tcontrol_t) * [_param->_nb_port_read]; 52 if (_param->_have_port_address == true) 52 53 in_READ_ADDRESS = new SC_IN (Taddress_t) * [_param->_nb_port_read]; 53 54 out_READ_DATA = new SC_OUT(Tdata_t ) * [_param->_nb_port_read]; … … 65 66 in_READ_VAL [i] = interface->set_signal_valack_in ("val" , VAL); 66 67 out_READ_ACK [i] = interface->set_signal_valack_out ("ack" , ACK); 68 if (_param->_have_port_address == true) 67 69 in_READ_ADDRESS [i] = interface->set_signal_in <Taddress_t> ("address", static_cast<uint32_t>(log2(_param->_nb_word))); 68 70 out_READ_DATA [i] = interface->set_signal_out <Tdata_t > ("data" , _param->_size_word); … … 73 75 in_WRITE_VAL = new SC_IN (Tcontrol_t) * [_param->_nb_port_write]; 74 76 out_WRITE_ACK = new SC_OUT(Tcontrol_t) * [_param->_nb_port_write]; 77 if (_param->_have_port_address == true) 75 78 in_WRITE_ADDRESS = new SC_IN (Taddress_t) * [_param->_nb_port_write]; 76 79 in_WRITE_DATA = new SC_IN (Tdata_t ) * [_param->_nb_port_write]; … … 88 91 in_WRITE_VAL [i] = interface->set_signal_valack_in ("val" , VAL); 89 92 out_WRITE_ACK [i] = interface->set_signal_valack_out ("ack" , ACK); 93 if (_param->_have_port_address == true) 90 94 in_WRITE_ADDRESS [i] = interface->set_signal_in <Taddress_t> ("address", static_cast<uint32_t>(log2(_param->_nb_word))); 91 95 in_WRITE_DATA [i] = interface->set_signal_in <Tdata_t > ("data" , _param->_size_word); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_deallocation.cpp
r53 r62 26 26 delete [] in_READ_VAL ; 27 27 delete [] out_READ_ACK ; 28 if (_param->_have_port_address == true) 28 29 delete [] in_READ_ADDRESS; 29 30 delete [] out_READ_DATA ; … … 32 33 delete [] in_WRITE_VAL ; 33 34 delete [] out_WRITE_ACK ; 35 if (_param->_have_port_address == true) 34 36 delete [] in_WRITE_ADDRESS; 35 37 delete [] in_WRITE_DATA ; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_full_crossbar_genMealy_read.cpp
r57 r62 37 37 { 38 38 // Compute the adress of the bank 39 Taddress_t address = PORT_READ(in_READ_ADDRESS[i]); 39 Taddress_t address; 40 if (_param->_have_port_address == true) 41 address = PORT_READ(in_READ_ADDRESS[i]); 42 else 43 address = 0; 44 40 45 log_printf(TRACE,RegisterFile_Multi_Banked,"full_crossbar_genMealy_read"," * address : %d",address); 41 46 Taddress_t bank = address_bank (address); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_full_crossbar_genMealy_write.cpp
r57 r62 38 38 val = false; 39 39 // Compute the adress of the bank 40 Taddress_t address = PORT_READ(in_WRITE_ADDRESS[i]); 40 Taddress_t address; 41 if (_param->_have_port_address == true) 42 address = PORT_READ(in_WRITE_ADDRESS[i]); 43 else 44 address = 0; 41 45 log_printf(TRACE,RegisterFile_Multi_Banked,"full_crossbar_genMealy_write"," * address : %d",address); 42 46 Taddress_t bank = address_bank (address); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_partial_crossbar_genMealy_read.cpp
r57 r62 37 37 { 38 38 // Compute the adress of the bank 39 Taddress_t address = PORT_READ(in_READ_ADDRESS[i]); 39 Taddress_t address; 40 if (_param->_have_port_address == true) 41 address = PORT_READ(in_READ_ADDRESS[i]); 42 else 43 address = 0; 40 44 log_printf(TRACE,RegisterFile_Multi_Banked,"full_crossbar_genMealy_read"," * address : %d",address); 41 45 Taddress_t bank = address_bank (address); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_partial_crossbar_genMealy_write.cpp
r57 r62 37 37 val = false; 38 38 // Compute the adress of the bank 39 Taddress_t address = PORT_READ(in_WRITE_ADDRESS[i]); 39 Taddress_t address; 40 if (_param->_have_port_address == true) 41 address = PORT_READ(in_WRITE_ADDRESS[i]); 42 else 43 address = 0; 40 44 log_printf(TRACE,RegisterFile_Multi_Banked,"partial_crossbar_genMealy_write"," * address : %d",address); 41 45 Taddress_t bank = address_bank (address); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_vhdl_body.cpp
r58 r62 51 51 vhdl->set_body("\t, in_READ_"+toString(j)+"_VAL \t=>\tinternal_BANK_READ_"+toString(i)+"_"+toString(j)+"_VAL"); 52 52 vhdl->set_body("\t,out_READ_"+toString(j)+"_ACK \t=>\tinternal_BANK_READ_"+toString(i)+"_"+toString(j)+"_ACK"); 53 if (_param->_have_bank_port_address == true) 53 54 vhdl->set_body("\t, in_READ_"+toString(j)+"_ADDRESS \t=>\tinternal_BANK_READ_"+toString(i)+"_"+toString(j)+"_ADDRESS"); 54 55 vhdl->set_body("\t,out_READ_"+toString(j)+"_DATA \t=>\tinternal_BANK_READ_"+toString(i)+"_"+toString(j)+"_DATA"); … … 58 59 vhdl->set_body("\t, in_WRITE_"+toString(j)+"_VAL \t=>\tinternal_BANK_WRITE_"+toString(i)+"_"+toString(j)+"_VAL"); 59 60 vhdl->set_body("\t,out_WRITE_"+toString(j)+"_ACK \t=>\tinternal_BANK_WRITE_"+toString(i)+"_"+toString(j)+"_ACK"); 61 if (_param->_have_bank_port_address == true) 60 62 vhdl->set_body("\t, in_WRITE_"+toString(j)+"_ADDRESS \t=>\tinternal_BANK_WRITE_"+toString(i)+"_"+toString(j)+"_ADDRESS"); 61 63 vhdl->set_body("\t, in_WRITE_"+toString(j)+"_DATA \t=>\tinternal_BANK_WRITE_"+toString(i)+"_"+toString(j)+"_DATA"); … … 154 156 vhdl->set_body("-----------------------------------"); 155 157 vhdl->set_body(""); 158 159 if (_param->_have_bank_port_address == true) 156 160 for (uint32_t i=0; i<_param->_nb_bank; i++) 157 161 { … … 221 225 for (uint32_t j=0; j<_param->_nb_port_read; j ++) 222 226 { 223 string address = (_param->_nb_bank==1)?"":("and (in_READ_"+toString(j)+"_ADDRESS"+std_logic_range(_param->_size_address-1,_param->_size_address_by_bank)+"="+std_logic_conv( _param->_size_address-_param->_size_address_by_bank,i)+") "); 224 225 vhdl->set_body("internal_READ_"+toString(i)+"_"+toString(j)+"_VAL <= '1' when (in_READ_"+toString(j)+"_VAL ='1') "+address+"else '0';"); 227 string str_address; 228 229 if (_param->_have_bank_port_address == true) 230 str_address = (_param->_nb_bank==1)?"":("and (in_READ_"+toString(j)+"_ADDRESS"+std_logic_range(_param->_size_address-1,_param->_size_address_by_bank)+"="+std_logic_conv( _param->_size_address-_param->_size_address_by_bank,i)+") "); 231 else 232 str_address = ""; 233 234 vhdl->set_body("internal_READ_"+toString(i)+"_"+toString(j)+"_VAL <= '1' when (in_READ_"+toString(j)+"_VAL ='1') "+str_address+"else '0';"); 226 235 } 227 236 for (uint32_t j=0; j<_param->_nb_port_write; j ++) 228 237 { 229 string address = (_param->_nb_bank==1)?"":("and (in_WRITE_"+toString(j)+"_ADDRESS"+std_logic_range(_param->_size_address-1,_param->_size_address_by_bank)+"="+std_logic_conv( _param->_size_address-_param->_size_address_by_bank,i)+") "); 230 vhdl->set_body("internal_WRITE_"+toString(i)+"_"+toString(j)+"_VAL <= '1' when (in_WRITE_"+toString(j)+"_VAL='1') "+address+"else '0';"); 238 string str_address; 239 240 if (_param->_have_port_address == true) 241 str_address = (_param->_nb_bank==1)?"":("and (in_WRITE_"+toString(j)+"_ADDRESS"+std_logic_range(_param->_size_address-1,_param->_size_address_by_bank)+"="+std_logic_conv( _param->_size_address-_param->_size_address_by_bank,i)+") "); 242 else 243 str_address = ""; 244 245 vhdl->set_body("internal_WRITE_"+toString(i)+"_"+toString(j)+"_VAL <= '1' when (in_WRITE_"+toString(j)+"_VAL='1') "+str_address+"else '0';"); 231 246 } 232 247 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_vhdl_declaration.cpp
r58 r62 41 41 vhdl->set_signal ("internal_BANK_READ_"+toString(i)+"_"+toString(j)+"_VAL" ,1); 42 42 vhdl->set_signal ("internal_BANK_READ_"+toString(i)+"_"+toString(j)+"_ACK" ,1); 43 if (_param->_have_bank_port_address == true) 43 44 vhdl->set_signal ("internal_BANK_READ_"+toString(i)+"_"+toString(j)+"_ADDRESS",_param->_size_address_by_bank); 44 45 vhdl->set_signal ("internal_BANK_READ_"+toString(i)+"_"+toString(j)+"_DATA" ,_param->_size_word); … … 64 65 vhdl->set_signal ("internal_BANK_WRITE_"+toString(i)+"_"+toString(j)+"_VAL" ,1); 65 66 vhdl->set_signal ("internal_BANK_WRITE_"+toString(i)+"_"+toString(j)+"_ACK" ,1); 67 if (_param->_have_bank_port_address == true) 66 68 vhdl->set_signal ("internal_BANK_WRITE_"+toString(i)+"_"+toString(j)+"_ADDRESS",_param->_size_address_by_bank); 67 69 vhdl->set_signal ("internal_BANK_WRITE_"+toString(i)+"_"+toString(j)+"_DATA" ,_param->_size_word); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/SelfTest/include/test.h
r53 r62 21 21 using namespace morpheo::behavioural; 22 22 using namespace morpheo::behavioural::generic; 23 24 23 using namespace morpheo::behavioural::generic::registerfile; 25 24 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/SelfTest/src/main.cpp
r53 r62 50 50 const uint32_t nb_port_write_by_bank = atoi(argv[8]); 51 51 const Tcrossbar_t crossbar = fromString<Tcrossbar_t>(argv[9]); 52 const Tinstance_t instance = (strcmp(argv[10], "0") == 0)?instance_RegisterFile_Monolithic:instance_RegisterFile_Multi_Banked;52 const morpheo::behavioural::generic::registerfile::Tinstance_t instance = (strcmp(argv[10], "0") == 0)?instance_RegisterFile_Monolithic:instance_RegisterFile_Multi_Banked; 53 53 54 54 try … … 60 60 morpheo::behavioural::generic::registerfile::registerfile_monolithic ::Parameters * param1 = new morpheo::behavioural::generic::registerfile::registerfile_monolithic ::Parameters (nb_port_read , 61 61 nb_port_write , 62 0 , 62 63 nb_word , 63 64 size_word ); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/SelfTest/src/test.cpp
r53 r62 33 33 cout << "<" << name << "> : Simulation SystemC" << endl; 34 34 35 #ifdef STATISTICS 36 morpheo::behavioural::Parameters_Statistics * _param_stat = new morpheo::behavioural::Parameters_Statistics(5,50); 37 #endif 38 35 39 RegisterFile * _RegisterFile = new RegisterFile (name.c_str(), 36 #ifdef STATISTICS 37 morpheo::behavioural::Parameters_Statistics(5,50),40 #ifdef STATISTICS 41 _param_stat, 38 42 #endif 39 *_param);43 _param); 40 44 41 45 #ifdef SYSTEMC … … 74 78 (*(_RegisterFile-> in_READ_VAL [i])) (READ_VAL [i]); 75 79 (*(_RegisterFile->out_READ_ACK [i])) (READ_ACK [i]); 80 if (_param->_have_port_address == true) 76 81 (*(_RegisterFile-> in_READ_ADDRESS [i])) (READ_ADDRESS [i]); 77 82 (*(_RegisterFile->out_READ_DATA [i])) (READ_DATA [i]); … … 82 87 (*(_RegisterFile-> in_WRITE_VAL [i])) (WRITE_VAL [i]); 83 88 (*(_RegisterFile->out_WRITE_ACK [i])) (WRITE_ACK [i]); 89 if (_param->_have_port_address == true) 84 90 (*(_RegisterFile-> in_WRITE_ADDRESS [i])) (WRITE_ADDRESS [i]); 85 91 (*(_RegisterFile-> in_WRITE_DATA [i])) (WRITE_DATA [i]); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/include/Parameters.h
r53 r62 23 23 instance_RegisterFile_Multi_Banked} Tinstance_t; 24 24 25 26 25 class Parameters : public morpheo::behavioural::Parameters 27 26 { … … 33 32 public : const uint32_t _size_word ; 34 33 public : const uint32_t _size_address ; 34 public : const bool _have_port_address; 35 35 36 public : morpheo::behavioural::generic::registerfile::registerfile_monolithic ::Parameters * _param_registerfile_monolithic; 36 37 public : morpheo::behavioural::generic::registerfile::registerfile_multi_banked::Parameters * _param_registerfile_multi_banked; 37 38 38 39 39 //-----[ methods ]----------------------------------------------------------- -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/include/RegisterFile.h
r53 r62 45 45 // -----[ fields ]---------------------------------------------------- 46 46 // Parameters 47 protected : const string _name;47 protected : const string _name; 48 48 49 protected : const Parameters _param;50 //#ifdef STATISTICS51 // protected : const morpheo::behavioural::Parameters_Statistics_param_statistics;52 //#endif49 protected : const Parameters * _param; 50 #ifdef STATISTICS 51 protected : morpheo::behavioural::Parameters_Statistics * _param_statistics; 52 #endif 53 53 54 54 public : Component * _component; … … 94 94 #endif 95 95 #ifdef STATISTICS 96 morpheo::behavioural::Parameters_Statistics param_statistics,96 morpheo::behavioural::Parameters_Statistics * param_statistics, 97 97 #endif 98 Parameters param );98 Parameters * param ); 99 99 100 public : RegisterFile (Parameters param );101 100 public : ~RegisterFile (void); 102 101 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/Parameters.cpp
r53 r62 20 20 _nb_word (param->_nb_word ), 21 21 _size_word (param->_size_word ), 22 _size_address (param->_size_address ) 22 _size_address (param->_size_address ), 23 _have_port_address (param->_have_port_address) 23 24 { 24 25 log_printf(FUNC,RegisterFile,"Parameters","Begin"); … … 37 38 _nb_word (param->_nb_word ), 38 39 _size_word (param->_size_word ), 39 _size_address (param->_size_address ) 40 _size_address (param->_size_address ), 41 _have_port_address (param->_have_port_address) 40 42 { 41 43 log_printf(FUNC,RegisterFile,"Parameters","Begin"); … … 54 56 _nb_word (param._nb_word ), 55 57 _size_word (param._size_word ), 56 _size_address (param._size_address ) 58 _size_address (param._size_address ), 59 _have_port_address (param._have_port_address) 57 60 { 58 61 log_printf(FUNC,RegisterFile,"Parameters (copy)","Begin"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile.cpp
r53 r62 20 20 #endif 21 21 #ifdef STATISTICS 22 morpheo::behavioural::Parameters_Statistics param_statistics,22 morpheo::behavioural::Parameters_Statistics * param_statistics, 23 23 #endif 24 morpheo::behavioural::generic::registerfile::Parameters param ):24 morpheo::behavioural::generic::registerfile::Parameters * param ): 25 25 _name (name) 26 26 ,_param (param) 27 //#ifdef STATISTICS28 //,_param_statistics (param_statistics)29 //#endif27 #ifdef STATISTICS 28 ,_param_statistics (param_statistics) 29 #endif 30 30 { 31 31 log_printf(FUNC,RegisterFile,"RegisterFile","Begin"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_allocation.cpp
r53 r62 28 28 // ~~~~~[ Interface : "read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 29 29 30 in_READ_VAL = new SC_IN (Tcontrol_t) * [_param._nb_port_read]; 31 out_READ_ACK = new SC_OUT(Tcontrol_t) * [_param._nb_port_read]; 32 in_READ_ADDRESS = new SC_IN (Taddress_t) * [_param._nb_port_read]; 33 out_READ_DATA = new SC_OUT(Tdata_t ) * [_param._nb_port_read]; 30 in_READ_VAL = new SC_IN (Tcontrol_t) * [_param->_nb_port_read]; 31 out_READ_ACK = new SC_OUT(Tcontrol_t) * [_param->_nb_port_read]; 32 if (_param->_have_port_address == true) 33 in_READ_ADDRESS = new SC_IN (Taddress_t) * [_param->_nb_port_read]; 34 out_READ_DATA = new SC_OUT(Tdata_t ) * [_param->_nb_port_read]; 34 35 35 for (uint32_t i=0; i<_param ._nb_port_read; i++)36 for (uint32_t i=0; i<_param->_nb_port_read; i++) 36 37 { 37 38 rename = "in_READ_"+toString(i)+"_VAL" ; … … 39 40 rename = "out_READ_"+toString(i)+"_ACK" ; 40 41 out_READ_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); 42 if (_param->_have_port_address == true) 43 { 41 44 rename = "in_READ_"+toString(i)+"_ADDRESS"; 42 45 in_READ_ADDRESS [i] = new SC_IN (Taddress_t) (rename.c_str()); 46 } 43 47 rename = "out_READ_"+toString(i)+"_DATA" ; 44 48 out_READ_DATA [i] = new SC_OUT(Tdata_t ) (rename.c_str()); … … 47 51 // ~~~~~[ Interface : "write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 48 52 49 in_WRITE_VAL = new SC_IN (Tcontrol_t) * [_param._nb_port_write]; 50 out_WRITE_ACK = new SC_OUT(Tcontrol_t) * [_param._nb_port_write]; 51 in_WRITE_ADDRESS = new SC_IN (Taddress_t) * [_param._nb_port_write]; 52 in_WRITE_DATA = new SC_IN (Tdata_t ) * [_param._nb_port_write]; 53 in_WRITE_VAL = new SC_IN (Tcontrol_t) * [_param->_nb_port_write]; 54 out_WRITE_ACK = new SC_OUT(Tcontrol_t) * [_param->_nb_port_write]; 55 if (_param->_have_port_address == true) 56 in_WRITE_ADDRESS = new SC_IN (Taddress_t) * [_param->_nb_port_write]; 57 in_WRITE_DATA = new SC_IN (Tdata_t ) * [_param->_nb_port_write]; 53 58 54 for (uint32_t i=0; i<_param ._nb_port_write; i++)59 for (uint32_t i=0; i<_param->_nb_port_write; i++) 55 60 { 56 61 rename = "in_WRITE_"+toString(i)+"_VAL" ; … … 58 63 rename = "out_WRITE_"+toString(i)+"_ACK" ; 59 64 out_WRITE_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); 65 if (_param->_have_port_address == true) 66 { 60 67 rename = "in_WRITE_"+toString(i)+"_ADDRESS"; 61 68 in_WRITE_ADDRESS [i] = new SC_IN (Taddress_t) (rename.c_str()); 69 } 62 70 rename = "in_WRITE_"+toString(i)+"_DATA" ; 63 71 in_WRITE_DATA [i] = new SC_IN (Tdata_t ) (rename.c_str()); … … 65 73 66 74 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 67 if (_param ._instance == instance_RegisterFile_Monolithic)75 if (_param->_instance == instance_RegisterFile_Monolithic) 68 76 // =====[ component_RegisterFile_Monolithic ]========================= 69 77 { … … 72 80 ,_param_statistics 73 81 #endif 74 , *(_param._param_registerfile_monolithic)82 ,_param->_param_registerfile_monolithic 75 83 ); 76 84 … … 83 91 ,_param_statistics 84 92 #endif 85 , *(_param._param_registerfile_multi_banked)93 ,_param->_param_registerfile_multi_banked 86 94 ); 87 95 … … 89 97 // ~~~~~[ Component - Instanciation ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 90 98 91 if (_param ._instance == instance_RegisterFile_Monolithic)99 if (_param->_instance == instance_RegisterFile_Monolithic) 92 100 // =====[ Component_RegisterFile_Monolithic - Instanciation ]========= 93 101 { … … 95 103 (*(component_RegisterFile_Monolithic ->in_NRESET)) (*(in_NRESET)); 96 104 97 for (uint32_t i=0; i<_param ._nb_port_read; i++)105 for (uint32_t i=0; i<_param->_nb_port_read; i++) 98 106 { 99 107 (*(component_RegisterFile_Monolithic -> in_READ_VAL [i])) (*( in_READ_VAL [i])); 100 108 (*(component_RegisterFile_Monolithic ->out_READ_ACK [i])) (*(out_READ_ACK [i])); 109 if (_param->_have_port_address == true) 101 110 (*(component_RegisterFile_Monolithic -> in_READ_ADDRESS [i])) (*( in_READ_ADDRESS [i])); 102 111 (*(component_RegisterFile_Monolithic ->out_READ_DATA [i])) (*(out_READ_DATA [i])); 103 112 } 104 113 105 for (uint32_t i=0; i<_param ._nb_port_write; i++)114 for (uint32_t i=0; i<_param->_nb_port_write; i++) 106 115 { 107 116 (*(component_RegisterFile_Monolithic -> in_WRITE_VAL [i])) (*( in_WRITE_VAL [i])); 108 117 (*(component_RegisterFile_Monolithic ->out_WRITE_ACK [i])) (*(out_WRITE_ACK [i])); 118 if (_param->_have_port_address == true) 109 119 (*(component_RegisterFile_Monolithic -> in_WRITE_ADDRESS [i])) (*( in_WRITE_ADDRESS [i])); 110 120 (*(component_RegisterFile_Monolithic -> in_WRITE_DATA [i])) (*( in_WRITE_DATA [i])); … … 117 127 (*(component_RegisterFile_Multi_Banked->in_NRESET)) (*(in_NRESET)); 118 128 119 for (uint32_t i=0; i<_param ._nb_port_read; i++)129 for (uint32_t i=0; i<_param->_nb_port_read; i++) 120 130 { 121 131 (*(component_RegisterFile_Multi_Banked-> in_READ_VAL [i])) (*( in_READ_VAL [i])); 122 132 (*(component_RegisterFile_Multi_Banked->out_READ_ACK [i])) (*(out_READ_ACK [i])); 133 if (_param->_have_port_address == true) 123 134 (*(component_RegisterFile_Multi_Banked-> in_READ_ADDRESS [i])) (*( in_READ_ADDRESS [i])); 124 135 (*(component_RegisterFile_Multi_Banked->out_READ_DATA [i])) (*(out_READ_DATA [i])); 125 136 } 126 137 127 for (uint32_t i=0; i<_param ._nb_port_write; i++)138 for (uint32_t i=0; i<_param->_nb_port_write; i++) 128 139 { 129 140 (*(component_RegisterFile_Multi_Banked-> in_WRITE_VAL [i])) (*( in_WRITE_VAL [i])); 130 141 (*(component_RegisterFile_Multi_Banked->out_WRITE_ACK [i])) (*(out_WRITE_ACK [i])); 142 if (_param->_have_port_address == true) 131 143 (*(component_RegisterFile_Multi_Banked-> in_WRITE_ADDRESS [i])) (*( in_WRITE_ADDRESS [i])); 132 144 (*(component_RegisterFile_Multi_Banked-> in_WRITE_DATA [i])) (*( in_WRITE_DATA [i])); … … 134 146 } 135 147 136 if (_param ._instance == instance_RegisterFile_Monolithic)148 if (_param->_instance == instance_RegisterFile_Monolithic) 137 149 _component = component_RegisterFile_Monolithic ->_component; 138 150 else -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_deallocation.cpp
r53 r62 24 24 delete [] in_READ_VAL ; 25 25 delete [] out_READ_ACK ; 26 if (_param->_have_port_address == true) 26 27 delete [] in_READ_ADDRESS; 27 28 delete [] out_READ_DATA ; … … 30 31 delete [] in_WRITE_VAL ; 31 32 delete [] out_WRITE_ACK ; 33 if (_param->_have_port_address == true) 32 34 delete [] in_WRITE_ADDRESS; 33 35 delete [] in_WRITE_DATA ; … … 37 39 // delete _component; 38 40 39 if (_param ._instance == instance_RegisterFile_Monolithic)41 if (_param->_instance == instance_RegisterFile_Monolithic) 40 42 delete component_RegisterFile_Monolithic ; 41 43 else -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_statistics.cpp
r53 r62 19 19 log_printf(FUNC,RegisterFile,"statistics","Begin"); 20 20 21 if (_param->_instance == instance_RegisterFile_Monilithic) 22 component_RegisterFile_Monolithic ->statistics(depth); 21 string txt; 22 23 if (_param->_instance == instance_RegisterFile_Monolithic) 24 txt = component_RegisterFile_Monolithic ->statistics(depth); 23 25 else 24 component_RegisterFile_Multi_Banked->statistics(depth); 25 26 string txt = _stat->print(depth); 26 txt = component_RegisterFile_Multi_Banked->statistics(depth); 27 27 28 28 log_printf(FUNC,RegisterFile,"statistics","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/SelfTest/mkf.info
r57 r62 3 3 target_dep all Select_Priority_Fixed_0.ngc 4 4 target_dep Select_Priority_Fixed_0.ngc Select_Priority_Fixed_0.prj 5 target_dep Select_Priority_Fixed_0.prj Select_Priority_Fixed_0_Pack.vhdl Select_Priority_Fixed_0.vhdl 5 target_dep Select_Priority_Fixed_0.prj Select_Priority_Fixed_0.vhdl Select_Priority_Fixed_0_Pack.vhdl 6 7 # Select_Priority_Fixed_1 8 target_dep all Select_Priority_Fixed_1.ngc 9 target_dep Select_Priority_Fixed_1.ngc Select_Priority_Fixed_1.prj 10 target_dep Select_Priority_Fixed_1.prj Select_Priority_Fixed_1.vhdl Select_Priority_Fixed_10.vhdl Select_Priority_Fixed_10_Pack.vhdl Select_Priority_Fixed_11.vhdl Select_Priority_Fixed_11_Pack.vhdl Select_Priority_Fixed_1_Pack.vhdl 6 11 7 12 # Select_Priority_Fixed_10 8 13 target_dep all Select_Priority_Fixed_10.ngc 9 14 target_dep Select_Priority_Fixed_10.ngc Select_Priority_Fixed_10.prj 10 target_dep Select_Priority_Fixed_10.prj Select_Priority_Fixed_10 _Pack.vhdl Select_Priority_Fixed_10.vhdl15 target_dep Select_Priority_Fixed_10.prj Select_Priority_Fixed_10.vhdl Select_Priority_Fixed_10_Pack.vhdl 11 16 12 17 # Select_Priority_Fixed_11 13 18 target_dep all Select_Priority_Fixed_11.ngc 14 19 target_dep Select_Priority_Fixed_11.ngc Select_Priority_Fixed_11.prj 15 target_dep Select_Priority_Fixed_11.prj Select_Priority_Fixed_11_Pack.vhdl Select_Priority_Fixed_11.vhdl 16 17 # Select_Priority_Fixed_1 18 target_dep all Select_Priority_Fixed_1.ngc 19 target_dep Select_Priority_Fixed_1.ngc Select_Priority_Fixed_1.prj 20 target_dep Select_Priority_Fixed_1.prj Select_Priority_Fixed_10_Pack.vhdl Select_Priority_Fixed_10.vhdl Select_Priority_Fixed_11_Pack.vhdl Select_Priority_Fixed_11.vhdl Select_Priority_Fixed_1_Pack.vhdl Select_Priority_Fixed_1.vhdl 20 target_dep Select_Priority_Fixed_11.prj Select_Priority_Fixed_11.vhdl Select_Priority_Fixed_11_Pack.vhdl 21 21 22 22 # Select_Priority_Fixed_2 23 23 target_dep all Select_Priority_Fixed_2.ngc 24 24 target_dep Select_Priority_Fixed_2.ngc Select_Priority_Fixed_2.prj 25 target_dep Select_Priority_Fixed_2.prj Select_Priority_Fixed_2 _Pack.vhdl Select_Priority_Fixed_2.vhdl25 target_dep Select_Priority_Fixed_2.prj Select_Priority_Fixed_2.vhdl Select_Priority_Fixed_2_Pack.vhdl 26 26 27 27 # Select_Priority_Fixed_3 28 28 target_dep all Select_Priority_Fixed_3.ngc 29 29 target_dep Select_Priority_Fixed_3.ngc Select_Priority_Fixed_3.prj 30 target_dep Select_Priority_Fixed_3.prj Select_Priority_Fixed_3 _Pack.vhdl Select_Priority_Fixed_3.vhdl30 target_dep Select_Priority_Fixed_3.prj Select_Priority_Fixed_3.vhdl Select_Priority_Fixed_3_Pack.vhdl 31 31 32 32 # Select_Priority_Fixed_4 33 33 target_dep all Select_Priority_Fixed_4.ngc 34 34 target_dep Select_Priority_Fixed_4.ngc Select_Priority_Fixed_4.prj 35 target_dep Select_Priority_Fixed_4.prj Select_Priority_Fixed_4 _Pack.vhdl Select_Priority_Fixed_4.vhdl35 target_dep Select_Priority_Fixed_4.prj Select_Priority_Fixed_4.vhdl Select_Priority_Fixed_4_Pack.vhdl 36 36 37 37 # Select_Priority_Fixed_5 38 38 target_dep all Select_Priority_Fixed_5.ngc 39 39 target_dep Select_Priority_Fixed_5.ngc Select_Priority_Fixed_5.prj 40 target_dep Select_Priority_Fixed_5.prj Select_Priority_Fixed_5 _Pack.vhdl Select_Priority_Fixed_5.vhdl40 target_dep Select_Priority_Fixed_5.prj Select_Priority_Fixed_5.vhdl Select_Priority_Fixed_5_Pack.vhdl 41 41 42 42 # Select_Priority_Fixed_6 43 43 target_dep all Select_Priority_Fixed_6.ngc 44 44 target_dep Select_Priority_Fixed_6.ngc Select_Priority_Fixed_6.prj 45 target_dep Select_Priority_Fixed_6.prj Select_Priority_Fixed_6 _Pack.vhdl Select_Priority_Fixed_6.vhdl45 target_dep Select_Priority_Fixed_6.prj Select_Priority_Fixed_6.vhdl Select_Priority_Fixed_6_Pack.vhdl 46 46 47 47 # Select_Priority_Fixed_7 48 48 target_dep all Select_Priority_Fixed_7.ngc 49 49 target_dep Select_Priority_Fixed_7.ngc Select_Priority_Fixed_7.prj 50 target_dep Select_Priority_Fixed_7.prj Select_Priority_Fixed_7 _Pack.vhdl Select_Priority_Fixed_7.vhdl50 target_dep Select_Priority_Fixed_7.prj Select_Priority_Fixed_7.vhdl Select_Priority_Fixed_7_Pack.vhdl 51 51 52 52 # Select_Priority_Fixed_8 53 53 target_dep all Select_Priority_Fixed_8.ngc 54 54 target_dep Select_Priority_Fixed_8.ngc Select_Priority_Fixed_8.prj 55 target_dep Select_Priority_Fixed_8.prj Select_Priority_Fixed_8 _Pack.vhdl Select_Priority_Fixed_8.vhdl55 target_dep Select_Priority_Fixed_8.prj Select_Priority_Fixed_8.vhdl Select_Priority_Fixed_8_Pack.vhdl 56 56 57 57 # Select_Priority_Fixed_9 58 58 target_dep all Select_Priority_Fixed_9.ngc 59 59 target_dep Select_Priority_Fixed_9.ngc Select_Priority_Fixed_9.prj 60 target_dep Select_Priority_Fixed_9.prj Select_Priority_Fixed_9 _Pack.vhdl Select_Priority_Fixed_9.vhdl60 target_dep Select_Priority_Fixed_9.prj Select_Priority_Fixed_9.vhdl Select_Priority_Fixed_9_Pack.vhdl 61 61 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Common
r55 r62 20 20 21 21 LIBDIR = $(DIR_LIBRARY) \ 22 $(SYSTEMC_LIBDIR_$(SIMULATOR)) \23 $(SOCLIB_LIBDIR) \24 $(OR1K_LIBDIR)22 $(SYSTEMC_LIBDIR_$(SIMULATOR)) 23 # $(SOCLIB_LIBDIR) \ 24 # $(OR1K_LIBDIR) 25 25 26 LIBS = $(LIBRARY) -lm $(SYSTEMC_LIBNAME_$(SIMULATOR)) $(SOCLIB_LIBNAME) $(OR1K_LIBNAME) -lbfd -ldl 26 LIBS = $(LIBRARY) -lm $(SYSTEMC_LIBNAME_$(SIMULATOR)) -ldl 27 28 # $(SOCLIB_LIBNAME) $(OR1K_LIBNAME) -lbfd 27 29 28 30 FLAGS_COMMON = $(SYSTEMC_CFLAGS_$(SIMULATOR)) \ -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Selftest
r53 r62 47 47 config : $(DIR_CFG_GEN) 48 48 @\ 49 $(ECHO) "Generate configuration"; \49 $(ECHO) "Generate configuration"; \ 50 50 declare -i CPT=0; \ 51 51 declare files; \ … … 160 160 *.pos \ 161 161 *.stat \ 162 *.dot \ 163 *.txt \ 162 164 generated_by_systemcass \ 163 165 core*; … … 178 180 help : 179 181 @\ 180 $(MAKE) common_help ; \182 $(MAKE) common_help ; \ 181 183 $(MAKE) synthesis_help;\ 182 184 $(MAKE) selftest_help; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Synthesis
r53 r62 22 22 $(patsubst $(DIR_CFG_USER)/%.cfg,$(DIR_LOG)/%.fpga.log,$(wildcard $(DIR_CFG_USER)/*.cfg)) 23 23 #-----[ Rules ]-------------------------------------------- 24 .PRECIOUS : $(DIR_LOG)/%.vhdl.log $(DIR_LOG)/%. vhdl_sim.log24 .PRECIOUS : $(DIR_LOG)/%.vhdl.log $(DIR_LOG)/%.sim.log 25 25 26 26 vhdl : execute $(DIR_WORK) … … 36 36 if $(TEST) $${#log_files[*]} -ne 0; then $(MAKE) $${log_files[*]/#$(DIR_VHDL)/$(DIR_LOG)}; fi; 37 37 38 vhdl_sim: vhdl38 sim : vhdl 39 39 @\ 40 40 declare -a vhdl_files=($$($(LS) $(DIR_VHDL)/*_Testbench.vhdl)); \ 41 declare -a log_files=($${vhdl_files[*]/%.vhdl/. vhdl_sim.log}); \41 declare -a log_files=($${vhdl_files[*]/%.vhdl/.sim.log}); \ 42 42 if $(TEST) $${#log_files[*]} -ne 0; then $(MAKE) $${log_files[*]/#$(DIR_VHDL)/$(DIR_LOG)}; fi; 43 43 44 fpga : vhdl_sim44 fpga : sim 45 45 @\ 46 46 $(ECHO) -e "" > $(FPGA_CFG_FILE_LOCAL); \ … … 54 54 $(ECHO) -e "" >> $(FPGA_CFG_FILE_LOCAL); \ 55 55 done; \ 56 ($(XILINX_ENV); $(CD) $(FPGA_CFG_FILE_GLOBAL_DIR); ./$(FPGA_CFG_FILE_GLOBAL)); \56 ($(XILINX_ENV); $(CD) $(FPGA_CFG_FILE_GLOBAL_DIR); $(FPGA_CFG_FILE_GLOBAL)); \ 57 57 $(MAKE) $(FPGA_LOG_FILES); 58 58 … … 67 67 $(MODELTECH_VLIB) $@; 68 68 69 $(DIR_LOG)/%. vhdl_sim.log: $(DIR_VHDL)/%.vhdl $(DIR_LOG)/%.vhdl.log69 $(DIR_LOG)/%.sim.log : $(DIR_VHDL)/%.vhdl $(DIR_LOG)/%.vhdl.log 70 70 @\ 71 71 $(ECHO) "VHDL's Simulation : $*"; \ … … 92 92 $(ECHO) "";\ 93 93 $(ECHO) " * vhdl : compile all vhdl's file";\ 94 $(ECHO) " * vhdl_sim: simulate all testbench's file";\94 $(ECHO) " * sim : simulate all testbench's file";\ 95 95 $(ECHO) " * fpga : synthetis with fpga's tools";\ 96 96 $(ECHO) ""; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.flags
r57 r62 2 2 # $Id$ 3 3 # 4 # [ 4 # [ Description ] 5 5 # 6 6 7 #-----[ 7 #-----[ Simulator ]---------------------------------------- 8 8 SIMULATOR = systemcass_deps 9 9 10 # 11 # 10 # 3 simulators : 11 # systemc - SystemC 12 12 # systemcass - SystemCASS 13 13 # systemcass_deps - Systemcass, and use port dependency information instead of sensitivity list 14 14 15 #-----[ 15 #-----[ Flags ]-------------------------------------------- 16 16 MORPHEO_FLAGS = -DSYSTEMC \ 17 -DVHDL \ 18 -DVHDL_TESTBENCH \ 19 -DVHDL_TESTBENCH_ASSERT \ 20 -DSTATISTICS \ 21 -DDEBUG=DEBUG_TRACE 17 -DDEBUG=DEBUG_TRACE 22 18 23 19 # -DVHDL \ 20 # -DVHDL_TESTBENCH \ 21 # -DVHDL_TESTBENCH_ASSERT \ 22 # 23 # -DSTATISTICS \ 24 24 # -DCONFIGURATION \ 25 25 # -DPOSITION \ … … 28 28 # DEBUG={level} - Print Debug Message 29 29 # SYSTEMC - To generate a systemc's model 30 # 30 # VHDL - To generate a vhdl's models 31 31 # VHDL_TESTBENCH (need SYSTEMC) - In the simulation, generate two testbench's file (input and ouput) to validate the vhdl's model 32 32 # VHDL_TESTBENCH_ASSERT (need SYSTEMC) - In the simulation, generate in testbench's file an serie of assert 33 # 34 # 33 # STATISTICS (need SYSTEMC) - In the simulation, generate a statistics's file 34 # POSITION - To generate a position's files (it's input of viewer) 35 35 # CONFIGURATION - To generate a configuration's file (it's input of viewer and generator) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.mkf
r57 r62 3 3 # 4 4 5 all: _Generic/RegisterFile/RegisterFile_Monolithic/SelfTest _Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest _Generic/Select/Select_Priority_Fixed/SelfTest 5 all: _Generic/RegisterFile/RegisterFile_Monolithic/SelfTest _Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest _Generic/Select/Select_Priority_Fixed/SelfTest _Generic/RegisterFile/RegisterFile_Monolithic/SelfTest _Core/Multi_Execute_loop/Execute_loop/Register_unit/Register_unit_Glue/SelfTest 6 6 7 7 _Generic/RegisterFile/RegisterFile_Monolithic/SelfTest: 8 gmake all -C Generic/RegisterFile/RegisterFile_Monolithic/SelfTest8 make all -C Generic/RegisterFile/RegisterFile_Monolithic/SelfTest 9 9 10 10 _Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest: 11 gmake all -C Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest11 make all -C Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest 12 12 13 13 _Generic/Select/Select_Priority_Fixed/SelfTest: 14 gmake all -C Generic/Select/Select_Priority_Fixed/SelfTest 14 make all -C Generic/Select/Select_Priority_Fixed/SelfTest 15 16 _Core/Multi_Execute_loop/Execute_loop/Register_unit/Register_unit_Glue/SelfTest: 17 make all -C Core/Multi_Execute_loop/Execute_loop/Register_unit/Register_unit_Glue/SelfTest 15 18 16 19 clean: 17 gmake clean -C Generic/RegisterFile/RegisterFile_Monolithic/SelfTest 18 gmake clean -C Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest 19 gmake clean -C Generic/Select/Select_Priority_Fixed/SelfTest 20 make clean -C Generic/RegisterFile/RegisterFile_Monolithic/SelfTest 21 make clean -C Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest 22 make clean -C Generic/Select/Select_Priority_Fixed/SelfTest 23 make clean -C Core/Multi_Execute_loop/Execute_loop/Register_unit/Register_unit_Glue/SelfTest 20 24 21 25 re: clean all 22 26 23 27 install: 24 gmake install -C Generic/RegisterFile/RegisterFile_Monolithic/SelfTest 25 gmake install -C Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest 26 gmake install -C Generic/Select/Select_Priority_Fixed/SelfTest 28 make install -C Generic/RegisterFile/RegisterFile_Monolithic/SelfTest 29 make install -C Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest 30 make install -C Generic/Select/Select_Priority_Fixed/SelfTest 31 make install -C Core/Multi_Execute_loop/Execute_loop/Register_unit/Register_unit_Glue/SelfTest 27 32 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/Makefile.deps
r53 r62 21 21 $(Behavioural_DIR_LIBRARY) 22 22 23 @COMPONENT_DEPENDENCIES = Behavioural_library 24 25 @COMPONENT_CLEAN = Behavioural_library_clean 26 23 27 #-----[ Rules ]-------------------------------------------- 24 28 25 @COMPONENT_library : 29 .NOTPARALLEL : @COMPONENT_library @COMPONENT_library_clean 30 31 @COMPONENT_library : $(@COMPONENT_DEPENDENCIES) 26 32 @\ 27 $(MAKE) Behavioural_library; \28 33 $(MAKE) --directory=$(DIR_MORPHEO)/Behavioural/@DIRECTORY --makefile=Makefile; 29 30 @COMPONENT_library_clean : 34 35 @COMPONENT_library_clean : $(@COMPONENT_CLEAN) 31 36 @\ 32 $(MAKE) Behavioural_library_clean; \33 37 $(MAKE) --directory=$(DIR_MORPHEO)/Behavioural/@DIRECTORY --makefile=Makefile clean; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/SelfTest/src/main.cpp
r55 r62 34 34 usage (argc, argv); 35 35 36 const string name = argv[1]; 37 //const uint32_t size_data = atoi(argv[2]); 38 //const uint32_t nb_port = atoi(argv[3]); 36 uint32_t x = 1; 37 38 const string name = argv[x++]; 39 //const uint32_t size_data = atoi(argv[x++]); 40 //const uint32_t nb_port = atoi(argv[x++]); 39 41 40 42 try -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Component.h
r57 r62 38 38 { 39 39 public : Tinstance_t _instance; 40 public : Entity 40 public : Entity * _entity ; 41 41 } Tcomponent_t; 42 42 … … 74 74 75 75 private : Entity * find_entity (string name); 76 77 Entity * entity);76 //private : Interface * find_interface (string name , 77 // Entity * entity); 78 78 79 79 #ifdef VHDL … … 81 81 #endif 82 82 83 84 private : Signal * signal_internal (Entity * entity_productor, 85 Signal * signal_productor); 86 83 87 public : void port_map (string component_src , 84 88 string port_src , 85 89 string component_dest, 86 90 string port_dest ); 91 public : void port_map (string component_src , 92 string port_src ); 93 94 public : bool test_map (void); 87 95 88 96 #ifdef POSITION -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Constants.h
r59 r62 131 131 #define EXCEPTION_MEMORY_BUS_ERROR 0x4 // Access at a invalid physical address 132 132 #define EXCEPTION_MEMORY_MISS_SPECULATION 0x5 // Load miss speculation 133 134 //==================================================[ dcache_type ]===== 135 # define DCACHE_LOAD 0x0 // 0000 136 # define DCACHE_LOCK 0x1 // 0001 137 # define DCACHE_INVALIDATE 0x2 // 0010 138 # define DCACHE_PREFETCH 0x3 // 0011 139 //#define DCACHE_ 0x4 // 0100 140 //#define DCACHE_ 0x5 // 0101 141 # define DCACHE_FLUSH 0x6 // 0110 142 # define DCACHE_SYNCHRONIZATION 0x7 // 0111 143 144 # define DCACHE_STORE_8 0x8 // 1000 145 # define DCACHE_STORE_16 0x9 // 1001 146 # define DCACHE_STORE_32 0xa // 1010 147 # define DCACHE_STORE_64 0xb // 1011 148 //#define DCACHE_ 0xc // 1100 149 //#define DCACHE_ 0xd // 1101 150 //#define DCACHE_ 0xe // 1110 151 //#define DCACHE_ 0xf // 1111 152 153 154 // just take the 4 less significative bits. 155 #define operation_to_dcache_type(x) (x&0xf) 133 156 134 157 /* -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Debug_component.h
r56 r62 25 25 #define DEBUG_Read_queue false 26 26 #define DEBUG_Reservation_station false 27 #define DEBUG_Register_unit true 28 #define DEBUG_Register_unit_Glue false 27 29 #define DEBUG_Multi_Front_end false 28 30 #define DEBUG_Front_end false -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Entity.h
r57 r62 80 80 #endif 81 81 82 public : bool test_map (bool top_level); 83 82 84 #ifdef POSITION 83 85 public : XML toXML (void); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface.h
r57 r62 22 22 #include "Behavioural/include/Vhdl.h" 23 23 #endif 24 #include "Common/include/ChangeCase.h" 24 25 #include "Common/include/ToString.h" 25 26 #include "Common/include/ErrorMorpheo.h" … … 230 231 #endif 231 232 233 public : bool test_map (bool top_level); 234 232 235 #ifdef POSITION 233 236 public : void interface_map (void * entity, -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interfaces.h
r57 r62 80 80 public : XML toXML_mapping (void); 81 81 #endif 82 83 public : bool test_map (bool top_level); 84 82 85 public : friend ostream& operator<< (ostream& output_stream, 83 86 morpheo::behavioural::Interfaces & x); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Parameters.h
r59 r62 15 15 #include "Common/include/ErrorMorpheo.h" 16 16 #include "Common/include/ToString.h" 17 #include "Common/include/Log2.h" 17 18 #include "Common/include/Debug.h" 18 19 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Signal.h
r59 r62 53 53 54 54 // -----[ fields ]---------------------------------------------------- 55 private : const string _name ;56 private : const direction_t _direction ;57 private : const uint32_t _size ;58 private : const presence_port_t _presence_port ;55 private : const string _name ; 56 private : const direction_t _direction ; 57 private : const uint32_t _size ; 58 private : const presence_port_t _presence_port ; 59 59 60 60 private : Signal * _connect_to_signal; // the actual implementaion, this signal link with one signal (but if signal is an output, it can be connect with many signal ...) 61 61 private : Signal * _connect_from_signal; // producter of signal. If NULL, then producteur is the current entity 62 private : bool _is_allocate ; // Have allocate a sc_in or sc_out port 63 private : void * _sc_signal ; // sc_in or sc_out associated at this signal 64 private : bool _is_map ; 65 private : void * _sc_signal_map; // sc_out generated this signal 66 private : type_info_t _type_info ; 62 private : bool _is_allocate ; // Have allocate a sc_in or sc_out port 63 private : void * _sc_signal ; // sc_in or sc_out associated at this signal 64 private : void * _sc_signal_map ; // sc_out generated this signal 65 private : bool _is_map_as_src ; 66 private : bool _is_map_as_dest; 67 private : type_info_t _type_info ; 67 68 68 69 #ifdef VHDL_TESTBENCH 69 private : list<string> * _list_value ;70 private : list<string> * _list_value ; 70 71 #endif 71 72 … … 78 79 public : ~Signal (); 79 80 80 public : string get_name (void); 81 public : uint32_t get_size (void); 82 public : bool get_is_map (void); 83 public : Signal * get_connect_to_signal (void); 81 public : string get_name (void); 82 public : uint32_t get_size (void); 83 public : Signal * get_connect_to_signal (void); 84 84 public : Signal * get_connect_from_signal (void); 85 public : direction_t get_direction (void); 86 87 public : bool presence_vhdl (void); 88 public : bool presence_testbench (void); 89 90 // public : void mapping (Signal * signal); 91 public : void link (Signal * signal , 92 bool is_port_component); 85 public : direction_t get_direction (void); 86 public : type_info_t get_type_info (void); 87 88 public : bool presence_vhdl (void); 89 public : bool presence_testbench (void); 90 91 public : bool test_map (bool top_level); 92 93 public : void link (Signal * signal_dest, 94 bool signal_dest_is_port); 95 96 public : void connect (Signal * signal_dest); 93 97 94 98 #ifdef SYSTEMC -
trunk/IPs/systemC/processor/Morpheo/Behavioural/mkf.info
r57 r62 18 18 target_dep all Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest 19 19 target_dep all Generic/Select/Select_Priority_Fixed/SelfTest 20 20 target_dep all Generic/RegisterFile/RegisterFile_Monolithic/SelfTest 21 target_dep all Core/Multi_Execute_loop/Execute_loop/Register_unit/Register_unit_Glue/SelfTest 21 22 # mkf include path 22 23 var_define _mkf_path include_mkf -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_port_map.cpp
r44 r62 51 51 ,signal_dest->get_name().c_str()); 52 52 53 signal_src ->link (signal_dest, entity_dest == _entity); 54 //signal_dest->mapping(signal_src ); 53 // need an internal signal ? 54 bool src_is_port = entity_src == _entity; 55 bool dest_is_port = entity_dest == _entity; 56 57 if (src_is_port == true) 58 throw (ErrorMorpheo ("<Component::port_map> src can't be an interface's port of the top level.")); 55 59 60 // 2 cases : 61 // a) dest is a top level port -> direct connection 62 // b) dest is a component port -> need internal signal 63 if (dest_is_port == false) 64 { 65 // 1) find productor of signal 66 // 67 // Interface Component 68 // | | 69 // ----> (IN) --X-> (IN) 70 // | | 71 // <-X-- (OUT) <---- (OUT) 72 // | | 73 74 Signal * signal_productor; 75 Entity * entity_productor; 76 77 bool src_is_productor = (signal_src->get_direction() == OUT); 78 79 if (src_is_productor == true) 80 { 81 signal_productor = signal_src; 82 entity_productor = entity_src; 83 } 84 else 85 { 86 signal_productor = signal_dest; 87 entity_productor = entity_dest; 88 } 89 90 signal_dest = signal_internal (entity_productor, signal_productor); 91 dest_is_port = false; 92 } 93 94 try 95 { 96 signal_src->link(signal_dest, 97 dest_is_port); 98 } 99 catch (morpheo::ErrorMorpheo & error) 100 { 101 throw (ErrorMorpheo ("<Component::port_map> Error in mapping between "+entity_src ->get_name()+"."+signal_src ->get_name()+" and "+entity_dest->get_name()+"."+signal_dest->get_name()+" :\n"+error.what ())); 102 } 103 //catch (...) 104 // { 105 // } 106 107 log_printf(FUNC,Behavioural,FUNCTION,"End"); 108 }; 109 110 111 void Component::port_map (string component_src , 112 string port_src ) 113 { 114 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 115 116 Entity * entity_src = find_entity(component_src); 117 118 if (entity_src == NULL) 119 throw (ErrorMorpheo ("<Component::port_map> in component \""+_entity->get_name()+"\", port map with unknow component \""+component_src+"\".")); 120 121 Signal * signal_src = entity_src->find_signal (port_src); 122 123 if (signal_src == NULL) 124 throw (ErrorMorpheo ("<Component::port_map> in component \""+_entity->get_name()+"\", port map with component \""+component_src+"\" and a unknow signal \""+port_src+"\".")); 125 126 // need an internal signal ? 127 128 if (entity_src == _entity) 129 throw (ErrorMorpheo ("<Component::port_map> src can't be an interface's port of the top level.")); 130 131 if (signal_src->get_direction() != OUT) 132 throw (ErrorMorpheo ("<Component::port_map> the direction of the signal '"+signal_src->get_name()+"' must be OUT.")); 133 134 try 135 { 136 signal_src->link(signal_internal (entity_src, signal_src), 137 false); 138 } 139 catch (morpheo::ErrorMorpheo & error) 140 { 141 throw (ErrorMorpheo ("<Component::port_map> Error in mapping "+entity_src ->get_name()+"."+signal_src ->get_name()+" :\n"+error.what ())); 142 } 143 //catch (...) 144 // { 145 // } 146 56 147 log_printf(FUNC,Behavioural,FUNCTION,"End"); 57 148 }; … … 59 150 }; // end namespace behavioural 60 151 }; // end namespace morpheo 152 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_fifo_testbench_test.cpp
r42 r62 66 66 while (i != _list_cycle->end()) 67 67 { 68 vhdl->set_body("assert not ( ("+counter_name+" = "+toString(*i)+")) report \"***** <"+_name+"> interface's test number "+toString(j)+" *****\" severity NOTE;"); 68 vhdl->set_body("assert not (("+counter_name+" = "+toString(*i)+" and "+test_name+" = '1')) report \"***** <"+_name+"> Test number "+toString(j)+" is OK *****\" severity NOTE;"); 69 vhdl->set_body("assert not (("+counter_name+" = "+toString(*i)+" and "+test_name+" = '0')) report \"@@@@@ <"+_name+"> Test number "+toString(j)+" is KO !!! @@@@@\" severity NOTE;"); 69 70 j++; 70 71 ++i; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_signal_name.cpp
r44 r62 7 7 8 8 #include "Behavioural/include/Interface.h" 9 #include "Common/include/ChangeCase.h"10 9 11 10 namespace morpheo { -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal.cpp
r44 r62 22 22 log_printf(FUNC,Behavioural,"Signal","Begin"); 23 23 _is_allocate = false; 24 _is_map = false; 24 _is_map_as_src = false; 25 _is_map_as_dest= false; 25 26 _connect_from_signal = NULL; 26 27 _connect_to_signal = NULL; … … 41 42 { 42 43 log_printf(FUNC,Behavioural,"Signal (copy)","Begin"); 43 _is_allocate= signal._is_allocate; 44 _is_map = signal._is_map ; 44 _is_allocate = signal._is_allocate; 45 _is_map_as_src = signal._is_map_as_src ; 46 _is_map_as_dest = signal._is_map_as_dest; 45 47 _connect_from_signal = signal._connect_from_signal; 46 48 _connect_to_signal = signal._connect_to_signal; 47 _sc_signal = signal._sc_signal ;48 _sc_signal_map = signal._sc_signal_map;49 _type_info = signal._type_info ;49 _sc_signal = signal._sc_signal ; 50 _sc_signal_map = signal._sc_signal_map; 51 _type_info = signal._type_info ; 50 52 #ifdef VHDL_TESTBENCH 51 _list_value = signal._list_value;53 _list_value = signal._list_value; 52 54 #endif 53 55 log_printf(FUNC,Behavioural,"Signal (copy)","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_link.cpp
r44 r62 14 14 #undef FUNCTION 15 15 #define FUNCTION "Signal::link" 16 void Signal::link (Signal * signal ,17 bool is_port_component)16 void Signal::link (Signal * signal_dest, 17 bool signal_dest_is_port) 18 18 { 19 19 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 20 20 21 if ( _is_allocate == false) 22 throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\", can't map with signal \""+ get_name()+"\", because it's not already allocate.")); 23 if (signal->_is_allocate == false) 24 throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\", can't map with signal \""+signal->get_name()+"\", because it's not already allocate.")); 25 if (_is_map == true) 26 throw (ErrorMorpheo ("<Signal::mapping> Can't mapping signal \""+_name+"\" with \""+signal->get_name()+"\", because it's already map.")); 27 21 Signal * signal_src = this; 22 23 // Test 24 if (signal_src ->_is_allocate == false) 25 throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\", can't map with signal \""+ get_name()+"\", because the first signal is not already allocate.")); 26 if (signal_dest->_is_allocate == false) 27 throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\", can't map with signal \""+signal_dest->get_name()+"\", because the second signal is not already allocate.")); 28 if (signal_src ->_is_map_as_src == true) 29 throw (ErrorMorpheo ("<Signal::mapping> Can't mapping signal \""+_name+"\" with \""+signal_dest->get_name()+"\", because the first signal is already mapped.")); 30 31 // log_printf(TRACE,Behavioural,FUNCTION, " * sc_signal (before) %.8x - %.8x", (uint32_t)(_sc_signal_map), (uint32_t)(signal_dest->_sc_signal_map)); 28 32 29 33 // List of all case 30 34 // 31 // dest src dest src32 // PORT {IN } ----- {SIG} COMBI33 // PORT {OUT} ----- {SIG} COMBI35 // src dest 36 // COMPONENT {IN } ----- {SIG} SIGNAL 37 // COMPONENT {OUT} ----- {SIG} SIGNAL 34 38 // 35 // PORT {IN } --X-- {OUT} COMPONENT {IN } ----- {OUT} COMPONENT 36 // PORT {IN } ----- {IN } COMPONENT {IN } --X-- {IN } COMPONENT 37 // PORT {OUT} ----- {OUT} COMPONENT {OUT} --X-- {OUT} COMPONENT 38 // PORT {OUT} --X-- {IN } COMPONENT {OUT} ----- {IN } COMPONENT 39 // COMPONENT {IN } ----- {IN } PORT 40 // COMPONENT {OUT} ----- {OUT} PORT 39 41 40 // log_printf(TRACE,Behavioural,FUNCTION, "Signal \"%s\"\tlink with \"%s\"", _name.c_str(), signal->get_name().c_str()); 42 // list valid case 43 if (not ( signal_dest_is_port and (((signal_src->_direction == IN ) and (signal_dest->_direction == IN )) or 44 ((signal_src->_direction == OUT) and (signal_dest->_direction == OUT )))) and 45 not (not signal_dest_is_port and (((signal_src->_direction == IN ) and (signal_dest->_direction == INTERNAL)) or 46 ((signal_src->_direction == OUT) and (signal_dest->_direction == INTERNAL))))) 47 throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\" can't been linked with signal \""+signal_dest->get_name()+"\" : illegal direction ("+toString(signal_src->_direction)+" with "+toString(signal_dest->_direction)+").")); 41 48 42 log_printf(TRACE,Behavioural,FUNCTION, " * sc_signal (before) %.8x - %.8x", (uint32_t)(_sc_signal_map), (uint32_t)(signal->_sc_signal_map)); 49 // update info source 50 signal_src ->_connect_to_signal = signal_dest; 51 signal_src ->_is_map_as_src = true; 52 53 // update info destination 54 signal_dest->_connect_from_signal = signal_src; 55 signal_dest->_is_map_as_dest = true; 43 56 44 _connect_to_signal = signal; 45 signal->_connect_from_signal = this; 57 // vhdl_testbench : to read an output producte by a internal component 58 // TODO : à vérifier !!!!!!!!!!!! 59 if ((signal_dest_is_port == true) and 60 (signal_src ->_direction == OUT)) 61 signal_dest->_sc_signal_map = signal_src ->_sc_signal_map; 62 63 connect (signal_dest); 46 64 47 if (is_port_component == true) 48 { 49 if ((_direction == IN ) and (signal->_direction == IN )) 50 { 51 switch (_type_info) 52 { 53 case BOOL : {(*(static_cast<sc_in <bool > *>(_sc_signal))) (*(static_cast<sc_in <bool > *>(signal->_sc_signal))); break;} 54 case UINT8_T : {(*(static_cast<sc_in <uint8_t > *>(_sc_signal))) (*(static_cast<sc_in <uint8_t > *>(signal->_sc_signal))); break;} 55 case UINT16_T : {(*(static_cast<sc_in <uint16_t> *>(_sc_signal))) (*(static_cast<sc_in <uint16_t> *>(signal->_sc_signal))); break;} 56 case UINT32_T : {(*(static_cast<sc_in <uint32_t> *>(_sc_signal))) (*(static_cast<sc_in <uint32_t> *>(signal->_sc_signal))); break;} 57 case UINT64_T : {(*(static_cast<sc_in <uint64_t> *>(_sc_signal))) (*(static_cast<sc_in <uint64_t> *>(signal->_sc_signal))); break;} 58 default : {throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\" : type unknow.")); break;} 59 } 60 } 61 else 62 { 63 if ((_direction == OUT) and (signal->_direction == OUT)) 64 { 65 _is_map = true; 66 signal->_sc_signal_map = _sc_signal_map; 67 68 switch (_type_info) 69 { 70 case BOOL : {(*(static_cast<sc_out <bool > *>(_sc_signal))) (*(static_cast<sc_out <bool > *>(signal->_sc_signal))); break;} 71 case UINT8_T : {(*(static_cast<sc_out <uint8_t > *>(_sc_signal))) (*(static_cast<sc_out <uint8_t > *>(signal->_sc_signal))); break;} 72 case UINT16_T : {(*(static_cast<sc_out <uint16_t> *>(_sc_signal))) (*(static_cast<sc_out <uint16_t> *>(signal->_sc_signal))); break;} 73 case UINT32_T : {(*(static_cast<sc_out <uint32_t> *>(_sc_signal))) (*(static_cast<sc_out <uint32_t> *>(signal->_sc_signal))); break;} 74 case UINT64_T : {(*(static_cast<sc_out <uint64_t> *>(_sc_signal))) (*(static_cast<sc_out <uint64_t> *>(signal->_sc_signal))); break;} 75 default : {throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\" : type unknow.")); break;} 76 } 77 } 78 else 79 { 80 throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\" can't been linked with signal \""+signal->get_name()+"\" : between two components, illegal direction ("+toString(_direction)+" with "+toString(signal->_direction)+").")); 81 } 82 } 83 } 84 else 85 { 86 if ((_direction == IN ) and (signal->_direction == OUT)) 87 { 88 switch (_type_info) 89 { 90 case BOOL : {(*(static_cast<sc_in <bool > *>(_sc_signal))) (*(static_cast<sc_out <bool > *>(signal->_sc_signal))); break;} 91 case UINT8_T : {(*(static_cast<sc_in <uint8_t > *>(_sc_signal))) (*(static_cast<sc_out <uint8_t > *>(signal->_sc_signal))); break;} 92 case UINT16_T : {(*(static_cast<sc_in <uint16_t> *>(_sc_signal))) (*(static_cast<sc_out <uint16_t> *>(signal->_sc_signal))); break;} 93 case UINT32_T : {(*(static_cast<sc_in <uint32_t> *>(_sc_signal))) (*(static_cast<sc_out <uint32_t> *>(signal->_sc_signal))); break;} 94 case UINT64_T : {(*(static_cast<sc_in <uint64_t> *>(_sc_signal))) (*(static_cast<sc_out <uint64_t> *>(signal->_sc_signal))); break;} 95 default : {throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\" : type unknow.")); break;} 96 } 97 } 98 else 99 { 100 if ((_direction == OUT) and (signal->_direction == IN )) 101 { 102 _is_map = true; 103 switch (_type_info) 104 { 105 case BOOL : {(*(static_cast<sc_out <bool > *>(_sc_signal))) (*(static_cast<sc_in <bool > *>(signal->_sc_signal))); break;} 106 case UINT8_T : {(*(static_cast<sc_out <uint8_t > *>(_sc_signal))) (*(static_cast<sc_in <uint8_t > *>(signal->_sc_signal))); break;} 107 case UINT16_T : {(*(static_cast<sc_out <uint16_t> *>(_sc_signal))) (*(static_cast<sc_in <uint16_t> *>(signal->_sc_signal))); break;} 108 case UINT32_T : {(*(static_cast<sc_out <uint32_t> *>(_sc_signal))) (*(static_cast<sc_in <uint32_t> *>(signal->_sc_signal))); break;} 109 case UINT64_T : {(*(static_cast<sc_out <uint64_t> *>(_sc_signal))) (*(static_cast<sc_in <uint64_t> *>(signal->_sc_signal))); break;} 110 default : {throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\" : type unknow.")); break;} 111 } 112 } 113 else 114 { 115 throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\" can't been linked with signal \""+signal->get_name()+"\" : between a interface's port and one component, illegal direction ("+toString(_direction)+" with "+toString(signal->_direction)+").")); 116 } 117 } 118 } 119 120 log_printf(TRACE,Behavioural,FUNCTION, " * sc_signal (after ) %.8x - %.8x", (uint32_t)(_sc_signal_map), (uint32_t)(signal->_sc_signal_map)); 65 // log_printf(TRACE,Behavioural,FUNCTION, " * sc_signal (after ) %.8x - %.8x", (uint32_t)(_sc_signal_map), (uint32_t)(signal_dest->_sc_signal_map)); 66 121 67 log_printf(FUNC,Behavioural,FUNCTION,"End"); 122 68 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_print.cpp
r42 r62 19 19 output_stream << "\t{" << x._size << "}\t" 20 20 << toString(x._direction) << "\t" 21 << toString(x._presence_port); 21 << toString(x._presence_port) 22 << "sc_signal : " << hex << x._sc_signal << " - " << x._sc_signal_map << dec; 22 23 23 24 log_printf(FUNC,Behavioural,"operator<<","End");
Note: See TracChangeset
for help on using the changeset viewer.