Documentation
¶
Index ¶
- type CPUIncentiveHook
- func (h *CPUIncentiveHook) CreateTransaction(nodeID int, cycle uint64) (*transaction.Transaction, error)
- func (h *CPUIncentiveHook) GetCPU() *cpu.O3CPU
- func (h *CPUIncentiveHook) GetStats() cpu.O3CPUStats
- func (h *CPUIncentiveHook) HandleResponse(msgID dataflow.MessageID, cycle uint64) error
- func (h *CPUIncentiveHook) ShouldCreateTransaction(nodeID int, cycle uint64) bool
- type MemoryRequestPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CPUIncentiveHook ¶
type CPUIncentiveHook struct {
// contains filtered or unexported fields
}
CPUIncentiveHook 实现 IncentiveHook 接口
将 ChampSim O3CPU 集成到框架中: - 每个周期调用 CPU Tick - 从 LSQ 获取准备好的内存请求 - 生成 CHI/AXI Message - 返回包含这些 Message 的 Transaction
func NewCPUIncentiveHook ¶
func NewCPUIncentiveHook( traceReader trace.TraceReader, config cpu.O3CPUConfig, nodeID int, targetNodeID int, protocol transaction.Protocol, ) *CPUIncentiveHook
NewCPUIncentiveHook 创建新的 CPU Incentive Hook
参数:
- traceReader: Trace 文件读取器
- config: CPU 配置
- nodeID: CPU 节点 ID
- targetNodeID: 内存控制器节点 ID
- protocol: 使用的协议 (AXI 或 CHI)
func (*CPUIncentiveHook) CreateTransaction ¶
func (h *CPUIncentiveHook) CreateTransaction(nodeID int, cycle uint64) (*transaction.Transaction, error)
CreateTransaction 创建 Transaction
流程: 1. 执行 CPU Tick (推进一个周期) 2. 从 LSQ 获取准备好的 load/store 请求 3. 为每个请求创建 Message 4. 返回包含这些 Message 的 Transaction
func (*CPUIncentiveHook) GetCPU ¶
func (h *CPUIncentiveHook) GetCPU() *cpu.O3CPU
GetCPU 返回 CPU 实例(用于测试和调试)
func (*CPUIncentiveHook) GetStats ¶
func (h *CPUIncentiveHook) GetStats() cpu.O3CPUStats
GetStats 返回 CPU 统计信息
func (*CPUIncentiveHook) HandleResponse ¶
func (h *CPUIncentiveHook) HandleResponse(msgID dataflow.MessageID, cycle uint64) error
HandleResponse 处理内存响应
当收到来自内存系统的响应时调用,更新 LSQ 状态
func (*CPUIncentiveHook) ShouldCreateTransaction ¶
func (h *CPUIncentiveHook) ShouldCreateTransaction(nodeID int, cycle uint64) bool
ShouldCreateTransaction 判断是否应该创建 Transaction
CPU 每个周期都可能产生内存请求,所以总是返回 true
Click to show internal directories.
Click to hide internal directories.