hbc_fsm
¶
Contains HyperBus_FSM class for the State Machine in hyperbus protocol.
Classes:
-
HyperBus_FSM–State machine class for hyperbus.
HyperBus_FSM
¶
HyperBus_FSM()
State machine class for hyperbus.
Methods:
-
ca_words–Splits the 48bit CA into 6 bytes for transmission.
-
fsm–FSM for states IDLE, CAs, WR_LATENCY, WRITE, READ, DONE.
-
fsm_reset–Resets the fsm to IDLE state.
-
generate_random_data–Generate random num number of byte.
-
get_time–Get simulation time.
-
is_rwdsvalid–Samples the RWDS input signal every 5ns and stores it in rwds_d.
-
log–Logs a message value with prefixed simulation time.
-
rwds_valid–Returns True if RWDS is valid.
-
rx_data–Returns hex string of a 32 bit number.
-
swap_halves–Swaps the upper and lower 16 bits of a 32-bit value used for word alignment, endianess conversion into little endian.
-
update_ca–Builds the 48-bit command/address word using write strobe, config access, and memory address fields.
-
wdata_words–Splits the 32 bit write data into bytes, with special arrangement if CA[46]=1.
-
wstrb_words–Splits Write strobe into bits for each byte lane.
Source code in src/cocotbext/hyperbus/hbc_fsm.py
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 69 70 | |
ca_words
¶
Splits the 48bit CA into 6 bytes for transmission.
Source code in src/cocotbext/hyperbus/hbc_fsm.py
176 177 178 | |
fsm
async
¶
fsm(dut: SimHandleBase) -> None
FSM for states IDLE, CAs, WR_LATENCY, WRITE, READ, DONE.
Source code in src/cocotbext/hyperbus/hbc_fsm.py
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 110 111 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 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | |
fsm_reset
¶
fsm_reset() -> None
Resets the fsm to IDLE state.
Source code in src/cocotbext/hyperbus/hbc_fsm.py
72 73 74 75 76 77 78 | |
generate_random_data
¶
Generate random num number of byte.
Source code in src/cocotbext/hyperbus/hbc_fsm.py
235 236 237 238 239 240 241 242 | |
get_time
¶
get_time() -> int
Get simulation time.
Source code in src/cocotbext/hyperbus/hbc_fsm.py
197 198 199 | |
is_rwdsvalid
async
¶
is_rwdsvalid() -> None
Samples the RWDS input signal every 5ns and stores it in rwds_d.
Source code in src/cocotbext/hyperbus/hbc_fsm.py
191 192 193 194 195 | |
log
¶
log(msg: str) -> None
Logs a message value with prefixed simulation time.
Source code in src/cocotbext/hyperbus/hbc_fsm.py
201 202 203 | |
rwds_valid
¶
rwds_valid() -> int
Returns True if RWDS is valid.
Used for data sampling.
Source code in src/cocotbext/hyperbus/hbc_fsm.py
169 170 171 172 173 174 | |
rx_data
¶
Returns hex string of a 32 bit number.
Source code in src/cocotbext/hyperbus/hbc_fsm.py
205 206 207 208 209 210 | |
swap_halves
¶
Swaps the upper and lower 16 bits of a 32-bit value used for word alignment, endianess conversion into little endian.
Source code in src/cocotbext/hyperbus/hbc_fsm.py
227 228 229 230 231 232 233 | |
update_ca
¶
Builds the 48-bit command/address word using write strobe, config access, and memory address fields.
Source code in src/cocotbext/hyperbus/hbc_fsm.py
212 213 214 215 216 217 218 219 220 221 222 223 224 225 | |
wdata_words
¶
Splits the 32 bit write data into bytes, with special arrangement if CA[46]=1.
Source code in src/cocotbext/hyperbus/hbc_fsm.py
180 181 182 183 184 185 | |
wstrb_words
¶
Splits Write strobe into bits for each byte lane.
Source code in src/cocotbext/hyperbus/hbc_fsm.py
187 188 189 | |