Skip to content

Commit

Permalink
firmware/ci: fix ddr bandwidth computation and add it to status
Browse files Browse the repository at this point in the history
  • Loading branch information
enjoy-digital committed Aug 19, 2015
1 parent 3ad56cd commit 28ed52e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions firmware/lm32/ci.c
Expand Up @@ -94,6 +94,8 @@ static void status_disable(void)
status_enabled = 0;
}

static void debug_ddr(void);

static void status_service(void)
{
static int last_event;
Expand Down Expand Up @@ -130,6 +132,8 @@ static void status_service(void)
printf("off");
printf("\n");
#endif
printf("ddr: ");
debug_ddr();
}
}
}
Expand Down Expand Up @@ -203,8 +207,8 @@ static void debug_ddr(void)
nr = sdram_controller_bandwidth_nreads_read();
nw = sdram_controller_bandwidth_nwrites_read();
f = identifier_frequency_read();
rdb = (nr*f >> (24 - 7))/1000000ULL;
wrb = (nw*f >> (24 - 7))/1000000ULL;
rdb = (nr*f >> (24 - 6))/1000000ULL;
wrb = (nw*f >> (24 - 6))/1000000ULL;
printf("read:%5dMbps write:%5dMbps all:%5dMbps\n", rdb, wrb, rdb + wrb);
}

Expand Down

0 comments on commit 28ed52e

Please sign in to comment.