Exemplo n.º 1
0
def setGlbl_vars(mhs):
    global sys_clk
    global sys_reset
    global main_plb
    global lib_name
    global lib_dir_name

    lib_dir_name = "kapi_cpuhwt_v1_00_a"
    lib_name = "kapi_cpuhwt"
    instances = mhs.getPcores("plb_v34")
    xps_instances = mhs.getPcores("plb_v46")

    if len(xps_instances) > 0:
        #instances.append(xps_instances)
        if len(instances) == 0:
            instances = xps_instances
        else:
            instances.append(xps_instances)

    if len(instances) <= 0:
        sys.stderr.write("ERROR, no PLB bus in system!\n")
        sys.exit(1)

    found = 0
    for pcore in instances:
        if pcore.instance_name == "plb":
            sys.stderr.write("pcore: %s" % pcore.instance_name)
            found = 1
            main_plb = "plb"
            sys_clk = pcore.getValue("PLB_Clk")
            sys_reset = pcore.getValue("SYS_Rst")

    #if no plb with instance_name "plb" found just take the first plb instance as main_plb
    if found == 0:
        sys.stderr.write("ERROR found == 0!\n")
        main_plb = instances[0].instance_name
        sys_clk = instances[0].getValue("PLB_Clk")
        sys_reset = instances[0].getValue("SYS_Rst")
Exemplo n.º 2
0
def setGlbl_vars(mhs):
    global sys_clk
    global sys_reset
    global main_plb
    global lib_name
    global lib_dir_name
    
    lib_dir_name = "kapi_cpuhwt_v1_00_a"
    lib_name = "kapi_cpuhwt"
    instances = mhs.getPcores("plb_v34")
    xps_instances = mhs.getPcores("plb_v46")
    
    if len(xps_instances) > 0:
        #instances.append(xps_instances)
        if len(instances) == 0:
            instances = xps_instances
        else:
            instances.append(xps_instances)
    
    if len(instances) <= 0:
        sys.stderr.write("ERROR, no PLB bus in system!\n")
        sys.exit(1)
           
    found = 0
    for pcore in instances:
        if pcore.instance_name == "plb":
            sys.stderr.write("pcore: %s" % pcore.instance_name) 
            found = 1
            main_plb = "plb"
            sys_clk = pcore.getValue("PLB_Clk")
            sys_reset = pcore.getValue("SYS_Rst")
    
    #if no plb with instance_name "plb" found just take the first plb instance as main_plb
    if found == 0:
        sys.stderr.write("ERROR found == 0!\n")
        main_plb = instances[0].instance_name
        sys_clk = instances[0].getValue("PLB_Clk")
        sys_reset = instances[0].getValue("SYS_Rst")  
Exemplo n.º 3
0
        elif (platform == "virtex4"):
            ppc_instances = mhs.getPcores("ppc405_virtex4")

        if (len(ppc_instances)) <= 1:
            #the toolchain requires that the reference design has already instantiated the processors
            sys.stderr.write("Only one PowerPC in system!\n")
            sys.exit(1)
        else:
            found = 0
            ppc_core = None
            #search for ppc instance which is not used
            for pcore in ppc_instances:
                #ppc405_0 is the ecos cpu
                if pcore.instance_name != "ppc405_0":
                    #make a simple check if ppc is already used (if the IPLB is connected the PPC could be in use)
                    if pcore.getValue("IPLB") == None:
                        #delete hw_task which was initialy instantiated
                        hw_task_name = "hw_task_" + str(
                            task_number - 1)  #the instance_name begin with 0
                        mhs.delPcore(hw_task_name)
                        ppc_core = pcore
                        found = 1
                        break

            if found == 0:
                sys.stderr.write("ERROR: All PPCs are in use!!!\n")
                sys.exit(1)

            #now check, if the bram_logic is already instantiated and get the port
            #sys.stderr.write(mhs.__str__())
Exemplo n.º 4
0
        elif (platform =="virtex4"):
            ppc_instances = mhs.getPcores("ppc405_virtex4")
        
        if (len(ppc_instances)) <= 1:
            #the toolchain requires that the reference design has already instantiated the processors
            sys.stderr.write("Only one PowerPC in system!\n")
            sys.exit(1)
        else:
            found = 0
            ppc_core = None
            #search for ppc instance which is not used
            for pcore in ppc_instances:
                #ppc405_0 is the ecos cpu
                if pcore.instance_name != "ppc405_0":
                    #make a simple check if ppc is already used (if the IPLB is connected the PPC could be in use)
                    if pcore.getValue("IPLB") == None:
                        #delete hw_task which was initialy instantiated
                        hw_task_name = "hw_task_" + str(task_number - 1) #the instance_name begin with 0
                        mhs.delPcore(hw_task_name)
                        ppc_core = pcore        
                        found = 1
                        break;
            
            if found == 0:
                sys.stderr.write("ERROR: All PPCs are in use!!!\n")
                sys.exit(1)
            
            #now check, if the bram_logic is already instantiated and get the port
            #sys.stderr.write(mhs.__str__())

            bram_logic_port = getBramLogicPort(mhs)