microprobe.target.uarch.cache.SetAssociativeCache

class SetAssociativeCache(element: MicroarchitectureElement, size: int, level: int, line_size: int, address_size: int, data: bool, ins: bool, ways: int)[source]

Bases: Cache

Class to represent a set-associative cache.

__init__(element: MicroarchitectureElement, size: int, level: int, line_size: int, address_size: int, data: bool, ins: bool, ways: int)[source]

Create a SetAssociativeCache object.

Parameters:
  • element (MicroarchitectureElement) – Micrarchitecture element

  • size (int) – Cache size in kilobytes

  • level (int) – Cache level

  • line_size (int) – Line size in bytes

  • address_size (int) – Address size in bits

  • data (bool) – Data cache flag

  • ins (int) – Instruction cache flag

  • ins – Cache ways

Returns:

Cache instance

Return type:

Cache

Methods

__init__(element, size, level, line_size, ...)

Create a SetAssociativeCache object.

congruence_class(value)

Return the congruence class for a given value.

lines()

Number of lines (class:~.int).

offset(value)

param value:

print_info()

sets()

Number of cache sets (class:~.int).

setsways()

Return the list of sets and ways.

Attributes

bits_x_lines

Number of bits per line (class:~.int).

bits_x_offset

Number of offset bits (class:~.int).

bits_x_set

Number of bits per set (class:~.int).

contains_data

Data cache flag (class:~.bool).

contains_instructions

Instruction cache (class:~.bool).

description

Cache description (class:~.str).

element

Corresponding microarchitecture element (MicroarchitectureElement).

level

Cache level (class:~.int).

line_size

Cache line size in bytes (class:~.int).

name

Cache name (class:~.str).

offset_bits

Number of offset bits (class:~.int).

set_ways_bits

Number of bits per way (class:~.int).

size

Cache size in kilobytes (class:~.int).

ways

Number of cache ways (class:~.int).




property ways

Number of cache ways (class:~.int).

sets()[source]

Number of cache sets (class:~.int).

property bits_x_set

Number of bits per set (class:~.int).

lines()[source]

Number of lines (class:~.int).

property bits_x_lines

Number of bits per line (class:~.int).

property bits_x_offset

Number of offset bits (class:~.int).

property set_ways_bits

Number of bits per way (class:~.int).

property offset_bits

Number of offset bits (class:~.int).

setsways()[source]

Return the list of sets and ways.

Returns:

List of available sets * ways

Return type:

list of int

congruence_class(value: int)[source]

Return the congruence class for a given value.

Parameters:

value (int) – Address

Returns:

Congruence class

Return type:

int

offset(value: int)[source]
Parameters:

value

print_info()[source]
property contains_data

Data cache flag (class:~.bool).

property contains_instructions

Instruction cache (class:~.bool).

property description

Cache description (class:~.str).

property element

Corresponding microarchitecture element (MicroarchitectureElement).

property level

Cache level (class:~.int).

property line_size

Cache line size in bytes (class:~.int).

property name

Cache name (class:~.str).

property size

Cache size in kilobytes (class:~.int).