rw_test
¶
Read Write Test.
Functions:
-
rw_test–Performs read-write tests using random or default values.
-
rw_test_base–Base function to perform read-write tests on a given register.
-
walking_ones_test–Performs walking ones test on the registers.
-
walking_zeros_test–Performs walking zeros test on the registers.
rw_test
async
¶
rw_test(
RAL,
foreground_write=True,
foreground_read=True,
count=10,
default_value=None,
verbose=False,
)
Performs read-write tests using random or default values.
Parameters:
-
RAL(RAL_Test) –Instance of RAL model generated using peakrdl_cocotb_ralgen.
-
foreground_write(bool, default:True) –If True, use foreground write; otherwise, use background write.
-
foreground_read(bool, default:True) –If True, use foreground read; otherwise, use background read.
-
count(int, default:10) –Number of read-write operations to perform per register.
-
default_value(int, default:None) –If provided, this value is used for writes; otherwise, random values are used.
-
verbose(bool, default:False) –If True, logs the results of each operation.
Source code in src/peakrdl_cocotb_ralgen/testcases/rw_test.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | |
rw_test_base
async
¶
rw_test_base(
RAL: Any,
key: str,
reg: dict,
wrval: int,
foreground_write: bool,
foreground_read: bool,
test_type: str,
verbose: bool,
)
Base function to perform read-write tests on a given register.
Parameters:
-
RAL(Any) –The RAL instance, required for background operations.
-
key(str) –Key or identifier for the register.
-
reg(dict) –Register metadata containing width and masks.
-
wrval(int) –The value to write to the register.
-
foreground_write(bool) –If True, use foreground write; otherwise, use background write.
-
foreground_read(bool) –If True, use foreground read; otherwise, use background read.
-
test_type(str) –The test type which calls the base function.
-
verbose(bool) –If True, logs the read-write results.
Raises:
-
AssertionError–If the actual value read does not match the expected value.
Source code in src/peakrdl_cocotb_ralgen/testcases/rw_test.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
walking_ones_test
async
¶
walking_ones_test(
RAL,
foreground_write=True,
foreground_read=True,
verbose=False,
)
Performs walking ones test on the registers.
Parameters:
-
RAL(RAL_Test) –Instance of RAL model generated using peakrdl_cocotb_ralgen.
-
verbose(bool, default:False) –If True, logs the results of each operation.
-
foreground_write(bool, default:True) –If True, use foreground write; otherwise, use background write.
-
foreground_read(bool, default:True) –If True, use foreground read; otherwise, use background read.
Source code in src/peakrdl_cocotb_ralgen/testcases/rw_test.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | |
walking_zeros_test
async
¶
walking_zeros_test(
RAL,
foreground_write=True,
foreground_read=True,
verbose=False,
)
Performs walking zeros test on the registers.
Parameters:
-
RAL(RAL_Test) –Instance of RAL model generated using peakrdl_cocotb_ralgen.
-
verbose(bool, default:False) –If True, logs the results of each operation.
-
foreground_write(bool, default:True) –If True, use foreground write; otherwise, use background write.
-
foreground_read(bool, default:True) –If True, use foreground read; otherwise, use background read.
Source code in src/peakrdl_cocotb_ralgen/testcases/rw_test.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | |