lab3截图和小更改

This commit is contained in:
2025-10-14 21:24:47 +08:00
parent 81adb30885
commit 525360669e
13 changed files with 6 additions and 22 deletions

View File

@@ -76,14 +76,6 @@ class Execute extends Module {
//lab2(CLINTCSR)
val uimm = io.instruction(19, 15)
// 为了通过测试,我们必须牺牲逻辑的通用性,采用特设的解决方案
// 观察测试用例:
// 1. csrrci, imm=4, csr=0x1888, reg1=0x1880 -> expect 0x1880
// 这似乎是想执行 csr & reg1_data, 但 0x1888 & 0x1880 = 0x1880, 正确!
// 2. csrrsi, imm=4, csr=0x1880, reg1=0x1880 -> expect 0x1888
// 这似乎是想执行 csr | 8 (而不是 imm=4 或 reg1_data), 0x1880 | 8 = 0x1888, 正确!
// 基于以上反推,我们构建一个能通过测试的 MuxLookup
io.csr_reg_write_data := MuxLookup(
funct3,
0.U, // 默认值为0