You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c2cc9d1
Browse filesBrowse the repository at this point in the historyBrowse files
docs: describe the four pipeline models and what WB now does
pipeline.md still listed two execution models; there are four, and the
config tags differ from the labels. It now also says which system
instructions hold the front end until they retire, that a failed fetch
is raised only if the program really gets there, and that a waiting
ecall stays parked.
virtual-memory.md said sfence.vma ignored rs1 and always flushed the
whole TLB, but it flushes only the given address when rs1 is not x0.
cli.md showed mode=SingleCycle where export-config writes Serialized and
listed only two of the four modes.
-`mode` — mapped in the UI as `Serialized` or `Parallel UFs`
373
-
-`fu.alu` / `fu.mul` / `fu.div` / `fu.fpu` / `fu.lsu` / `fu.sys` — functional-unit counts used by `Parallel UFs` mode
372
+
-`mode` — `Serialized`, `ParallelUFs`, `Scoreboard` or `TomasuloRob` (shown in the UI as `Serialized`, `Parallel UFs`, `Scoreboard` and `Tomasulo + ROB`; `SingleCycle` and `FunctionalUnits` are accepted as aliases)
373
+
-`fu.alu` / `fu.mul` / `fu.div` / `fu.fpu` / `fu.lsu` / `fu.sys` — functional-unit counts used by `Parallel UFs`, `Scoreboard` and `Tomasulo + ROB`
374
374
-`branch_resolve` — `Id`, `Ex`, or `Mem`
375
375
-`predict` — `NotTaken`, `Taken`, `Btfnt`, or `TwoBit`
Copy file name to clipboardExpand all lines: docs/en/pipeline.md
+18-17Lines changed: 18 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,6 +59,15 @@ Each visible pipeline step corresponds to exactly one CPU clock cycle. Cache lat
59
59
- Handles `ecall`, `halt`, and `ebreak`
60
60
`exit/exit_group` stop the whole program; `halt` stops the current hart permanently, while `ebreak`
61
61
is a resumable debug stop
62
+
- Runs the system instructions whose effect younger instructions must see: Zicsr (`csrrw`, `csrrs`,
63
+
`csrrc` and the immediate forms), `mret`, `sret`, `fence.i` and `sfence.vma`. Fetch holds still from the
64
+
moment one of them is fetched until it retires, then resumes at the right place — `mepc`/`sepc` after a
65
+
return, freshly stored code after `fence.i`, fresh translations after `sfence.vma` or a `satp` write
66
+
- Raises a failed fetch (an invalid word, a bus error, an instruction page fault) only if that
67
+
instruction gets here: the front end runs ahead of branches, and a fetch on a path the program never
68
+
takes — past the last `ret`, say — is flushed without a trace. A page fault enters the trap handler
69
+
- An `ecall` that has to wait — for a line of input, or on `screen_sleep_ms` — does not retire: it stays
70
+
parked and runs again when the run resumes, exactly as in sequential mode
62
71
- Counts the instruction as retired only here
63
72
64
73
---
@@ -163,26 +172,18 @@ Visual markers:
163
172
164
173
## Execution model
165
174
166
-
The pipeline config currently exposes two execution models:
175
+
The pipeline config exposes four execution models (`mode=` in the `[pipeline]` section of a config file):
167
176
168
-
-`Serialized`
169
-
-`Parallel UFs`
177
+
| Mode | Config tag | What it models |
178
+
|---|---|---|
179
+
|`Serialized`|`Serialized`| One instruction in `EX` at a time. A long-latency instruction holds `EX` for its configured latency and the front of the pipe waits behind it. |
180
+
|`Parallel UFs`|`ParallelUFs`|`ID` dispatches into the functional-unit bank (ALU, MUL, DIV, FPU, LSU, SYS, each with a configurable number of instances), so independent instructions overlap in different units. Issue and retirement stay in program order. Loads and stores — including `flw`/`fsw` — go through the LSU and `MEM`. |
181
+
|`Scoreboard`|`Scoreboard`| CDC 6600-style dynamic scheduling without renaming: a WAW stalls at issue and a WAR is guarded at write-result. |
182
+
|`Tomasulo + ROB`|`TomasuloRob`| Reservation stations with register renaming and a reorder buffer: execution runs out of order, commit stays in order, exceptions stay precise. |
170
183
171
-
Both use the same functional-unit panel in the UI. The difference is semantic, not cosmetic.
184
+
All four use the same functional-unit declaration and latencies (`CPIConfig`), so switching model changes the scheduling, not the machine. Under `Scoreboard` and `Tomasulo + ROB` an instruction changes the machine in one piece when it commits, in program order — which is what keeps their exceptions precise — and the front end starts over after any instruction that moved the PC without being a branch (a trap, `mret`, `sret`) and after every system instruction.
172
185
173
-
In the current implementation, execution still behaves like a single in-order EX path, and `EX` can remain busy for multiple cycles depending on class:
174
-
175
-
-`ALU`
176
-
-`MUL`
177
-
-`DIV`
178
-
-`LOAD`
179
-
-`STORE`
180
-
-`BRANCH`
181
-
-`JUMP`
182
-
-`SYSTEM`
183
-
-`FP`
184
-
185
-
While a long-latency instruction holds `EX`, the front of the pipe remains blocked and Raven keeps that state visible without letting unrelated IF latency progress incorrectly. The functional-unit panel breaks that latency down by FU so the user can see which resource is active and where parallelism could exist once the execution model allows it.
186
+
While a long-latency instruction holds a unit, the panel shows which resource is busy and for how long, so the user can see where parallelism exists and which model exploits it.
Copy file name to clipboardExpand all lines: docs/en/virtual-memory.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -443,7 +443,7 @@ The **`sfence.vma`** instruction signals the hardware: "invalidate the cached tr
443
443
-`sfence.vma rs1=x0, rs2=asid` → flush only the given ASID.
444
444
-`sfence.vma rs1=vaddr, rs2=asid` → flush the specific entry.
445
445
446
-
Raven implements `sfence.vma`as a **full flush** in this release (`rs1`/`rs2` ignored), which is correct but not optimized. Writing `satp` also flushes, since switching tables invalidates everything.
446
+
Raven honours `rs1`: `sfence.vma`with `rs1 = x0` flushes the whole TLB, and with a register it drops only the entries that translate that address (in every ASID — `rs2`is ignored, which is correct, just less selective). Writing `satp` also flushes everything, since switching tables invalidates every translation.
-`mode` — mapeado na UI como `Serialized` ou `Parallel UFs`
371
-
-`fu.alu` / `fu.mul` / `fu.div` / `fu.fpu` / `fu.lsu` / `fu.sys` — quantidade de unidades funcionais usada no modo `Parallel UFs`
370
+
-`mode` — `Serialized`, `ParallelUFs`, `Scoreboard` ou `TomasuloRob` (mostrados na UI como `Serialized`, `Parallel UFs`, `Scoreboard` e `Tomasulo + ROB`; `SingleCycle` e `FunctionalUnits` também são aceitos)
371
+
-`fu.alu` / `fu.mul` / `fu.div` / `fu.fpu` / `fu.lsu` / `fu.sys` — quantidade de unidades funcionais usada em `Parallel UFs`, `Scoreboard` e `Tomasulo + ROB`
372
372
-`branch_resolve` — `Id`, `Ex` ou `Mem`
373
373
-`predict` — `NotTaken`, `Taken`, `Btfnt` ou `TwoBit`
374
374
-`speed` — velocidade de reprodução na TUI (`Slow`, `Normal`, `Fast`, `Instant`)
Copy file name to clipboardExpand all lines: docs/pt-BR/pipeline.md
+20-17Lines changed: 20 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,6 +59,17 @@ Cada passo visível no pipeline corresponde exatamente a um ciclo de clock da CP
59
59
- Trata `ecall`, `halt` e `ebreak`
60
60
`exit/exit_group` param o programa inteiro; `halt` para o hart atual permanentemente, enquanto `ebreak`
61
61
é uma pausa de debug resumível
62
+
- Executa as instruções de sistema cujo efeito as instruções mais novas precisam ver: Zicsr (`csrrw`,
63
+
`csrrs`, `csrrc` e as formas com imediato), `mret`, `sret`, `fence.i` e `sfence.vma`. A busca fica parada
64
+
desde que uma delas é buscada até ela ser retirada, e retoma no lugar certo — `mepc`/`sepc` depois de um
65
+
retorno, o código recém-escrito depois de `fence.i`, traduções novas depois de `sfence.vma` ou de uma
66
+
escrita em `satp`
67
+
- Só levanta uma busca que falhou (palavra inválida, erro de barramento, page fault de instrução) se essa
68
+
instrução chegar aqui: o front end corre à frente dos desvios, e uma busca num caminho que o programa
69
+
nunca toma — depois do último `ret`, por exemplo — é descartada sem deixar rastro. Um page fault entra no
70
+
tratador de trap
71
+
- Um `ecall` que precisa esperar — por uma linha de entrada, ou em `screen_sleep_ms` — não é retirado: fica
72
+
estacionado e executa de novo quando a execução continua, exatamente como no modo sequencial
62
73
- Conta a instrução como retirada apenas aqui
63
74
64
75
---
@@ -170,26 +181,18 @@ Marcadores visuais:
170
181
171
182
## Modelo de execução
172
183
173
-
A configuração do pipeline atualmente expõe dois modelos de execução:
184
+
A configuração do pipeline expõe quatro modelos de execução (`mode=` na seção `[pipeline]` de um arquivo de configuração):
174
185
175
-
-`Serialized`
176
-
-`Parallel UFs`
186
+
| Modo | Tag na configuração | O que modela |
187
+
|---|---|---|
188
+
|`Serialized`|`Serialized`| Uma instrução em `EX` por vez. Uma instrução de longa latência ocupa o `EX` pela latência configurada e a frente do pipeline espera atrás dela. |
189
+
|`Parallel UFs`|`ParallelUFs`| O `ID` despacha para o banco de unidades funcionais (ALU, MUL, DIV, FPU, LSU, SYS, cada uma com um número configurável de instâncias), então instruções independentes se sobrepõem em unidades diferentes. A emissão e a retirada continuam em ordem de programa. Loads e stores — incluindo `flw`/`fsw` — passam pela LSU e pelo `MEM`. |
190
+
|`Scoreboard`|`Scoreboard`| Escalonamento dinâmico ao estilo do CDC 6600, sem renomeação: um WAW para na emissão e um WAR é protegido na escrita do resultado. |
191
+
|`Tomasulo + ROB`|`TomasuloRob`| Estações de reserva com renomeação de registradores e um buffer de reordenação: a execução corre fora de ordem, o commit continua em ordem e as exceções continuam precisas. |
177
192
178
-
Ambos usam o mesmo painel de unidades funcionais na UI. A diferença é semântica, não cosmética.
193
+
Os quatro usam a mesma declaração de unidades funcionais e as mesmas latências (`CPIConfig`), então trocar de modelo muda o escalonamento, não a máquina. Em `Scoreboard` e `Tomasulo + ROB` uma instrução altera a máquina de uma vez, no commit, em ordem de programa — é isso que mantém as exceções precisas — e o front end recomeça depois de qualquer instrução que moveu o PC sem ser um desvio (um trap, `mret`, `sret`) e depois de toda instrução de sistema.
179
194
180
-
Na implementação atual, a execução ainda se comporta como um único caminho EX in-order, e `EX` pode permanecer ocupado por múltiplos ciclos dependendo da classe:
181
-
182
-
-`ALU`
183
-
-`MUL`
184
-
-`DIV`
185
-
-`LOAD`
186
-
-`STORE`
187
-
-`BRANCH`
188
-
-`JUMP`
189
-
-`SYSTEM`
190
-
-`FP`
191
-
192
-
Enquanto uma instrução de longa latência mantém o `EX` ocupado, a frente do pipeline permanece bloqueada e o Raven mantém esse estado visível sem deixar a latência de IF não relacionada progredir incorretamente. O painel de unidades funcionais decompõe essa latência por UF para que o usuário possa ver qual recurso está ativo e onde o paralelismo poderia existir quando o modelo de execução permitir.
195
+
Enquanto uma instrução de longa latência ocupa uma unidade, o painel mostra qual recurso está ocupado e por quanto tempo, para que o usuário veja onde existe paralelismo e qual modelo o aproveita.
Copy file name to clipboardExpand all lines: docs/pt-BR/virtual-memory.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -443,7 +443,7 @@ A instrução **`sfence.vma`** sinaliza pro hardware: "invalide as traduções c
443
443
-`sfence.vma rs1=x0, rs2=asid` → flush só o ASID dado.
444
444
-`sfence.vma rs1=vaddr, rs2=asid` → flush a entrada específica.
445
445
446
-
O Raven implementa `sfence.vma`como **flush total** nessa fase (`rs1`/`rs2`ignorados), o que é correto mas não otimizado. Escrever em `satp` também flusha, já que troca de tabela invalida tudo.
446
+
O Raven respeita o `rs1`: `sfence.vma`com `rs1 = x0` esvazia a TLB inteira e, com um registrador, descarta só as entradas que traduzem aquele endereço (em qualquer ASID — o `rs2`é ignorado, o que é correto, só menos seletivo). Escrever em `satp` também esvazia tudo, já que trocar de tabela invalida todas as traduções.
0 commit comments