From ed441935a7fe4cc1014b58b4cd6e9b35971c457e Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Tue, 10 Oct 2017 17:36:34 +0200 Subject: [PATCH] Optimized chip tests for good new chips with lower leakage current --- .../drscl/drscl.xcodeproj/project.pbxproj | 14 ++++- software/src/DRS.cpp | 56 +++++++++++-------- 2 files changed, 46 insertions(+), 24 deletions(-) diff --git a/software/drscl/drscl.xcodeproj/project.pbxproj b/software/drscl/drscl.xcodeproj/project.pbxproj index 91b025f..43209de 100644 --- a/software/drscl/drscl.xcodeproj/project.pbxproj +++ b/software/drscl/drscl.xcodeproj/project.pbxproj @@ -121,7 +121,7 @@ D5446422141E1BB40027AF52 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0810; + LastUpgradeCheck = 0900; ORGANIZATIONNAME = PSI; }; buildConfigurationList = D5446425141E1BB40027AF52 /* Build configuration list for PBXProject "drscl" */; @@ -162,12 +162,18 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -202,12 +208,18 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; diff --git a/software/src/DRS.cpp b/software/src/DRS.cpp index 62415d4..a6e7887 100644 --- a/software/src/DRS.cpp +++ b/software/src/DRS.cpp @@ -3043,22 +3043,33 @@ int DRSBoard::ChipTest(int flag) int n = 0, imax, jmax; int histo[100]; - Init(); - SetChannelConfig(0, 8, 8); - SetDominoMode(1); - SetReadoutMode(1); - SetDominoActive(1); - SetTranspMode(0); - EnableTrigger(0, 0); - EnableTcal(0); - SelectClockSource(0); - - printf("Chip test at %1.1lf deg. C\n", GetTemperature()); + for (int retry = 0 ; retry < 5 ; retry++) { + Init(); + SetChannelConfig(0, 8, 8); + SetDominoMode(1); + SetReadoutMode(1); + SetDominoActive(1); + SetTranspMode(0); + EnableTrigger(0, 0); + EnableTcal(0); + SelectClockSource(0); + + printf("Chip test at %1.1lf deg. C\n", GetTemperature()); + + /* test 1 GHz */ + SetFrequency(1, true); + StartDomino(); + Sleep(100); + + if ((GetStatusReg() & BIT_PLL_LOCKED0)) + break; + + SetStandbyMode(1); + Sleep(300); + SetStandbyMode(0); + Sleep(300); + } - /* test 1 GHz */ - SetFrequency(1, true); - StartDomino(); - Sleep(100); if (!(GetStatusReg() & BIT_PLL_LOCKED0)) { puts("PLL did not lock at 1 GHz"); return 0; @@ -3192,16 +3203,15 @@ int DRSBoard::ChipTest(int flag) double delta_t = 0.1; for (t=0 ; t<150 ; t+=delta_t) { - if (t >= 0.99 && delta_t == 0.1) delta_t = 1; - if (t >= 9.99 && delta_t == 1) delta_t = 10; + delta_t *= 1.5; SetReadoutDelay((float)t); - // average over 10 waveforms + // average over 5 waveforms printf("."); fflush(stdout); memset(wf1, 0, sizeof(wf1)); - for (int r=0 ; r<10 ; r++) { + for (int r=0 ; r<5 ; r++) { StartDomino(); Sleep(10); SoftTrigger(); @@ -3213,7 +3223,7 @@ int DRSBoard::ChipTest(int flag) GetWave(0, i, wft[i], false, tc, 0, true); for (j=0 ; j<1024 ; j++) - wf1[i][j] += wft[i][j]/10; + wf1[i][j] += wft[i][j]/5; } } @@ -3304,10 +3314,10 @@ int DRSBoard::ChipTest(int flag) if (cell_error[i][j]) n_error++; - if (lcmax > 100) - printf("\n=== Chip has too high leakage current ===\n"); + if (lcmax > 10) + printf("\n========== Chip has too high leakage current ==========\n"); else if (n_error) - printf("\n=== Chip has %d cells with errors ===\n", n_error); + printf("\n========== Chip has %d cells with errors ==========\n", n_error); else printf("\n*** Chip test successfully finished ***\n");