// Blah blah blah... miniTramp *instPoint::instrument(AstNode *ast, callWhen when, callOrder order, bool trampRecursive, bool noCost) { miniTramp *mini = addInst(ast, when, order, trampRecursive, noCost); if (!mini) { cerr << "instPoint::instrument: failed addInst, ret NULL" << endl; return NULL; } if (!generateInst()) { cerr << "instPoint::instrument: failed generateInst, ret NULL" << endl; return NULL; } if (!installInst()) { cerr << "instPoint::instrument: failed installInst, ret NULL" << endl; return NULL; } if (!linkInst()) { cerr << "instPoint::instrument: failed linkInst, ret NULL" << endl; return NULL; } return mini; }
int GProcessor::issue(PipeQueue &pipeQ) { int i=0; // Instructions executed counter int j=0; // Fake Instructions counter I(!pipeQ.instQueue.empty()); if(!replayQ.empty()) { issueFromReplayQ(); nStall[ReplayStall]->add(RealisticWidth); return 0; // we issued 0 from the instQ; // FIXME:check if we can issue from replayQ and // fetchQ during the same cycle } do{ IBucket *bucket = pipeQ.instQueue.top(); do{ I(!bucket->empty()); if( i >= IssueWidth ) { return i+j; } I(!bucket->empty()); DInst *dinst = bucket->top(); #ifdef TASKSCALAR if (!dinst->isFake()) { if (dinst->getLVID()==0 || dinst->getLVID()->isKilled()) { // Task got killed. Just swallow the instruction dinst->killSilently(); bucket->pop(); j++; continue; } } #endif StallCause c = addInst(dinst); if (c != NoStall) { if (i < RealisticWidth) nStall[c]->add(RealisticWidth - i); return i+j; } i++; bucket->pop(); }while(!bucket->empty()); pipeQ.pipeLine.doneItem(bucket); pipeQ.instQueue.pop(); }while(!pipeQ.instQueue.empty()); return i+j; }
int32_t GProcessor::issue(PipeQueue &pipeQ) { int32_t i=0; // Instructions executed counter int32_t j=0; // Fake Instructions counter I(!pipeQ.instQueue.empty()); if(!replayQ.empty()) { issueFromReplayQ(); nStall[ReplayStall]->add(RealisticWidth); return 0; // we issued 0 from the instQ; // FIXME:check if we can issue from replayQ and // fetchQ during the same cycle } do { IBucket *bucket = pipeQ.instQueue.top(); do { I(!bucket->empty()); if( i >= IssueWidth ) { return i+j; } I(!bucket->empty()); DInst *dinst = bucket->top(); StallCause c = addInst(dinst); if (c != NoStall) { if (i < RealisticWidth) nStall[c]->add(RealisticWidth - i); return i+j; } i++; bucket->pop(); } while(!bucket->empty()); pipeQ.pipeLine.doneItem(bucket); pipeQ.instQueue.pop(); } while(!pipeQ.instQueue.empty()); return i+j; }
int GProcessor::issueFromReplayQ() { int nIssued = 0; while(!replayQ.empty()) { DInst *dinst = replayQ.top(); StallCause c = addInst(dinst); if (c != NoStall) { if (nIssued < RealisticWidth) nStall[c]->add(RealisticWidth - nIssued); break; } nIssued++; replayQ.pop(); if(nIssued >= IssueWidth) break; } return nIssued; }
void initLib(void) { addFonc(".",IF_point); addFonc("+",IF_plus); addFonc("-",IF_moins); addFonc("=",IF_Legal); addFonc("<>",IF_Ldiff); addFonc(">",IF_Lsup); addFonc("<",IF_Linf); addFonc(">=",IF_Lsupeg); addFonc("<=",IF_Linfeg); addFonc("*",IF_mult); addFonc("/",IF_div); addFonc("neg",IF_neg); addFonc("min",IF_min); addFonc("max",IF_max); addFonc("modulo",IF_modulo); addFonc("**",IF_puiss); addFonc("[]-sub",IF_subTab); addFonc("[]sub",IF_subTabR); addFonc("*[]-sub",IF_NsubTab); addFonc("*[]sub",IF_NsubTabR); addFonc("[]rev",IF_TabRev); addFonc("*[]rev",IF_NTabRev); addFonc("[]crot",IF_TabTransp); addFonc("[]transp",IF_TabTranspN); addFonc("[]trot",IF_TabTranspT); addFonc("[]>>",IF_TNShiftR); addFonc("[]<<",IF_TNShiftL); addFonc("*[]>>",IF_NTNShiftR); addFonc("*[]<<",IF_NTNShiftL); addFonc("[]>",IF_TShiftR); addFonc("[]<",IF_TShiftL); addFonc("*[]>",IF_NTShiftR); addFonc("*[]<",IF_NTShiftL); addFonc("[]min",IF_TABMin); addFonc("[]max",IF_TABMax); addFonc("[]sum",IF_TABSum); addFonc("[]prod",IF_TABProd); addFonc("[]min/max",IF_TABMinMax); addFonc(">array",IF_toArray); addFonc(">scalar",IF_toScalar); addFonc(">-scalar",IF_toScalarR); addFonc("\"",IF_debString); addFonc("\"drop",IF_dropC); addFonc("\"dup",IF_dupC); addFonc("\"over",IF_overC); addFonc("\"swap",IF_swapC); addFonc("\"type",IF_typeC); addFonc("\"cat",IF_catC); addFonc("\"cats",IF_catsC); addFonc("cr",IF_crC); addFonc("\"time",IF_timeC); addFonc("\"date",IF_dateC); addFonc("sleep",IF_sleep); addFonc("sh",IF_sh); addFonc("?drop",IF_dropL); addFonc("?dup",IF_dupL); addFonc("?swap",IF_swapL); addFonc("?over",IF_overL); addFonc("?t/f",IF_typeL); addFonc("and",IF_andL); addFonc("or",IF_orL); addFonc("xor",IF_xorL); addFonP("fdrop",rmLastFct); addFonE("del_func",IF_delFct, F_PROG); addFonE("del_afunc",IF_delAFct, F_PROG); addFonE("del_ofunc",IF_delOFct, F_PROG); addFonE("fscan",IF_scanFct, F_PROG); addFonc("?cs",IF_show_stackC); addFonP("_?cs",IFD_show_stackC); addFonP("?f",IF_show_stackF); addFonP("_?f",IFD_show_stackF); /* addFonP("?l",IF_showFD); for internal debugging */ addFonP("?v",IF_show_stackV); addFonP("_?v",IFD_show_stackV); addFonE("del_var",IF_delVar,F_PROG); addFonP("vdrop",rmLastVar); addFonP("reset_var",IF_setVarI); addFonP(">v",IF_setVarN); addFonP("?>v",IF_setVarB); addFonP("\">v",IF_setVarC); addFonP("in",IF_setVarLF); addFonP("install",IF_INSTALL); addFonP("install_f",IF_INSTALLF); addFonP("install_v",IF_INSTALLV); /* pas pour le moment !! addFonP("df_init",IF_DF_INIT); addFonP("df_start",IF_DF_START); addFonP("df_stop",IF_DF_STOP); ****************/ addFonc("?ls",IF_show_stackL); addFonP("_?ls",IFD_show_stackL); addFonc("?s",IF_show_stack); addFonP("_?s",IFD_show_stack); addFonc("?ms",IF_show_TStacks); addFonc("[",IF_new_stackN); addFonc("]",IF_old_stackN); addFonc("{",IF_new_stackC); addFonc("}",IF_old_stackC); addFonc("(",IF_new_stackL); addFonc(")",IF_old_stackL); addFonc("[*",IF_new_stackAll); addFonc("]*",IF_old_stackAll); /* addFonc("?libX",show_lib_addr); for internal debugging */ addFonc("?libs",IF_show_liball); addFonc("?lib",IF_show_libstd); addFonc("?libM",IF_show_libmath); addFonc("?libT",IF_show_libtools); addFonc("?libP",IF_show_libprog); addFonc("?libD",IF_show_libdev); addFonc("?libN",IF_show_libnet); addFonc("?libU",IF_show_libusr); addFonc("?lasterr",IF_showError); addFonc("?err",IF_IsError); addFonc("noerr",IF_NoError); addFonc("messerr",IF_LibError); addFonc("ls_clear",IF_stackL_clear); addFonc("cs_clear",IF_stackC_clear); addFonc("REAL",IF_REAL); addFonc("INTEGER",IF_INTEGER); addFonc("DEC",IF_DEC); addFonc("HEX",IF_HEX); addFonc("OCT",IF_OCT); addFonc("BIN",IF_BIN); addFonc("echo_on",IF_ECHOON); addFonc("echo_off",IF_ECHOFF); addFonP("DEBUG_I/O",IFD_Update); addFonP("\"saveLog",IFD_SaveLog); /* addFonP("?logs",IFD_DebugTOn); */ addFonc("NBTAB",IF_NBTAB); addFonc("NBLIG",IF_NBLIG); addFonE("Var",IF_debVar, F_PROG); addFonc("\"Var",IF_debVarCS); addFonP("var_off",IF_VAROFF); addFonP("var_up",IF_VARUP); addFonP("var_down",IF_VARDOWN); addFonc("?vars",IF_vars); addFonP("_?vars",IFD_vars); addFonc("drop",IF_drop); addFonc("dup",IF_dup); addFonc("swap",IF_swap); addFonc("over",IF_over); addFonc("pick",IF_pick); addFonc("rot",IF_rot); addFonc("unrot",IF_unrot); addFonc("roll",IF_roll); addFonc("unroll",IF_unroll); addFonc("*drop",IF_Ndrop); addFonc("*dup",IF_Ndup); addFonc("depth",IF_depth); addFonc("exit",IF_exit); addFonc("false",IF_false); addFonc("not",negBool); addFonc("ramp",IF_ramp); addFonc("dramp",IF_dramp); addFonc("rusage",IF_resUsage); addFonc("s_clear",IF_stack_clear); addFonM("inv",IF_inv); addFonM("sqrt",IF_sqrt); addFonM("cbrt",IF_cbrt); addFonM("round",IF_round); addFonM("floor",IF_floor); addFonM("ceil",IF_ceil); addFonM("sgn",IF_sgn); addFonM("abs",IF_abs); addFonM("pi",IF_pi); addFonM("sin",IF_sin); addFonM("cos",IF_cos); addFonM("tan",IF_tan); addFonM("asin",IF_asin); addFonM("acos",IF_acos); addFonM("atan",IF_atan); addFonM("sinh",IF_sinh); addFonM("cosh",IF_cosh); addFonM("tanh",IF_tanh); addFonM("asinh",IF_asinh); addFonM("acosh",IF_acosh); addFonM("atanh",IF_atanh); addFonM("ln",IF_ln); addFonM("log",IF_log); addFonM("exp",IF_exp); addFonM("j0",IF_j0); addFonM("j1",IF_j1); addFonM("y0",IF_y0); addFonM("y1",IF_y1); addFonc("time",IF_time); addFonc("true",IF_true); addFonc("about",IF_about); addFonc("vers",IF_vers); addFonE("load",IF_Load, F_PROG); addFonE("dump",IF_Dump, F_PROG); addFonE("restore",IF_Restore, F_PROG); addFonP("\"load",IF_LoadCS); addFonP("\"exec",IF_ExecCS); addFonP("\"execf",IF_ExecCSf); addInst("\"execk",IF_EXEK); addFonG(">csv",IF_toCsv); addFonG("y_xgraph",IF_yXgraph); addFonG("yt_xgraph",IF_ytXgraph); addFonG("xy_xgraph",IF_xyXgraph); addFonG("xyt_xgraph",IF_xytXgraph); addFonG("?gp",IF_show_stackGP); addFonP("_?gp",IFD_show_stackGP); addFonG("gplot",IF_gplot_new); addFonG("gplotM",IF_gplot_newM); addFonG("gplotRaz",IF_delAllGP); addFonG("gplotCmd",IF_gplot_commapp); addFonG("gplotAdd",IF_gplot_append); addFonG("gplotRepl",IF_gplot_replace); addFonG("del_gplot",IF_gplot_del); addFonG("gplotClear",IF_gplot_clear); addFonP(":",IF_debFct); addFonP(":!",IF_debFctS); addFonP("Task",IF_NewTask); addFonP("?t",IF_show_Tasks); addFonP("_?t",IFD_show_Tasks); addFonP("?task_run",IF_statusTask); addFonP("del_task",IF_delTask); addFonP("\"f",IF_execCS); addFonP("\"v",IF_execCSv); addFonP("\"f?",IF_execCSl); addFonP("\"v?",IF_execCSvl); addFonP("stop_task",IF_stopTask); addFonP("?console",IF_showCons); addFonP("_?console",IFD_showCons); addInst(";",IF_finFct); addInst("'",IF_debBackC); addInst("`",IF_debBackC1); addInst("return",IF_RET); addInst("if",IF_IF); addInst("else",IF_ELSE); addInst("then",IF_THEN); addInst("begin",IF_BEGIN); addInst("again",IF_AGAIN); addInst("until",IF_UNTIL); addInst("while",IF_WHILE); addInst("repeat",IF_REPEAT); addInst("do",IF_DO); addFonc("do_leave",IF_DO_Leave); addFonc("*do_leave",IF_DO_MLeave); addFonc("do_next",IF_DO_Next); /* addFonc("?do",IF_DO_Show); for internal debugging */ addFonc("ndo",IF_nDO); addInst("loop",IF_LOOP); addInst("+loop",IF_PLOOP); addInst("I",IF_I_DO); addInst("J",IF_J_DO); addInst("K",IF_K_DO); addInst("break",IF_BREAK); addInst("myself",IF_MYSELF); addInst("onerr:",IF_ONERR); addInst("end:",IF_END); addInst("goto_end",IF_JEND); addFonE("help",IF_help, F_CORE); addFonD("?dev",IF_listDev); addFonP("_?dev",IFD_listDev); addFonD("dev_info",IF_showDev); addFonP("_dev_info",IFD_showDev); addFonD("dev_read",IF_devRead); addFonD("dev_write",IF_devWrite); addFonD("dev_dflt",IF_devDflt); addFonD("?dev_dflt",IF_devShowDflt); addFonP("_?dev_dflt",IFD_devShowDflt); addFonD("dev_dflW",IF_devDflW); addFonD("dev_dflR",IF_devDflR); addFonD("?i2c",IF_listI2C); addFonP("_?i2c",IFD_listI2C); addFonD("i2c_info",IF_showI2C); addFonP("_i2c_info",IFD_showI2C); addFonD("i2c_read",IF_I2CRead); addFonD("i2c_write",IF_I2CWrite); addFonN("?n",IF_netList); addFonP("_?n",IFD_netList); addFonN("netOn",IF_netOn); addFonN("netOff",IF_netOff); addFonN("netDt>",IF_netDt); addFonN("netExec",IF_netExec); addFonN("netCompile",IF_netCompile); addFonN("ndepth",IF_netDepth); addFonN("stopServer",IF_netStopS); addFonN("NetServer",IF_NetServer); addFonN("srusage",IF_netRusage); addFonN("NetKey",IF_NetKey); addFonN("NetErr",IF_NetErrVal); addFonN("Me",IF_Me); addFonN("?ns",IF_netStackList); addFonP("_?ns",IFD_netStackList); addFonN(">net",IF_netU2S); addFonN("net>",IF_netS2U); addFonN("ndrop",IF_netDropS); /* triList(); */ }