From: Emanuel P. <ema...@gm...> - 2005-12-08 15:57:50
|
Dear Kim (and other coleagues), PCAF is a framework based on Coloured Petri Net modeling language (CPN) tha= t is adopted for supporting simulation and analysis. As result, it is possibl= e to explore scenarios of code execution according to the occurrence probabilities of external events. Nowadays, the flow of code execution is assumed to be fifty-fifty in a conditional jump instruction in the asm code= ; our approach is to insert a more realistic value of probability. For example, the instruction <@70@> after a conditional jump means that thi= s jump has got 70% of chance to execute. The proposed approach (begin the analysis in C code) offers three basic contributions: (i)code modeling, a probabilistic model for scenarios exploration being presented, (ii) formalism, a formal and widespread modeling language (CPN) being applied, with previously validated engines and algorithms for simulation; (iii) flexibility, the proposed approach enabling modeling of different micro-controllers at different abstraction levels. For more references about this project, please see: 1. Oliveira J=FAnior, M. N. Analyzing Compiler Optimization Focusing Energy Consumption: A Coloured Petri Net Approach. 2. Oliveira J=FAnior, M. N., et al. Towards a Software Power Cost Analysis Framework Using Colored Petri Net. 3. Oliveira J=FAnior, M. N., et al. A Retargetable Environment for Power-Aw= are Code Evaluation: An Approach based on Coloured Petri Net. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > The later syntax would allow you to change the definition of an > expression and pass the @70 and @80 in with the expression to the next > level. > If you could pass them on down in the expression, when it comes time to > generate the iCode, generate a branch icode for bne a,5 and insert an > inlineasm iCode with @70 right behind it. Then in gen.c , the backend > will have to be modified so that if it sees a branch followed by an > inline asm with ;<@INT@>, it knows to put that on the same line as the > last emit went on, which means you'll have to watch the '\n's on the > emits. in other words, are you suggesting us to do something like: relational_expr '<' shift_expr { $$ =3D (port->lt_nge ? newNode('!',newNode(GE_OP,$1,$3),NULL) : newNode('<', $1,$3)); } | relational_expr '<' shift_expr '@' CONSTANT { ast *ex; ex =3D (port->lt_nge ? newNode('!',newNode(GE_OP,$1,$3),NULL) : newNode('<', $1,$3)); ex->values.probability =3D newAst_VALUE($5); $$ =3D ex; } ... ? great thanks Emanuel Pessoa Computer Engineering student State University of Pernambuco - Recife - Brasil |