Test Engine FPGA IP User Guide: Agilex™ 3, Agilex™ 5, and Agilex™ 7 FPGAs

ID 817758
Date 3/31/2025
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

5.3.1.7. gencmd

Usage

def traffic_patterns.MemAxi4DriverPrograms.gencmd (self, str cmd, int iters=1, Union[int, List[int], str, List[str]] addr="seq", Union[None, Tuple[int, int]] addr_range=None, Union[None, int, List[int], str, List[str]] data="addr", Union[int, List[int], str, List[str]] strb=-1, Union[int, List[int]] bl=1, Union[float, List[float]] size=1.0, Union[int, List[int]] burst=axburst_incr, Union[int, List[int]] lock=0, Union[int, List[int]] cache=0, Union[int, List[int]] prot=0, Union[int, List[int]] qos=0, Union[int, List[int]] region=0, Union[int, List[int]] auser=0, Union[int, List[int]] resp=xresp_okay, Union[int, List[int]] id=0, Union[float, Tuple[int, int]] addr_bw=1.0, Union[float, Tuple[int, int]] data_bw=1.0, Union[float, Tuple[int, int]] resp_bw=1.0, Union[bool, List[bool]] resume=False, bool inspect=True)

Description

Helper function to construct a write or read instruction for the Memory AXI Driver.

By default, the write/read instruction generates a single AXI transaction that accesses sequential addresses with data matching the address. You can customize this default behavior by overriding the appropriate input arguments to this function.

Parameters

cmd
Supported values are:
  • "wr": Generate AXI write transactions

  • "rd": Generate AXI read transactions

iters

Number of AXI write/read transactions to generate.

addr
The data-type of the value determines how the value is parsed:
  • Integer: AxADDR value

  • String: Preset for AxADDR pattern. Supported values are:
    • "seq[_strideX][_echoX]": Sequential access. Optional modifiers:
      • _strideX: X must be an integer, and will be multiplied to address increment. Ex: _stride2 multiplies increment by 2.

      • _echoX: X must be an integer, indicating number of times to repeat each address. Ex: _echo1 repeats each address once, i.e. addr_0, addr_0, addr_1, addr_1, addr_2, addr_2, ...

    • "rand[_echoX]": Random access. Optional modifiers:
      • _echoX: X must be an integer, indicating number of times to repeat each address. Ex: _echo1 repeats each address once, i.e. addr_0, addr_0, addr_1, addr_1, addr_2, addr_2, ...

addr_range

Address range formatted as a tuple (lo_addr, hi_addr), where lo_addr <= AxADDR <= hi_addr. Ex: (0x0000, 0x0FFF). By default the address range matches the full address space derived based on address port width. addr_range is only applicable if addr preset is used.

data
The data-type of the value determines how the value is parsed:
  • None: Skip error checking for RDATA (only applicable for 'read' command)

  • Integer: WDATA value for 'write' transaction, expected RDATA value for 'read' transaction

  • String: Preset for xDATA pattern. Supported values are:
    • "addr": xDATA matches the address of the corresponding command

    • "id": xDATA matches the AxID of the corresponding command

    • "clock": Every DQ pin toggles between 1 and 0 on every clock cycle

    • "pulse0": Every DQ pin outputs a long train of 1s with a single intermittent 0

    • "pulse1": Every DQ pin outputs a long train of 0s with a single intermittent 1

    • "walking0": Each DQ pin within a byte lane takes turns outputting a single 0. Useful for finding crosstalk issues and normally used for simultaneous switching noise (SSN) testing. The data bit (DQ pin) that has a different value from the rest will be more likely to be affected by the rest of the data bits, especially the adjacent bits.

    • "walking1": Each DQ pin within a byte lane takes turns outputting a single 1. Useful for finding crosstalk issues and normally used for simultaneous switching noise (SSN) testing. The data bit (DQ pin) that has a different value from the rest will be more likely to be affected by the rest of the data bits, especially the adjacent bits.

    • "prbs7[_echoX]": Every DQ pin outputs a PRBS7 pattern initialized with a unique seed. Optional modifiers:
      • _echoX: X must be an integer, indicating number of times to repeat each data value. Ex: _echo1 repeats each data once, i.e. data_0, data_0, data_1, data_1, data_2, data_2, ...

    • "prbs15[_echoX]": Every DQ pin outputs a PRBS15 pattern initialized with a unique seed. Optional modifiers:
      • _echoX: X must be an integer, indicating number of times to repeat each data value. Ex: _echo1 repeats each data once, i.e. data_0, data_0, data_1, data_1, data_2, data_2, ...

    • "prbs23[_echoX]": Every DQ pin outputs a PRBS23 pattern initialized with a unique seed. Optional modifiers:
      • _echoX: X must be an integer, indicating number of times to repeat each data value. Ex: _echo1 repeats each data once, i.e. data_0, data_0, data_1, data_1, data_2, data_2, ...

    • "prbs31[_echoX]": Every DQ pin outputs a PRBS31 pattern initialized with a unique seed. Optional modifiers:
      • _echoX: X must be an integer, indicating number of times to repeat each data value. Ex: _echo1 repeats each data once, i.e. data_0, data_0, data_1, data_1, data_2, data_2, ...

