Esempio n. 1
0
 def __init__(self, numcoarsechannels, numfinechannels, accumulation_length, bandwidth, input_bitwidth, fft_coarse_out_bitwidth, antennas=1):
     self.maxdesigns=0
     self.blocks = {}
     self.blockalgs = {}
     self.totalblocks = 0
     
     self.maxdesigns = 1
     self.singleimplementation = 1
     
     #add the platform array
     self.platforms = {}
     
     # add platforms: cost, inputbw, outputbw, resources
     self.platforms['ROACH'] = Platform('ROACH',6700,40,40,['registers','luts','dsp','bram'])
     self.platforms['GTX580'] = Platform('GTX580',3500,10,1,['time'])
     
     
     
     for i in range(0,antennas):
         # add the ADC
         adc_bw = bandwidth*input_bitwidth
         self.blocks['ADC'+`i`] = CBlock('ADC', CBlock.getADCModel(self.platforms, bandwidth, input_bitwidth),-1,0,0,'PFB'+`i`,0,adc_bw,1)
         self.totalblocks += 1
     
         # add the PFB
         pfb_bw = bandwidth*32
         self.blocks['PFB'+`i`] = CBlock('PFB',CBlock.getPFBWModel(self.platforms, bandwidth, pfb_bw, numcoarsechannels),'ADC'+`i`,0,adc_bw,'FFT_coarse'+`i`,0,adc_bw,1)
         self.totalblocks += 1
     
         # add the FFT
         #print CBlock.getFFTModel(self.platforms, bandwidth, input_bitwidth, numchannels)
         fft_coarse_out_bandwidth = bandwidth* fft_coarse_out_bitwidth*2
         self.blocks['FFT_coarse'+`i`] = CBlock('FFT_coarse',CBlock.getFFTWModel(self.platforms, bandwidth, numcoarsechannels),'PFB'+`i`,0,pfb_bw,'Transpose'+`i`,0,fft_coarse_out_bandwidth,1)
         self.totalblocks += 1
         
         # adjust to ensure the block fits on the gpu
         fft_fine_in_bandwidth = fft_coarse_out_bandwidth/numcoarsechannels
         finemodel = CBlock.getFFTModel(self.platforms, fft_fine_in_bandwidth, numfinechannels)
         if(finemodel['GTX580']['time']<0.1):
             multiplier = pow(2,int(log(0.1/finemodel['GTX580']['time'],2)))
         else:
             multiplier = 1
         finemodel['GTX580']['time'] = finemodel['GTX580']['time']*multiplier
         fine_blocks = int(numcoarsechannels/multiplier)
         
         fine_sky_bandwidth = bandwidth/fineblocks
         fine_block_bandwidth = fft_coarse_out_bandwidth/fine_blocks
         
         
         self.blocks['Transpose'+`i`] = CBlock('Transpose', CBlock.getTransposeModel(self.platforms, bandwidth, numcoarsechannels, numfinechannels), 'FFT_coarse'+`i`,0,fft_coarse_out_bandwidth,'FFT_fine'+`i`,1,fft_coarse_out_bandwidth,1)
         self.totalblocks += 1
     
         self.blocks['FFT_fine'+`i`] = CBlock('FFT_fine',finemodel,'Transpose'+`i`,0,fine_block_bandwidth,'VAcc'+`i`,0,fft_fine_in_bandwidth,fine_blocks)
         self.totalblocks += fine_blocks
     
         self.blocks['VAcc'+`i`] = CBlock('VAcc',{'ROACH': {'registers': 0.2, 'luts': 0.1, 'dsp': 0, 'bram':0.4}, 'GTX580': {'time': 0.001}},'FFT_fine'+`i`,0,fine_block_bandwidth,-1,0,0,fine_blocks)
         self.totalblocks += fine_blocks
Esempio n. 2
0
    def __init__(self,
                 numchannels,
                 accumulation_length,
                 bandwidth,
                 input_bitwidth,
                 fft_out_bitwidth,
                 antennas=1):
        self.maxdesigns = 1
        self.blocks = {}
        self.totalblocks = 0

        #add the platform array
        self.platforms = {}

        # add platforms: cost, inputbw, outputbw, resources
        self.platforms['ROACH'] = Platform.createRoach('dollars')
        self.platforms['GTX580'] = Platform.createGTX580Server('dollars')
        #self.platforms['IBOB'] = Platform('IBOB',2000,10,1,['resources'])

        # add the ADC
        adc_bw = bandwidth * input_bitwidth
        self.blocks['ADC'] = CBlock(
            'ADC', CBlock.getADCModel(self.platforms, bandwidth,
                                      input_bitwidth), -1, 0, 0, 'PFB', 0,
            adc_bw, antennas)
        self.totalblocks += antennas

        # add the PFB
        pfb_bw = bandwidth * 32
        self.blocks['PFB'] = CBlock(
            'PFB',
            CBlock.getPFBModel(self.platforms, bandwidth, input_bitwidth,
                               numchannels), 'ADC', 0, pfb_bw, 'FFT', 0,
            adc_bw, antennas)
        self.totalblocks += antennas

        # add the FFT
        fft_out_bandwidth = bandwidth * fft_out_bitwidth
        self.blocks['FFT'] = CBlock(
            'FFT', CBlock.getFFTModel(self.platforms, bandwidth, numchannels),
            'PFB', 0, pfb_bw, 'VAcc', 0, fft_out_bandwidth, antennas)
        self.totalblocks += antennas

        #add the Vacc
        self.blocks['VAcc'] = CBlock(
            'VAcc',
            CBlock.getVAccModel(self.platforms, bandwidth, fft_out_bitwidth,
                                accumulation_length), 'FFT', 0,
            fft_out_bandwidth, -1, 0, 0, antennas)
        self.totalblocks += antennas
