Changeset 40 for trunk/IPs/systemC
- Timestamp:
- Jun 5, 2007, 11:06:46 PM (18 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural
- Files:
-
- 7 added
- 45 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/SelfTest/src/test.cpp
r15 r40 19 19 Select_Priority_Fixed * _Select_Priority_Fixed = new Select_Priority_Fixed (name.c_str(), 20 20 #ifdef STATISTICS 21 morpheo::behavioural::Parameters_Statistics(5,50),21 morpheo::behavioural::Parameters_Statistics(5,50), 22 22 #endif 23 _param);23 _param); 24 24 25 25 #ifdef SYSTEMC … … 137 137 cout << "<" << name << "> ............ Stop Simulation" << endl; 138 138 139 delete CLOCK; 140 delete NRESET; 141 142 for (uint32_t i=0; i<_param._nb_entity; i++) 143 { 144 delete VAL [i]; 145 delete ACK [i]; 146 } 147 148 delete VAL ; 149 delete ACK ; 150 delete ENTITY ; 151 delete ENTITY_ACK; 139 delete CLOCK; 140 delete NRESET; 141 delete [] VAL ; 142 delete [] ACK ; 143 delete ENTITY ; 144 delete ENTITY_ACK; 152 145 #endif 153 146 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/include/Select_Priority_Fixed.h
r31 r40 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 #ifdef STATISTICS 22 #include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Statistics.h" 23 #endif 21 24 #ifdef POSITION 22 25 #include "Behavioural/include/Position.h" 23 26 #else 24 27 #include "Behavioural/include/Interfaces.h" 25 #endif26 27 #ifdef STATISTICS28 #include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Statistics.h"29 28 #endif 30 29 #ifdef VHDL -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Parameters_msg_error.cpp
r15 r40 31 31 } 32 32 33 log_printf(FUNC,Select_Priority_Fixed,"msg_error","End"); 34 33 35 return msg; 34 35 log_printf(FUNC,Select_Priority_Fixed,"msg_error","End");36 36 }; 37 37 … … 39 39 }; // end namespace select 40 40 }; // end namespace generic 41 42 41 }; // end namespace behavioural 43 42 }; // end namespace morpheo -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed.cpp
r29 r40 38 38 #endif 39 39 40 #ifdef POSITION41 log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Position");42 43 44 #endif45 46 40 #ifdef STATISTICS 47 41 log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Allocation of statistics"); … … 56 50 log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Creation of a testbench"); 57 51 58 // Creation of a testbench59 // -> port60 // -> clock's signals61 52 _vhdl_testbench = new Vhdl_Testbench (_name); 62 53 #endif … … 137 128 }; // end namespace select 138 129 }; // end namespace generic 139 140 130 }; // end namespace behavioural 141 131 }; // end namespace morpheo -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_allocation.cpp
r31 r40 35 35 // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 36 36 37 Interface * interface_ = _interfaces->set_interface("" , 38 IN , 39 WEST, 40 "..."); 37 Interface_fifo * interface_ = _interfaces->set_interface("", IN ,WEST, "Generalist interface"); 41 38 42 39 in_CLOCK = interface_->set_signal_clk ("clock" ,1, PORT_VHDL_YES_TESTBENCH_NO); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_deallocation.cpp
r31 r40 20 20 log_printf(FUNC,Select_Priority_Fixed,"deallocation","Begin"); 21 21 22 delete in_CLOCK;23 delete in_NRESET;22 delete in_CLOCK; 23 delete in_NRESET; 24 24 25 for (uint32_t i=0; i<_param._nb_entity; i++) 26 { 27 delete in_VAL [i]; 28 if (_param._encoding_one_hot) 29 delete out_ACK [i]; 30 } 25 delete [] in_VAL; 26 if (_param._encoding_one_hot) 27 delete [] out_ACK; 31 28 32 delete in_VAL;33 if (_param._encoding_one_hot)34 delete out_ACK;35 29 if (_param._encoding_compact) 36 30 { 37 delete out_ENTITY;38 delete out_ENTITY_ACK;31 delete out_ENTITY; 32 delete out_ENTITY_ACK; 39 33 } 40 34 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 35 36 cout << *_interfaces << endl; 41 37 42 38 #ifdef POSITION -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_genMealy_entity.cpp
r15 r40 1 1 #ifdef SYSTEMC 2 #if defined(STATISTICS) or defined(VHDL_TESTBENCH)3 2 /* 4 3 * $Id$ … … 64 63 }; // end namespace morpheo 65 64 #endif 66 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_vhdl.cpp
r29 r40 30 30 31 31 vhdl->generate_file(); 32 33 delete vhdl; 34 32 35 log_printf(FUNC,Select_Priority_Fixed,"vhdl","End"); 33 34 36 }; 35 37 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_vhdl_port.cpp
r31 r40 19 19 log_printf(FUNC,Select_Priority_Fixed,"vhdl_port","Begin"); 20 20 21 #ifdef VHDL22 21 _interfaces->set_port(vhdl); 23 #endif 22 24 23 #ifdef VHDL_TESTBENCH 25 24 _interfaces->set_port(_vhdl_testbench); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_vhdl_testbench_transition.cpp
r38 r40 23 23 sc_start(0); 24 24 25 // In order with file Select_Priority_Fixed_vhdl_testbench_port.cpp26 // Warning : if a output depend of a subcomponent, take directly the port of subcomponent27 // (because we have no control on the ordonnancer's policy)28 29 25 _interfaces->testbench(_vhdl_testbench); 30 26 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Selftest
r31 r40 96 96 $(DIR_LOG)/%.exec.log : $(DIR_CFG_GEN)/%.cfg $(DIR_BIN)/$(EXEC).x 97 97 @$(ECHO) "Execute : $*" 98 @$(EXPORT) SYSTEMC=$(SYSTEMC_$(SIMULATOR)) ; ./$(DIR_BIN)/$(EXEC).x $(EXEC_PARAMS) $* `$(CAT) $<`> $@98 @$(EXPORT) SYSTEMC=$(SYSTEMC_$(SIMULATOR)) ; $(VALGRIND) ./$(DIR_BIN)/$(EXEC).x $(EXEC_PARAMS) $* `$(CAT) $<` &> $@ 99 99 declare -i count=`$(GREP) -ch "Test KO" $@`; \ 100 100 if $(TEST) $$count -eq 0; \ -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Synthesis
r19 r40 60 60 $(DIR_LOG)/%.fpga.log : 61 61 @$(ECHO) "Synthetis on FPGA : $*" 62 @$(XILINX_ENV); $(MAKE) -f Makefile.mkf $*.ngc > $@62 @$(XILINX_ENV); $(MAKE) -f Makefile.mkf $*.ngc &> $@ 63 63 64 64 $(DIR_WORK) : … … 67 67 68 68 $(DIR_LOG)/%.vhdl_sim.log : $(DIR_VHDL)/%.vhdl $(DIR_LOG)/%.vhdl.log 69 @$(ECHO) "VHDL's Simulation : $*"70 @$(MODELTECH_VSIM) "$(DIR_WORK).`$(BASENAME) $* |$(UPPERtoLOWER)`" > $@69 @$(ECHO) "VHDL's Simulation : $*" 70 @$(MODELTECH_VSIM) "$(DIR_WORK).`$(BASENAME) $* |$(UPPERtoLOWER)`" &> $@ 71 71 declare -i count=`$(GREP) -ch "Test KO" $@`; \ 72 72 if $(TEST) $$count -eq 0; \ … … 77 77 $(DIR_LOG)/%.vhdl.log : $(DIR_VHDL)/%.vhdl 78 78 @$(ECHO) "VHDL's Compilation : $*" 79 @$(MODELTECH_VCOM) $< > $@79 @$(MODELTECH_VCOM) $< &> $@ 80 80 81 81 synthesis_clean : -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.flags
r38 r40 6 6 7 7 #-----[ Simulator ]---------------------------------------- 8 SIMULATOR = systemcass _deps8 SIMULATOR = systemcass 9 9 10 10 # 3 simulators : … … 17 17 -DVHDL \ 18 18 -DVHDL_TESTBENCH \ 19 -DCONFIGURATION \ 20 -DPOSITION \ 19 21 -DSTATISTICS \ 20 -DPOSITION \ 21 -DCONFIGURATION \ 22 -DDEBUG=DEBUG_ALL 22 -DDEBUG=DEBUG_NONE 23 23 24 25 24 # Flags : 26 25 # DEBUG={level} - Print Debug Message -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/include/New_Component.h
r15 r40 21 21 #ifdef STATISTICS 22 22 #include "Behavioural/@DIRECTORY/include/Statistics.h" 23 #endif 24 #ifdef POSITION 25 #include "Behavioural/include/Position.h" 26 #else 27 #include "Behavioural/include/Interfaces.h" 23 28 #endif 24 29 #ifdef VHDL … … 56 61 private : Vhdl_Testbench * _vhdl_testbench; 57 62 #endif 63 64 #ifdef POSITION 65 private : Position * _position; 66 #endif 67 68 private : Interfaces * _interfaces; 58 69 59 70 #ifdef SYSTEMC -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component.cpp
r15 r40 29 29 log_printf(FUNC,@COMPONENT,"@COMPONENT","Begin"); 30 30 31 #ifdef SYSTEMC 32 log_printf(INFO,@COMPONENT,"@COMPONENT","Allocation"); 33 34 allocation (); 35 #endif 36 31 37 #ifdef STATISTICS 32 38 log_printf(INFO,@COMPONENT,"@COMPONENT","Allocation of statistics"); … … 41 47 log_printf(INFO,@COMPONENT,"@COMPONENT","Creation of a testbench"); 42 48 43 // Creation of a testbench44 // -> port45 // -> clock's signals46 49 _vhdl_testbench = new Vhdl_Testbench (_name); 47 50 #endif … … 54 57 #endif 55 58 56 #ifdef VHDL_TESTBENCH57 // must be invoke after affect of port58 _vhdl_testbench->set_clock ("in_CLOCK",true);59 #endif60 61 59 #ifdef SYSTEMC 62 log_printf(INFO,@COMPONENT,"@COMPONENT","Allocation");63 64 allocation ();65 66 60 //#if defined(STATISTICS) or defined(VHDL_TESTBENCH) 67 61 log_printf(INFO,@COMPONENT,"@COMPONENT","Method - transition"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_allocation.cpp
r15 r40 19 19 log_printf(FUNC,@COMPONENT,"allocation","Begin"); 20 20 21 //#if defined(STATISTICS) or defined(VHDL_TESTBENCH) 22 in_CLOCK = new SC_CLOCK ("in_CLOCK"); 23 //#endif 24 in_NRESET = new SC_IN (Tcontrol_t) ("in_NRESET"); 21 #ifdef POSITION 22 _position = new Position (); 23 24 Entity * entity = _position->set_entity (_name , 25 "@COMPONENT", 26 COMBINATORY ); 27 28 _interfaces = entity->set_interfaces(); 29 #else 30 _interfaces = new Interfaces(); 31 #endif 32 33 // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 34 35 Interface * interface_ = _interfaces->set_interface("", IN ,WEST, "Generalist interface"); 36 37 in_CLOCK = interface_->set_signal_clk ("clock" ,1, PORT_VHDL_YES_TESTBENCH_NO); 38 in_NRESET = interface_->set_signal_in <Tcontrol_t> ("nreset",1); 39 25 40 26 41 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 42 43 #ifdef POSITION 44 _position->generate_file(); 45 #endif 27 46 28 47 log_printf(FUNC,@COMPONENT,"allocation","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_deallocation.cpp
r15 r40 24 24 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 25 25 26 #ifdef POSITION 27 delete _position; 28 #else 29 delete _interfaces; 30 #endif 31 26 32 log_printf(FUNC,@COMPONENT,"deallocation","End"); 27 33 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_vhdl.cpp
r2 r40 17 17 { 18 18 log_printf(FUNC,@COMPONENT,"vhdl","Begin"); 19 19 20 Vhdl vhdl (_name); 20 21 … … 26 27 27 28 vhdl.generate_file(); 29 30 delete vhdl; 31 28 32 log_printf(FUNC,@COMPONENT,"vhdl","End"); 29 30 33 }; 31 34 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_vhdl_port.cpp
r15 r40 9 9 #include "Behavioural/@DIRECTORY/include/@COMPONENT.h" 10 10 11 #ifdef VHDL_TESTBENCH12 # define VHDL_SET_PORT(name,direction,size) do {vhdl.set_port (name,direction,size); _vhdl_testbench->set_port (name,direction,size);} while(0)13 #else14 # define VHDL_SET_PORT(name,direction,size) vhdl.set_port (name,direction,size)15 #endif16 17 11 namespace morpheo { 18 12 namespace behavioural { … … 23 17 log_printf(FUNC,@COMPONENT,"vhdl_port","Begin"); 24 18 25 vhdl.set_port (" in_CLOCK" , IN, 1); 26 VHDL_SET_PORT (" in_NRESET", IN, 1); 19 _interfaces->set_port(vhdl); 20 21 #ifdef VHDL_TESTBENCH 22 _interfaces->set_port(_vhdl_testbench); 23 _vhdl_testbench->set_clock ("in_CLOCK",true); 24 #endif 27 25 28 26 log_printf(FUNC,@COMPONENT,"vhdl_port","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_vhdl_testbench_transition.cpp
r2 r40 20 20 sc_start(0); 21 21 22 // In order with file @COMPONENT_vhdl_testbench_port.cpp 23 // Warning : if a output depend of a subcomponent, take directly the port of subcomponent 24 // (because we have no control on the ordonnancer's policy) 25 26 _vhdl_testbench->add_input (PORT_READ( in_NRESET)); 22 _interfaces->testbench(_vhdl_testbench); 27 23 28 24 // add_test : -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Configuration_Parameters.h
r3 r40 12 12 #include <iostream> 13 13 #include "Behavioural/include/XML.h" 14 #include "Behavioural/include/Environnement.h" 14 15 #include "Include/ErrorMorpheo.h" 15 16 #include "Include/ToString.h" -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Environnement.h
r2 r40 6 6 # error "To have the vhdl's test bench, you must set flags SYSTEMC" 7 7 #endif 8 9 #if (defined(VHDL_TESTBENCH) and not defined(VHDL)) 10 # error "To have the vhdl's test bench, you must set flags VHDL" 11 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface.h
r38 r40 39 39 40 40 // -----[ fields ]---------------------------------------------------- 41 pr ivate: const string _name ;42 pr ivate: const direction_t _direction ;43 pr ivate: const localisation_t _localisation ;44 pr ivate: string _comment ;41 protected : const string _name ; 42 protected : const direction_t _direction ; 43 protected : const localisation_t _localisation ; 44 protected : string _comment ; 45 45 46 private : list<Signal *> * _list_signal ; 47 46 protected : list<Signal *> * _list_signal ; 48 47 49 48 #ifdef POSITION 50 pr ivate: bool _is_map ;51 pr ivate: void * _entity_map ; // Entity -> erreur cyclique52 pr ivate: void * _interface_map; // pour être homogène avec _entity_map49 protected : bool _is_map ; 50 protected : void * _entity_map ; // Entity -> erreur cyclique 51 protected : void * _interface_map; // pour être homogène avec _entity_map 53 52 #endif 54 53 54 #ifdef VHDL_TESTBENCH 55 private : list<string> * _list_cycle ; 56 #endif 57 55 58 // -----[ methods ]--------------------------------------------------- 56 59 public : Interface (string name , … … 62 65 63 66 public : void set_comment (string comment); 64 pr ivate: string get_comment (void );67 protected : string get_comment (void ); 65 68 66 private : string get_signal (void); 69 protected : string signal_name (string name_interface, 70 string name_signal , 71 direction_t direction ); 72 73 protected : string get_signal (void); 67 74 public : Signal * set_signal (string name , 68 75 direction_t direction, … … 135 142 136 143 #ifdef VHDL_TESTBENCH 144 public : void testbench_cycle (void); 137 145 public : void testbench (Vhdl_Testbench * & vhdl_testbench); 138 146 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interfaces.h
r38 r40 12 12 #include <iostream> 13 13 #include <list> 14 #include "Behavioural/include/Interface .h"14 #include "Behavioural/include/Interface_fifo.h" 15 15 #include "Include/ToString.h" 16 16 #include "Include/Debug.h" … … 30 30 { 31 31 // -----[ fields ]---------------------------------------------------- 32 private : list<Interface *> * _list_interface;32 private : list<Interface_fifo*> * _list_interface; 33 33 34 34 // -----[ methods ]--------------------------------------------------- … … 37 37 public : ~Interfaces (); 38 38 39 public : Interface *set_interface (string name ,39 public : Interface_fifo * set_interface (string name , 40 40 direction_t direction , 41 41 localisation_t localisation); 42 public : Interface *set_interface (string name ,42 public : Interface_fifo * set_interface (string name , 43 43 direction_t direction , 44 44 localisation_t localisation, … … 53 53 #endif 54 54 55 public : Interface *find_interface (string name);55 public : Interface_fifo * find_interface (string name); 56 56 57 57 #ifdef VHDL_TESTBENCH -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Signal.h
r38 r40 23 23 #include "Behavioural/include/XML.h" 24 24 #include "Include/ErrorMorpheo.h" 25 #include "Include/ToBase2.h" 25 26 #include "Include/ToString.h" 26 27 #include "Include/Debug.h" … … 56 57 private : void * _signal ; 57 58 private : type_info_t _type_info ; 59 60 private : list<string> * _list_value ; 58 61 #endif 59 62 … … 67 70 68 71 #ifdef VHDL_TESTBENCH 72 public :template <typename T> 73 T read (void) 74 { 75 switch (_direction) 76 { 77 case IN : {return read_in <T>();} 78 case OUT : {return read_out <T>();} 79 default : throw (ErrorMorpheo ("Signal \""+_name+"\" : direction unknow.")); 80 } 81 } 82 83 public :template <typename T> 84 T read_in (void) 85 { 86 switch (_type_info) 87 { 88 case BOOL : return (static_cast<sc_in <bool > *>(_signal)->read()); 89 case UINT8_T : return (static_cast<sc_in <uint8_t > *>(_signal)->read()); 90 case UINT16_T : return (static_cast<sc_in <uint16_t> *>(_signal)->read()); 91 case UINT32_T : return (static_cast<sc_in <uint32_t> *>(_signal)->read()); 92 case UINT64_T : return (static_cast<sc_in <uint64_t> *>(_signal)->read()); 93 default : throw (ErrorMorpheo ("Signal \""+_name+"\" : type unknow.")); 94 } 95 } 96 97 public :template <typename T> 98 T read_out(void) 99 { 100 switch (_type_info) 101 { 102 case BOOL : return (static_cast<sc_out <bool > *>(_signal)->read()); 103 case UINT8_T : return (static_cast<sc_out <uint8_t > *>(_signal)->read()); 104 case UINT16_T : return (static_cast<sc_out <uint16_t> *>(_signal)->read()); 105 case UINT32_T : return (static_cast<sc_out <uint32_t> *>(_signal)->read()); 106 case UINT64_T : return (static_cast<sc_out <uint64_t> *>(_signal)->read()); 107 default : throw (ErrorMorpheo ("Signal \""+_name+"\" : type unknow.")); 108 } 109 } 110 69 111 public : void testbench (Vhdl_Testbench * & vhdl_testbench); 70 112 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Statistics.h
r2 r40 13 13 #include <stdint.h> 14 14 #include <iostream> 15 #include "Behavioural/include/Environnement.h" 15 16 #include "Behavioural/include/Parameters_Statistics.h" 16 17 #include "Include/Average.h" -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Vhdl.h
r29 r40 14 14 #include <iostream> 15 15 #include <list> 16 #include "Behavioural/include/Environnement.h" 16 17 #include "Behavioural/include/Direction.h" 17 18 #include "Include/ToString.h" -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Vhdl_Testbench.h
r2 r40 11 11 */ 12 12 13 #include "Behavioural/include/Environnement.h" 13 14 #include "Behavioural/include/Vhdl.h" 14 15 #include "Include/ToString.h" … … 39 40 // -----[ fields ]---------------------------------------------------- 40 41 private : const string _name ; 42 private : const bool _exhaustive ; 43 41 44 private : string _clock_name ; 42 45 private : uint32_t _num_cycle ; … … 48 51 private : list<string> _list_input_cycle; 49 52 private : list<uint32_t> _list_input_size ; 53 50 54 private : list<string> _list_output; 51 55 private : list<string> _list_output_cycle; 52 56 private : list<uint32_t> _list_output_size ; 57 53 58 private : list<bool> _list_test; 54 59 private : list<string> _list_port; … … 61 66 62 67 // -----[ methods ]--------------------------------------------------- 63 public : Vhdl_Testbench (string name); 68 public : Vhdl_Testbench (string name, 69 bool exhaustive=true); 64 70 public : virtual ~Vhdl_Testbench (); 65 71 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface.cpp
r38 r40 20 20 log_printf(FUNC,Behavioural,"Interface","Begin"); 21 21 22 _comment = "";23 _list_signal = new (list<Signal*>);22 _comment = ""; 23 _list_signal = new (list<Signal*>); 24 24 25 25 #ifdef POSITION 26 _is_map = false; 27 _entity_map = NULL; 28 _interface_map = NULL; 26 _is_map = false; 27 _entity_map = NULL; 28 _interface_map = NULL; 29 #endif 30 31 #ifdef VHDL_TESTBENCH 32 _list_cycle = new list<string>; 29 33 #endif 30 34 … … 45 49 _interface_map = interface._interface_map; 46 50 #endif 51 #ifdef VHDL_TESTBENCH 52 _list_cycle = interface._list_cycle; 53 #endif 54 47 55 log_printf(FUNC,Behavioural,"Interface (copy)","End"); 48 56 }; … … 54 62 if (_list_signal->empty()== false) 55 63 { 56 list<Signal*>::iterator i 64 list<Signal*>::iterator i = _list_signal->begin(); 57 65 58 66 while (i != _list_signal->end()) … … 64 72 65 73 delete _list_signal; 74 75 #ifdef VHDL_TESTBENCH 76 delete _list_cycle ; 77 #endif 78 66 79 log_printf(FUNC,Behavioural,"~Interface","End"); 67 80 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_get_signal.cpp
r38 r40 15 15 { 16 16 log_printf(FUNC,Behavioural,"get_signal","Begin"); 17 17 18 uint32_t depth = 0; 18 19 string separator = ",\n"; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_print.cpp
r38 r40 19 19 output_stream << x.get_comment() << endl; 20 20 output_stream << x.get_signal () << endl; 21 22 #ifdef VHDL_TESTBENCH 23 if (x._list_cycle->empty()== false) 24 { 25 list<string>::iterator i = x._list_cycle->begin(); 26 27 while (i != x._list_cycle->end()) 28 { 29 output_stream << "\n\t" << *i ; 30 ++i; 31 } 32 } 33 #endif 34 21 35 log_printf(FUNC,Behavioural,"operator<<","End"); 22 36 return output_stream; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_set_port.cpp
r38 r40 1 #ifdef VHDL2 1 /* 3 2 * $Id$ … … 13 12 namespace behavioural { 14 13 14 #ifdef VHDL 15 15 void Interface::set_port (Vhdl * & vhdl) 16 16 { … … 31 31 log_printf(FUNC,Behavioural,"set_port (Vhdl)","End"); 32 32 }; 33 #endif 33 34 35 #ifdef VHDL_TESTBENCH 34 36 void Interface::set_port (Vhdl_Testbench * & vhdl_testbench) 35 37 { … … 50 52 log_printf(FUNC,Behavioural,"set_port (Testbench)","End"); 51 53 }; 52 54 #endif 53 55 }; // end namespace behavioural 54 56 }; // end namespace morpheo 55 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_set_signal.cpp
r38 r40 6 6 */ 7 7 8 #include "Include/ChangeCase.h"9 8 #include "Behavioural/include/Interface.h" 10 9 … … 18 17 { 19 18 log_printf(FUNC,Behavioural,"set_signal","Begin"); 20 string str_direction = toString(direction);21 string str_interface = _name;22 string str_signal = name;23 19 24 LowerCase(str_direction); 25 UpperCase(str_interface); 26 UpperCase(str_signal ); 27 28 string signame = str_direction; 29 if (_name != "") 30 signame += "_"+str_interface; 31 if (name != "") 32 signame += "_"+str_signal; 20 string signame = signal_name(_name, name, direction); 33 21 34 22 Signal * sig = new Signal (signame , -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_testbench.cpp
r38 r40 12 12 namespace morpheo { 13 13 namespace behavioural { 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 } 14 20 15 21 void Interface::testbench (Vhdl_Testbench * & vhdl_testbench) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces.cpp
r38 r40 14 14 { 15 15 log_printf(FUNC,Behavioural,"Interfaces","Begin"); 16 _list_interface = new list<Interface *>;16 _list_interface = new list<Interface_fifo*>; 17 17 log_printf(FUNC,Behavioural,"Interfaces","End"); 18 18 }; … … 31 31 if (_list_interface->empty()== false) 32 32 { 33 list<Interface *>::iterator i = _list_interface->begin();33 list<Interface_fifo*>::iterator i = _list_interface->begin(); 34 34 35 35 while (i != _list_interface->end()) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_find_interface.cpp
r38 r40 11 11 namespace behavioural { 12 12 13 Interface * Interfaces::find_interface (string name)13 Interface_fifo * Interfaces::find_interface (string name) 14 14 { 15 15 if (_list_interface->empty()== false) 16 16 { 17 list<Interface *>::iterator i = _list_interface->begin();17 list<Interface_fifo*>::iterator i = _list_interface->begin(); 18 18 19 19 while (i != _list_interface->end()) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_get_interface.cpp
r38 r40 18 18 bool last_separator = false; 19 19 20 list<Interface *>::iterator i = _list_interface->begin();20 list<Interface_fifo*>::iterator i = _list_interface->begin(); 21 21 bool empty = _list_interface->empty(); 22 22 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_set_interface.cpp
r38 r40 11 11 namespace behavioural { 12 12 13 Interface * Interfaces::set_interface (string name ,13 Interface_fifo * Interfaces::set_interface (string name , 14 14 direction_t direction , 15 15 localisation_t localisation) 16 16 { 17 Interface * interface = new Interface(name, direction, localisation);17 Interface_fifo * interface = new Interface_fifo (name, direction, localisation); 18 18 19 19 _list_interface->push_back (interface); … … 22 22 }; 23 23 24 Interface * Interfaces::set_interface (string name ,24 Interface_fifo * Interfaces::set_interface (string name , 25 25 direction_t direction , 26 26 localisation_t localisation, 27 27 string comment ) 28 28 { 29 Interface * interface = set_interface(name, direction, localisation);29 Interface_fifo * interface = set_interface(name, direction, localisation); 30 30 31 31 interface->set_comment (comment); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_set_port.cpp
r38 r40 1 #ifdef VHDL2 1 /* 3 2 * $Id$ … … 13 12 namespace behavioural { 14 13 14 #ifdef VHDL 15 15 void Interfaces::set_port (Vhdl * & vhdl) 16 16 { 17 17 if (not _list_interface->empty()) 18 18 { 19 list<Interface *>::iterator i = _list_interface->begin();19 list<Interface_fifo*>::iterator i = _list_interface->begin(); 20 20 21 21 while (i != _list_interface->end()) … … 26 26 } 27 27 }; 28 #endif 28 29 30 31 #ifdef VHDL_TESTBENCH 29 32 void Interfaces::set_port (Vhdl_Testbench * & vhdl_testbench) 30 33 { 31 34 if (not _list_interface->empty()) 32 35 { 33 list<Interface *>::iterator i = _list_interface->begin();36 list<Interface_fifo*>::iterator i = _list_interface->begin(); 34 37 35 38 while (i != _list_interface->end()) … … 40 43 } 41 44 }; 45 #endif 42 46 43 47 }; // end namespace behavioural 44 48 }; // end namespace morpheo 45 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_testbench.cpp
r38 r40 19 19 if (_list_interface->empty()== false) 20 20 { 21 list<Interface *>::iterator i = _list_interface->begin();21 list<Interface_fifo*>::iterator i = _list_interface->begin(); 22 22 23 23 while (i != _list_interface->end()) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_toXML.cpp
r38 r40 17 17 if (_list_interface->empty()== false) 18 18 { 19 list<Interface *>::iterator i = _list_interface->begin();19 list<Interface_fifo*>::iterator i = _list_interface->begin(); 20 20 21 21 while (i != _list_interface->end()) … … 36 36 if (_list_interface->empty()== false) 37 37 { 38 list<Interface *>::iterator i = _list_interface->begin();38 list<Interface_fifo*>::iterator i = _list_interface->begin(); 39 39 40 40 while (i != _list_interface->end()) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal.cpp
r38 r40 22 22 log_printf(FUNC,Behavioural,"Signal","Begin"); 23 23 #ifdef VHDL_TESTBENCH 24 _signal = NULL; 25 _type_info = UNKNOW; 24 _signal = NULL; 25 _type_info = UNKNOW; 26 _list_value = new list<string>; 26 27 #endif 27 28 log_printf(FUNC,Behavioural,"Signal","End"); … … 36 37 log_printf(FUNC,Behavioural,"Signal (copy)","Begin"); 37 38 #ifdef VHDL_TESTBENCH 38 _signal = signal._signal ; 39 _type_info = signal._type_info; 39 _signal = signal._signal ; 40 _type_info = signal._type_info ; 41 _list_value = signal._list_value; 40 42 #endif 41 43 log_printf(FUNC,Behavioural,"Signal (copy)","End"); … … 45 47 { 46 48 log_printf(FUNC,Behavioural,"~Signal","Begin"); 49 #ifdef VHDL_TESTBENCH 50 delete _list_value; 51 #endif 47 52 log_printf(FUNC,Behavioural,"~Signal","End"); 48 53 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_print.cpp
r38 r40 9 9 10 10 namespace morpheo { 11 12 13 14 11 namespace behavioural { 15 12 … … 22 19 output_stream << "\t{" << x._size << "}\t" 23 20 << toString(x._direction) << "\t" 24 << toString(x._presence_port)<< endl; 21 << toString(x._presence_port); 22 23 // #ifdef VHDL_TESTBENCH 24 // if (x._list_value->empty()== false) 25 // { 26 // list<string>::iterator i = x._list_value->begin(); 27 28 // while (i != x._list_value->end()) 29 // { 30 // output_stream << "\n\t" << *i ; 31 // ++i; 32 // } 33 // } 34 // #endif 25 35 26 36 log_printf(FUNC,Behavioural,"operator<<","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_testbench.cpp
r38 r40 20 20 (_presence_port == PORT_VHDL_NO_TESTBENCH_YES)) 21 21 { 22 string str; 23 22 24 switch (_type_info) 23 25 { 24 26 case BOOL : 25 27 { 28 bool value = read <bool> (); 29 26 30 switch (_direction) 27 31 { 28 case IN : {vhdl_testbench->add_input (static_cast<sc_in <bool > *>(_signal)->read()); break; } 29 case OUT : {vhdl_testbench->add_output(static_cast<sc_out <bool > *>(_signal)->read()); break; } 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;} 30 36 case INOUT : {break;} 31 37 } … … 34 40 case UINT8_T : 35 41 { 42 uint8_t value = read <uint8_t> (); 43 36 44 switch (_direction) 37 45 { 38 case IN : {vhdl_testbench->add_input (static_cast<sc_in <uint8_t > *>(_signal)->read()); break; } 39 case OUT : {vhdl_testbench->add_output(static_cast<sc_out <uint8_t > *>(_signal)->read()); break; } 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;} 40 50 case INOUT : {break;} 41 51 } … … 44 54 case UINT16_T : 45 55 { 56 uint16_t value = read <uint16_t> (); 57 46 58 switch (_direction) 47 59 { 48 case IN : {vhdl_testbench->add_input (static_cast<sc_in <uint16_t> *>(_signal)->read()); break; } 49 case OUT : {vhdl_testbench->add_output(static_cast<sc_out <uint16_t> *>(_signal)->read()); break; } 50 case INOUT : {break;} 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;} 51 65 } 52 66 break; … … 54 68 case UINT32_T : 55 69 { 70 uint32_t value = read <uint32_t> (); 71 56 72 switch (_direction) 57 73 { 58 case IN : {vhdl_testbench->add_input (static_cast<sc_in <uint32_t> *>(_signal)->read()); break; } 59 case OUT : {vhdl_testbench->add_output(static_cast<sc_out <uint32_t> *>(_signal)->read()); break; } 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;} 60 78 case INOUT : {break;} 61 79 } … … 64 82 case UINT64_T : 65 83 { 84 uint64_t value = read <uint64_t> (); 85 66 86 switch (_direction) 67 87 { 68 case IN : {vhdl_testbench->add_input (static_cast<sc_in <uint64_t> *>(_signal)->read()); break; } 69 case OUT : {vhdl_testbench->add_output(static_cast<sc_out <uint64_t> *>(_signal)->read()); break; } 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;} 70 92 case INOUT : {break;} 71 93 } … … 76 98 } 77 99 100 _list_value->push_back(str); 78 101 } 79 102 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench.cpp
r2 r40 13 13 namespace behavioural { 14 14 15 Vhdl_Testbench::Vhdl_Testbench (string name ): 16 _name (name ) 15 Vhdl_Testbench::Vhdl_Testbench (string name , 16 bool exhaustive ): 17 _name (name ), 18 _exhaustive (exhaustive ) 17 19 { 18 20 _vhdl = new Vhdl (_name + "_Testbench"); … … 26 28 Vhdl_Testbench::~Vhdl_Testbench () 27 29 { 30 delete _vhdl; 28 31 }; 29 32
Note: See TracChangeset
for help on using the changeset viewer.