Simulation API¶
Configuration¶
fpga_verification.sim.config
¶
Configuration contract shared by Platform Designer and cocotb tests.
RUNTIME_CONFIG_ENV = 'FPGA_VERIFICATION_TEST_CONFIG_JSON'
module-attribute
¶
Environment variable containing the resolved test configuration JSON.
ComponentConfig
¶
Mixin for a resolved component configuration dataclass.
A configuration has two deliberately different representations: Platform Designer receives only HDL parameters, while cocotb receives the complete, already-resolved configuration. Runtime loading is strict so a stale test cannot silently run with defaults different from the generated DUT.
Source code in src/fpga_verification/sim/config.py
hdl_parameter(default=MISSING, *, name=None, **kwargs)
¶
Declare a dataclass field which is also a Platform Designer parameter.
name defaults to the dataclass field name. All fields remain present in
the runtime configuration; the metadata only controls to_parameters().
Source code in src/fpga_verification/sim/config.py
runtime_config_environment(config)
¶
Return the cocotb environment payload for an already-resolved config.
Source code in src/fpga_verification/sim/config.py
load_runtime_config(config_type, environ=None)
¶
Strictly restore config_type from runner-provided JSON.
Missing variables, malformed JSON and both missing and unknown fields are errors. Tests must never fall back to constructing a default config.
Source code in src/fpga_verification/sim/config.py
Agents¶
fpga_verification.sim.agents
¶
Reusable pyuvm agents.
VIPAgent
¶
Bases: uvm_agent
Source/sink pyuvm agent for Intel Avalon-ST Video packet streams.
Source code in src/fpga_verification/sim/agents/intel_video.py
377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 | |
VIPDriver
¶
Bases: uvm_driver
Drive VIP packet sequence items onto an Avalon-ST source.
Source code in src/fpga_verification/sim/agents/intel_video.py
VIPItem
¶
Bases: uvm_sequence_item
Sequence item containing one complete Intel VIP packet.
Source code in src/fpga_verification/sim/agents/intel_video.py
VIPMonitor
¶
Bases: uvm_monitor
Observe VIP packets, validate stream protocol, and publish packets.
Source code in src/fpga_verification/sim/agents/intel_video.py
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 | |
VIPSequence
¶
Bases: uvm_sequence
Sequence that sends one or more complete Intel VIP packets.
Source code in src/fpga_verification/sim/agents/intel_video.py
AvalonMMMonitor
¶
Bases: uvm_monitor
Passively observes accepted Avalon-MM read/write requests.
Source code in src/fpga_verification/sim/agents/avalon_mm.py
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 168 169 170 171 172 173 174 175 176 177 178 179 180 | |
AvalonMMAgent
¶
Bases: uvm_agent
Avalon-MM pyuvm agent with an always-on monitor and optional master.
Source code in src/fpga_verification/sim/agents/avalon_mm.py
FrameSource
¶
Bases: Protocol
A source with lifecycle and analysis publication compatible with VIP tests.
Source code in src/fpga_verification/sim/agents/frame_source.py
send_frame(frame)
async
¶
FrameTransaction
dataclass
¶
A frame published before its source drives physical conduit signals.
Source code in src/fpga_verification/sim/agents/frame_source.py
Scoreboards¶
fpga_verification.sim.scoreboards
¶
Reusable pyuvm scoreboards.
AnalysisImp
¶
Bases: uvm_analysis_export
pyuvm analysis export forwarding writes to a Python callable.
Source code in src/fpga_verification/sim/scoreboards/analysis.py
BaseVIPScoreboard
¶
Bases: uvm_scoreboard
Ordered protocol-level comparison engine for one VIP output stream.
Subclasses implement IP semantics through process_input_packet(),
process_control_transaction() and on_reset(). They create all
expectations explicitly with :meth:add_expectation; this base class only
enforces packet order and the selected protocol-level comparison mode.
Source code in src/fpga_verification/sim/scoreboards/intel_video.py
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 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 | |
add_expectation(expectation)
¶
Append exactly one output packet expectation in protocol order.
Source code in src/fpga_verification/sim/scoreboards/intel_video.py
process_input_packet(packet)
¶
process_control_transaction(transaction)
¶
on_reset()
¶
reset()
¶
Abort pending protocol work while preserving an already-found error.
Source code in src/fpga_verification/sim/scoreboards/intel_video.py
wait_frame_checked(timeout=1, timeout_unit='ms', *, after=None)
async
¶
Wait until one more expected VIDEO packet has been checked.
Source code in src/fpga_verification/sim/scoreboards/intel_video.py
drain(timeout, timeout_unit='ms', *, quiet_cycles=None)
async
¶
Wait for all expectations, then require a quiet output window.
An output packet during the quiet window is always a failure: by then
there is no matching expectation left. quiet_cycles=0 disables the
additional observation window.
Source code in src/fpga_verification/sim/scoreboards/intel_video.py
CheckMode
¶
PacketExpectation
dataclass
¶
One expected output packet and its explicit comparison contract.
Source code in src/fpga_verification/sim/scoreboards/intel_video.py
UserPacketPolicy
¶
Bases: str, Enum
Default input-user-packet policy for custom VIP scoreboards.
Source code in src/fpga_verification/sim/scoreboards/intel_video.py
VideoPacketPolicy
¶
VideoPacketResult
dataclass
¶
Standard behaviour-model result for one input video packet.
Source code in src/fpga_verification/sim/scoreboards/intel_video.py
Performance metrics¶
fpga_verification.sim.stream_metrics
¶
Reusable performance metrics for packetized streaming interfaces.
PacketObservation
dataclass
¶
One packet observed at the input and output of a DUT or pipeline.
Source code in src/fpga_verification/sim/stream_metrics.py
PacketMetrics
dataclass
¶
Latency and throughput metrics for one packet.
Source code in src/fpga_verification/sim/stream_metrics.py
PacketSequenceMetrics
dataclass
¶
Throughput and packet-boundary metrics for an ordered packet sequence.
Source code in src/fpga_verification/sim/stream_metrics.py
70 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 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 168 169 170 171 172 173 174 175 176 | |
sustainable_efficiency
property
¶
Conservative sustained throughput relative to one beat per cycle.
required_clock_multiplier
property
¶
Clock multiplier needed to match an ideal one-beat/cycle stream.
assert_input_packet_gap_at_most(maximum_cycles)
¶
Require every next input SoP to be accepted within the limit.
Source code in src/fpga_verification/sim/stream_metrics.py
assert_all_boundaries_overlap()
¶
Require the next packet to enter before the previous packet exits.
Source code in src/fpga_verification/sim/stream_metrics.py
StreamPerformanceAnalyzer
¶
Calculate cycle-based metrics from timestamped monitor frames.
Frames must expose sim_time_start and sim_time_end attributes, as
AvalonSTFrame does. The analyzer is otherwise independent of packet
contents and can therefore measure a single IP or a complete pipeline.
Source code in src/fpga_verification/sim/stream_metrics.py
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 | |
from_clock(clock)
async
classmethod
¶
Measure the simulation clock period without requiring its frequency.