pacman.model.resources package¶
Module contents¶
-
class
pacman.model.resources.
AbstractSDRAM
[source]¶ Bases:
object
Represents an amount of SDRAM used on a chip in the machine.
-
fixed
¶ Returns the fixed SDRAM cost
-
get_total_sdram
(n_timesteps)[source]¶ The total SDRAM.
Parameters: n_timesteps (int) – number of timesteps to cost for Returns:
-
per_timestep
¶ Returns extra SDRAM cost for each additional timestep
Warning
May well be zero.
-
report
(timesteps, indent='', preamble='', target=None)[source]¶ Writes a description of this SDRAM to the target.
Parameters:
-
sub_from
(other)[source]¶ Creates a new SDRAM which is the other less this one
Parameters: other (AbstractSDRAM) – another SDRAM resource Returns: a New AbstractSDRAM Return type: AbstractSDRAM
-
-
class
pacman.model.resources.
CoreTracker
(chip, preallocated_resources, cores_counter)[source]¶ Bases:
object
Represents the number of cores and sdram left to allocate
Parameters: - chip (Chip) – chip whose resources can be allocated
- preallocated_resources (PreAllocatedResourceContainer or None) –
-
is_available
¶
-
n_cores_available
¶
-
class
pacman.model.resources.
ConstantSDRAM
(sdram)[source]¶ Bases:
pacman.model.resources.abstract_sdram.AbstractSDRAM
Represents an amount of SDRAM used on a chip in the machine.
This is used when the amount of SDRAM needed is not effected by runtime
Parameters: sdram (int or int64) – The amount of SDRAM in bytes -
fixed
¶ Returns the fixed SDRAM cost
-
get_total_sdram
(n_timesteps)[source]¶ The total SDRAM.
Parameters: n_timesteps (int) – number of timesteps to cost for Returns:
-
per_timestep
¶ Returns extra SDRAM cost for each additional timestep
Warning
May well be zero.
-
report
(timesteps, indent='', preamble='', target=None)[source]¶ Writes a description of this SDRAM to the target.
Parameters:
-
sub_from
(other)[source]¶ Creates a new SDRAM which is the other less this one
Parameters: other (AbstractSDRAM) – another SDRAM resource Returns: a New AbstractSDRAM Return type: AbstractSDRAM
-
-
class
pacman.model.resources.
CoreResource
(chip, n_cores)[source]¶ Bases:
object
Represents the number of cores that need to be allocated.
Parameters: -
chip
¶
-
n_cores
¶
-
-
class
pacman.model.resources.
CPUCyclesPerTickResource
(cycles)[source]¶ Bases:
object
Represents the number of CPU clock cycles per tick used or available on a core of a chip in the machine.
Parameters: cycles (int or int64) – The number of CPU clock cycles
-
class
pacman.model.resources.
DTCMResource
(dtcm)[source]¶ Bases:
object
Represents the amount of local core memory available or used on a core on a chip of the machine.
Parameters: dtcm (int or numpy.integer) – The amount of DTCM in bytes
-
class
pacman.model.resources.
ElementFreeSpace
(start_address, size)[source]¶ Bases:
object
Parameters:
-
class
pacman.model.resources.
IPtagResource
(ip_address, port, strip_sdp, tag=None, traffic_identifier='DEFAULT')[source]¶ Bases:
object
Represents the ability to have a SpiNNaker machine send messages to you during execution.
Parameters: - ip_address (str) – The IP address of the host that will receive data from this tag
- port (int or None) – The port that will
- strip_sdp (bool) – Whether the tag requires that SDP headers are stripped before transmission of data
- tag (int or None) – A fixed tag ID to assign, or None if any tag is OK
- traffic_identifier (str) – The traffic to be sent using this tag; traffic with the same traffic_identifier can be sent using the same tag
-
get_value
()[source]¶ Returns: The description of the IP tag. Return type: list(str, int, bool, int, str)
-
traffic_identifier
¶ The traffic identifier for this IP tag
-
class
pacman.model.resources.
MultiRegionSDRAM
[source]¶ Bases:
pacman.model.resources.variable_sdram.VariableSDRAM
A resource for SDRAM that comes in regions
-
add_cost
(region, fixed_sdram, per_timestep_sdram=0)[source]¶ Adds the cost for the specified region
Parameters: - region (int or str or enum) – Key to identify the region
- fixed_sdram (int or numpy.integer) – The fixed cost for this region.
- per_timestep_sdram (int or numpy.integer) – The variable cost for this region is any
-
merge
(other)[source]¶ Combines the other SDRAM costs keeping the region mappings
Parameters: other (MultiRegionSDRAM) – Another mapping of costs by region
-
nest
(region, other)[source]¶ Combines the other SDRAM cost, in a nested fashion.
The totals for the new region are added to the total of this one. A new region is created summarising the cost of others. If other contains a regions which is the same as one in self they are not combined, but kept separate.
Parameters: - region (int or str or enum) – Key to identify the summary region
- other (AbstractSDRAM) – Another SDRAM model to make combine by nesting
-
regions
¶
-
-
class
pacman.model.resources.
PreAllocatedResourceContainer
[source]¶ Bases:
object
Container object for preallocated resources
-
add_cores_all
(extra)[source]¶ Add extra core requirement for all cores including ethernets
Parameters: extra (int) – number of extra cores
-
add_cores_ethernet
(extra)[source]¶ Add extra core requirement for all cores including ethernets
Parameters: extra (int) – number of extra cores
-
add_iptag_resource
(extra)[source]¶ Adds an additional iptag resource to be reserved on all ethernet chips :param IPtagResource extraa:
-
add_sdram_all
(extra)[source]¶ Add extra sdram to preallocate on all chips including ethernets
Parameters: extra (AbstractSDRAM) – Additioanal sdram required
-
add_sdram_ethernet
(extra)[source]¶ Add extra sdram to preallocate on ethernet chips
Parameters: extra (AbstractSDRAM) – Additioanal sdram required
-
cores_all
¶
-
cores_ethernet
¶
-
iptag_resources
¶
-
sdram_all
¶
-
sdram_ethernet
¶
-
-
class
pacman.model.resources.
ResourceContainer
(dtcm=None, sdram=None, cpu_cycles=None, iptags=None, reverse_iptags=None)[source]¶ Bases:
object
Container for the types of resources so that ordering is not a problem.
Parameters: - dtcm (None or DTCMResource) – the amount of dtcm used
- sdram (None or AbstractSDRAM) – the amount of SDRAM used
- cpu_cycles (None or CPUCyclesPerTickResource) – the amount of CPU used
- iptags (None or list(IPtagResource)) – the IP tags required
- reverse_iptags (None or list(SpecificBoardReverseIPtagResource)) – the reverse IP tags required
-
cpu_cycles
¶
-
dtcm
¶
-
extend
(other)[source]¶ Parameters: other (ResourceContainer) –
-
sdram
¶
-
class
pacman.model.resources.
ReverseIPtagResource
(port=None, sdp_port=1, tag=None)[source]¶ Bases:
object
Represents the ability to talk to a SpiNNaker machine by sending UDP packets to it during execution.
Parameters:
-
class
pacman.model.resources.
VariableSDRAM
(fixed_sdram, per_timestep_sdram)[source]¶ Bases:
pacman.model.resources.abstract_sdram.AbstractSDRAM
Represents an amount of SDRAM used on a chip in the machine.
This is where the usage increase as the run time increases
Parameters: - fixed_sdram – The amount of SDRAM (in bytes) that represents static overhead
- per_timestep_sdram (float or numpy.float) – The amount of SDRAM (in bytes) required per timestep. Often represents the space to record a timestep.
-
fixed
¶ Returns the fixed SDRAM cost
-
get_total_sdram
(n_timesteps)[source]¶ The total SDRAM.
Parameters: n_timesteps (int) – number of timesteps to cost for Returns:
-
per_timestep
¶ Returns extra SDRAM cost for each additional timestep
Warning
May well be zero.
-
report
(timesteps, indent='', preamble='', target=None)[source]¶ Writes a description of this SDRAM to the target.
Parameters:
-
sub_from
(other)[source]¶ Creates a new SDRAM which is the other less this one
Parameters: other (AbstractSDRAM) – another SDRAM resource Returns: a New AbstractSDRAM Return type: AbstractSDRAM