15 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 控制端口软件适配器
四个lane取值0..3,所有寄存器和统计初始0,软件替身不执行真实MMIO。
C lane command交付一次作业,command是0..65535,作业可重复,数值0也是有效命令。
写操作只放入posted槽并增加writes;完成动作使槽内command成为committed,清pending,jobs增加1。
一次交付的顺序为写入、完成、读回,分别恰好一次;drains/reads统计对应适配动作次数。
设备读回低16位是command,高16位携带状态,不属于command。读回不隐式完成posted写。
读回command匹配返回0,accepted加1;不匹配返回-1,failed加1;不能通过忽略结果认领作业。
每次C输出SUBMIT lane command result,之后输出状态;上层没有自动重发或隐式取消。
H lane status设置独立状态字段0..255,不交付作业、也不消耗或完成pending。
I lane只读寄存器并输出READ lane raw 0,raw包含状态位,reads增加1。
R重置全部状态;非法命令/参数无设备副作用,只rejected加1并输出REJECT。
状态字段:rejected accepted failed,随后每lane:committed pending_value pending status writes drains reads jobs。
任何诊断输出可写stderr,stdout只用当前观测协议,正常EOF退出0。