Changeset 29 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic
- Timestamp:
- May 23, 2007, 6:17:08 PM (18 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/SelfTest/configuration.cfg
r15 r29 1 1 Select_Priority_Fixed 2 216 *2 # nb_entity3 0 1+1 # encoding_one_hot2 16 16 *2 # nb_entity 3 0 0 +1 # encoding_one_hot 4 4 1 1 +1 # encoding_compact -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/include/Select_Priority_Fixed.h
r15 r29 19 19 #include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Parameters.h" 20 20 #include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Types.h" 21 #include "Behavioural/include/Interfaces.h" 22 21 23 #ifdef STATISTICS 22 24 #include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Statistics.h" … … 59 61 private : Vhdl_Testbench * _vhdl_testbench; 60 62 #endif 63 64 private : Interfaces * interfaces; 61 65 62 66 #ifdef SYSTEMC … … 113 117 #if VHDL 114 118 public : void vhdl (void); 115 private : void vhdl_port (Vhdl & vhdl);116 private : void vhdl_declaration (Vhdl & vhdl);117 private : void vhdl_body (Vhdl & vhdl);119 private : void vhdl_port (Vhdl * & vhdl); 120 private : void vhdl_declaration (Vhdl * & vhdl); 121 private : void vhdl_body (Vhdl * & vhdl); 118 122 #endif 119 123 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed.cpp
r15 r29 32 32 log_printf(FUNC,Select_Priority_Fixed,"Select_Priority_Fixed","Begin"); 33 33 34 #ifdef SYSTEMC 35 log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Allocation"); 36 37 allocation (); 38 #endif 39 40 #ifdef POSITION 41 log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Position"); 42 43 44 #endif 45 34 46 #ifdef STATISTICS 35 47 log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Allocation of statistics"); … … 48 60 // -> clock's signals 49 61 _vhdl_testbench = new Vhdl_Testbench (_name); 50 // _vhdl_testbench->set_clock ("in_CLOCK",false);51 62 #endif 52 63 … … 58 69 #endif 59 70 60 #ifdef VHDL_TESTBENCH61 _vhdl_testbench->set_clock ("in_CLOCK",true);62 #endif63 64 71 #ifdef SYSTEMC 65 log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Allocation");66 67 allocation ();68 69 72 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 70 73 log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Method - transition"); … … 98 101 99 102 #endif 100 101 103 #endif 102 104 log_printf(FUNC,Select_Priority_Fixed,"Select_Priority_Fixed","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_allocation.cpp
r15 r29 15 15 namespace select_priority_fixed { 16 16 17 18 17 void Select_Priority_Fixed::allocation (void) 19 18 { … … 22 21 log_printf(FUNC,Select_Priority_Fixed,"allocation","Begin"); 23 22 24 in_CLOCK = new SC_CLOCK ("in_CLOCK "); 25 in_NRESET = new SC_IN (Tcontrol_t) ("in_NRESET"); 23 interfaces = new Interfaces; 24 25 // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 26 Interface interface_ ("", IN, WEST); 27 28 in_CLOCK = interface_.set_signal_clk ("clock" ,1, PORT_VHDL_YES_TESTBENCH_NO); 29 in_NRESET = interface_.set_signal_in <Tcontrol_t> ("nreset",1); 26 30 27 31 in_VAL = new SC_IN (Tcontrol_t) * [_param._nb_entity]; … … 31 35 for (uint32_t i=0; i<_param._nb_entity; i++) 32 36 { 33 rename = " in_VAL_"+toString(i); 34 in_VAL [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 35 37 in_VAL [i] = interface_.set_signal_in <Tcontrol_t> ("val_"+toString(i),1); 36 38 if (_param._encoding_one_hot) 37 { 38 rename = "out_ACK_"+toString(i); 39 out_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); 40 } 39 out_ACK [i] = interface_.set_signal_out <Tcontrol_t> ("ack_"+toString(i),1); 41 40 } 42 41 43 42 if (_param._encoding_compact) 44 43 { 45 out_ENTITY _ACK = new SC_OUT(Tcontrol_t) ("out_entity_ack");46 out_ENTITY = new SC_OUT(Tentity_t) ("out_entity");44 out_ENTITY = interface_.set_signal_out <Tentity_t > ("entity" , _param._size_entity); 45 out_ENTITY_ACK = interface_.set_signal_out <Tcontrol_t> ("entity_ack", 1); 47 46 } 47 48 48 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 49 49 … … 54 54 }; // end namespace select 55 55 }; // end namespace generic 56 57 56 }; // end namespace behavioural 58 57 }; // end namespace morpheo -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_deallocation.cpp
r15 r29 40 40 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 41 41 42 delete interfaces; 43 42 44 log_printf(FUNC,Select_Priority_Fixed,"deallocation","End"); 43 45 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_vhdl.cpp
r15 r29 20 20 { 21 21 log_printf(FUNC,Select_Priority_Fixed,"vhdl","Begin"); 22 Vhdl vhdl (_name);23 22 24 vhdl.set_library_work (_name + "_Pack"); 23 Vhdl * vhdl = new Vhdl (_name); 24 25 vhdl->set_library_work (_name + "_Pack"); 25 26 26 27 vhdl_port (vhdl); … … 28 29 vhdl_body (vhdl); 29 30 30 vhdl .generate_file();31 vhdl->generate_file(); 31 32 log_printf(FUNC,Select_Priority_Fixed,"vhdl","End"); 32 33 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_vhdl_body.cpp
r15 r29 16 16 17 17 18 void Select_Priority_Fixed::vhdl_body (Vhdl & vhdl)18 void Select_Priority_Fixed::vhdl_body (Vhdl * & vhdl) 19 19 { 20 20 log_printf(FUNC,Select_Priority_Fixed,"vhdl_body","Begin"); 21 vhdl .set_body ("");21 vhdl->set_body (""); 22 22 23 vhdl .set_body("internal_entity <=");23 vhdl->set_body("internal_entity <="); 24 24 for (uint32_t i=0; i<_param._nb_entity; i++) 25 25 { 26 vhdl .set_body("\t"+std_logic_conv(_param._size_entity+1,i)+" when in_VAL_"+toString(i)+"='1' else");26 vhdl->set_body("\t"+std_logic_conv(_param._size_entity+1,i)+" when in_VAL_"+toString(i)+"='1' else"); 27 27 } 28 vhdl .set_body("\t"+std_logic_conv(_param._size_entity+1,1<<_param._size_entity)+";");29 vhdl .set_body ("");28 vhdl->set_body("\t"+std_logic_conv(_param._size_entity+1,1<<_param._size_entity)+";"); 29 vhdl->set_body (""); 30 30 31 31 if (_param._encoding_one_hot) 32 32 { 33 33 for (uint32_t i=0; i<_param._nb_entity; i++) 34 vhdl .set_body("out_ACK_"+toString(i)+" <= '1' when internal_entity"+std_logic_range(_param._size_entity+1)+" = "+std_logic_conv(_param._size_entity+1,i)+" else '0';");35 vhdl .set_body ("");34 vhdl->set_body("out_ACK_"+toString(i)+" <= '1' when internal_entity"+std_logic_range(_param._size_entity+1)+" = "+std_logic_conv(_param._size_entity+1,i)+" else '0';"); 35 vhdl->set_body (""); 36 36 } 37 37 38 38 if (_param._encoding_compact) 39 39 { 40 vhdl .set_body ("out_ENTITY <= internal_entity"+std_logic_range(_param._size_entity-1, 0)+";");41 vhdl .set_body ("out_ENTITY_ACK <= not internal_entity"+std_logic_range(_param._size_entity ,_param._size_entity)+";");40 vhdl->set_body ("out_ENTITY <= internal_entity"+std_logic_range(_param._size_entity-1, 0)+";"); 41 vhdl->set_body ("out_ENTITY_ACK <= not internal_entity"+std_logic_range(_param._size_entity ,_param._size_entity)+";"); 42 42 } 43 43 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_vhdl_declaration.cpp
r15 r29 16 16 17 17 18 void Select_Priority_Fixed::vhdl_declaration (Vhdl & vhdl)18 void Select_Priority_Fixed::vhdl_declaration (Vhdl * & vhdl) 19 19 { 20 20 log_printf(FUNC,Select_Priority_Fixed,"vhdl_declaration","Begin"); 21 21 22 vhdl .set_signal("internal_entity",_param._size_entity+1);22 vhdl->set_signal("internal_entity",_param._size_entity+1); 23 23 24 24 log_printf(FUNC,Select_Priority_Fixed,"vhdl_declaration","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_vhdl_port.cpp
r15 r29 9 9 #include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Select_Priority_Fixed.h" 10 10 11 #ifdef VHDL_TESTBENCH 12 # define VHDL_SET_PORT(name,direction,size) do {vhdl.set_port (name,direction,size); _vhdl_testbench->set_port (name,direction,size);} while (0) 13 #else 14 # define VHDL_SET_PORT(name,direction,size) vhdl.set_port (name,direction,size) 15 #endif 16 17 namespace morpheo { 11 namespace morpheo { 18 12 namespace behavioural { 19 13 namespace generic { … … 21 15 namespace select_priority_fixed { 22 16 23 24 void Select_Priority_Fixed::vhdl_port (Vhdl & vhdl) 17 void Select_Priority_Fixed::vhdl_port (Vhdl * & vhdl) 25 18 { 26 19 log_printf(FUNC,Select_Priority_Fixed,"vhdl_port","Begin"); 27 20 28 vhdl.set_port (" in_CLOCK ", IN, 1); 29 VHDL_SET_PORT (" in_NRESET", IN, 1); 30 31 for (uint32_t i=0; i<_param._nb_entity; i++) 32 { 33 VHDL_SET_PORT (" in_VAL_"+toString(i) , IN, 1); 34 if (_param._encoding_one_hot) 35 VHDL_SET_PORT ("out_ACK_"+toString(i) ,OUT, 1); 36 } 37 if (_param._encoding_compact) 38 { 39 VHDL_SET_PORT ("out_ENTITY ",OUT,_param._size_entity); 40 VHDL_SET_PORT ("out_ENTITY_ACK",OUT,1); 41 } 42 log_printf(FUNC,Select_Priority_Fixed,"vhdl_port","End"); 21 #ifdef VHDL 22 interfaces->set_port(vhdl); 23 #endif 24 #ifdef VHDL_TESTBENCH 25 interfaces->set_port(_vhdl_testbench); 26 _vhdl_testbench->set_clock ("in_CLOCK",true); 27 #endif 28 29 log_printf(FUNC,Select_Priority_Fixed,"vhdl_port","End"); 43 30 }; 44 31
Note: See TracChangeset
for help on using the changeset viewer.