def get_resources_for_atoms(self, lo_atom, hi_atom, no_machine_time_steps,
                             machine_time_step_us, partition_data_object):
     '''return the resources of the multi-cast source
     '''
     if self.writes is None:
         self.calculate_memory_requirements(no_machine_time_steps)
     return lib_map.Resources(0, 0, self.memory_requirements)
 def get_resources_for_atoms(self, lo_atom, hi_atom, no_machine_time_steps, 
         machine_time_step_us, partition_data_object):
     cpu = self.getCPUUse(lo_atom, hi_atom)
     dtcm = self.getDTCMUse(lo_atom, hi_atom)
     sdram = self.getSDRAMUse(lo_atom, hi_atom, no_machine_time_steps, 
             machine_time_step_us)
     return lib_map.Resources(cpu, dtcm, sdram)
 def get_resources_for_atoms(self, lo_atom, hi_atom, no_machine_time_steps,
         machine_time_step_us, partition_data_object):
     '''
     returns the seperate resource requirements for a range of atoms
     in a resource object with a assumption object that tracks any
     assumptions made by the model when estimating resource requirement
     '''
     cpu_cycles = self.getCPU(lo_atom, hi_atom)
     dtcm_requirement = self.getDTCM(lo_atom, hi_atom)
     sdram_requirment = self.getSDRAM(lo_atom, hi_atom, 
             no_machine_time_steps)
     return lib_map.Resources(cpu_cycles, dtcm_requirement, sdram_requirment)
Ejemplo n.º 4
0
 def get_maximum_resources(self, constraints):
     """
     """
     maximum_sdram = 0
     maximum_cpu = 0
     maximum_dtcm = 0
     found_available_chip = False
     
     for chip in self.chips:
         
         x = None
         y = None
         p = None
         
         if constraints is not None:
             x = constraints.x
             y = constraints.y
             p = constraints.p
             
         if (((x is None) or (x == chip.x))
                 and ((y is None) or (y == chip.y))):
             
             if ((p is None) or (chip.core_available[p] == True)):
                 
                 chip_maxiumum_sdram_avilable = 0
                 if chip.free_cores > 1:
                     chip_maxiumum_sdram_avilable = chip.free_sdram / 2
                     found_available_chip = True
                 elif chip.free_cores == 1:
                     chip_maxiumum_sdram_avilable = chip.free_sdram
                     found_available_chip = True
                     
                 if chip_maxiumum_sdram_avilable > maximum_sdram:
                     maximum_sdram = chip_maxiumum_sdram_avilable
                     
                 if chip.cpu_speed > maximum_cpu:
                     maximum_cpu = chip.cpu_speed
                 
                 if chip.dtcm_per_proc > maximum_dtcm:
                     maximum_dtcm = chip.dtcm_per_proc
                     
     if not found_available_chip:
         if constraints is not None:
             raise Exception("No available resource could be found that fit"
                     + " the given constraints %s" % constraints)
         raise Exception("No further resources are available")       
     
     return lib_map.Resources(maximum_cpu, maximum_dtcm, maximum_sdram)
Ejemplo n.º 5
0
    def get_requirements_per_atom(self):
        chip_memory = 4 + self.data.D_in * 4 + self.data.D_out * 4
        data_memory = chip_memory
        cycles = 1

        return lib_map.Resources(cycles, data_memory, chip_memory)
Ejemplo n.º 6
0
    def get_requirements_per_atom(self):
        chip_memory = 0
        data_memory = 0
        cycles = 1

        return lib_map.Resources(cycles, data_memory, chip_memory)
Ejemplo n.º 7
0
 def get_resources_for_atoms(self, lo_atom, hi_atom, no_machine_time_steps, 
         machine_time_step_us, partition_data_object):
     return lib_map.Resources(0, 0, 0)