Changeset 41 for trunk/IPs/systemC/processor/Morpheo
- Timestamp:
- Jun 7, 2007, 9:13:47 PM (18 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo
- Files:
-
- 21 added
- 4 deleted
- 66 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h
r15 r41 23 23 #include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Statistics.h" 24 24 #endif 25 #ifdef POSITION 26 #include "Behavioural/include/Position.h" 27 #else 28 #include "Behavioural/include/Interfaces.h" 29 #endif 25 30 #ifdef VHDL 26 31 #include "Behavioural/include/Vhdl.h" 27 #endif28 #ifdef VHDL_TESTBENCH29 #include "Behavioural/include/Vhdl_Testbench.h"30 32 #endif 31 33 … … 55 57 #endif 56 58 57 #ifdef VHDL_TESTBENCH58 private : Vhdl_Testbench * _vhdl_testbench;59 #ifdef POSITION 60 private : Position * _position; 59 61 #endif 62 63 private : Interfaces * _interfaces; 60 64 61 65 #ifdef SYSTEMC … … 63 67 // Interface 64 68 public : SC_CLOCK * in_CLOCK ; 65 public : SC_ CLOCK* in_NRESET ;69 public : SC_IN (Tcontrol_t) * in_NRESET ; 66 70 67 71 // ----- Interface Read … … 117 121 #if VHDL 118 122 private : void vhdl (void); 119 private : void vhdl_port (Vhdl & vhdl);120 private : void vhdl_type (Vhdl & vhdl);121 private : void vhdl_signal (Vhdl & vhdl);122 private : void vhdl_body (Vhdl & vhdl);123 private : void vhdl_port (Vhdl * & vhdl); 124 private : void vhdl_type (Vhdl * & vhdl); 125 private : void vhdl_signal (Vhdl * & vhdl); 126 private : void vhdl_body (Vhdl * & vhdl); 123 127 #endif 124 128 125 129 #ifdef VHDL_TESTBENCH 126 private : void vhdl_testbench (Vhdl_Testbench & vhdl_testbench); 127 private : void vhdl_testbench_port (Vhdl_Testbench & vhdl_testbench); 128 private : void vhdl_testbench_transition (Vhdl_Testbench & vhdl_testbench); 130 private : void vhdl_testbench_transition (void); 129 131 #endif 130 132 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic.cpp
r15 r41 27 27 _param (param) 28 28 { 29 log_printf(FUNC,RegisterFile_Monolithic,"RegisterFile_Monolithic","Begin"); 30 31 #ifdef SYSTEMC 32 log_printf(INFO,RegisterFile_Monolithic,"RegisterFile_Monolithic","Allocation"); 33 34 allocation (); 35 #endif 36 29 37 #ifdef STATISTICS 30 38 _stat = new Statistics (static_cast<string>(_name), 31 39 param_statistics , 32 40 param); 33 #endif34 35 #ifdef VHDL_TESTBENCH36 _vhdl_testbench = new Vhdl_Testbench (_name);37 vhdl_testbench_port (*_vhdl_testbench);38 _vhdl_testbench->set_clock ("in_CLOCK",true);39 41 #endif 40 42 … … 45 47 46 48 #ifdef SYSTEMC 47 allocation ();48 49 49 SC_METHOD (transition); 50 50 dont_initialize (); … … 72 72 PORT_WRITE(out_WRITE_ACK [i], 1); 73 73 #endif 74 75 log_printf(FUNC,RegisterFile_Monolithic,"RegisterFile_Monolithic","End"); 74 76 }; 75 77 76 78 RegisterFile_Monolithic::~RegisterFile_Monolithic (void) 77 79 { 78 #ifdef SYSTEMC79 deallocation ();80 #endif81 82 #ifdef VHDL_TESTBENCH83 // generate the test bench84 _vhdl_testbench->generate_file();85 delete _vhdl_testbench;86 #endif87 88 80 #ifdef STATISTICS 89 81 _stat->generate_file(statistics(0)); 90 82 delete _stat; 83 #endif 84 85 #ifdef SYSTEMC 86 deallocation (); 91 87 #endif 92 88 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_allocation.cpp
r15 r41 17 17 void RegisterFile_Monolithic::allocation (void) 18 18 { 19 in_CLOCK = new SC_CLOCK ("in_CLOCK"); 20 in_NRESET = new SC_IN (Tcontrol_t) ("in_NRESET");19 #ifdef POSITION 20 _position = new Position (); 21 21 22 // ----- Interface Read 22 Entity * entity = _position->set_entity (_name , 23 "RegisterFile_Monolithic", 24 REGISTER ); 25 26 _interfaces = entity->set_interfaces(); 27 #else 28 _interfaces = new Interfaces(); 29 #endif 30 31 // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 32 Interface * interface_ = _interfaces->set_interface("", IN ,SOUTH, "Generalist interface"); 33 34 in_CLOCK = interface_->set_signal_clk ("clock" ,1); 35 in_NRESET = interface_->set_signal_in <Tcontrol_t> ("nreset",1); 36 37 // ~~~~~[ Interface : "read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 38 23 39 in_READ_VAL = new SC_IN (Tcontrol_t) * [_param._nb_port_read]; 24 40 out_READ_ACK = new SC_OUT(Tcontrol_t) * [_param._nb_port_read]; … … 27 43 28 44 for (uint32_t i=0; i<_param._nb_port_read; i++) 29 { 30 string rename;45 { 46 Interface_fifo * interface_read = _interfaces->set_interface("read_"+toString(i), IN ,WEST, "Interface Read"); 31 47 32 rename = "in_READ_VAL[" + toString(i) + "]"; 33 in_READ_VAL [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 34 35 rename = "out_READ_ACK[" + toString(i) + "]"; 36 out_READ_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); 37 38 rename = "in_READ_ADDRESS[" + toString(i) + "]"; 39 in_READ_ADDRESS [i] = new SC_IN (Taddress_t) (rename.c_str()); 40 41 rename = "out_READ_DATA[" + toString(i) + "]"; 42 out_READ_DATA [i] = new SC_OUT(Tdata_t) (rename.c_str()); 48 in_READ_VAL [i] = interface_read->set_signal_valack_in ("val" , VAL); 49 out_READ_ACK [i] = interface_read->set_signal_valack_out ("ack" , ACK); 50 in_READ_ADDRESS [i] = interface_read->set_signal_in <Taddress_t> ("address", static_cast<uint32_t>(log2(_param._nb_word))); 51 out_READ_DATA [i] = interface_read->set_signal_out <Tdata_t > ("data" , _param._size_word); 43 52 } 44 53 45 // ----- Interface Write 54 // ~~~~~[ Interface : "write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 55 46 56 in_WRITE_VAL = new SC_IN (Tcontrol_t) * [_param._nb_port_write]; 47 57 out_WRITE_ACK = new SC_OUT(Tcontrol_t) * [_param._nb_port_write]; … … 51 61 for (uint32_t i=0; i<_param._nb_port_write; i++) 52 62 { 53 string rename;63 Interface_fifo * interface_write = _interfaces->set_interface("write_"+toString(i), IN ,EAST, "Interface Write"); 54 64 55 rename = "in_WRITE_VAL[" + toString(i) + "]"; 56 in_WRITE_VAL [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 57 58 rename = "out_WRITE_VAL[" + toString(i) + "]"; 59 out_WRITE_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); 60 61 rename = "in_WRITE_ADDRESS[" + toString(i) + "]"; 62 in_WRITE_ADDRESS [i] = new SC_IN (Taddress_t) (rename.c_str()); 63 64 rename = "in_WRITE_DATA[" + toString(i) + "]"; 65 in_WRITE_DATA [i] = new SC_IN (Tdata_t) (rename.c_str()); 65 in_WRITE_VAL [i] = interface_write->set_signal_valack_in ("val" , VAL); 66 out_WRITE_ACK [i] = interface_write->set_signal_valack_out ("ack" , ACK); 67 in_WRITE_ADDRESS [i] = interface_write->set_signal_in <Taddress_t> ("address", static_cast<uint32_t>(log2(_param._nb_word))); 68 in_WRITE_DATA [i] = interface_write->set_signal_in <Tdata_t > ("data" , _param._size_word); 66 69 } 67 70 … … 73 76 string rename = "reg_DATA[" + toString(i) + "]"; 74 77 reg_DATA [i] = new SC_REGISTER (Tdata_t) (rename.c_str()); 75 } 78 } 79 80 #ifdef POSITION 81 _position->generate_file(); 82 #endif 76 83 }; 77 84 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_deallocation.cpp
r15 r41 17 17 void RegisterFile_Monolithic::deallocation (void) 18 18 { 19 delete in_CLOCK;20 delete in_NRESET;19 delete in_CLOCK; 20 delete in_NRESET; 21 21 // ----- Interface Read 22 for (uint32_t i=0; i<_param._nb_port_read; i++) 23 { 24 delete in_READ_VAL [i]; 25 delete out_READ_ACK [i]; 26 delete in_READ_ADDRESS [i]; 27 delete out_READ_DATA [i]; 28 } 29 30 delete in_READ_VAL ; 31 delete out_READ_ACK ; 32 delete in_READ_ADDRESS; 33 delete out_READ_DATA ; 22 delete [] in_READ_VAL ; 23 delete [] out_READ_ACK ; 24 delete [] in_READ_ADDRESS; 25 delete [] out_READ_DATA ; 34 26 35 27 // ----- Interface Write 36 for (uint32_t i=0; i<_param._nb_port_write; i++) 37 { 38 delete in_WRITE_VAL [i]; 39 delete out_WRITE_ACK [i]; 40 delete in_WRITE_ADDRESS [i]; 41 delete in_WRITE_DATA [i]; 42 } 43 44 delete in_WRITE_VAL ; 45 delete out_WRITE_ACK ; 46 delete in_WRITE_ADDRESS; 47 delete in_WRITE_DATA ; 28 delete [] in_WRITE_VAL ; 29 delete [] out_WRITE_ACK ; 30 delete [] in_WRITE_ADDRESS; 31 delete [] in_WRITE_DATA ; 48 32 49 33 // ----- Register 50 for (uint32_t i=0; i<_param._nb_word; i++) 51 { 52 delete reg_DATA [i]; 53 } 34 delete [] reg_DATA; 54 35 55 delete reg_DATA; 36 #ifdef POSITION 37 delete _position; 38 #else 39 delete _interfaces; 40 #endif 56 41 }; 57 42 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_transition.cpp
r15 r41 45 45 46 46 #ifdef VHDL_TESTBENCH 47 vhdl_testbench_transition ( *_vhdl_testbench);47 vhdl_testbench_transition (); 48 48 #endif 49 49 log_printf(FUNC,Register_File,"transition","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl.cpp
r15 r41 18 18 void RegisterFile_Monolithic::vhdl (void) 19 19 { 20 Vhdl vhdl (_name);20 Vhdl * vhdl = new Vhdl (_name); 21 21 22 vhdl .set_library_work (_name + "_Pack");22 vhdl->set_library_work (_name + "_Pack"); 23 23 24 24 vhdl_port (vhdl); … … 27 27 vhdl_body (vhdl); 28 28 29 vhdl.generate_file(); 29 vhdl->generate_file(); 30 31 delete vhdl; 30 32 }; 31 33 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl_body.cpp
r15 r41 15 15 namespace registerfile_monolithic { 16 16 17 void RegisterFile_Monolithic::vhdl_body (Vhdl & vhdl)17 void RegisterFile_Monolithic::vhdl_body (Vhdl * & vhdl) 18 18 { 19 vhdl .set_body ("");20 vhdl .set_body ("-----------------------------------------------------------------------------");21 vhdl .set_body ("-- Read RegisterFile");22 vhdl .set_body ("-----------------------------------------------------------------------------");23 vhdl .set_body ("");19 vhdl->set_body (""); 20 vhdl->set_body ("-----------------------------------------------------------------------------"); 21 vhdl->set_body ("-- Read RegisterFile"); 22 vhdl->set_body ("-----------------------------------------------------------------------------"); 23 vhdl->set_body (""); 24 24 25 25 for (uint32_t i = 0; i < _param._nb_port_read; i++) 26 26 { 27 vhdl .set_body ("out_READ_ACK_"+toString(i)+"<= '1';");28 vhdl .set_body ("out_READ_DATA_"+toString(i)+" <= reg_DATA (conv_integer(in_READ_ADDRESS_"+toString(i)+")) when in_READ_VAL_"+toString(i)+"= '1' else "+std_logic_others(_param._size_word,0)+";");27 vhdl->set_body ("out_READ_"+toString(i)+"_ACK <= '1';"); 28 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)+";"); 29 29 } 30 vhdl.set_body ("");31 vhdl.set_body ("-----------------------------------------------------------------------------");32 vhdl.set_body ("-- Write RegisterFile");33 vhdl.set_body ("-----------------------------------------------------------------------------");34 vhdl.set_body ("");35 30 36 vhdl.set_body ("RegisterFile_write: process (in_CLOCK)"); 37 vhdl.set_body ("begin -- process RegisterFile_write"); 38 vhdl.set_body ("\tif in_CLOCK'event and in_CLOCK = '1' then"); 31 vhdl->set_body (""); 32 vhdl->set_body ("-----------------------------------------------------------------------------"); 33 vhdl->set_body ("-- Write RegisterFile"); 34 vhdl->set_body ("-----------------------------------------------------------------------------"); 35 vhdl->set_body (""); 36 37 vhdl->set_body ("RegisterFile_write: process (in_CLOCK)"); 38 vhdl->set_body ("begin -- process RegisterFile_write"); 39 vhdl->set_body ("\tif in_CLOCK'event and in_CLOCK = '1' then"); 39 40 40 41 for (uint32_t i = 0; i < _param._nb_port_write; i++) 41 42 { 42 vhdl .set_body ("\t\tif (in_WRITE_VAL_"+toString(i)+"= '1') then");43 vhdl .set_body ("\t\t\treg_DATA(conv_integer(in_WRITE_ADDRESS_"+toString(i)+")) <= in_WRITE_DATA_"+toString(i)+";");44 vhdl .set_body ("\t\tend if;");43 vhdl->set_body ("\t\tif (in_WRITE_"+toString(i)+"_VAL = '1') then"); 44 vhdl->set_body ("\t\t\treg_DATA(conv_integer(in_WRITE_"+toString(i)+"_ADDRESS)) <= in_WRITE_"+toString(i)+"_DATA;"); 45 vhdl->set_body ("\t\tend if;"); 45 46 } 46 47 47 vhdl .set_body ("\tend if;");48 vhdl .set_body ("end process RegisterFile_write;");48 vhdl->set_body ("\tend if;"); 49 vhdl->set_body ("end process RegisterFile_write;"); 49 50 50 51 for (uint32_t i = 0; i < _param._nb_port_write; i++) 51 vhdl .set_body ("out_WRITE_ACK_"+toString(i)+"<= '1';");52 vhdl->set_body ("out_WRITE_"+toString(i)+"_ACK <= '1';"); 52 53 }; 53 54 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl_port.cpp
r15 r41 15 15 namespace registerfile_monolithic { 16 16 17 void RegisterFile_Monolithic::vhdl_port (Vhdl & vhdl)17 void RegisterFile_Monolithic::vhdl_port (Vhdl * & vhdl) 18 18 { 19 vhdl.set_port ("in_CLOCK" , IN, 1); 20 vhdl.set_port ("in_NRESET", IN, 1); 21 22 for (uint32_t i = 0; i < _param._nb_port_read; i ++) 23 { 24 vhdl.set_port (" in_READ_VAL_"+toString(i)+" ",IN ,std_logic(1) ); 25 vhdl.set_port ("out_READ_ACK_"+toString(i)+" ",OUT,std_logic(1) ); 26 vhdl.set_port (" in_READ_ADDRESS_"+toString(i)+"",IN ,std_logic(static_cast<uint32_t>(log2(_param._nb_word)))); 27 vhdl.set_port ("out_READ_DATA_"+toString(i)+" ",OUT,std_logic(_param._size_word )); 28 } 29 30 for (uint32_t i = 0; i < _param._nb_port_write; i ++) 31 { 32 vhdl.set_port (" in_WRITE_VAL_"+toString(i)+" ",IN ,std_logic(1) ); 33 vhdl.set_port ("out_WRITE_ACK_"+toString(i)+" ",OUT,std_logic(1) ); 34 vhdl.set_port (" in_WRITE_ADDRESS_"+toString(i)+"",IN ,std_logic(static_cast<uint32_t>(log2(_param._nb_word)))); 35 vhdl.set_port (" in_WRITE_DATA_"+toString(i)+" ",IN ,std_logic(_param._size_word )); 36 } 19 _interfaces->set_port(vhdl); 37 20 }; 38 21 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl_signal.cpp
r15 r41 15 15 namespace registerfile_monolithic { 16 16 17 void RegisterFile_Monolithic::vhdl_signal (Vhdl & vhdl)17 void RegisterFile_Monolithic::vhdl_signal (Vhdl * & vhdl) 18 18 { 19 vhdl .set_signal ("reg_DATA", "Tregfile");19 vhdl->set_signal ("reg_DATA", "Tregfile"); 20 20 }; 21 21 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl_testbench_transition.cpp
r15 r41 15 15 namespace registerfile_monolithic { 16 16 17 void RegisterFile_Monolithic::vhdl_testbench_transition ( Vhdl_Testbench & vhdl_testbench)17 void RegisterFile_Monolithic::vhdl_testbench_transition (void) 18 18 { 19 #ifndef SYSTEMCASS_SPECIFIC 20 sc_cycle(0); 21 #endif 22 vhdl_testbench.add_input (PORT_READ( in_NRESET)); 19 // Evaluation before read the ouput signal 20 sc_start(0); 23 21 24 for (uint32_t i = 0; i < _param._nb_port_read ; i ++) 25 { 26 vhdl_testbench.add_input (PORT_READ( in_READ_VAL [i])); 27 vhdl_testbench.add_output(PORT_READ(out_READ_ACK [i])); 28 vhdl_testbench.add_input (PORT_READ( in_READ_ADDRESS [i])); 29 vhdl_testbench.add_output(PORT_READ(out_READ_DATA [i])); 30 } 31 for (uint32_t i = 0; i < _param._nb_port_write; i ++) 32 { 33 vhdl_testbench.add_input (PORT_READ( in_WRITE_VAL [i])); 34 vhdl_testbench.add_output(PORT_READ(out_WRITE_ACK [i])); 35 vhdl_testbench.add_input (PORT_READ( in_WRITE_ADDRESS[i])); 36 vhdl_testbench.add_input (PORT_READ( in_WRITE_DATA [i])); 37 } 38 39 vhdl_testbench.add_test(true); 40 41 vhdl_testbench.new_cycle (); // always at the end 22 _interfaces->testbench(); 42 23 }; 43 24 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl_type.cpp
r15 r41 15 15 namespace registerfile_monolithic { 16 16 17 void RegisterFile_Monolithic::vhdl_type (Vhdl & vhdl)17 void RegisterFile_Monolithic::vhdl_type (Vhdl * & vhdl) 18 18 { 19 vhdl .set_type ("Tregfile", "array (" + toString(_param._nb_word-1) + " downto 0) of " + std_logic(_param._size_word));19 vhdl->set_type ("Tregfile", "array (" + toString(_param._nb_word-1) + " downto 0) of " + std_logic(_param._size_word)); 20 20 }; 21 21 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/SelfTest/src/test.cpp
r40 r41 90 90 91 91 sc_start(0); 92 //_Select_Priority_Fixed->vhdl_testbench_label("Initialisation");93 92 //cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Initialisation" << endl; 94 93 95 _Select_Priority_Fixed->vhdl_testbench_label("Loop of Test");96 94 cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Loop of Test" << endl; 97 95 98 96 for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++) 99 97 { 100 _Select_Priority_Fixed->vhdl_testbench_label("Iteration "+toString(iteration));101 102 98 entity = 0; 103 99 bool find = false; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/include/Select_Priority_Fixed.h
r40 r41 30 30 #include "Behavioural/include/Vhdl.h" 31 31 #endif 32 #ifdef VHDL_TESTBENCH33 #include "Behavioural/include/Vhdl_Testbench.h"34 #endif35 32 36 33 using namespace std; … … 59 56 #ifdef STATISTICS 60 57 private : Statistics * _stat; 61 #endif62 63 #ifdef VHDL_TESTBENCH64 private : Vhdl_Testbench * _vhdl_testbench;65 58 #endif 66 59 … … 132 125 private : void vhdl_testbench_transition (void); 133 126 #endif 134 public : void vhdl_testbench_label (string label);135 127 }; 136 128 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed.cpp
r40 r41 45 45 param_statistics , 46 46 param); 47 #endif48 49 #ifdef VHDL_TESTBENCH50 log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Creation of a testbench");51 52 _vhdl_testbench = new Vhdl_Testbench (_name);53 47 #endif 54 48 … … 100 94 log_printf(FUNC,Select_Priority_Fixed,"~Select_Priority_Fixed","Begin"); 101 95 102 #ifdef VHDL_TESTBENCH103 log_printf(INFO,Select_Priority_Fixed,"~Select_Priority_Fixed","Generate Testbench file");104 105 // generate the test bench106 _vhdl_testbench->generate_file();107 delete _vhdl_testbench;108 #endif109 110 96 #ifdef STATISTICS 111 97 log_printf(INFO,Select_Priority_Fixed,"~Select_Priority_Fixed","Generate Statistics file"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_allocation.cpp
r40 r41 17 17 void Select_Priority_Fixed::allocation (void) 18 18 { 19 string rename;20 21 19 log_printf(FUNC,Select_Priority_Fixed,"allocation","Begin"); 22 20 … … 27 25 "Select_Priority_Fixed", 28 26 COMBINATORY ); 29 27 30 28 _interfaces = entity->set_interfaces(); 31 29 #else … … 37 35 Interface_fifo * interface_ = _interfaces->set_interface("", IN ,WEST, "Generalist interface"); 38 36 39 in_CLOCK = interface_->set_signal_clk ("clock" ,1, PORT_VHDL_YES_TESTBENCH_NO);37 in_CLOCK = interface_->set_signal_clk ("clock" ,1, CLOCK_VHDL_NO); 40 38 in_NRESET = interface_->set_signal_in <Tcontrol_t> ("nreset",1); 41 39 in_VAL = new SC_IN (Tcontrol_t) * [_param._nb_entity]; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_deallocation.cpp
r40 r41 34 34 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 35 35 36 cout << *_interfaces << endl;37 38 36 #ifdef POSITION 39 37 delete _position; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_vhdl_port.cpp
r40 r41 21 21 _interfaces->set_port(vhdl); 22 22 23 #ifdef VHDL_TESTBENCH24 _interfaces->set_port(_vhdl_testbench);25 _vhdl_testbench->set_clock ("in_CLOCK",true);26 #endif27 28 23 log_printf(FUNC,Select_Priority_Fixed,"vhdl_port","End"); 29 24 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_vhdl_testbench_transition.cpp
r40 r41 23 23 sc_start(0); 24 24 25 _interfaces->testbench(_vhdl_testbench); 26 27 // add_test : 28 // - True : the cycle must be compare with the output of systemC 29 // - False : no test 30 _vhdl_testbench->add_test(true); 31 32 _vhdl_testbench->new_cycle (); // always at the end 25 _interfaces->testbench(); 33 26 34 27 log_printf(FUNC,Select_Priority_Fixed,"vhdl_testbench_transition","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/include/New_Component.h
r40 r41 30 30 #include "Behavioural/include/Vhdl.h" 31 31 #endif 32 #ifdef VHDL_TESTBENCH33 #include "Behavioural/include/Vhdl_Testbench.h"34 #endif35 32 36 33 using namespace std; … … 56 53 #ifdef STATISTICS 57 54 private : Statistics * _stat; 58 #endif59 60 #ifdef VHDL_TESTBENCH61 private : Vhdl_Testbench * _vhdl_testbench;62 55 #endif 63 56 … … 122 115 private : void vhdl_testbench_transition (void); 123 116 #endif 124 public : void vhdl_testbench_label (string label);125 117 }; 126 118 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component.cpp
r40 r41 44 44 #endif 45 45 46 #ifdef VHDL_TESTBENCH47 log_printf(INFO,@COMPONENT,"@COMPONENT","Creation of a testbench");48 49 _vhdl_testbench = new Vhdl_Testbench (_name);50 #endif51 52 46 #ifdef VHDL 53 47 // generate the vhdl … … 78 72 log_printf(FUNC,@COMPONENT,"~@COMPONENT","Begin"); 79 73 80 #ifdef VHDL_TESTBENCH81 log_printf(INFO,@COMPONENT,"~@COMPONENT","Generate Testbench file");82 83 // generate the test bench84 _vhdl_testbench->generate_file();85 delete _vhdl_testbench;86 #endif87 88 74 #ifdef STATISTICS 89 75 log_printf(INFO,@COMPONENT,"~@COMPONENT","Generate Statistics file"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_vhdl_port.cpp
r40 r41 19 19 _interfaces->set_port(vhdl); 20 20 21 #ifdef VHDL_TESTBENCH22 _interfaces->set_port(_vhdl_testbench);23 _vhdl_testbench->set_clock ("in_CLOCK",true);24 #endif25 26 21 log_printf(FUNC,@COMPONENT,"vhdl_port","End"); 27 22 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_vhdl_testbench_transition.cpp
r40 r41 20 20 sc_start(0); 21 21 22 _interfaces->testbench(_vhdl_testbench); 23 24 // add_test : 25 // - True : the cycle must be compare with the output of systemC 26 // - False : no test 27 _vhdl_testbench->add_test(true); 28 29 _vhdl_testbench->new_cycle (); // always at the end 22 _interfaces->testbench(); 30 23 31 24 log_printf(FUNC,@COMPONENT,"vhdl_testbench_transition","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Debug_component.h
r38 r41 7 7 #define DEBUG_Group false 8 8 #define DEBUG_Shifter false 9 #define DEBUG_Register_File false 10 #define DEBUG_RegisterFile_Multi_Banked false 11 #define DEBUG_RegisterFile_Multi_Banked_Glue false 9 #define DEBUG_Register_File false 10 #define DEBUG_RegisterFile_Monolithic false 11 #define DEBUG_RegisterFile_Multi_Banked false 12 #define DEBUG_RegisterFile_Multi_Banked_Glue false 12 13 #define DEBUG_Select false 13 14 #define DEBUG_Select_Priority_Fixed false -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Direction.h
r31 r41 7 7 namespace behavioural { 8 8 9 typedef enum { IN, OUT, INOUT } direction_t; 9 typedef enum { IN, OUT } direction_t; 10 //typedef enum { IN, OUT, INOUT } direction_t; 10 11 11 12 }; // end namespace behavioural … … 17 18 case morpheo::behavioural::IN : return "in" ; break; 18 19 case morpheo::behavioural::OUT : return "out" ; break; 19 20 // case morpheo::behavioural::INOUT : return "inout" ; break; 20 21 default : return "" ; break; 21 22 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface.h
r40 r41 21 21 #ifdef VHDL 22 22 #include "Behavioural/include/Vhdl.h" 23 #endif24 #ifdef VHDL_TESTBENCH25 #include "Behavioural/include/Vhdl_Testbench.h"26 23 #endif 27 24 #include "Include/ToString.h" … … 53 50 54 51 #ifdef VHDL_TESTBENCH 55 private : list<string> * _list_cycle;52 private : uint32_t _nb_cycle ; 56 53 #endif 57 54 … … 80 77 public : sc_in_clk * set_signal_clk (string name , 81 78 uint32_t size , 82 presence_port_t presence_port= PORT_VHDL_YES_TESTBENCH_YES)79 presence_port_t presence_port=CLOCK_VHDL_YES) 83 80 { 84 81 log_printf(FUNC,Behavioural,"set_signal_clk","Begin"); 85 82 86 Signal * sig = set_signal (name, IN , size, presence_port); 83 if ((presence_port != CLOCK_VHDL_YES) and 84 (presence_port != CLOCK_VHDL_NO )) 85 throw ErrorMorpheo ("Signal \""+name+"\" is a clock, bad presence_port."); 86 87 Signal * sig = set_signal (name, IN , size, presence_port); 87 88 sc_in_clk * signal = new sc_in_clk (sig->_name.c_str()); 88 89 … … 98 99 { 99 100 log_printf(FUNC,Behavioural,"set_signal_in","Begin"); 101 102 if ((presence_port == CLOCK_VHDL_YES) or 103 (presence_port == CLOCK_VHDL_NO )) 104 throw ErrorMorpheo ("Signal \""+name+"\" is not a clock, bad presence_port."); 100 105 101 106 Signal * sig = set_signal (name, IN , size, presence_port); … … 117 122 log_printf(FUNC,Behavioural,"set_signal_out","Begin"); 118 123 124 if ((presence_port == CLOCK_VHDL_YES) or 125 (presence_port == CLOCK_VHDL_NO )) 126 throw ErrorMorpheo ("Signal \""+name+"\" is not a clock, bad presence_port."); 127 119 128 Signal * sig = set_signal (name, OUT , size, presence_port); 120 129 sc_out <T> * port = new sc_out <T> (sig->_name.c_str()); … … 131 140 #ifdef VHDL 132 141 public : void set_port (Vhdl * & vhdl); 142 #ifdef VHDL_TESTBENCH 143 public : void set_signal (Vhdl * & vhdl); 144 public : void get_signal (list<string> * & list_signal); 145 #endif 133 146 #endif 134 147 #ifdef VHDL_TESTBENCH 135 public : void set_port (Vhdl_Testbench * & vhdl_testbench); 148 public : uint32_t get_cycle (void); 149 public : string get_clock (void); 150 151 public : void testbench (void); 152 public : void testbench_cycle (void); 153 public : void testbench_body (Vhdl * & vhdl , 154 string counter_name ); 155 public : string testbench_test (Vhdl * & vhdl , 156 string counter_name); 157 public : string testbench_test_ok (Vhdl * & vhdl ); 158 protected : string testbench_test_name (Vhdl * & vhdl); 159 protected : string testbench_test_ok_name(Vhdl * & vhdl); 160 136 161 #endif 137 162 … … 139 164 public : void port_map (void * entity, 140 165 void * interface); 141 #endif142 143 #ifdef VHDL_TESTBENCH144 public : void testbench_cycle (void);145 public : void testbench (Vhdl_Testbench * & vhdl_testbench);146 166 #endif 147 167 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface_fifo.h
r40 r41 23 23 #ifdef VHDL_TESTBENCH 24 24 private : bool _test_exhaustive; 25 private : list<uint32_t> * _list_cycle ; 26 25 27 #endif 26 28 … … 72 74 73 75 #ifdef VHDL_TESTBENCH 76 public : uint32_t get_cycle (void); 77 78 public : void testbench (void); 74 79 public : bool testbench_transaction(void); 75 public : void testbench (Vhdl_Testbench * & vhdl_testbench); 80 public : void testbench_cycle (void); 81 public : string testbench_test (Vhdl * & vhdl , 82 string counter_name); 76 83 #endif 77 84 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interfaces.h
r40 r41 18 18 #include "Behavioural/include/Vhdl.h" 19 19 #endif 20 #ifdef VHDL_TESTBENCH21 #include "Behavioural/include/Vhdl_Testbench.h"22 #endif23 20 24 21 using namespace std; … … 30 27 { 31 28 // -----[ fields ]---------------------------------------------------- 29 private : const string _name; 32 30 private : list<Interface_fifo*> * _list_interface; 33 31 34 32 // -----[ methods ]--------------------------------------------------- 35 public : Interfaces ( void);33 public : Interfaces (string name); 36 34 public : Interfaces (const Interfaces & interfaces); 37 35 public : ~Interfaces (); … … 48 46 #ifdef VHDL 49 47 public : void set_port (Vhdl * & vhdl ); 48 # ifdef VHDL_TESTBENCH 49 private : void get_signal (list<string> * & list_signal ); 50 private : void set_signal (Vhdl * & vhdl ); 51 # endif 50 52 #endif 51 53 #ifdef VHDL_TESTBENCH 52 public : void set_port (Vhdl_Testbench * & vhdl_testbench); 54 private : uint32_t get_cycle (void); 55 private : string get_clock (void); 56 57 private : void testbench_generate_file (void); 58 public : void testbench (void); 59 private : string testbench_body (Vhdl * & vhdl , 60 string counter_name ); 53 61 #endif 54 62 55 63 public : Interface_fifo * find_interface (string name); 56 57 #ifdef VHDL_TESTBENCH58 public : void testbench (Vhdl_Testbench * & vhdl_testbench);59 #endif60 64 61 65 public : XML toXML (void); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Signal.h
r40 r41 16 16 #include <iostream> 17 17 18 #ifdef VHDL _TESTBENCH19 #include "Behavioural/include/Vhdl _Testbench.h"18 #ifdef VHDL 19 #include "Behavioural/include/Vhdl.h" 20 20 #endif 21 21 … … 42 42 PORT_VHDL_YES_TESTBENCH_NO , 43 43 PORT_VHDL_NO_TESTBENCH_YES , 44 PORT_VHDL_NO_TESTBENCH_NO } presence_port_t; 44 PORT_VHDL_NO_TESTBENCH_NO , 45 CLOCK_VHDL_YES , 46 CLOCK_VHDL_NO } presence_port_t; 45 47 46 48 class Signal … … 109 111 } 110 112 111 public : void testbench (Vhdl_Testbench * & vhdl_testbench);112 113 113 public : template <typename T> 114 114 void alloc (void * port) … … 136 136 _type_info = UNKNOW; 137 137 } 138 139 public : void testbench (void); 140 public : void testbench_body (Vhdl * & vhdl , 141 string counter_name ); 142 public : void testbench_test_ok(Vhdl * & vhdl ); 138 143 #endif 139 144 #ifdef VHDL 145 public : void set_port (Vhdl * & vhdl); 146 # ifdef VHDL_TESTBENCH 147 public : string get_clock (void); 148 public : void set_signal (Vhdl * & vhdl); 149 public : void get_name_vhdl (list<string> * & list_signal); 150 # endif 151 #endif 140 152 public : XML toXML (void); 141 153 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Vhdl_Testbench.h
r40 r41 38 38 }; 39 39 40 // -----[ fields ]----------------------------------------------------41 private : const string _name ;42 private : const bool _exhaustive ;40 // // -----[ fields ]---------------------------------------------------- 41 // private : const string _name ; 42 // private : const bool _exhaustive ; 43 43 44 private : string _clock_name ;45 private : uint32_t _num_cycle ;44 // private : string _clock_name ; 45 // private : uint32_t _num_cycle ; 46 46 47 private : uint32_t _size_input ;48 private : uint32_t _size_output;47 // private : uint32_t _size_input ; 48 // private : uint32_t _size_output; 49 49 50 private : list<string> _list_input ;51 private : list<string> _list_input_cycle;52 private : list<uint32_t> _list_input_size ;50 // private : list<string> _list_input ; 51 // private : list<string> _list_input_cycle; 52 // private : list<uint32_t> _list_input_size ; 53 53 54 private : list<string> _list_output;55 private : list<string> _list_output_cycle;56 private : list<uint32_t> _list_output_size ;54 // private : list<string> _list_output; 55 // private : list<string> _list_output_cycle; 56 // private : list<uint32_t> _list_output_size ; 57 57 58 private : list<bool> _list_test;59 private : list<string> _list_port;60 private : list<label_t> _list_label;58 // private : list<bool> _list_test; 59 // private : list<string> _list_port; 60 // private : list<label_t> _list_label; 61 61 62 private : list<uint32_t>::iterator _num_input ;63 private : list<uint32_t>::iterator _num_output;62 // private : list<uint32_t>::iterator _num_input ; 63 // private : list<uint32_t>::iterator _num_output; 64 64 65 private : Vhdl * _vhdl;65 // private : Vhdl * _vhdl; 66 66 67 67 // -----[ methods ]--------------------------------------------------- 68 68 public : Vhdl_Testbench (string name, 69 bool exhaustive=true) ;70 public : virtual ~Vhdl_Testbench ();69 bool exhaustive=true){}; 70 public : ~Vhdl_Testbench (){}; 71 71 72 public : void generate_file (void) ;72 public : void generate_file (void){}; 73 73 74 74 public : void set_port (string name , 75 75 direction_t direction , 76 uint32_t size ) ;76 uint32_t size ){}; 77 77 public : void set_clock (string name , 78 bool model_have_clock) ;79 public : void new_cycle (void) ;78 bool model_have_clock){}; 79 public : void new_cycle (void){}; 80 80 81 private : uint32_t get_input (void) ;82 private : void set_input (void) ;83 public : void add_input (uint32_t value ) ;81 private : uint32_t get_input (void){return 0;}; 82 private : void set_input (void){}; 83 public : void add_input (uint32_t value ){}; 84 84 85 private : uint32_t get_output (void) ;86 private : void set_output (void) ;87 public : void add_output (uint32_t value ) ;85 private : uint32_t get_output (void){return 0;}; 86 private : void set_output (void){}; 87 public : void add_output (uint32_t value ){}; 88 88 89 private : uint32_t get_test (void) ;90 public : void add_test (bool must_test ) ;89 private : uint32_t get_test (void){return 0;}; 90 public : void add_test (bool must_test ){}; 91 91 92 private : void get_label (void) ;93 public : void add_label (string label ) ;92 private : void get_label (void){}; 93 public : void add_label (string label ){}; 94 94 95 private : void generate_process_clock (uint32_t counter ) ;96 private : void generate_instance (void) ;95 private : void generate_process_clock (uint32_t counter ){}; 96 private : void generate_instance (void){}; 97 97 }; 98 98 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Entity.cpp
r38 r41 20 20 { 21 21 log_printf(FUNC,Behavioural,"Entity","Begin"); 22 _is_map = false; 22 _interfaces = new Interfaces (name); 23 _is_map = false; 23 24 log_printf(FUNC,Behavioural,"Entity","End"); 24 25 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Entity_set_interfaces.cpp
r31 r41 14 14 Interfaces * Entity::set_interfaces (void) 15 15 { 16 Interfaces * interfaces = new Interfaces (); 17 18 _interfaces = interfaces; 19 20 return interfaces; 16 return _interfaces; 21 17 }; 22 18 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface.cpp
r40 r41 30 30 31 31 #ifdef VHDL_TESTBENCH 32 _ list_cycle = new list<string>;32 _nb_cycle = 0; 33 33 #endif 34 34 … … 50 50 #endif 51 51 #ifdef VHDL_TESTBENCH 52 _ list_cycle = interface._list_cycle;52 _nb_cycle = interface._nb_cycle; 53 53 #endif 54 54 … … 73 73 delete _list_signal; 74 74 75 #ifdef VHDL_TESTBENCH76 delete _list_cycle ;77 #endif78 79 75 log_printf(FUNC,Behavioural,"~Interface","End"); 80 76 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_fifo.cpp
r40 r41 25 25 #ifdef VHDL_TESTBENCH 26 26 _test_exhaustive = true; 27 _list_cycle = new list<uint32_t>; 27 28 #endif 28 29 … … 42 43 #ifdef VHDL_TESTBENCH 43 44 _test_exhaustive = interface_fifo._test_exhaustive; 45 _list_cycle = interface_fifo._list_cycle; 44 46 #endif 45 47 … … 54 56 delete _list_signal_ack; 55 57 58 #ifdef VHDL_TESTBENCH 59 delete _list_cycle; 60 #endif 61 56 62 log_printf(FUNC,Behavioural,"~Interface_fifo","End"); 57 63 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_fifo_save_ptr.cpp
r40 r41 16 16 log_printf(FUNC,Behavioural,"save_ptr","Begin"); 17 17 18 #ifdef VHDL_TESTBENCH 19 _test_exhaustive = false; 20 #endif 21 18 22 if (val_ack == VAL) 19 23 _list_signal_val->push_back (signal); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_fifo_set_signal.cpp
r40 r41 17 17 { 18 18 log_printf(FUNC,Behavioural,"set_signal_valack","Begin"); 19 19 20 20 Signal * sig = Interface::set_signal (name , 21 21 direction , -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_fifo_testbench.cpp
r40 r41 13 13 namespace behavioural { 14 14 15 void Interface_fifo::testbench ( Vhdl_Testbench * & vhdl_testbench)15 void Interface_fifo::testbench (void) 16 16 { 17 17 log_printf(FUNC,Behavioural,"testbench","Begin"); … … 20 20 testbench_cycle (); 21 21 22 Interface::testbench(vhdl_testbench); 22 Interface::testbench_cycle (); 23 Interface::testbench(); 23 24 24 25 log_printf(FUNC,Behavioural,"testbench","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_get_signal.cpp
r40 r41 51 51 }; 52 52 53 #ifdef VHDL 54 # ifdef VHDL_TESTBENCH 55 void Interface::get_signal (list<string> * & list_signal) 56 { 57 if (not _list_signal->empty()) 58 { 59 list<Signal*>::iterator i = _list_signal->begin(); 60 61 while (i != _list_signal->end()) 62 { 63 (*i)->get_name_vhdl (list_signal); 64 ++i; 65 } 66 } 67 }; 68 # endif 69 #endif 70 53 71 }; // end namespace behavioural 54 72 }; // end namespace morpheo -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_print.cpp
r40 r41 20 20 output_stream << x.get_signal () << endl; 21 21 22 #ifdef VHDL_TESTBENCH23 if (x._list_cycle->empty()== false)24 {25 list<string>::iterator i = x._list_cycle->begin();22 // #ifdef VHDL_TESTBENCH 23 // if (x._list_cycle->empty()== false) 24 // { 25 // list<string>::iterator i = x._list_cycle->begin(); 26 26 27 while (i != x._list_cycle->end())28 {29 output_stream << "\n\t" << *i ;30 ++i;31 }32 }33 #endif27 // while (i != x._list_cycle->end()) 28 // { 29 // output_stream << "\n\t" << *i ; 30 // ++i; 31 // } 32 // } 33 // #endif 34 34 35 35 log_printf(FUNC,Behavioural,"operator<<","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_set_port.cpp
r40 r41 22 22 while (i != _list_signal->end()) 23 23 { 24 presence_port_t p = (*i)->_presence_port; 25 if ((p == PORT_VHDL_YES_TESTBENCH_YES) or 26 (p == PORT_VHDL_YES_TESTBENCH_NO ) ) 27 vhdl->set_port ((*i)->_name,(*i)->_direction,(*i)->_size); 24 (*i)->set_port (vhdl); 28 25 ++i; 29 26 } … … 33 30 #endif 34 31 35 #ifdef VHDL_TESTBENCH36 void Interface::set_port (Vhdl_Testbench * & vhdl_testbench)37 {38 log_printf(FUNC,Behavioural,"set_port (Testbench)","Begin");39 if (not _list_signal->empty())40 {41 list<Signal*>::iterator i = _list_signal->begin();42 43 while (i != _list_signal->end())44 {45 presence_port_t p = (*i)->_presence_port;46 if ((p == PORT_VHDL_YES_TESTBENCH_YES) or47 (p == PORT_VHDL_NO_TESTBENCH_YES ) )48 vhdl_testbench->set_port ((*i)->_name,(*i)->_direction,(*i)->_size);49 ++i;50 }51 }52 log_printf(FUNC,Behavioural,"set_port (Testbench)","End");53 };54 #endif55 32 }; // end namespace behavioural 56 33 }; // end namespace morpheo -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_set_signal.cpp
r40 r41 32 32 }; 33 33 34 #ifdef VHDL 35 # ifdef VHDL_TESTBENCH 36 void Interface::set_signal (Vhdl * & vhdl) 37 { 38 if (not _list_signal->empty()) 39 { 40 list<Signal*>::iterator i = _list_signal->begin(); 41 42 while (i != _list_signal->end()) 43 { 44 (*i)->set_signal (vhdl); 45 ++i; 46 } 47 } 48 }; 49 # endif 50 #endif 51 34 52 }; // end namespace behavioural 35 53 }; // end namespace morpheo -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_testbench.cpp
r40 r41 13 13 namespace behavioural { 14 14 15 void Interface::testbench_cycle (void) 16 { 17 // note : if defined(VHDL_TESTBENCH) then defined(SYSTEMC) 18 _list_cycle->push_back(toString(sc_simulation_time())); 19 } 20 21 void Interface::testbench (Vhdl_Testbench * & vhdl_testbench) 15 void Interface::testbench (void) 22 16 { 23 17 log_printf(FUNC,Behavioural,"testbench","Begin"); … … 29 23 while (i != _list_signal->end()) 30 24 { 31 (*i)->testbench( vhdl_testbench);25 (*i)->testbench(); 32 26 ++i; 33 27 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces.cpp
r40 r41 11 11 namespace behavioural { 12 12 13 Interfaces::Interfaces (void) 13 Interfaces::Interfaces (string name): 14 _name (name) 14 15 { 15 16 log_printf(FUNC,Behavioural,"Interfaces","Begin"); … … 18 19 }; 19 20 20 Interfaces::Interfaces (const Interfaces & interfaces) 21 Interfaces::Interfaces (const Interfaces & interfaces) : 22 _name (interfaces._name) 21 23 { 22 24 log_printf(FUNC,Behavioural,"Interfaces (copy)","Begin"); … … 28 30 { 29 31 log_printf(FUNC,Behavioural,"~Interfaces","Begin"); 32 33 #ifdef VHDL_TESTBENCH 34 testbench_generate_file (); 35 #endif 30 36 31 37 if (_list_interface->empty()== false) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_set_port.cpp
r40 r41 28 28 #endif 29 29 30 31 #ifdef VHDL_TESTBENCH32 void Interfaces::set_port (Vhdl_Testbench * & vhdl_testbench)33 {34 if (not _list_interface->empty())35 {36 list<Interface_fifo*>::iterator i = _list_interface->begin();37 38 while (i != _list_interface->end())39 {40 (*i)->set_port (vhdl_testbench);41 ++i;42 }43 }44 };45 #endif46 47 30 }; // end namespace behavioural 48 31 }; // end namespace morpheo -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_testbench.cpp
r40 r41 13 13 namespace behavioural { 14 14 15 void Interfaces::testbench ( Vhdl_Testbench * & vhdl_testbench)15 void Interfaces::testbench (void) 16 16 { 17 17 log_printf(FUNC,Behavioural,"testbench","Begin"); … … 23 23 while (i != _list_interface->end()) 24 24 { 25 (*i)->testbench( vhdl_testbench);25 (*i)->testbench(); 26 26 ++i; 27 27 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_testbench.cpp
r40 r41 13 13 14 14 // à optimisé -> pointeur de fonction afin d'éviter le test et le switch 15 void Signal::testbench ( Vhdl_Testbench * & vhdl_testbench)15 void Signal::testbench (void) 16 16 { 17 17 log_printf(FUNC,Behavioural,"testbench","Begin"); 18 18 19 19 if ((_presence_port == PORT_VHDL_YES_TESTBENCH_YES) or 20 (_presence_port == PORT_VHDL_NO_TESTBENCH_YES ))20 (_presence_port == PORT_VHDL_NO_TESTBENCH_YES )) 21 21 { 22 22 string str; … … 30 30 switch (_direction) 31 31 { 32 case IN : {vhdl_testbench->add_input (value); 33 str = toBase2 (value); break;} 34 case OUT : {vhdl_testbench->add_output(value); 35 str = toBase2 (value); break;} 36 case INOUT : {break;} 32 case IN : {str = toBase2 (value); break;} 33 case OUT : {str = toBase2 (value); break;} 34 // case INOUT : {break;} 37 35 } 38 36 break; … … 44 42 switch (_direction) 45 43 { 46 case IN : {vhdl_testbench->add_input (value); 47 str = toBase2 (value,_size); break;} 48 case OUT : {vhdl_testbench->add_output(value); 49 str = toBase2 (value,_size); break;} 50 case INOUT : {break;} 44 case IN : {str = toBase2 (value,_size); break;} 45 case OUT : {str = toBase2 (value,_size); break;} 46 // case INOUT : {break;} 51 47 } 52 48 break; … … 58 54 switch (_direction) 59 55 { 60 case IN : {vhdl_testbench->add_input (value); 61 str = toBase2 (value,_size); break;} 62 case OUT : {vhdl_testbench->add_output(value); 63 str = toBase2 (value,_size); break;} 64 case INOUT : {break;} 56 case IN : {str = toBase2 (value,_size); break;} 57 case OUT : {str = toBase2 (value,_size); break;} 58 // case INOUT : {break;} 65 59 } 66 60 break; … … 72 66 switch (_direction) 73 67 { 74 case IN : {vhdl_testbench->add_input (value); 75 str = toBase2 (value,_size); break;} 76 case OUT : {vhdl_testbench->add_output(value); 77 str = toBase2 (value,_size); break;} 78 case INOUT : {break;} 68 case IN : {str = toBase2 (value,_size); break;} 69 case OUT : {str = toBase2 (value,_size); break;} 70 // case INOUT : {break;} 79 71 } 80 72 break; … … 86 78 switch (_direction) 87 79 { 88 case IN : {vhdl_testbench->add_input (value); 89 str = toBase2 (value,_size); break;} 90 case OUT : {vhdl_testbench->add_output(value); 91 str = toBase2 (value,_size); break;} 92 case INOUT : {break;} 80 case IN : {str = toBase2 (value,_size); break;} 81 case OUT : {str = toBase2 (value,_size); break;} 82 // case INOUT : {break;} 93 83 } 94 84 break; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench.cpp
r40 r41 13 13 namespace behavioural { 14 14 15 Vhdl_Testbench::Vhdl_Testbench (string name ,16 bool exhaustive ):17 _name (name ),18 _exhaustive (exhaustive )19 {20 _vhdl = new Vhdl (_name + "_Testbench");15 // Vhdl_Testbench::Vhdl_Testbench (string name , 16 // bool exhaustive ): 17 // _name (name ), 18 // _exhaustive (exhaustive ) 19 // { 20 // _vhdl = new Vhdl (_name + "_Testbench"); 21 21 22 _size_input = 0;23 _size_output = 0;22 // _size_input = 0; 23 // _size_output = 0; 24 24 25 _num_cycle = 0;26 };25 // _num_cycle = 0; 26 // }; 27 27 28 Vhdl_Testbench::~Vhdl_Testbench ()29 {30 delete _vhdl;31 };28 // Vhdl_Testbench::~Vhdl_Testbench () 29 // { 30 // delete _vhdl; 31 // }; 32 32 33 33 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_add_input.cpp
r2 r41 16 16 namespace behavioural { 17 17 18 void Vhdl_Testbench::add_input (uint32_t value)19 {20 _list_input_cycle.push_front(toBase2(value,*_num_input));21 _num_input++;22 };18 // void Vhdl_Testbench::add_input (uint32_t value) 19 // { 20 // _list_input_cycle.push_front(toBase2(value,*_num_input)); 21 // _num_input++; 22 // }; 23 23 24 24 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_add_label.cpp
r2 r41 16 16 namespace behavioural { 17 17 18 void Vhdl_Testbench::add_label (string label)19 {20 _list_label.push_back(label_t(_num_cycle,label));21 };18 // void Vhdl_Testbench::add_label (string label) 19 // { 20 // _list_label.push_back(label_t(_num_cycle,label)); 21 // }; 22 22 23 23 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_add_output.cpp
r2 r41 16 16 namespace behavioural { 17 17 18 void Vhdl_Testbench::add_output (uint32_t value)19 {20 _list_output_cycle.push_front(toBase2(value,*_num_output));21 _num_output ++;22 };18 // void Vhdl_Testbench::add_output (uint32_t value) 19 // { 20 // _list_output_cycle.push_front(toBase2(value,*_num_output)); 21 // _num_output ++; 22 // }; 23 23 24 24 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_add_test.cpp
r2 r41 16 16 namespace behavioural { 17 17 18 void Vhdl_Testbench::add_test (bool must_test)19 {20 _list_test.push_back(must_test);21 };18 // void Vhdl_Testbench::add_test (bool must_test) 19 // { 20 // _list_test.push_back(must_test); 21 // }; 22 22 23 23 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_generate_file.cpp
r2 r41 14 14 namespace behavioural { 15 15 16 void Vhdl_Testbench::generate_file (void)17 {18 _vhdl->set_library_work (_name + "_Pack");16 // void Vhdl_Testbench::generate_file (void) 17 // { 18 // _vhdl->set_library_work (_name + "_Pack"); 19 19 20 if (_size_input == 0)21 throw (ErrorMorpheo ("No input for the test bench."));22 if (_size_output == 0)23 throw (ErrorMorpheo ("No output for the test bench."));20 // if (_size_input == 0) 21 // throw (ErrorMorpheo ("No input for the test bench.")); 22 // if (_size_output == 0) 23 // throw (ErrorMorpheo ("No output for the test bench.")); 24 24 25 // Only 2 signals and a variable26 _vhdl->set_signal ("testbench_input" ,std_logic(_size_input ));27 _vhdl->set_signal ("testbench_output" ,std_logic(_size_output));28 _vhdl->set_signal ("testbench_test" ,std_logic(_size_output));29 _vhdl->set_signal ("testbench_must_test" ,std_logic(1));30 _vhdl->set_signal ("testbench_counter" ,"natural","0");25 // // Only 2 signals and a variable 26 // _vhdl->set_signal ("testbench_input" ,std_logic(_size_input )); 27 // _vhdl->set_signal ("testbench_output" ,std_logic(_size_output)); 28 // _vhdl->set_signal ("testbench_test" ,std_logic(_size_output)); 29 // _vhdl->set_signal ("testbench_must_test" ,std_logic(1)); 30 // _vhdl->set_signal ("testbench_counter" ,"natural","0"); 31 31 32 uint32_t counter = get_input ();33 get_output ();34 get_test ();35 get_label ();32 // uint32_t counter = get_input (); 33 // get_output (); 34 // get_test (); 35 // get_label (); 36 36 37 // if (counter == get_output ())38 // throw (ErrorMorpheo ("The number of input is different of number of output."));37 // // if (counter == get_output ()) 38 // // throw (ErrorMorpheo ("The number of input is different of number of output.")); 39 39 40 generate_instance ();41 generate_process_clock (counter);40 // generate_instance (); 41 // generate_process_clock (counter); 42 42 43 _vhdl->generate_file(false, true);44 };43 // _vhdl->generate_file(false, true); 44 // }; 45 45 46 46 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_generate_instance.cpp
r2 r41 13 13 namespace behavioural { 14 14 15 void Vhdl_Testbench::generate_instance (void)16 {17 _vhdl->set_body("");18 _vhdl->set_body("instance_"+_name+" : "+_name);19 _vhdl->set_body("port map (");15 // void Vhdl_Testbench::generate_instance (void) 16 // { 17 // _vhdl->set_body(""); 18 // _vhdl->set_body("instance_"+_name+" : "+_name); 19 // _vhdl->set_body("port map ("); 20 20 21 list<string>::iterator i = _list_port.begin();22 if (i != _list_port.end())23 {24 _vhdl->set_body("\t "+*i+"\t=>\t"+*i);25 ++i;26 }27 while (i != _list_port.end())28 {29 _vhdl->set_body("\t,"+*i+"\t=>\t"+*i);30 ++i;31 }32 _vhdl->set_body(" );");33 };21 // list<string>::iterator i = _list_port.begin(); 22 // if (i != _list_port.end()) 23 // { 24 // _vhdl->set_body("\t "+*i+"\t=>\t"+*i); 25 // ++i; 26 // } 27 // while (i != _list_port.end()) 28 // { 29 // _vhdl->set_body("\t,"+*i+"\t=>\t"+*i); 30 // ++i; 31 // } 32 // _vhdl->set_body(" );"); 33 // }; 34 34 35 35 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_generate_process_clock.cpp
r2 r41 13 13 namespace behavioural { 14 14 15 void Vhdl_Testbench::generate_process_clock (uint32_t counter)16 {17 _vhdl->set_body("");18 _vhdl->set_body(_clock_name+" <= not "+_clock_name+" after 50 ns;");19 _vhdl->set_body("testbench_counter <= testbench_counter+1 after 100 ns;");20 _vhdl->set_body("");15 // void Vhdl_Testbench::generate_process_clock (uint32_t counter) 16 // { 17 // _vhdl->set_body(""); 18 // _vhdl->set_body(_clock_name+" <= not "+_clock_name+" after 50 ns;"); 19 // _vhdl->set_body("testbench_counter <= testbench_counter+1 after 100 ns;"); 20 // _vhdl->set_body(""); 21 21 22 _vhdl->set_body("process ("+_clock_name+")");23 _vhdl->set_body("begin");24 _vhdl->set_body("\tif "+_clock_name+"'event and "+_clock_name+" = '1' then");25 _vhdl->set_body("");26 _vhdl->set_body("\t\tassert (not ((testbench_must_test = '1') and not (testbench_test = testbench_output)))");27 _vhdl->set_body("\t\treport \" Test KO - output's test is different of output's component\"");28 _vhdl->set_body("\t\tseverity FAILURE;");29 _vhdl->set_body("");30 _vhdl->set_body("\t\tassert (not ((testbench_must_test = '1') and (testbench_test = testbench_output)))");31 _vhdl->set_body("\t\treport \" Test OK\"");32 _vhdl->set_body("\t\tseverity NOTE;");33 _vhdl->set_body("");34 _vhdl->set_body("\t\tassert (not ( testbench_must_test = '0'))");35 _vhdl->set_body("\t\treport \"No Test\"");36 _vhdl->set_body("\t\tseverity NOTE;");37 _vhdl->set_body("");38 _vhdl->set_body("\tend if;");39 _vhdl->set_body("end process;");22 // _vhdl->set_body("process ("+_clock_name+")"); 23 // _vhdl->set_body("begin"); 24 // _vhdl->set_body("\tif "+_clock_name+"'event and "+_clock_name+" = '1' then"); 25 // _vhdl->set_body(""); 26 // _vhdl->set_body("\t\tassert (not ((testbench_must_test = '1') and not (testbench_test = testbench_output)))"); 27 // _vhdl->set_body("\t\treport \" Test KO - output's test is different of output's component\""); 28 // _vhdl->set_body("\t\tseverity FAILURE;"); 29 // _vhdl->set_body(""); 30 // _vhdl->set_body("\t\tassert (not ((testbench_must_test = '1') and (testbench_test = testbench_output)))"); 31 // _vhdl->set_body("\t\treport \" Test OK\""); 32 // _vhdl->set_body("\t\tseverity NOTE;"); 33 // _vhdl->set_body(""); 34 // _vhdl->set_body("\t\tassert (not ( testbench_must_test = '0'))"); 35 // _vhdl->set_body("\t\treport \"No Test\""); 36 // _vhdl->set_body("\t\tseverity NOTE;"); 37 // _vhdl->set_body(""); 38 // _vhdl->set_body("\tend if;"); 39 // _vhdl->set_body("end process;"); 40 40 41 _vhdl->set_body("");42 _vhdl->set_body("assert (not (testbench_counter = " + toString(counter)+"))");43 _vhdl->set_body("report \"End of Simulation\"");44 _vhdl->set_body("severity FAILURE;");45 };41 // _vhdl->set_body(""); 42 // _vhdl->set_body("assert (not (testbench_counter = " + toString(counter)+"))"); 43 // _vhdl->set_body("report \"End of Simulation\""); 44 // _vhdl->set_body("severity FAILURE;"); 45 // }; 46 46 47 47 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_get_input.cpp
r2 r41 16 16 namespace behavioural { 17 17 18 uint32_t Vhdl_Testbench::get_input (void)19 {20 list<string>::iterator i = _list_input.begin();18 // uint32_t Vhdl_Testbench::get_input (void) 19 // { 20 // list<string>::iterator i = _list_input.begin(); 21 21 22 uint32_t counter = 0;22 // uint32_t counter = 0; 23 23 24 if (i != _list_input.end())25 {26 _vhdl->set_body ("");27 _vhdl->set_body ("with testbench_counter select");28 _vhdl->set_body ("\ttestbench_input <=");24 // if (i != _list_input.end()) 25 // { 26 // _vhdl->set_body (""); 27 // _vhdl->set_body ("with testbench_counter select"); 28 // _vhdl->set_body ("\ttestbench_input <="); 29 29 30 while (i != _list_input.end())31 {32 list<string>::iterator j = i;33 ++i;30 // while (i != _list_input.end()) 31 // { 32 // list<string>::iterator j = i; 33 // ++i; 34 34 35 if (i != _list_input.end())36 _vhdl->set_body ("\t\""+*j+"\" when "+toString(counter++)+",");37 else38 _vhdl->set_body ("\t\""+*j+"\" when others;");39 }40 }35 // if (i != _list_input.end()) 36 // _vhdl->set_body ("\t\""+*j+"\" when "+toString(counter++)+","); 37 // else 38 // _vhdl->set_body ("\t\""+*j+"\" when others;"); 39 // } 40 // } 41 41 42 return counter;43 };42 // return counter; 43 // }; 44 44 45 45 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_get_label.cpp
r2 r41 16 16 namespace behavioural { 17 17 18 void Vhdl_Testbench::get_label (void)19 {20 for (list<label_t>::iterator i = _list_label.begin(); i != _list_label.end(); i++)21 {22 _vhdl->set_body("");23 _vhdl->set_body("assert (not (testbench_counter = " + toString(i->_cycle)+"))");24 _vhdl->set_body("report \"***** "+i->_label+" *****\"");25 _vhdl->set_body("severity NOTE;");26 }27 };18 // void Vhdl_Testbench::get_label (void) 19 // { 20 // for (list<label_t>::iterator i = _list_label.begin(); i != _list_label.end(); i++) 21 // { 22 // _vhdl->set_body(""); 23 // _vhdl->set_body("assert (not (testbench_counter = " + toString(i->_cycle)+"))"); 24 // _vhdl->set_body("report \"***** "+i->_label+" *****\""); 25 // _vhdl->set_body("severity NOTE;"); 26 // } 27 // }; 28 28 29 29 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_get_output.cpp
r2 r41 16 16 namespace behavioural { 17 17 18 uint32_t Vhdl_Testbench::get_output (void)19 {20 list<string>::iterator i = _list_output.begin();18 // uint32_t Vhdl_Testbench::get_output (void) 19 // { 20 // list<string>::iterator i = _list_output.begin(); 21 21 22 uint32_t counter = 0;22 // uint32_t counter = 0; 23 23 24 if (i != _list_output.end())25 {26 _vhdl->set_body ("");27 _vhdl->set_body ("with testbench_counter select");28 _vhdl->set_body ("\ttestbench_test <=");24 // if (i != _list_output.end()) 25 // { 26 // _vhdl->set_body (""); 27 // _vhdl->set_body ("with testbench_counter select"); 28 // _vhdl->set_body ("\ttestbench_test <="); 29 29 30 while (i != _list_output.end())31 {32 list<string>::iterator j = i;33 ++i;30 // while (i != _list_output.end()) 31 // { 32 // list<string>::iterator j = i; 33 // ++i; 34 34 35 if (i != _list_output.end())36 _vhdl->set_body ("\t\""+*j+"\" when "+toString(counter++)+",");37 else38 _vhdl->set_body ("\t\""+*j+"\" when others;");39 }40 }35 // if (i != _list_output.end()) 36 // _vhdl->set_body ("\t\""+*j+"\" when "+toString(counter++)+","); 37 // else 38 // _vhdl->set_body ("\t\""+*j+"\" when others;"); 39 // } 40 // } 41 41 42 return counter;43 };42 // return counter; 43 // }; 44 44 45 45 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_get_test.cpp
r2 r41 16 16 namespace behavioural { 17 17 18 uint32_t Vhdl_Testbench::get_test (void)19 {20 list<bool>::iterator i = _list_test.begin();18 // uint32_t Vhdl_Testbench::get_test (void) 19 // { 20 // list<bool>::iterator i = _list_test.begin(); 21 21 22 uint32_t counter = 0;22 // uint32_t counter = 0; 23 23 24 if (i != _list_test.end())25 {26 _vhdl->set_body ("");27 _vhdl->set_body ("with testbench_counter select");28 _vhdl->set_body ("\ttestbench_must_test <=");24 // if (i != _list_test.end()) 25 // { 26 // _vhdl->set_body (""); 27 // _vhdl->set_body ("with testbench_counter select"); 28 // _vhdl->set_body ("\ttestbench_must_test <="); 29 29 30 while (i != _list_test.end())31 {32 list<bool>::iterator j = i;33 ++i;30 // while (i != _list_test.end()) 31 // { 32 // list<bool>::iterator j = i; 33 // ++i; 34 34 35 string str = (*j==true)?"1":"0";35 // string str = (*j==true)?"1":"0"; 36 36 37 if (i != _list_test.end())38 _vhdl->set_body ("\t'"+str+"' when "+toString(counter++)+",");39 else40 _vhdl->set_body ("\t'"+str+"' when others;");41 }42 }37 // if (i != _list_test.end()) 38 // _vhdl->set_body ("\t'"+str+"' when "+toString(counter++)+","); 39 // else 40 // _vhdl->set_body ("\t'"+str+"' when others;"); 41 // } 42 // } 43 43 44 return counter;45 };44 // return counter; 45 // }; 46 46 47 47 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_new_cycle.cpp
r2 r41 16 16 namespace behavioural { 17 17 18 void Vhdl_Testbench::new_cycle (void)19 {20 set_input();21 set_output();18 // void Vhdl_Testbench::new_cycle (void) 19 // { 20 // set_input(); 21 // set_output(); 22 22 23 _num_input = _list_input_size .begin();24 _num_output = _list_output_size.begin();23 // _num_input = _list_input_size .begin(); 24 // _num_output = _list_output_size.begin(); 25 25 26 _num_cycle ++;27 };26 // _num_cycle ++; 27 // }; 28 28 29 29 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_set_clock.cpp
r2 r41 16 16 namespace behavioural { 17 17 18 void Vhdl_Testbench::set_clock (string name,19 bool model_have_clock)20 {21 _clock_name = name;22 _vhdl->set_signal (name,std_logic(1),"'0'");18 // void Vhdl_Testbench::set_clock (string name, 19 // bool model_have_clock) 20 // { 21 // _clock_name = name; 22 // _vhdl->set_signal (name,std_logic(1),"'0'"); 23 23 24 if (model_have_clock == true)25 _list_port.push_back(name);24 // if (model_have_clock == true) 25 // _list_port.push_back(name); 26 26 27 _num_input = _list_input_size .begin();28 _num_output = _list_output_size.begin();29 };27 // _num_input = _list_input_size .begin(); 28 // _num_output = _list_output_size.begin(); 29 // }; 30 30 31 31 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_set_input.cpp
r2 r41 16 16 namespace behavioural { 17 17 18 void Vhdl_Testbench::set_input (void)19 {20 string text = "";18 // void Vhdl_Testbench::set_input (void) 19 // { 20 // string text = ""; 21 21 22 while (_list_input_cycle.empty() == false)23 {24 text += _list_input_cycle.front();22 // while (_list_input_cycle.empty() == false) 23 // { 24 // text += _list_input_cycle.front(); 25 25 26 _list_input_cycle.pop_front();27 }26 // _list_input_cycle.pop_front(); 27 // } 28 28 29 _list_input.push_back(text);30 };29 // _list_input.push_back(text); 30 // }; 31 31 32 32 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_set_output.cpp
r2 r41 16 16 namespace behavioural { 17 17 18 void Vhdl_Testbench::set_output (void)19 {20 string text = "";18 // void Vhdl_Testbench::set_output (void) 19 // { 20 // string text = ""; 21 21 22 while (_list_output_cycle.empty() == false)23 {24 text += _list_output_cycle.front();22 // while (_list_output_cycle.empty() == false) 23 // { 24 // text += _list_output_cycle.front(); 25 25 26 _list_output_cycle.pop_front();27 }26 // _list_output_cycle.pop_front(); 27 // } 28 28 29 _list_output.push_back(text);30 };29 // _list_output.push_back(text); 30 // }; 31 31 32 32 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_set_port.cpp
r2 r41 16 16 namespace behavioural { 17 17 18 void Vhdl_Testbench::set_port (string name ,19 direction_t direction,20 uint32_t size )21 {22 string name2;23 uint32_t size_old;24 if (direction == IN)25 {26 _list_input_size.push_back(size);27 size_old = _size_input;28 _size_input += size;29 name2 = "testbench_input";30 }31 else32 {33 _list_output_size.push_back(size);34 size_old = _size_output;35 _size_output += size;36 name2 = "testbench_output";37 }18 // void Vhdl_Testbench::set_port (string name , 19 // direction_t direction, 20 // uint32_t size ) 21 // { 22 // string name2; 23 // uint32_t size_old; 24 // if (direction == IN) 25 // { 26 // _list_input_size.push_back(size); 27 // size_old = _size_input; 28 // _size_input += size; 29 // name2 = "testbench_input"; 30 // } 31 // else 32 // { 33 // _list_output_size.push_back(size); 34 // size_old = _size_output; 35 // _size_output += size; 36 // name2 = "testbench_output"; 37 // } 38 38 39 string range;40 if (size == 1)41 range = "("+toString(size_old)+")";42 else43 range = "("+toString(size_old+size-1)+" downto "+toString(size_old)+")";39 // string range; 40 // if (size == 1) 41 // range = "("+toString(size_old)+")"; 42 // else 43 // range = "("+toString(size_old+size-1)+" downto "+toString(size_old)+")"; 44 44 45 _vhdl->set_alias (name, std_logic(size), name2, range);45 // _vhdl->set_alias (name, std_logic(size), name2, range); 46 46 47 _list_port.push_back(name);48 };47 // _list_port.push_back(name); 48 // }; 49 49 50 50 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Documentation/Source/Documents/document-morpheo-interface_processor_cache/fr/root.tex
r39 r41 38 38 \end{description} 39 39 40 La requête est effective quand les signaux XXX\_VAL et XXX\_ACK valent tous les 1 à la fin d'un cycle.40 La requête est effective quand les signaux XXX\_VAL et XXX\_ACK valent tous les deux 1 à la fin d'un cycle. 41 41 42 42 \subsection{Champ : REQ\_UNC} … … 131 131 RSP\_PKTID & CPU to CACHE & {\it SIZE\_PKTID} bits\\ 132 132 RSP\_RDATA & CACHE to CPU & {\it SIZE\_DATA} bits\\ 133 RSP\_ERR & CACHE to CPU & {\it 2} bits\\133 RSP\_ERR & CACHE to CPU & {\it 1} bit\\ 134 134 \end{tabular} 135 135 \end{center} … … 157 157 0 & 0 & 1 & 0 & Invalidate \\ 158 158 0 & 0 & 1 & 1 & Prefetch \\ 159 0 & 1 & 0 & 0 & Write 8 bits ack\\159 0 & 1 & 0 & 0 & {\it non utilisé} \\ 160 160 0 & 1 & 0 & 1 & {\it non utilisé} \\ 161 161 0 & 1 & 1 & 0 & Flush \\ … … 184 184 \item[Flush :] Invalide la ligne de cache contenant l'adresse fournit, et propage les éventuelles écritures jusqu'à la mémoire\\ 185 185 {\it Remarque :} Le flush va implicitement déverrouiller la ligne de cache. 186 \item[Write :] Demande de l'écriture d'une donnée. Aucun acquittement ne sera retourné au processeur. 187 \item[Write ack :] Demande de l'écriture d'une donnée. Une fois effectué, un acquittement sera retourné au processeur par l'intermédiaire de l'interface de réponse. 186 \item[Write :] Demande de l'écriture d'une donnée. Une fois effectué, un acquittement sera retourné au processeur par l'intermédiaire de l'interface de réponse. 188 187 \end{description} 189 188 … … 193 192 194 193 \begin{center} 195 \begin{tabular}{|cc||l|} 196 \hline 197 b1 & b0 & Description \\ 198 \hline 199 \hline 200 0 & 0 & NOERR \\ 201 0 & 1 & BERR\_PRECISE \\ 202 1 & 1 & BERR\_UNPRECISE \\ 203 \hline 204 \end{tabular} 205 \end{center} 206 \begin{description} 207 \item[NOERR : ] indique qu'il n'y a aucune erreur lors de la requête. 208 \item[BERR\_PRECISE : ] indique qu'il y a eu une erreur de transmission lors d'un accès mémoire. 209 {\it Remarque : } Seul les requêtes de type {\it Read}, {\it Write 8 bits ack} peuvent générées cette erreur. 210 \item[BERR\_UNPRECISE : ] indique qu'il y a eu une erreur de transmission lors d'un accès mémoire. 211 {\it Remarque : } Seul les requêtes de type {\it Write 8 bits}, {\it Write 16 bits}, {\it Write 32 bits}, {\it Write 64 bits} peuvent générées cette erreur. 212 \end{description} 213 214 Au contraire de l'exception BERR\_PRECISE qui ne peut être provoqué que par des requêtes demandant un acquittement, l'exception BERR\_UNPRECISE est provoqué par des requête qui ne demande pas d'acquittement. Le processeur doit être capable de traiter ce genre d'erreur. 194 \begin{tabular}{|c||l|} 195 \hline 196 b0 & Description \\ 197 \hline 198 \hline 199 0 & NOERR \\ 200 1 & BERR \\ 201 \hline 202 \end{tabular} 203 \end{center} 204 \begin{description} 205 \item[NOERR : ] indique qu'il n'y a aucune erreur lors de la requête. 206 \item[BERR : ] indique qu'il y a eu une erreur de transmission lors d'un accès mémoire. 207 {\it Remarque : } Seul les requêtes de type {\it Read}, {\it Write 8 bits}, {\it Write 16 bits}, {\it Write 32 bits}, {\it Write 64 bits} peuvent générées cette erreur. 208 \end{description} 215 209 216 210 \section{Protocole de communication} 217 211 218 Il y a un échange sur une des sous interface si VAL AND ACK = 1. 219 220 Lors d'une requête de lecture, la hiérarchie mémoire envoie la donnée sur le port des réponses de manière asynchrone et de manière non ordonnée (une requête de lecture ancienne peut répondre après une requête de lecture nouvelle. C'est au processeur de gérer le ré-ordonnancement) 212 Il y a un échange sur une des sous interface si VAL AND ACK = 1. Toute requête entraîne une réponse. Les réponses n'arrive pas dans l'ordre émisent sur l'interface des réponses. 221 213 222 214 Sur le port des requêtes, si le cache est occupé, le processeur peut changer au cycle suivant sa requête (typiquement donne la main à un autre thread). Par contre sur le port des réponses, tant que le processeur est occupé, le cache maintient sa réponse. (Ceci permet d'éviter les questions : quand réémettre la réponse? et quel évènement déclenche la remise de la réponse?) -
trunk/IPs/systemC/processor/Morpheo/Documentation/Source/Include/ppt-style.sty
r17 r41 12 12 \bibliographystyle{plain} 13 13 14 \useoutertheme{infolines} 14 15 15 16 %% % file, Dimension -
trunk/IPs/systemC/processor/Morpheo/Documentation/Source/Package/presentation-share_architectural_ressources_between_hardware_context.tex
r16 r41 1 1 \usepackage{beamerthemetree} 2 2 3 \setbeameroption{show notes on second screen}3 %\setbeameroption{show notes on second screen} -
trunk/IPs/systemC/processor/Morpheo/Include/ToBase2.h
r2 r41 14 14 namespace morpheo { 15 15 16 inline string toBase2 (uint32_t value, uint32_tsize)16 template<typename T> inline std::string toBase2 (const T& value, const uint32_t & size) 17 17 { 18 18 ostringstream res; 19 uint32_tmask = 1<<(size-1);20 19 T mask = 1<<(size-1); 20 21 21 while (mask != 0) 22 22 { … … 27 27 return res.str(); 28 28 } 29 29 30 inline std::string toBase2 (const bool & value) 31 { 32 return toBase2<bool > (value, 1); 33 } 34 35 inline std::string toBase2 (const uint8_t & value, const uint32_t & size) 36 { 37 return toBase2<uint8_t> (value, size); 38 } 39 40 inline std::string toBase2 (const uint16_t& value, const uint32_t & size) 41 { 42 return toBase2<uint16_t> (value, size); 43 } 44 45 inline std::string toBase2 (const uint32_t& value, const uint32_t & size) 46 { 47 return toBase2<uint32_t> (value, size); 48 } 49 50 inline std::string toBase2 (const uint64_t& value, const uint32_t & size) 51 { 52 return toBase2<uint64_t> (value, size); 53 } 54 55 30 56 }; // end namespace morpheo 31 57
Note: See TracChangeset
for help on using the changeset viewer.