gem5.components.processors.complex_generator_core module

class gem5.components.processors.complex_generator_core.ComplexGeneratorCore

Bases: AbstractGeneratorCore

abstract = False
add_linear(duration: str, rate: str, block_size: int, min_addr: int, max_addr: int, rd_perc: int, data_limit: int) None

This function will add the params for a linear traffic to the list of traffic params in this generator core. These params will be later resolved by the start_traffic call. This core uses a PyTrafficGen to create the traffic based on the specified params below.

Parameters:
  • duration – The number of ticks for the generator core to generate traffic.

  • rate – The rate at which the synthetic data is read/written.

  • block_size – The number of bytes to be read/written with each request.

  • min_addr – The lower bound of the address range the generator will read/write from/to.

  • max_addr – The upper bound of the address range the generator will read/write from/to.

  • rd_perc – The percentage of read requests among all the generated requests. The write percentage would be equal to 100 - rd_perc.

  • data_limit – The amount of data in bytes to read/write by the generator before stopping generation.

add_random(duration: str, rate: str, block_size: int, min_addr: int, max_addr: int, rd_perc: int, data_limit: int) None

This function will add the params for a random traffic to the list of traffic params in this generator core. These params will be later resolved by the start_traffic call. This core uses a PyTrafficGen to create the traffic based on the specified params below.

Parameters:
  • duration – The number of ticks for the generator core to generate traffic.

  • rate – The rate at which the synthetic data is read/written.

  • block_size – The number of bytes to be read/written with each request.

  • min_addr – The lower bound of the address range the generator will read/write from/to.

  • max_addr – The upper bound of the address range the generator will read/write from/to.

  • rd_perc – The percentage of read requests among all the generated requests. The write percentage would be equal to 100 - rd_perc.

  • data_limit – The amount of data in bytes to read/write by the generator before stopping generation.

connect_dcache(port: Port) None

This function should connect the response port from the data cache to the right request port on the core.

Parameters:

port – The response port from the icache to connect to.

cxx_exports = []
cxx_extra_bases = []
cxx_param_exports = []
cxx_template_params = []
set_traffic_from_python_generator(python_generator: Iterator[Any]) None

Function to set the traffic from a user defined python generator. The generator should only assume one input argument (positional) for the actual PyTrafficGen object to create the traffic. This is possible either through using a generator with hardcoded parameters in the function calls to PyTrafficGen methods or by compiling a flexible python generator into a generator object with only one input argument (positional) using functools.partial.

Parameters:

generator – A python generator object that creates traffic patterns through calls to methods of PyTrafficGen.

start_traffic() None

This function first checks if there are any pending traffics that require creation, if so it will create the pending traffics based on traffic_params list and adds them to the traffic list, then it starts generating the traffic at the top of the traffic list. It also pops the first element in the list so that every time this function is called a new traffic is generated, each instance of a call to this function should happen before each instance of the call to m5.simulate(). All the instances of calls to this function should happen after m5.instantiate().

class gem5.components.processors.complex_generator_core.ComplexTrafficParams(mode: TrafficModes, duration: str, rate: str, block_size: int, min_addr: int, max_addr: int, rd_perc: int, data_limit: int)

Bases: object

class gem5.components.processors.complex_generator_core.TrafficModes(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

The traffic mode class

This class is an enum to store traffic mode in a more meaningful way.

linear = 0
random = 1