Changeset 35 for sources/src/gen_code.cc
- Timestamp:
- Jun 29, 2009, 6:03:59 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sources/src/gen_code.cc
r31 r35 79 79 ostream& operator << (ostream &o, const SC_ENTRY_FUNC &f) 80 80 { 81 register fct p; 82 p.pmf = f; 83 return o << "0x" << hex << p.integer << "ULL"; 81 register fct p; 82 p.integer = 0; 83 p.pmf = f; 84 return o << "0x" << hex << p.integer << "ULL"; 84 85 } 85 86 … … 242 243 o << "\nextern void mealy_generation (void)\n{\n"; 243 244 o << " register fct p;\n" 244 245 246 247 248 249 250 245 << "\n\n /* fonctions de mealy */\n"; 246 ProcessDependencyList::iterator it; 247 for (it = mealy_func_list.begin(); it != mealy_func_list.end(); ++it) 248 { 249 const method_process_t *m = *it; 250 PrintCall (o, *m); 251 } 251 252 } 252 253 … … 260 261 cerr << "Generating C code for scheduling...\n"; 261 262 262 263 263 // open temporary file 264 ofstream o; 264 265 char base_name[PATH_MAX]; 265 266 open_temp (o, base_name); 266 267 267 268 if (! o.good ()) { 268 269 perror("scheduling: open file\n"); 269 270 exit(-1); … … 271 272 272 273 o << "// generated by " << sc_version () << endl 273 274 275 // 276 274 << "#include <casc.h>\n\n" 275 << "#include <cstdio>\n\n" 276 // << "#include <iostream>\n\n" 277 << "namespace sc_core {\n" 277 278 << " typedef void (sc_module::*SC_ENTRY_FUNC)();\n" 278 279 << " typedef void (*CASC_ENTRY_FUNC)(void *);\n"; 279 280 const char *pmf_type = (sizeof (SC_ENTRY_FUNC) == 4)? 280 281 // G4 pointer-to-member-function style … … 286 287 << " integer; SC_ENTRY_FUNC pmf; CASC_ENTRY_FUNC pf; } fct;\n"; 287 288 288 289 290 289 gen_transition (o, transition_func_list); 290 gen_moore (o, moore_func_list); 291 gen_mealy (o, strongcomponents); 291 292 292 293 o << " \n}\n"; … … 340 341 << " typedef union { unsigned long long int integer; SC_ENTRY_FUNC pmf; CASC_ENTRY_FUNC pf; } fct;\n"; 341 342 342 343 344 343 gen_transition (o, transition_func_list); 344 gen_moore (o, moore_func_list); 345 gen_mealy (o, mealy_func_list); 345 346 346 347 o << "\n}\n"; … … 567 568 { 568 569 #ifdef CONFIG_CHECK_FSM_RULES 569 570 casc_fsm_step = TRANSITION; 570 571 #endif 571 572 call_functions (pf[0]); // transition 572 573 update (); 573 574 #ifdef CONFIG_CHECK_FSM_RULES 574 575 casc_fsm_step = GEN_MOORE; 575 576 #endif 576 577 call_functions (pf[1]); // moore generation 577 578 #ifdef CONFIG_CHECK_FSM_RULES 578 579 casc_fsm_step = GEN_MEALY; 579 580 #endif 580 581 call_functions (pf[2]); // mealy generation 581 582 #ifdef CONFIG_CHECK_FSM_RULES 582 583 casc_fsm_step = STIMULI; 583 584 #endif 584 585 } … … 626 627 { 627 628 #ifdef CONFIG_CHECK_FSM_RULES 628 629 casc_fsm_step = TRANSITION; 629 630 #endif 630 631 method_process_list_t::iterator mm; … … 636 637 update (); 637 638 #ifdef CONFIG_CHECK_FSM_RULES 638 639 casc_fsm_step = GEN_MOORE; 639 640 #endif 640 641 for( mm = func_list[1].begin(); mm != func_list[1].end(); ++mm) … … 644 645 } 645 646 #ifdef CONFIG_CHECK_FSM_RULES 646 647 casc_fsm_step = GEN_MEALY; 647 648 #endif 648 649 quasistatic_mealy_generation (); 649 650 #ifdef CONFIG_CHECK_FSM_RULES 650 651 casc_fsm_step = STIMULI; 651 652 #endif 652 653 }
Note: See TracChangeset
for help on using the changeset viewer.