Changeset 4 for sources/src
- Timestamp:
- Mar 10, 2008, 12:37:25 PM (17 years ago)
- Location:
- sources/src
- Files:
-
- 1 added
- 1 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
sources/src/Makefile
r3 r4 10 10 # | | 11 11 # \------------------------------------------------------------*/ 12 ifndef SYSTEMC13 $(error SYSTEMC is not defined. This variable should be set to SystemCASS \14 directory when SYSTEMCASS variable is not set.)15 endif16 12 ifndef SYSTEMCASS 17 13 $(error SYSTEMCASS is not defined. This variable has to be defined to install \ … … 186 182 187 183 EXTERNAL_INCLUDES = \ 184 ${SYSTEMCASS_INCLUDEDIR}/systemc \ 188 185 ${SYSTEMCASS_INCLUDEDIR}/systemc.h \ 189 186 ${SYSTEMCASS_INCLUDEDIR}/sc_fwd.h\ … … 289 286 cp $*.h ${SYSTEMCASS_INCLUDEDIR}/$*.h 290 287 288 ${SYSTEMCASS_INCLUDEDIR}/systemc: systemc 289 cp $< $@ 290 291 291 ${SYSTEMCASS_DOCDIR}/%.pdf: %.pdf 292 292 cp $*.pdf ${SYSTEMCASS_DOCDIR}/$*.pdf … … 348 348 ./guess_endianness.x > ${SYSTEMCASS_INCLUDEDIR}/endianness.h 349 349 350 include Makefile.deps350 -include Makefile.deps 351 351 352 352 ################## … … 374 374 #### CLEANING 375 375 clean : 376 echo >Makefile.deps376 rm -f Makefile.deps 377 377 rm -f *~ 378 378 rm -f $(OBJECTS) -
sources/src/casc.h
r1 r4 19 19 #endif 20 20 21 #include <stdint.h> 22 21 23 EXTERN char unstable; 22 EXTERN unsigned int pending_write_vector_nb;24 EXTERN int32_t pending_write_vector_nb; 23 25 24 26 namespace sc_core { -
sources/src/dump_dot.cc
r1 r4 41 41 #include "sc_ver.h" // sc_version 42 42 43 typedef std::list<sc_ port_base*> port_list_t;43 typedef std::list<sc_core::sc_port_base*> port_list_t; 44 44 using namespace std; 45 45 46 46 namespace sc_core { 47 48 using namespace sc_dt; 47 49 48 50 // Build a port list owned by the module mod -
sources/src/global_functions.cc
r1 r4 357 357 358 358 void 359 sc_start(double d_val) 359 sc_start(double d_val) 360 360 { 361 361 sc_cycle (d_val); … … 368 368 } 369 369 370 void 371 sc_start() 372 { 373 sc_cycle (-1); 374 #ifdef DUMP_SIGNAL_STATS 375 print_registers_writing_stats (cerr); 376 #endif 377 #ifdef DUMP_SCHEDULE_STATS 378 print_schedule_stats (cerr); 379 #endif 380 } 381 370 382 void 371 383 sc_start (double d_val, … … 378 390 sc_start( const sc_time& duration ) 379 391 { 380 sc_start ((double)duration); 392 sc_cycle ((double)duration); 393 #ifdef DUMP_SIGNAL_STATS 394 print_registers_writing_stats (cerr); 395 #endif 396 #ifdef DUMP_SCHEDULE_STATS 397 print_schedule_stats (cerr); 398 #endif 381 399 } 382 400 -
sources/src/global_functions.h
r1 r4 35 35 36 36 //extern void next_cycle(void); 37 extern void sc_start (double d_val = -1); 37 extern void sc_start (double d_val) __attribute__((deprecated)); 38 extern void sc_start (); 38 39 extern void sc_start ( const sc_time& duration ); 39 40 extern void sc_start (double d_val, sc_time_unit d_tu); -
sources/src/sc_event_finder.cc
r1 r4 37 37 #include"sc_event_finder.h" 38 38 39 sc_event_finder::sc_event_finder (/*const*/ sc_port_base &p) 39 namespace sc_core { 40 41 sc_event_finder::sc_event_finder (/*const*/ sc_core::sc_port_base &p) 40 42 : a_port (p) 41 43 { … … 46 48 } 47 49 48 /*const*/ sc_ port_base&50 /*const*/ sc_core::sc_port_base& 49 51 sc_event_finder::port () /*const*/ 50 52 { … … 52 54 } 53 55 56 } -
sources/src/sc_event_finder.h
r1 r4 15 15 #include"sc_fwd.h" 16 16 17 namespace sc_core { 18 17 19 class sc_event_finder { 18 /*const*/sc_ port_base &a_port;20 /*const*/sc_core::sc_port_base &a_port; 19 21 public: 20 sc_event_finder (/*const*/ sc_ port_base&);22 sc_event_finder (/*const*/ sc_core::sc_port_base&); 21 23 virtual ~sc_event_finder (); 22 24 23 25 // methods 24 /*const*/ sc_ port_base& port () /*const*/;26 /*const*/ sc_core::sc_port_base& port () /*const*/; 25 27 26 28 // operators … … 33 35 }; 34 36 37 } 38 35 39 #endif /* __SC_EVENT_FINDER_H__ */ -
sources/src/sc_fwd.h
r1 r4 56 56 } 57 57 58 using sc_core::method_process_t;59 using sc_core::sc_port_base;60 using sc_core::sc_object;61 using sc_core::sc_interface;62 using sc_core::sc_module;63 using sc_core::sc_module_name;64 using sc_core::sc_event;65 using sc_core::sc_event_finder;66 using sc_core::sc_sensitive;67 using sc_core::sc_sensitive_pos;68 using sc_core::sc_sensitive_neg;69 /////////////////////////////////////////////////70 // Ports & Signals71 //72 using sc_core::sc_time;73 74 using sc_core::sc_in;75 using sc_core::sc_inout;76 using sc_core::sc_out;77 using sc_core::sc_signal;78 using sc_core::sc_port_b;79 using sc_core::sc_signal_base;80 using sc_core::sc_clock;81 82 using sc_core::sc_trace_file;83 84 using sc_core::method_process_list_t;85 86 58 ///////////////////////////////////////////////// 87 59 // Data Types … … 101 73 } 102 74 103 using sc_dt::sc_bit;104 using sc_dt::sc_bv;105 using sc_dt::sc_logic;106 using sc_dt::sc_lv;107 using sc_dt::sc_unsigned;108 using sc_dt::sc_signed;109 //using sc_dt::sc_int_base;110 using sc_dt::sc_int;111 using sc_dt::sc_uint;112 using sc_dt::sc_bigint;113 using sc_dt::sc_biguint;114 //using sc_dt::sc_uint_base;115 116 75 #endif 117 76 -
sources/src/sc_main.cc
r1 r4 51 51 // 52 52 using namespace std; 53 using namespace sc_core; 53 54 // 54 55 typedef list<sc_module* > module_list_t; … … 58 59 59 60 bool check_port_dependencies = false; 60 bool dynamic_link_of_scheduling_code = true;61 bool dynamic_link_of_scheduling_code = false; 61 62 bool dump_netlist_info = false; 62 63 bool dump_funclist_info = false; -
sources/src/sc_port.cc
r1 r4 51 51 extern char unstable; 52 52 char unstable = 0; // not in sc_core namespace because dynamic link support C linkage only 53 unsigned int pending_write_vector_nb = 0;53 int32_t pending_write_vector_nb = 0; 54 54 } 55 55 -
sources/src/sc_port_ext.h
r1 r4 43 43 namespace sc_core { 44 44 // 45 46 using namespace sc_dt; 47 45 48 const char *get_name (const tab_t *pointer); 46 49 … … 269 272 sc_inout<T>::init () 270 273 { 271 set_pointer ((tab_t*) &val);274 set_pointer ((tab_t*)(void*)&val); 272 275 sc_object::set_kind (sc_inout_string); 273 276 sc_interface::init (sizeof (data_type)); -
sources/src/sc_time.cc
r1 r4 39 39 #include <sys/time.h> 40 40 #include <string> 41 42 using namespace std; 41 #include <sstream> 43 42 44 43 namespace sc_core { 45 44 46 uint64 nb_cycles = 0; 45 static const char *const unit_repr_string[6] = 46 { 47 "FS", "PS", "NS", "US", "MS", "SEC" 48 }; 49 50 uint64_t nb_cycles = 0; 47 51 48 52 const sc_time SC_ZERO_TIME(0,SC_NS); … … 51 55 sc_time::sc_time (const sc_time &t) 52 56 { 53 time = t.time;57 *this = t; 54 58 } 55 59 56 60 sc_time::sc_time (double val, sc_time_unit tu) 57 61 { 58 time = (long long int) val; 62 time = (uint64_t) val; 63 unit = tu; 59 64 } 60 65 … … 64 69 { 65 70 time = t.time; 71 unit = t.unit; 72 return *this; 66 73 } 67 74 68 75 69 const st ring76 const std::string 70 77 sc_time::to_string () const 71 78 { 72 char res[32]; 73 const char* unit; 74 if (time == 0) 75 { 76 unit = "s"; 77 } else 78 unit = "ns"; 79 sprintf (res, "%lld %s", time, unit); 80 return (string)res; 79 std::ostringstream o; 80 o << time << ' ' << unit_repr_string[unit]; 81 return o.str(); 81 82 } 82 83 -
sources/src/sc_time.h
r1 r4 13 13 #define __SC_TIME_H__ 14 14 15 #include <iostream>16 15 #include <string> 17 #include "sc_nbdefs.h" 18 #include "internal_ext.h" 16 #include <stdint.h> 19 17 20 18 namespace sc_core { … … 41 39 extern sc_time SC_CURRENT_TIME; 42 40 43 extern uint64 nb_cycles;41 extern uint64_t nb_cycles; 44 42 45 43 inline double sc_simulation_time() // in default time units … … 54 52 { 55 53 friend const sc_time &sc_time_stamp (); 56 long long int time; 54 uint64_t time; 55 enum sc_time_unit unit; 57 56 public: 58 // sc_time (); LRM 2.159 57 sc_time (double val, sc_time_unit tu); 60 58 sc_time (const sc_time& = SC_ZERO_TIME); … … 62 60 sc_time& operator= (const sc_time &); 63 61 64 /*sc_dt::*/uint64 value () const { return (/*sc_dt::*/uint64)time;}65 double to_double () const { return time * 1000;}66 double to_seconds() const { return time / (double)1000000000;};67 operator double () const { return to_double ();};62 uint64_t value () const { return time;} 63 inline double to_double () const; 64 inline double to_seconds() const; 65 inline operator double () const { return to_double ();} 68 66 const std::string to_string () const; 69 67 }; … … 75 73 } 76 74 75 double 76 sc_time::to_double () const 77 { 78 double fact = 1; 79 switch(unit) { 80 case SC_FS: fact = 1e-6; break; 81 case SC_PS: fact = 1e-3; break; 82 case SC_NS: fact = 1; break; 83 case SC_US: fact = 1e3; break; 84 case SC_MS: fact = 1e6; break; 85 case SC_SEC: fact = 1e9; break; 86 } 87 return (double)time * fact; 88 } 89 90 double 91 sc_time::to_seconds() const 92 { 93 double fact = 1; 94 switch(unit) { 95 case SC_FS: fact = 1e-15; break; 96 case SC_PS: fact = 1e-12; break; 97 case SC_NS: fact = 1e-9; break; 98 case SC_US: fact = 1e-6; break; 99 case SC_MS: fact = 1e-3; break; 100 case SC_SEC: fact = 1; break; 101 } 102 return (double)time * fact; 103 } 104 77 105 } // end of namespace sc_core 78 106 79 using sc_core::sc_simulation_time;80 using sc_core::sc_time;81 using sc_core::sc_time_stamp;82 83 107 #endif /* __SC_TIME_H__ */ -
sources/src/sc_trace_ext.h
r1 r4 51 51 52 52 namespace sc_core { 53 54 using namespace sc_dt; 53 55 54 56 //--------------------------------------------------------------------------- -
sources/src/systemc.h
r1 r4 38 38 #define __SYSTEMC_H__ 39 39 40 #define SYSTEMCASS_SPECIFIC 41 //#define SOCVIEW // we can't define SOCVIEW macro because we don't support 42 //some features like "debug" function 43 #define STATESAVER_SYSTEM 44 #define NONAME_RENAME 45 #define PORT_DEPENDANCIES_ENABLED 40 #include <systemc> 46 41 47 #include"sc_fwd.h"48 42 49 #include"global_functions.h" 50 #include"sc_nbdefs.h" 51 #include"sc_ver_ext.h" 52 #include"sc_module_name.h" 53 #include"sc_module_ext.h" 54 #include"sc_module_name.h" 55 #include"module_hierarchy_ext.h" 56 #include"serialization_ext.h" 57 #include"sc_port_ext.h" 58 #include"sc_signal.h" 59 #include"sc_clock_ext.h" 60 #include"sc_sensitive.h" 43 using sc_core::method_process_t; 44 using sc_core::sc_port_base; 45 using sc_core::sc_object; 46 using sc_core::sc_interface; 47 using sc_core::sc_module; 48 using sc_core::sc_module_name; 49 using sc_core::sc_event; 50 using sc_core::sc_event_finder; 51 using sc_core::sc_sensitive; 52 using sc_core::sc_sensitive_pos; 53 using sc_core::sc_sensitive_neg; 54 ///////////////////////////////////////////////// 55 // Ports & Signals 56 // 57 using sc_core::sc_time; 58 using sc_core::sc_simulation_time; 59 using sc_core::sc_time_stamp; 61 60 62 #include"sc_time.h" 63 #include"sc_unit.h" 64 #include"sc_trace_ext.h" 65 #include"sc_vcd_trace.h" 66 #include"sc_pat_trace.h" 67 #include"endianness.h" 61 using sc_core::sc_in; 62 using sc_core::sc_inout; 63 using sc_core::sc_out; 64 using sc_core::sc_signal; 65 using sc_core::sc_port_b; 66 using sc_core::sc_signal_base; 67 using sc_core::sc_clock; 68 69 using sc_core::sc_trace_file; 70 71 using sc_core::method_process_list_t; 72 73 using sc_dt::sc_bit; 74 using sc_dt::sc_bv; 75 using sc_dt::sc_logic; 76 using sc_dt::sc_lv; 77 using sc_dt::sc_unsigned; 78 using sc_dt::sc_signed; 79 //using sc_dt::sc_int_base; 80 using sc_dt::sc_int; 81 using sc_dt::sc_uint; 82 using sc_dt::sc_bigint; 83 using sc_dt::sc_biguint; 84 //using sc_dt::sc_uint_base; 68 85 69 86 using std::ios;
Note: See TracChangeset
for help on using the changeset viewer.