Пример #1
0
import sys
import time
sys.path.append("../")
import config.manager as config_man
from bsp.tpm import *
from optparse import OptionParser

design = "tpm_test"
config = config_man.get_config_from_file("../config/config.txt",design,True)

XML_FILE = config['XML_FILE']
FPGA_IP  = config['FPGA_IP']

parser = OptionParser()
parser.add_option("-f", "--freq", 
                  dest="frequency", 
                  default = 700,
                  help="sampling frequency")
parser.add_option("-i", "--input", 
                  dest="input_list", 
                  default = "0,1",
                  help="input list")
parser.add_option("--ada", 
                  action="store_true",
                  dest="ada", 
                  default = False,
                  help="Enable ADA")
parser.add_option("-t", "--tag", 
                  dest="tag_string", 
                  default = "No TAG!",
                  help="TAG RAM value, 4096 bytes maximum size!")
Пример #2
0
                      default=False,
                      help="Download XML memory map from connected board")
    parser.add_option(
        "-m",
        "--sim_mode",
        dest="sim_mode",
        default="",
        help=
        "Simulation mode. 0 forces network mode, any other value forces simulation mode. I this parameter is not specified the mode is retrieved from configuration file."
    )

    (options, args) = parser.parse_args()

    config = config_man.get_config_from_file(
        config_file="../config/config.txt",
        design=options.design,
        display=False,
        check=True,
        sim=options.sim_mode)

    if options.search != "*":
        tree = ET.parse(config['XML_FILE'])
        root = tree.getroot()
        reg_list = []
        for node in root.iter('node'):
            id = node.get("absolute_id")
            if id != None:
                if id.find(options.search) != -1:
                    reg_list.append([
                        id, "0x" + node.get("absolute_offset"),
                        node.get("mask")
                    ])
Пример #3
0
import sys
sys.path.append("../")
import config.manager as config_man
from bsp.tpm import *
from mytest.c2c_test import *

config = config_man.get_config_from_file("../config/config.txt", "tpm_test",
                                         True)
inst = TPM(ip=config['FPGA_IP'],
           port=config['UDP_PORT'],
           board="kcu105",
           timeout=5)
inst.load_firmware_blocking(Device.FPGA_1, config['XML_FILE'])

c2c_test = c2cTest(inst)
c2c_test.start(1000)

inst.disconnect()
Пример #4
0
                  default = False,
                  help="Generate bitstream without generation Vivado project files")
parser.add_option("-m", "--modelsim", 
                  action="store_true",
                  dest="modelsim", 
                  default = False,
                  help="ModelSim compile")
parser.add_option("", "--module_depend", 
                  action="store_true",
                  dest="module_depend", 
                  default = False,
                  help="List module dependencies")

(options, args) = parser.parse_args()

config = config_man.get_config_from_file(config_file= "../config/config.txt",design=options.design,display=True)

#Repository ROOT
REPO_ROOT = config['REPO_ROOT']

#Path to Vivado Executable
VIVADO_EXE = config['VIVADO_EXE']

#Path to compiled ModelSim Library
MSIM_LIB_PATH = config['MSIM_LIB_PATH']

#Design
DESIGN = options.design

#board name
BOARD = options.board
Пример #5
0
from bsp.tpm import *
from optparse import OptionParser

if __name__ == "__main__":
    parser = OptionParser()
    parser.add_option("-i",
                      "--ip",
                      dest="ip",
                      default="10.0.10.2",
                      help="FPGA IP")

    (options, args) = parser.parse_args()

    config = config_man.get_config_from_file(
        config_file="../config/config.txt",
        design="tpm_test",
        display=False,
        check=True,
        sim="")
    tpm_inst = TPM(ip=options.ip,
                   port=config['UDP_PORT'],
                   timeout=config['UDP_TIMEOUT'])
    code = -1
    try:
        prova = tpm_inst[0]
        #print "ONLINE"
        code = 0
    except:
        #print "OFFLINE -2"
        code = -2

    exit(code)