class
Cradare2::Platform::PS2::VUProfiler
- Cradare2::Platform::PS2::VUProfiler
- Reference
- Object
Overview
PS2 EE/VU1 memory & cycle profiling bridge inspecting VU1 Micro-Memory (0x11008000),
VU1 Data Memory (0x1100C000), and pipeline stall hazards over r2pipe, GDB RSP, or byte slices.
Defined in:
cradare2/platform/ps2/vu_profiler.crConstant Summary
-
FDIV_DIV_LATENCY =
7 -
FDIV_RSQRT_LATENCY =
13 -
FMAC_LATENCY =
4 -
ILW_LATENCY =
4 -
LOAD_LATENCY =
4 -
LOWER_NOP_CANONICAL =
2147484476_u32 -
UPPER_NOP_CANONICAL =
767_u32
Constructors
- .from_bytes(micro_bytes : Bytes, data_bytes : Bytes = Bytes.empty) : self
- .from_gdb(gdb : Gdb::Client) : self
- .new(client : Client)
- .new(gdb : Gdb::Client)
- .new(micro_buffer : Bytes = Bytes.empty, data_buffer : Bytes = Bytes.empty)
Class Method Summary
-
.decode_instruction(lower_word : UInt32, upper_word : UInt32, pc : UInt32 = 0_u32, base_addr : UInt64 = Registers::VU1_MICRO_MEM) : VUInstruction
Decodes a single 64-bit Dual-Issue VU1 Microinstruction (
lower_wordin bits 0..31,upper_wordin bits 32..63). - .format_broadcast(bc : UInt8) : String
-
.format_dest_mask(mask : UInt8) : String
Formats a 4-bit destination mask (
0b1000=x,0b0100=y,0b0010=z,0b0001=w) into a suffix string. - .format_vf(idx : UInt8) : String
- .format_vi(idx : UInt8) : String
Instance Method Summary
-
#analyze_hazards(instructions : Array(VUInstruction), xgkick_min_separation : Int32 = @xgkick_min_separation) : Array(VUStallHazard)
Analyzes a sequence of decoded
VUInstructions for PS2 VU1 pipeline stall hazards and register conflicts. - #client : Client | Nil
- #data_base : UInt64
- #data_base=(data_base : UInt64)
- #data_buffer : Bytes
- #data_buffer=(data_buffer : Bytes)
- #data_qw_count : Int32
- #data_qw_count=(data_qw_count : Int32)
- #data_qw_offset : Int32
- #data_qw_offset=(data_qw_offset : Int32)
-
#decode_microprogram(bytes : Bytes, start_pc : UInt32 = @start_pc, max_instructions : Int32 = @max_instructions, stop_on_e_bit : Bool = @stop_on_e_bit, base_addr : UInt64 = @micro_base) : Array(VUInstruction)
Decodes a binary slice of 64-bit VU1 microinstructions (8 bytes each, little-endian).
-
#decode_quadwords(bytes : Bytes, qw_offset : Int32 = 0, base_addr : UInt64 = @data_base) : Array(VUQuadword)
Decodes a slice of bytes into 128-bit
VUQuadwordentries (x, y, z, wfloats &ix, iy, iz, iwuint32s). -
#dissect_xgkick_packet(qw_offset : Int32, max_items : Int32 = 32) : Array(GifDissector::GifItemInfo)
Dissects a GS GIF packet prepared for
XGKICKat quadword offsetqw_offsetin VU1 Data Memory (0x1100C000). - #gdb : Gdb::Client | Nil
-
#inspect_data_memory(qw_offset : Int32 = @data_qw_offset, qw_count : Int32 = @data_qw_count) : VUMemorySnapshot
Inspects VU1 Data Memory (
0x1100C000), VIF1 double-buffer registers, and EE timers over r2pipe/GDB. - #max_instructions : Int32
- #max_instructions=(max_instructions : Int32)
-
#measure_ee_cycles(&) : UInt32
Measures elapsed Emotion Engine Hardware Timer 0 (
0x10000000) bus cycles around a block. - #micro_base : UInt64
- #micro_base=(micro_base : UInt64)
- #micro_buffer : Bytes
- #micro_buffer=(micro_buffer : Bytes)
-
#profile(start_pc : UInt32 = @start_pc, max_instructions : Int32 = @max_instructions) : VUProfileReport
Reads VU1 Micro-Memory (
0x11008000) over r2pipe/GDB and profiles the microprogram. -
#profile_bytes(micro_bytes : Bytes, start_pc : UInt32 = @start_pc, max_instructions : Int32 = @max_instructions, stop_on_e_bit : Bool = @stop_on_e_bit) : VUProfileReport
Profiles a binary slice of VU1 micro-memory instructions and computes cycle counts, stalls, IPC, and frame budgets.
-
#read_bytes(address : UInt64, length : Int32) : Bytes
Unified memory reader across r2pipe (
Client), GDB RSP (Gdb::Client), or local buffers. -
#read_data_memory(offset_bytes : Int32 = 0, size : Int32 = 1024) : Bytes
Reads raw bytes from VU1 Data Memory (
0x1100C000 + offset_bytes). -
#read_micro_memory(offset_bytes : Int32 = 0, size : Int32 = 2048) : Bytes
Reads raw bytes from VU1 Micro-Memory (
0x11008000 + offset_bytes). -
#read_u32(address : UInt64) : UInt32
Reads a 32-bit unsigned integer in PlayStation 2 little-endian byte order.
- #start_pc : UInt32
- #start_pc=(start_pc : UInt32)
- #stop_on_e_bit : Bool
- #stop_on_e_bit=(stop_on_e_bit : Bool)
- #xgkick_min_separation : Int32
- #xgkick_min_separation=(xgkick_min_separation : Int32)
Constructor Detail
Class Method Detail
Decodes a single 64-bit Dual-Issue VU1 Microinstruction (lower_word in bits 0..31, upper_word in bits 32..63).
Formats a 4-bit destination mask (0b1000=x, 0b0100=y, 0b0010=z, 0b0001=w) into a suffix string.
Instance Method Detail
Analyzes a sequence of decoded VUInstructions for PS2 VU1 pipeline stall hazards and register conflicts.
Decodes a binary slice of 64-bit VU1 microinstructions (8 bytes each, little-endian).
Decodes a slice of bytes into 128-bit VUQuadword entries (x, y, z, w floats & ix, iy, iz, iw uint32s).
Dissects a GS GIF packet prepared for XGKICK at quadword offset qw_offset in VU1 Data Memory (0x1100C000).
Inspects VU1 Data Memory (0x1100C000), VIF1 double-buffer registers, and EE timers over r2pipe/GDB.
Measures elapsed Emotion Engine Hardware Timer 0 (0x10000000) bus cycles around a block.
Reads VU1 Micro-Memory (0x11008000) over r2pipe/GDB and profiles the microprogram.
Profiles a binary slice of VU1 micro-memory instructions and computes cycle counts, stalls, IPC, and frame budgets.
Unified memory reader across r2pipe (Client), GDB RSP (Gdb::Client), or local buffers.
Reads raw bytes from VU1 Data Memory (0x1100C000 + offset_bytes).
Reads raw bytes from VU1 Micro-Memory (0x11008000 + offset_bytes).
Reads a 32-bit unsigned integer in PlayStation 2 little-endian byte order.