strb
The data-type of the value determines how the value is parsed:
  • Integer: WSTRB value for 'write' transaction, bytemask for error checking RDATA for 'read' transaction

  • String: Preset for xSTRB pattern. Supported values are:
    • "prbs7": Every DM pin outputs a PRBS7 pattern initialized with a unique seed.

    • "prbs15": Every DM pin outputs a PRBS15 pattern initialized with a unique seed.

    • "prbs23": Every DM pin outputs a PRBS23 pattern initialized with a unique seed.

    • "prbs31": Every DM pin outputs a PRBS31 pattern initialized with a unique seed.

    • "byteen_test": Continually generate a random xSTRB (held constant within a burst) followed by its inverse (held constant within a burst). This option can be used for byte-enable testing.

bl

Burst length value. AxLEN is derived based on this parameter (AxLEN = bl - 1)

size

Fraction of data width to transfer. Ex: 1, 0.5, 0.25, 0.125, ... AxSIZE is derived based on this parameter.

burst

AxBURST value

lock

AxLOCK value

cache

AxCACHE value

prot

AxPROT value

qos

AxQOS value

region

AxREGION value

auser

AxUSER value

resp
The data-type of the value determines how the value is parsed:
  • None: Skip error checking for xRESP

  • Integer: Expected xRESP value. If expected value is an error response RDATA checking will be disabled.

id
The data-type of the value determines how the value is parsed:
  • Integer: AxID value

  • List: Number of unique AxIDs in this list determines number of workers. And the list itself represents the AxID sequence. NOTE: Each AxID is represented by a unique "worker", which can generate a distinct traffic pattern for that specific AxID. The address range is evenly split among all workers. Ex: addr_range 0x00000000-0x3fffffff split among 4 workers is 0x00000000-0x0fffffff, 0x10000000-0x1fffffff, 0x20000000-0x2fffffff, 0x30000000-0x3fffffff You can customize the traffic stream for each worker by providing a list of values (for supported parameters listed below). Ex: bl=4 will use burst length 4 for all workers, bl=[2, 4] will use burst lengths 2 and 4 for the first and second workers respectively. The following parameters can be customized per worker by providing a list: addr, data, strb, bl, size, burst, lock, cache, prot, qos, region, auser, resp, resume

addr_bw
AW/AR channel bandwidth specified using duty-cycle. The data-type of the value determines how the value is parsed:
  • Float: Duty-cycle specified as percentage. Ex: 0.5 for 50% duty-cycle. Minimum supported value is 0.125.

  • Tuple: Duty-cycle specified as (pulse width, period). Ex: (1, 2) or (4, 8). Minimum supported value is (1, 8).

data_bw
W channel bandwidth specified using duty-cycle. The data-type of the value determines how the value is parsed:
  • Float: Duty-cycle specified as percentage. Ex: 0.5 for 50% duty-cycle. Minimum supported value is 0.125.

  • Tuple: Duty-cycle specified as (pulse width, period). Ex: (1, 2) or (4, 8). Minimum supported value is (1, 8).

resp_bw
B/R channel bandwidth specified using duty-cycle. The data-type of the value determines how the value is parsed:
  • Float: Duty-cycle specified as percentage. Ex: 0.5 for 50% duty-cycle. Minimum supported value is 0.02.

  • Tuple: Duty-cycle specified as (pulse width, period). Ex: (1, 2) or (4, 8). Minimum supported value is (1, 64).

resume

Continue the addr, data, and strbl pattern preset from previous command. If resume=True, addr, data, and strb values must match the previous command.

inspect

Scan the traffic pattern for potential issues and throw errors. Set inspect=False to print warnings instead.

Returns

List of write or read instruction(s) for the Memory AXI Driver's kernel. NOTE: you can use Python's splat operator (*) to unpack the list for insertion into a larger list. Ex: my_prog = [*gencmd(...), *gencmd(...), ...]