| 
									
										
										
										
											2018-09-20 05:44:38 +08:00
										 |  |  | /*!
 | 
					
						
							|  |  |  |    \file Trace.h | 
					
						
							|  |  |  |    \brief Basic TLM-2 Trace module | 
					
						
							|  |  |  |    \author Màrius Montón | 
					
						
							|  |  |  |    \date September 2018 | 
					
						
							|  |  |  | */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef __TRACE_H__
 | 
					
						
							|  |  |  | #define __TRACE_H__
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <iostream>
 | 
					
						
							|  |  |  | #include <fstream>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define SC_INCLUDE_DYNAMIC_PROCESSES
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "systemc"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "tlm.h"
 | 
					
						
							|  |  |  | #include "tlm_utils/simple_target_socket.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | using namespace sc_core; | 
					
						
							|  |  |  | using namespace sc_dt; | 
					
						
							|  |  |  | using namespace std; | 
					
						
							| 
									
										
										
										
											2018-11-25 06:46:01 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-21 17:23:31 +08:00
										 |  |  | /**
 | 
					
						
							|  |  |  |  * @brief Simple trace peripheral | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * This peripheral outputs to cout any character written to its unique register | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2018-09-20 05:44:38 +08:00
										 |  |  | class Trace: sc_module { | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  |     // TLM-2 socket, defaults to 32-bits wide, base protocol
 | 
					
						
							|  |  |  |     tlm_utils::simple_target_socket<Trace> socket; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // Constructor
 | 
					
						
							|  |  |  |     Trace(sc_module_name name); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // TLM-2 blocking transport method
 | 
					
						
							|  |  |  |     virtual void b_transport( tlm::tlm_generic_payload& trans, sc_time& delay ); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif
 |