Beispiel #1
0
def enable_detail_mapping(mask):
    ''' mask is 2**interface+2**interface '''

    mapper_wrap.programDetailMapping(mask)
    print 'enabled detailed mapping with mask (2**interface0)+(2**interface1).. ', str(
        mask)
    return
Beispiel #2
0
def init_mappings(offsetchip0,offset_usb,offsetadcs, offsetadcs1, offsetadcs2):

    offset_first_chip = offsetchip0

    for i in range(8):
        mapper_wrap.programAddressRange(int(i),(2**32)-1)
        mapper_wrap.programOffset(i,0)
        #mapper_wrap.programBulkSpec(i,2**1)

    #registers
    mapper_wrap.programDetailMapping(0) # remove detailed mapping

    #memory
    print 'clear all mapper memory'
    mapper_wrap.programMemoryRange(0,(2**15)-1,0,0)

    time.sleep(0.5)	

    ## bulk mapping 
    mapper_wrap.programBulkSpec(1,2**0) #usb to chip0 
    mapper_wrap.programBulkSpec(0,2**1) #chip0 to usb
	#mapper_wrap.programBulkSpec(3,2**1) #adcs to usb
    mapper_wrap.programBulkSpec(3,2**1) #adcs to usb
    mapper_wrap.programBulkSpec(4,2**1) #adcs to usb
    mapper_wrap.programBulkSpec(5,2**1) #adcs to usb

    #usb offset and negative shifted input from usb
    mapper_wrap.programOffset(0,offset_first_chip)
    mapper_wrap.programMemory(offset_first_chip+0,0,0)

    #cio che entra dall'usb (con il bit 29 a uno) deve essere sottratto 2**31	
    mapper_wrap.programOffset(1,offset_usb)
    mapper_wrap.programMemory(offset_usb+0,0,0)

    mapper_wrap.programOffset(4,offsetadcs)
    mapper_wrap.programMemory(offsetadcs+1,305,1)

    mapper_wrap.programOffset(3,offsetadcs1)
    mapper_wrap.programMemory(offsetadcs1+1,300,1)

    mapper_wrap.programOffset(5,offsetadcs2)
    mapper_wrap.programMemory(offsetadcs2+1,310,1)

    #usb to 0 and 3 address range
    mapper_wrap.programAddressRange(0,(2**32)-1)
    mapper_wrap.programAddressRange(1,(2**32)-1)
    mapper_wrap.programAddressRange(3,(2**32)-1)
    mapper_wrap.programAddressRange(4,(2**32)-1)
    mapper_wrap.programAddressRange(5,(2**32)-1)
Beispiel #3
0
def init_mappings(offsetchip0,offset_usb,offsetadcs):

    offset_first_chip = offsetchip0

    for i in range(8):
        mapper_wrap.programAddressRange(int(i),(2**32)-1)
        mapper_wrap.programOffset(i,0)
        mapper_wrap.programBulkSpec(i,0)
        #mapper_wrap.programBulkSpec(i,2**1)

    #registers
    mapper_wrap.programDetailMapping(0) # remove detailed mapping

    #memory
    print 'clear all mapper memory'
    mapper_wrap.programMemoryRange(0,(2**15)-1,0,0)

    time.sleep(0.5)	

    ## bulk mapping 
    mapper_wrap.programBulkSpec(1,2**0) #usb to chip0 
    mapper_wrap.programBulkSpec(0,2**1) #chip0 to usb
    #mapper_wrap.programBulkSpec(2,2**1) #adcs to usb

    #usb offset and negative shifted input from usb
    mapper_wrap.programOffset(0,offset_first_chip)
    mapper_wrap.programMemory(offset_first_chip+0,0,0)

    #cio che entra dall'usb (con il bit 29 a uno) deve essere sottratto 2**31	
    mapper_wrap.programOffset(1,offset_usb)
    mapper_wrap.programMemory(offset_usb+0,0,0)
    #mapper_wrap.programMemory(offset_usb+0,-(2**29),0)

    #mapper_wrap.programOffset(2,offsetadcs)
    #mapper_wrap.programMemory(offsetadcs+1,offsetadcs+500,1)
    #mapper_wrap.programMemory(offsetadcs+500,500,1)

    #usb to 0 and 3 address range
    mapper_wrap.programAddressRange(0,(2**32)-1)
    mapper_wrap.programAddressRange(1,(2**32)-1)
Beispiel #4
0
def init_mappings(offsetchip0, offset_usb):

    offset_first_chip = offsetchip0

    for i in range(8):
        mapper_wrap.programAddressRange(int(i), (2**32) - 1)
        mapper_wrap.programOffset(i, 0)
        #mapper_wrap.programBulkSpec(i,2**1)

    #registers
    mapper_wrap.programDetailMapping(0)  # remove detailed mapping

    #memory
    print 'clear all mapper memory'
    mapper_wrap.programMemoryRange(0, (2**15) - 1, 0, 0)

    time.sleep(0.5)

    ## bulk mapping
    mapper_wrap.programBulkSpec(1, 2**0)  #usb to chip0 and chip1
    mapper_wrap.programBulkSpec(0, 2**1)  #chip0 to usb

    #mapper_wrap.programOffset(0,offset_first_chip)
    #mapper_wrap.programMemory(offset_first_chip+1,0,0)

    #cio che entra dall'usb (con il bit 32 a uno) deve essere sottratto 2**31
    mapper_wrap.programOffset(1, offset_usb)
    mapper_wrap.programMemory(offset_usb + 0, -(2**22), 0)

    #usb offset and negative shifted input from usb
    mapper_wrap.programOffset(0, offset_first_chip)
    #mapper_wrap.programMemory(offset_first_chip+0,2**22,0)
    #mapper_wrap.programMemory(offset_first_chip+1,256,1) # shift of 64 for usb check first bulk memory is for shifting

    #usb to 0 and 3 address range
    mapper_wrap.programAddressRange(0, (2**32) - 1)
    mapper_wrap.programAddressRange(1, (2**32) - 1)
Beispiel #5
0
def enable_detail_mapping(mask):
    ''' mask is 2**interface+2**interface '''

    mapper_wrap.programDetailMapping(mask) 
    print 'enabled detailed mapping with mask (2**interface0)+(2**interface1).. ', str(mask)
    return
Beispiel #6
0
import numpy as np

def init_mappings(offsetchip0,offset_usb,offsetadcs):
	'''
		initialize memory of the FPGA based mapper 
	'''

    offset_first_chip = offsetchip0

    for i in range(8):
        mapper_wrap.programAddressRange(int(i),(2**32)-1)
        mapper_wrap.programOffset(i,0)
        mapper_wrap.programBulkSpec(i,0)

    #registers
    mapper_wrap.programDetailMapping(0) # remove detailed mapping

    #memory
    print 'clear all mapper memory'
    mapper_wrap.programMemoryRange(0,(2**15)-1,0,0)

    time.sleep(0.5)	

    ## bulk mapping 
    mapper_wrap.programBulkSpec(1,2**0) #usb to chip0 
    mapper_wrap.programBulkSpec(0,2**1) #chip0 to usb

    #usb offset and negative shifted input from usb
    mapper_wrap.programOffset(0,offset_first_chip)
    mapper_wrap.programMemory(offset_first_chip+0,0,0)
    mapper_wrap.programOffset(1,offset_usb)