Commit e5b382bb authored by Alejandro Homs Puron's avatar Alejandro Homs Puron Committed by Operator for ID00

Eiger macros: extend test macro to mult-modules and different pixel depths

parent dc1316e2
def test_macro '{
while(1) {
local napi, cbp, cbe, bf, fr, nbi, et;
local lcd, lsd, ln, i;
local napi, cbp, cbe, bf, fr, mfr, lt, pd, mnbi[], nbi, et;
local lcd, lsd, ln, i, nbh, nbp, hmem, hnbp;
napi = 1;
ln = _lima_getccdname(CCD_U)
lcd = list_getpar(LIMA_DEV, ln, "control");
lsd = list_getpar(LIMA_DEV, ln, "config");
nbh = _limapar_get(ln, "hostname_list", -1)
nbp = nbh * 2
fr = ($# > 0) ? $1 : 22.0e3
nbi = ($# > 1) ? $2 : 30000
et = 1 / fr - _limapar_get("eiger500k", "latency_time")
for (i = 1; i <= list_n(LIMA_DEV); i++) {
ln = list_item(LIMA_DEV, i);
lcd = list_getpar(LIMA_DEV, ln, "control");
lsd = list_getpar(LIMA_DEV, ln, "config");
if (list_getpar(LIMA_DEV, ln, "unit") == CCD_U)
break;
}
if (i > list_n(LIMA_DEV)) {
printf("Error: could not find LIMA dev for CCD %d\n", \
CCD_U);
exit;
hmem = 4 * pow(1024, 3)
hnbp = (256 * 256 * 4)
for (i = 0; i < 4; i++) {
pd = pow(2, i + 2)
mnbi[pd] = 1.5 * hmem / (hnbp * pd / 8)
}
pd = _limapar_get(ln, "pixel_depth")
mfr = _limapar_get(ln, "max_frame_rate") * 1e3
lt = _limapar_get(ln, "latency_time")
fr = ($# > 0) ? $1 : mfr
nbi = ($# > 1) ? $2 : mnbi[pd]
et = 1 / fr - lt
bench ccdtake et nbi;
if (napi) {
......@@ -39,14 +43,14 @@ def test_macro '{
printf("\n%6d %6d %8.2f %8.2f\n", \
tango_get(lcd, "last_image_acquired") + 1, bf, \
eiger_cb_period_stats[2], eiger_cb_exec_stats[2]);
double array port_stats[4][5];
double array port_stats[nbp][5];
if (napi) {
for (i = 0; i < 4; i++)
for (i = 0; i < nbp; i++)
tango_io(lsd, "getStats", \
sprintf("%d:cb_period", i), \
port_stats[i]);
p port_stats[:][2];
for (i = 0; i < 4; i++)
for (i = 0; i < nbp; i++)
tango_io(lsd, "getStats", \
sprintf("%d:cb_exec", i), \
port_stats[i]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment