@ -60,9 +60,9 @@ module TransferFunctionsNodesBasicCost (CFG : ProcCfg.S) = struct
let exec_instr_cost _ inferbo_mem ( astate : CostDomain . NodeInstructionToCostMap . astate )
let exec_instr_cost _ inferbo_mem ( astate : CostDomain . NodeInstructionToCostMap . astate )
{ ProcData . pdesc } ( node : CFG . node ) instr : CostDomain . NodeInstructionToCostMap . astate =
{ ProcData . pdesc } ( node : CFG . node ) instr : CostDomain . NodeInstructionToCostMap . astate =
let nid_int = ( Procdesc . Node . get_id ( CFG . underlying_node node ) :> int ) in
let nid_int = Procdesc . Node . get_id ( CFG . underlying_node node ) in
let instr_idx = instr_idx node instr in
let instr_idx = instr_idx node instr in
let key = ( nid_int , instr_idx ) in
let key = ( nid_int , ProcCfg . Instr_index instr_idx ) in
let astate' =
let astate' =
match instr with
match instr with
| Sil . Call ( _ , Exp . Const Const . Cfun callee_pname , _ , _ , _ ) -> (
| Sil . Call ( _ , Exp . Const Const . Cfun callee_pname , _ , _ , _ ) -> (
@ -486,27 +486,25 @@ module TransferFunctionsWCET (CFG : ProcCfg.S) = struct
let exec_instr ( astate : Domain . astate ) { ProcData . extras } ( node : CFG . node ) instr : Domain . astate =
let exec_instr ( astate : Domain . astate ) { ProcData . extras } ( node : CFG . node ) instr : Domain . astate =
let { basic_cost_map = invariant_map_cost ; min_trees_map = trees ; summary } = extras in
let { basic_cost_map = invariant_map_cost ; min_trees_map = trees ; summary } = extras in
let und_node = CFG . underlying_node node in
let node_id = Procdesc . Node . get_id und_node in
let preds = Procdesc . Node . get_preds und_node in
let map_cost m : Itv . Bound . t =
let map_cost m : Itv . Bound . t =
CostDomain . NodeInstructionToCostMap . fold
CostDomain . NodeInstructionToCostMap . fold
( fun ( nid , idx ) c acc ->
( fun ( ( node_id , _ ) as instr_node_id ) c acc ->
match Int . Map . find trees nid with
let nid = ( node_id :> int ) in
| Some t ->
let t = Int . Map . find_exn trees nid in
let c_node = Itv . Bound . mult c t in
let c_node = Itv . Bound . mult c t in
L . ( debug Analysis Medium )
L . ( debug Analysis Medium )
" @ \n [AnalyzerWCET] Adding cost: (% i,%i) --> c =%a t = %a @\n " nid idx
" @ \n [AnalyzerWCET] Adding cost: (% a) --> c =%a t = %a @\n " ProcCfg . InstrNode . pp_id
Itv . Bound . pp c Itv . Bound . pp t ;
instr_node_id Itv . Bound . pp c Itv . Bound . pp t ;
let c_node' = Itv . Bound . plus_u acc c_node in
let c_node' = Itv . Bound . plus_u acc c_node in
L . ( debug Analysis Medium )
L . ( debug Analysis Medium )
" @ \n [AnalyzerWCET] Adding cost: (%i,%i) --> c_node=%a cost = %a @ \n " nid idx
" @ \n [AnalyzerWCET] Adding cost: (%a) --> c_node=%a cost = %a @ \n "
Itv . Bound . pp c_node Itv . Bound . pp c_node' ;
ProcCfg . InstrNode . pp_id instr_node_id Itv . Bound . pp c_node Itv . Bound . pp c_node' ;
c_node'
c_node' )
| _ ->
assert false )
m Itv . Bound . zero
m Itv . Bound . zero
in
in
let und_node = CFG . underlying_node node in
let node_id = Procdesc . Node . get_id und_node in
let preds = Procdesc . Node . get_preds und_node in
let cost_node =
let cost_node =
match AnalyzerNodesBasicCost . extract_post node_id invariant_map_cost with
match AnalyzerNodesBasicCost . extract_post node_id invariant_map_cost with
| Some ( _ , node_map ) ->
| Some ( _ , node_map ) ->