Esempio n. 3
0
    def __init__(self,
                 numcoarsechannels,
                 numfinechannels,
                 accumulation_length,
                 bandwidth,
                 input_bitwidth,
                 fft_coarse_out_bitwidth,
                 antennas=1):
        self.maxdesigns = 0
        self.blocks = {}
        self.blockalgs = {}
        self.totalblocks = 0

        self.maxdesigns = 1
        self.singleimplementation = 1

        #add the platform array
        self.platforms = {}

        # add platforms: cost, inputbw, outputbw, resources
        self.platforms['ROACH'] = Platform(
            'ROACH', 6700, 40, 40, ['registers', 'luts', 'dsp', 'bram'])
        self.platforms['GTX580'] = Platform('GTX580', 3500, 10, 1, ['time'])

        for i in range(0, antennas):
            # add the ADC
            adc_bw = bandwidth * input_bitwidth
            self.blocks['ADC' + ` i `] = CBlock(
                'ADC',
                CBlock.getADCModel(self.platforms, bandwidth, input_bitwidth),
                -1, 0, 0, 'PFB' + ` i `, 0, adc_bw, 1)
            self.totalblocks += 1

            # add the PFB
            pfb_bw = bandwidth * 32
            self.blocks['PFB' + ` i `] = CBlock(
                'PFB',
                CBlock.getPFBWModel(self.platforms, bandwidth, pfb_bw,
                                    numcoarsechannels), 'ADC' + ` i `, 0,
                adc_bw, 'FFT_coarse' + ` i `, 0, adc_bw, 1)
            self.totalblocks += 1

            # add the FFT
            #print CBlock.getFFTModel(self.platforms, bandwidth, input_bitwidth, numchannels)
            fft_coarse_out_bandwidth = bandwidth * fft_coarse_out_bitwidth * 2
            self.blocks['FFT_coarse' + ` i `] = CBlock(
                'FFT_coarse',
                CBlock.getFFTWModel(self.platforms, bandwidth,
                                    numcoarsechannels), 'PFB' + ` i `, 0,
                pfb_bw, 'Transpose' + ` i `, 0, fft_coarse_out_bandwidth, 1)
            self.totalblocks += 1

            # adjust to ensure the block fits on the gpu
            fft_fine_in_bandwidth = fft_coarse_out_bandwidth / numcoarsechannels
            finemodel = CBlock.getFFTModel(self.platforms,
                                           fft_fine_in_bandwidth,
                                           numfinechannels)
            if (finemodel['GTX580']['time'] < 0.1):
                multiplier = pow(
                    2, int(log(0.1 / finemodel['GTX580']['time'], 2)))
            else:
                multiplier = 1
            finemodel['GTX580'][
                'time'] = finemodel['GTX580']['time'] * multiplier
            fine_blocks = int(numcoarsechannels / multiplier)

            fine_sky_bandwidth = bandwidth / fineblocks
            fine_block_bandwidth = fft_coarse_out_bandwidth / fine_blocks

            self.blocks['Transpose' + ` i `] = CBlock(
                'Transpose',
                CBlock.getTransposeModel(self.platforms, bandwidth,
                                         numcoarsechannels, numfinechannels),
                'FFT_coarse' + ` i `, 0, fft_coarse_out_bandwidth,
                'FFT_fine' + ` i `, 1, fft_coarse_out_bandwidth, 1)
            self.totalblocks += 1

            self.blocks['FFT_fine' + ` i `] = CBlock('FFT_fine', finemodel,
                                                     'Transpose' + ` i `, 0,
                                                     fine_block_bandwidth,
                                                     'VAcc' + ` i `, 0,
                                                     fft_fine_in_bandwidth,
                                                     fine_blocks)
            self.totalblocks += fine_blocks

            self.blocks['VAcc' + ` i `] = CBlock(
                'VAcc', {
                    'ROACH': {
                        'registers': 0.2,
                        'luts': 0.1,
                        'dsp': 0,
                        'bram': 0.4
                    },
                    'GTX580': {
                        'time': 0.001
                    }
                }, 'FFT_fine' + ` i `, 0, fine_block_bandwidth, -1, 0, 0,
                fine_blocks)
            self.totalblocks += fine_blocks