Skip to content

Commit

Permalink
skip negatives
Browse files Browse the repository at this point in the history
  • Loading branch information
rmanohar committed Feb 22, 2023
1 parent 72e8895 commit 05a1008
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions chpsim.cc
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,9 @@ static void _get_costs (stateinfo_t *si, ActId *id, chpsimstmt *stmt)
if (config_exists (buf)) {
if (debug_metrics) fprintf (stderr, " >> found %s\n", buf);
stmt->delay_cost = config_get_int (buf);
if (stmt->delay_cost < 0) {
stmt->delay_cost = 0;
}
}
else {
// default delay is 10
Expand All @@ -320,6 +323,9 @@ static void _get_costs (stateinfo_t *si, ActId *id, chpsimstmt *stmt)
if (config_exists (buf)) {
if (debug_metrics) fprintf (stderr, " >> found %s\n", buf);
stmt->energy_cost = config_get_int (buf);
if (stmt->energy_cost < 0) {
stmt->energy_cost = 0;
}
}
else {
// default energy is 0
Expand Down

0 comments on commit 05a1008

Please sign in to comment.