Skip to content

Commit 5651d4f

Browse files
committed
更新README强调DRY原则和执行逻辑
1 parent a04ae85 commit 5651d4f

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,21 @@ cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=ON .. && make -j
5757
└── tasks/ # 任务说明、重构计划与执行记录(新增任务文档统一放此目录)
5858
```
5959

60+
## 开发原则(DRY / KISS)
61+
62+
为避免 InOrder/OOO 出现两套语义实现并长期分叉,后续开发默认遵循以下约束:
63+
64+
- 指令语义统一下沉到 `src/core/instruction_executor.cpp`(及对应头文件)。
65+
- `src/cpu/inorder/``src/cpu/ooo/` 只处理流水线/调度/提交/异常传播等控制流逻辑。
66+
- 禁止在 InOrder 与 OOO 中重复实现同一条指令的算术、比较、访存宽度、CSR 位语义。
67+
- 新增 ISA 能力时,优先扩展 `InstructionExecutor`,然后让 InOrder/OOO 复用同一语义入口。
68+
69+
建议在提交前自检:
70+
71+
- 该指令的语义是否只在 `InstructionExecutor` 出现一次。
72+
- InOrder 与 OOO 是否都调用了同一语义实现。
73+
- 是否补充了对应单测与 `run_tests.py` 回归。
74+
6075
## 文档
6176

6277
- 架构设计(精简):`docs/代码架构文档.md`

0 commit comments

Comments
 (0)