Ejemplo n.º 1
0
    def __init__(self, debug_mode=1, dry_mode=True):  #, saveFileName=None):
        global BUFFER_ADDRESS, BUFFER_LEN
        self.DEBUG_MODE = debug_mode
        self.DRY_MODE = dry_mode
        self.x393_mem = x393_mem.X393Mem(debug_mode, dry_mode)
        self.x393_axi_tasks = x393_axi_control_status.X393AxiControlStatus(
            debug_mode, dry_mode)
        self.x393_pio_sequences = x393_pio_sequences.X393PIOSequences(
            debug_mode, dry_mode)
        self.x393_mcntrl_timing = x393_mcntrl_timing.X393McntrlTiming(
            debug_mode, dry_mode)
        self.x393_mcntrl_buffers = x393_mcntrl_buffers.X393McntrlBuffers(
            debug_mode, dry_mode)

        #        self.x393_utils=          x393_utils.X393Utils(debug_mode,dry_mode, saveFileName) # should not overwrite save file path
        try:
            self.verbose = vrlg.VERBOSE
        except:
            pass
        if dry_mode:
            BUFFER_ADDRESS = 0x27900000
            BUFFER_LEN = 0x6400000
            print("Running in simulated mode, using hard-coded addresses:")
        else:
            try:
                with open(MEM_PATH + BUFFER_ADDRESS_NAME) as sysfile:
                    BUFFER_ADDRESS = int(sysfile.read(), 0)
                with open(MEM_PATH + BUFFER_PAGES_NAME) as sysfile:
                    BUFFER_LEN = PAGE_SIZE * int(sysfile.read(), 0)
            except:
                print("Failed to get reserved physical memory range")
                print('BUFFER_ADDRESS=', BUFFER_ADDRESS)
                print('BUFFER_LEN=', BUFFER_LEN)
                return
        print('BUFFER_ADDRESS=0x%x' % (BUFFER_ADDRESS))
        print('BUFFER_LEN=0x%x' % (BUFFER_LEN))
Ejemplo n.º 2
0
            print("`" + macro + ": " + defines[macro])
        print("======= Parameters =======")
        for par in parameters:
            try:
                print(par + " = " + hex(parameters[par][0]) + " (type = " +
                      parameters[par][1] + " raw = " + parameters[par][2] +
                      ")")
            except:
                print(par + " = " + str(parameters[par][0]) + " (type = " +
                      parameters[par][1] + " raw = " + parameters[par][2] +
                      ")")
        print("vrlg.VERBOSE=" + str(vrlg.VERBOSE))
        print("vrlg.VERBOSE__TYPE=" + str(vrlg.VERBOSE__TYPE))
        print("vrlg.VERBOSE__RAW=" + str(vrlg.VERBOSE__RAW))

    x393mem = x393_mem.X393Mem(verbose, args.simulated)  #add dry run parameter
    x393utils = x393_utils.X393Utils(verbose, args.simulated, args.localparams)
    x393tasks = x393_axi_control_status.X393AxiControlStatus(
        verbose, args.simulated)
    x393Pio = x393_pio_sequences.X393PIOSequences(verbose, args.simulated)
    x393Timing = x393_mcntrl_timing.X393McntrlTiming(verbose, args.simulated)
    x393Buffers = x393_mcntrl_buffers.X393McntrlBuffers(
        verbose, args.simulated)
    x393Tests = x393_mcntrl_tests.X393McntrlTests(verbose, args.simulated)
    x393Eyepatterns = x393_mcntrl_eyepatterns.X393McntrlEyepattern(
        verbose, args.simulated)
    x393Adjust = x393_mcntrl_adjust.X393McntrlAdjust(verbose, args.simulated,
                                                     args.localparams)
    X393Membridge = x393_mcntrl_membridge.X393McntrlMembridge(
        verbose, args.simulated)
    x393SensCmprs = x393_sens_cmprs.X393SensCmprs(verbose, args.simulated,
Ejemplo n.º 3
0
                    "SSD was not detected: waiting for another " +
                    str(DRIVER_WAIT_TIME) + " seconds", 'YELLOW', True))
            sleep(DRIVER_WAIT_TIME)
            result = check_device()
    else:
        result = True

    return result


def unmount_unload_disconnect():
    unload_ahci_elphel_driver()
    sata.vsc3304.disconnect_all()


mem = x393_mem.X393Mem(0, 0, 1)
sata = x393sata.x393sata()  # 1,0,"10389B")

if len(sys.argv) > 1:
    cmd = sys.argv[1]
else:
    cmd = "donothing"

if cmd == "set_zynq_ssd":
    unmount_unload_disconnect()
    sata.set_zynq_ssd()
    reset_device()
elif cmd == "set_zynq_esata":
    unmount_unload_disconnect()
    sata.set_zynq_esata()
    reset_device()
Ejemplo n.º 4
0
            for i in range(start_offset, end_offset, 4):
                bf.write(mm[i:i + 4])


debug_mode = 0
dry_mode = 0
filename = "/tmp/x393mem.log"

MAX_SIZE = 20000000
TIMEOUT = 10

BUF_SIZE = 4096
BUF_START = 0x80001000
BUF_END = 0x80002000

mem = x393_mem.X393Mem(debug_mode, dry_mode, 1)

run = True
wp_old = BUF_START
time_old = time.time()

if os.path.isfile(filename):
    os.remove(filename)

#
#f = open(filename,"w+b")
#mem_write_to_file(mem, f, 0x80001000, 64)
#f.close()

#mem.mem_save(self, filename, start_addr, length)