Пример #1
0
 def __init__(self, host, index, katcp_port=7147, boffile=None,
              connect=True, config=None):
     FpgaHost.__init__(self, host, katcp_port=katcp_port,
                       boffile=boffile, connect=connect)
     self.config = config
     self.index = index
     if self.config is not None:
         self.vacc_len = int(self.config['xeng_accumulation_len'])
         self.x_per_fpga = int(self.config['x_per_fpga'])
     else:
         self.x_per_fpga = -1
Пример #2
0
    def __init__(self, host, katcp_port=7147, boffile=None,
                 connect=True, config=None):
        FpgaHost.__init__(self, host, katcp_port=katcp_port,
                          boffile=boffile, connect=connect)
        self.config = config
        if self.config is not None:
            self.vacc_len = int(self.config['xeng_accumulation_len'])
            self.x_per_fpga = int(self.config['x_per_fpga'])

        # TODO - and if there is no config and this was made on a running device?
        # something like set it to -1, if it's accessed when -1 then try and discover it
        self.x_per_fpga = 4
Пример #3
0
 def __init__(self, host, katcp_port=7147, boffile=None, connect=True, config=None):
     FpgaHost.__init__(self, host, katcp_port=katcp_port, boffile=boffile, connect=connect)
     self._config = config
     self.data_sources = []  # a list of DataSources received by this f-engine host
     self.eqs = {}  # a dictionary, indexed on source name, containing tuples of poly and bram name
     if config is not None:
         self.num_fengines = int(config['f_per_fpga'])
         self.ports_per_fengine = int(config['ports_per_fengine'])
         self.fft_shift = int(config['fft_shift'])
         self.n_chans = int(config['n_chans'])
     else:
         self.num_fengines = None
         self.ports_per_fengine = None
         self.fft_shift = None
         self.n_chans = None
Пример #4
0
    def __init__(self, host, index, katcp_port=7147, bitstream=None,
                 connect=True, config=None, **kwargs):
        FpgaHost.__init__(self, host=host, katcp_port=katcp_port,
                          bitstream=bitstream, connect=connect, transport=SkarabTransport)
        try:
            descriptor = kwargs['descriptor']
        except KeyError:
            descriptor = 'InstrumentName'

        # This will always be a kwarg
        self.getLogger = kwargs['getLogger']

        logger_name = '{}_xhost-{}-{}'.format(descriptor, str(index), host)
        # Why is logging defaulted to INFO, what if I do not want to see the info logs?
        logLevel = kwargs.get('logLevel', INFO)

        result, self.logger = self.getLogger(logger_name=logger_name,
                                             log_level=logLevel, **kwargs)
        if not result:
            # Problem
            errmsg = 'Unable to create logger for {}'.format(logger_name)
            raise ValueError(errmsg)

        self.logger.debug('Successfully created logger for {}'.format(logger_name))

        self.config = config
        self.index = index
        self.acc_len = None
        self.n_ants = None
        self.x_per_fpga = None
        self.xeng_accumulation_len = None
        self.n_chans = None
        self.sample_rate_hz = None
        if self.config is not None:
            xcfg = self.config['xengine']
            fcfg = self.config['fengine']
            ccfg = self.config['FxCorrelator']
            self.x_per_fpga = int(xcfg['x_per_fpga'])
            self.acc_len = int(xcfg['accumulation_len'])
            self.xeng_accumulation_len = int(xcfg['xeng_accumulation_len'])
            self.n_chans = int(fcfg['n_chans'])
            self.n_ants = int(ccfg['n_ants'])
            self.sample_rate_hz = int(ccfg['sample_rate_hz'])
        self._vaccs_per_sec_last_readtime = None
        self._vaccs_per_sec_last_values = None

        self.host_type = 'xhost'
Пример #5
0
    def __init__(self, host, katcp_port=7147, bitstream=None,
                 connect=True, config=None, config_file=None, **kwargs):
        """

        :param host:
        :param katcp_port:
        :param bitstream:
        :param connect:
        :param config:
        """
        FpgaHost.__init__(self, host=host, katcp_port=katcp_port, **kwargs)
        if config is not None and config_file is not None:
            LOGGER.warn('config file and config supplied, defaulting to config')
        self.config = config or parse_ini_file(config_file)['dsimengine']
        self.bitstream = bitstream
        self.sine_sources = AttributeContainer()
        self.noise_sources = AttributeContainer()
        self.pulsar_sources = AttributeContainer()
        self.outputs = AttributeContainer()