2026-01-28 06:16:04 +00:00

65 lines
1.7 KiB
Python

"""
Constants needed for the general flow of the simulator.
"""
import pathlib
SUPPORTED_PLATFORMS = [520, 530, 540, 630, 720, 730]
FLATBUFFERS = [530, 540, 630, 730]
INI_PLATFORMS = [530, 540, 630, 720, 730]
PLATFORMS_MO3 = [520, 530, 540, 630, 720]
PLATFORMS_NG1 = [730]
BASE_DIR = pathlib.Path(__file__).parent.parent.resolve()
BIN_DIR = BASE_DIR / "bin"
DATA_CONVERTER = str(BIN_DIR / "data_converter720")
TEMPLATE_INI = str(BASE_DIR / "template.ini")
# Default binaries to use
CSIM520 = str(BIN_DIR / "current/npu_csim_520")
CSIM530 = str(BIN_DIR / "current/npu_csim_530")
CSIM540 = str(BIN_DIR / "current/npu_csim_540")
CSIM630 = str(BIN_DIR / "current/npu_csim_630")
CSIM720 = str(BIN_DIR / "current/npu_csim_720")
CSIM720_1 = str(BIN_DIR / "current/npu_csim_flatbuffers")
CSIM730 = str(BIN_DIR / "current/npu_csim_730")
APB530 = str(BIN_DIR / "current/apb_530.npu")
APB540 = str(BIN_DIR / "current/apb_540.npu")
APB630 = str(BIN_DIR / "current/apb_630.npu")
APB720 = str(BIN_DIR / "current/apb_720.npu")
APB720_1 = str(BIN_DIR / "current/apb_720_flatbuffers.npu")
APB730 = str(BIN_DIR / "current/apb_730.npu")
# Following to parse setup for each platform
NODE_MAP720 = { # old 720 setup format
0: 1, # input
1: 14, # cpu
2: 11, # output
3: 10, # data
4: 7, # super
}
FORMAT_MAP530 = {
0: "1W16C8B",
1: "1W16C8BHL",
2: "4W4C8B",
3: "4W4C8BHL",
4: "16W1C8B",
5: "16W1C8BHL",
6: "8W1C16B",
7: "PS_1W16C24B"
}
FORMAT_MAP720 = {
0: "1W16C8B",
1: "1W16C8B_INTLV",
2: "1W16C8BHL",
3: "1W16C8BHL_INTLV",
4: "4W4C8B",
5: "16W1C8B",
6: "8W1C16B",
100: "RAW8B",
101: "RAW16B",
102: "RAW_FLOAT"
}