byteman  1.3 (Build #225)
Bitstream relocation and manipulation tool
inlineTest.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2022 Kristiyan Manev (University of Manchester)
3  *
4  * Licensed under the Apache License, Version 2.0(the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *****************************************************************************/
16 
17 #if !defined(NDEBUG)
18 inline void ensureFramesAre(bool usableFramesOnly, bool testValueEqual, uint32_t testValue)
19 {
20  for(int r = 0 ; r < numberOfRows ; r++){
21  for(int c = 0 ; c < numberOfCols[r] ; c++){
22  uint8_t frameLetter = (uint8_t)resourceString[r][c];
23  if(frameLetter <= 1) //don't include the extra frames on each row in the test
24  continue;
25  if(!usableFramesOnly || (!LUT_isFrameUnusedForResourceLetter[frameLetter])){
26  for(int m = 0 ; m < LUT_numberOfFramesForResourceLetter[frameLetter] ; m++){
27  for(int f = 0 ; f < WORDS_PER_FRAME ; f++){
28  if(testValueEqual) {
29  throwingAssertPrintVar_5(bitstreamCLB[r][c][m * WORDS_PER_FRAME + f], ==, testValue, r, c, m, WORDS_PER_FRAME, f);
30  } else {
31  throwingAssertPrintVar_5(bitstreamCLB[r][c][m * WORDS_PER_FRAME + f], !=, testValue, r, c, m, WORDS_PER_FRAME, f);
32  }
33  }
34  }
35  }
36  }
37  for(int c = 0 ; c < numberOfBRAMCols[r] ; c++){
38  for(int m = 0 ; m < FRAMES_PER_BRAM_CONTENT_COLUMN ; m++){
39  for(int f = 0 ; f < WORDS_PER_FRAME ; f++){
40  if(testValueEqual){
41  throwingAssertPrintVar_5(bitstreamBRAM[r][c][m * WORDS_PER_FRAME + f], ==, testValue, r, c, m, WORDS_PER_FRAME, f);
42  } else {
43  throwingAssertPrintVar_5(bitstreamBRAM[r][c][m * WORDS_PER_FRAME + f], !=, testValue, r, c, m, WORDS_PER_FRAME, f);
44  }
45  }
46  }
47  }
48  }
49  log("Test finished successfully.");
50 }
51 #endif
52 
#define throwingAssertPrintVar_5(left, operator,right, var1, var2, var3, var4, var5)
Definition: assert.h:37
void ensureFramesAre(bool usableFramesOnly, bool testValueEqual, uint32_t testValue)
Definition: inlineTest.h:18