vta.environment#

Configurable VTA Hareware Environment scope.

Module Contents#

Classes#

DevContext

Internal development context

Environment

Hardware configuration object.

Functions#

_init_env()

Initialize the default global env

get_env()

Get the current VTA Environment.

get_vta_hw_path()

Get the VTA HW path.

pkg_config(cfg)

Returns PkgConfig pkg config object.

class vta.environment.DevContext(env)[源代码]#

Bases: object

Internal development context

This contains all the non-user facing compiler internal context that is hold by the Environment.

Parameters#

envEnvironment

The environment hosting the DevContext

Note#

This class is introduced so we have a clear separation of developer related, and user facing attributes.

ALU_OPCODE_ADD = 2[源代码]#
ALU_OPCODE_MAX = 1[源代码]#
ALU_OPCODE_MIN = 0[源代码]#
ALU_OPCODE_MUL = 4[源代码]#
ALU_OPCODE_SHR = 3[源代码]#
MEM_ID_ACC = 3[源代码]#
MEM_ID_ACC_8BIT = 5[源代码]#
MEM_ID_INP = 2[源代码]#
MEM_ID_OUT = 4[源代码]#
MEM_ID_UOP = 0[源代码]#
MEM_ID_WGT = 1[源代码]#
QID_COMPUTE = 2[源代码]#
QID_LOAD_INP = 1[源代码]#
QID_LOAD_OUT = 2[源代码]#
QID_LOAD_WGT = 1[源代码]#
QID_STORE_OUT = 3[源代码]#
get_task_qid(qid)[源代码]#

Get transformed queue index.

class vta.environment.Environment(cfg)[源代码]#

Bases: object

Hardware configuration object.

This object contains all the information needed for compiling to a specific VTA backend.

Parameters#

cfgdict of str to value.

The configuration parameters.

Example#

# the following code reconfigures the environment
# temporarily to attributes specified in new_cfg.json
new_cfg = json.load(json.load(open("new_cfg.json")))
with vta.Environment(new_cfg):
    # env works on the new environment
    env = vta.get_env()
property alu[源代码]#

ALU pragma

property cfg_dict[源代码]#
property dev[源代码]#

Developer context

property dma_copy[源代码]#

DMA copy pragma

property gemm[源代码]#

GEMM intrinsic

property mock[源代码]#

A mock version of the Environment

The ALU, dma_copy and intrinsics will be mocked to be nop.

property target[源代码]#
property target_host[源代码]#

The target host

property target_vta_cpu[源代码]#
DEBUG_DUMP_INSN[源代码]#
DEBUG_DUMP_UOP[源代码]#
DEBUG_SKIP_READ_BARRIER[源代码]#
DEBUG_SKIP_WRITE_BARRIER[源代码]#
MAX_XFER[源代码]#
acc_scope = 'local.acc_buffer'[源代码]#
current[源代码]#
inp_scope = 'local.inp_buffer'[源代码]#
wgt_scope = 'local.wgt_buffer'[源代码]#
__enter__()[源代码]#
__exit__(ptype, value, trace)[源代码]#
vta.environment._init_env()[源代码]#

Initialize the default global env

vta.environment.get_env()[源代码]#

Get the current VTA Environment.

Returns#

envEnvironment

The current environment.

vta.environment.get_vta_hw_path()[源代码]#

Get the VTA HW path.

vta.environment.pkg_config(cfg)[源代码]#

Returns PkgConfig pkg config object.