Changeset 47 for sources/src
- Timestamp:
- Oct 26, 2009, 7:07:37 PM (15 years ago)
- Location:
- sources/src
- Files:
-
- 1 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
sources/src/casc.h
r37 r47 38 38 #ifdef SCHEDULING_BY_CASC 39 39 #include <systemcass_version_ext.h> 40 #include <fsm_rules.h>41 40 42 41 namespace sc_core { … … 49 48 EXTERN void simulate_1_cycle (void) 50 49 { 51 #ifdef CONFIG_CHECK_FSM_RULES52 casc_fsm_step = TRANSITION;53 #endif54 50 transition (); 55 51 update (); 56 #ifdef CONFIG_CHECK_FSM_RULES57 casc_fsm_step = GEN_MOORE;58 #endif59 52 moore_generation (); 60 #ifdef CONFIG_CHECK_FSM_RULES61 casc_fsm_step = GEN_MEALY;62 #endif63 53 mealy_generation (); 64 #ifdef CONFIG_CHECK_FSM_RULES65 casc_fsm_step = STIMULI;66 #endif67 54 } 68 55 } // end of sc_core namespace -
sources/src/dump_used_options.cc
r42 r47 68 68 "DUMP_STAGE, " 69 69 #endif 70 #ifdef CONFIG_CHECK_FSM_RULES71 "CONFIG_CHECK_FSM_RULES, "72 #endif73 #ifdef CONFIG_CHECK_MULTIWRITING2PORT74 "CONFIG_CHECK_MULTIWRITING2PORT, "75 #endif76 #ifdef CONFIG_CHECK_MULTIWRITING2REGISTER77 "CONFIG_CHECK_MULTIWRITING2REGISTER, "78 #endif79 70 #ifdef CONFIG_DEFAULT_RUNTIME_COMPILATION 80 71 "CONFIG_DEFAULT_RUNTIME_COMPILATION, " -
sources/src/gen_code.cc
r41 r47 58 58 #endif 59 59 60 #ifdef CONFIG_CHECK_FSM_RULES 61 #include "fsm_rules.h" 62 #define fsm_check_flag "-DCONFIG_CHECK_FSM_RULES" 63 #else 64 #define fsm_check_flag 65 #endif 66 67 #define casc_cflags GENERATED_MODULE_CFLAGS " " fsm_check_flag 60 #define casc_cflags GENERATED_MODULE_CFLAGS 68 61 69 62 // Enable CPP call, this is useful for typeinfo-enabled classes … … 608 601 void static_simulate_1_cycle (void) 609 602 { 610 #ifdef CONFIG_CHECK_FSM_RULES611 casc_fsm_step = TRANSITION;612 #endif613 603 call_functions (pf[0]); // transition 614 604 update (); 615 #ifdef CONFIG_CHECK_FSM_RULES616 casc_fsm_step = GEN_MOORE;617 #endif618 605 call_functions_in_parallel (pf[1]); // moore generation 619 #ifdef CONFIG_CHECK_FSM_RULES620 casc_fsm_step = GEN_MEALY;621 #endif622 606 call_functions (pf[2]); // mealy generation 623 #ifdef CONFIG_CHECK_FSM_RULES624 casc_fsm_step = STIMULI;625 #endif626 607 } 627 608 … … 668 649 void quasistatic_simulate_1_cycle (void) 669 650 { 670 #ifdef CONFIG_CHECK_FSM_RULES671 casc_fsm_step = TRANSITION;672 #endif673 651 method_process_list_t::iterator mm; 674 652 for( mm = func_list[0].begin(); mm != func_list[0].end(); ++mm) … … 678 656 } 679 657 update (); 680 #ifdef CONFIG_CHECK_FSM_RULES681 casc_fsm_step = GEN_MOORE;682 #endif683 658 for( mm = func_list[1].begin(); mm != func_list[1].end(); ++mm) 684 659 { … … 686 661 Call (m); 687 662 } 688 #ifdef CONFIG_CHECK_FSM_RULES689 casc_fsm_step = GEN_MEALY;690 #endif691 663 quasistatic_mealy_generation (); 692 #ifdef CONFIG_CHECK_FSM_RULES693 casc_fsm_step = STIMULI;694 #endif695 664 } 696 665 -
sources/src/gen_code.h
r27 r47 121 121 #endif 122 122 update (); 123 #ifdef CONFIG_CHECK_FSM_RULES124 casc_fsm_step = GEN_MEALY;125 #endif126 123 func_combinationals (); 127 124 } … … 132 129 if (is_posted_write ()) { 133 130 update (); 134 #ifdef CONFIG_CHECK_FSM_RULES135 casc_fsm_step = GEN_MEALY;136 #endif137 131 func_combinationals (); 138 132 } -
sources/src/global_functions.cc
r42 r47 49 49 #endif 50 50 51 #ifdef CONFIG_CHECK_FSM_RULES52 #include "fsm_rules.h"53 #endif54 55 51 using namespace std; 56 52 … … 264 260 265 261 // Init variables to be able to run combinational functions 266 #ifdef CONFIG_CHECK_FSM_RULES267 casc_fsm_step = STIMULI;268 #endif269 270 262 pending_write_vector_capacity = get_signal_table_size (); 271 #if 0 272 cerr << "pending_write_vector_capacity = " << pending_write_vector_capacity 273 << "\n"; 274 #endif 263 275 264 if (pending_write_vector_capacity == 0) 276 265 pending_write_vector = NULL; -
sources/src/sc_port.cc
r35 r47 57 57 58 58 using namespace std; 59 60 #ifdef CONFIG_CHECK_FSM_RULES61 #include "fsm_rules.h"62 namespace sc_core {63 casc_fsm_step_t casc_fsm_step = ELABORATION;64 }65 #endif66 59 67 60 namespace sc_core { … … 259 252 cerr << "done.\n"; 260 253 #endif 261 #if defined(CONFIG_CHECK_MULTIWRITING2REGISTER)262 sc_core::pending_writing2register_clear ();263 #endif264 254 } 265 255 … … 354 344 } 355 345 356 #if defined(CONFIG_CHECK_MULTIWRITING2REGISTER)357 typedef set<const tab_t*> pending_writing2register_set_t;358 pending_writing2register_set_t pending_writing2register_set;359 360 void361 pending_writing2register_clear ()362 {363 pending_writing2register_set.clear();364 }365 366 void367 pending_writing2register_record_and_check (const tab_t *p)368 {369 if (pending_writing2register_set.find (p) != pending_writing2register_set.end())370 {371 std::cerr << "Error : please check '" << get_name (p) << "'.\n";372 std::cerr << "Up to 1 writing per register is allowed during a cycle.\n";373 sc_stop ();374 exit (31072006); // 6375 } else376 pending_writing2register_set.insert(p);377 }378 #endif379 380 346 } // end of sc_core namespace 381 347 -
sources/src/sc_port_ext.h
r35 r47 22 22 #endif 23 23 24 #include "fsm_rules.h"25 24 #include "internal_ext.h" 26 25 #include "port_dependency_ext.h" … … 56 55 ((value_type_&) (*((value_type_*) (pointer_)))) 57 56 58 57 ///////////////////// DEPRECATED 59 58 // C ANSI-only since it is needed to link with extern "C" 60 // this declaration is not in casc.h since the CONFIG_CHECK_FSM_RULES macro61 // is not defined.62 59 63 60 extern void bind (sc_port_base&,sc_port_base&); … … 188 185 << " on signal " << name () << "\n"; 189 186 #endif 190 #ifdef CONFIG_CHECK_FSM_RULES191 if (casc_fsm_step == GEN_MOORE) {192 std::cerr << "FSM rules error : trying to read on input port '"193 << name ()194 << "' from " << get_step_name () << " function.\n";195 exit (-1);196 }197 #endif198 187 return READ_SIGNAL(const T, get_pointer()); 199 188 } … … 298 287 << " on signal " << name () << "\n"; 299 288 #endif 300 #ifdef CONFIG_CHECK_FSM_RULES301 if (casc_fsm_step == GEN_MOORE) {302 std::cerr << "FSM rules error : trying to read on input/output port "303 << name () //get_name (get_pointer())304 << " from " << get_step_name () << " function.\n";305 exit (-1);306 }307 #endif308 289 // return val; 309 290 return READ_SIGNAL(const T, get_pointer()); … … 320 301 << " on in/out port (writing into a signal) '" << name () << "'\n"; 321 302 #endif 322 #ifdef CONFIG_CHECK_FSM_RULES323 if ((casc_fsm_step != GEN_MOORE) && ( casc_fsm_step != GEN_MEALY)) {324 std::cerr << "FSM rules error : trying to write on output port "325 << name ()326 << " from an " << get_step_name () << " function.\n";327 exit (-1);328 }329 #endif330 303 // T& ref = *(T*)(get_pointer()); 331 #if defined(CONFIG_CHECK_MULTIWRITING2PORT)332 check_multiwriting2port ();333 #endif334 304 #ifndef USE_PORT_DEPENDENCY 335 305 unstable |= (value_) != val; //ref; -
sources/src/sc_signal.h
r32 r47 26 26 #include "internal_ext.h" 27 27 28 #ifdef CONFIG_CHECK_FSM_RULES29 #include "fsm_rules.h"30 #endif31 32 28 namespace sc_core { 33 29 … … 45 41 ///////////////////// DEPRECATED 46 42 // C ANSI-only since it is needed to link with extern "C" 47 // this declaration is not in casc.h since the CONFIG_CHECK_FSM_RULES macro48 // is not defined.49 43 50 44 extern void bind (sc_port_base&,sc_port_base&); … … 250 244 << " on signal " << name () << "\n"; 251 245 #endif 252 #ifdef CONFIG_CHECK_FSM_RULES253 // we can read value from sc_signal type (used like a register) at any time254 #endif255 246 return READ_SIGNAL(const T, get_pointer()); 256 247 } … … 262 253 sc_signal<T>::write( const data_type& value_ ) 263 254 { 264 #ifdef CONFIG_CHECK_FSM_RULES265 if ((casc_fsm_step != TRANSITION)266 && ( casc_fsm_step != STIMULI)) {267 std::cerr << "FSM rules error : trying to write on signal "268 << name ()269 << " from " << get_step_name () << " function.\n";270 exit (-1);271 }272 #endif273 255 #ifdef CONFIG_DEBUG 274 256 if (get_pointer() == NULL) … … 278 260 } 279 261 #endif 280 #ifdef CONFIG_CHECK_MULTIWRITING2REGISTER281 pending_writing2register_record_and_check (get_pointer ());282 #endif283 262 #ifdef DUMP_WRITE 284 263 if (sc_signal<T>::read() == value_)
Note: See TracChangeset
for help on using the changeset viewer.