diff options
| author | Julian Blake Kongslie | 2022-09-22 11:29:07 -0700 |
|---|---|---|
| committer | Julian Blake Kongslie | 2022-09-22 11:29:07 -0700 |
| commit | eb3fd68203fee7c63245c702914c2acd3332d65a (patch) | |
| tree | 7796707c0372e7fbe4a8bac70aad95f619e8ba29 /cpu.h | |
| download | procmodel-eb3fd68203fee7c63245c702914c2acd3332d65a.tar.xz | |
Initial commit.
Diffstat (limited to '')
| -rw-r--r-- | cpu.h | 40 |
1 files changed, 40 insertions, 0 deletions
| @@ -0,0 +1,40 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include <cstdint> | ||
| 4 | #include <cstring> | ||
| 5 | #include <optional> | ||
| 6 | |||
| 7 | #include "backend/exec.h" | ||
| 8 | #include "backend/regfile.h" | ||
| 9 | #include "frontend/decode.h" | ||
| 10 | #include "frontend/fetch.h" | ||
| 11 | #include "infra/arbiter.h" | ||
| 12 | #include "infra/pipetrace.h" | ||
| 13 | #include "infra/queue.h" | ||
| 14 | #include "infra/sim.h" | ||
| 15 | #include "inst.h" | ||
| 16 | #include "memory/dram.h" | ||
| 17 | |||
| 18 | struct cpu { | ||
| 19 | backend::exec exec; | ||
| 20 | backend::regfile regfile; | ||
| 21 | frontend::decode decode; | ||
| 22 | frontend::fetch fetch; | ||
| 23 | infra::priority_arbiter<memory::dram::command, 3> dram_arbiter; | ||
| 24 | infra::queue<inst, 4> decodeq; | ||
| 25 | memory::dram dram; | ||
| 26 | |||
| 27 | cpu() { | ||
| 28 | decode.fetch_restartp = &fetch.restartp; | ||
| 29 | decode.instp = &decodeq.input; | ||
| 30 | decodeq.output = ®file.instp; | ||
| 31 | dram_arbiter.outp = &dram.commandp; | ||
| 32 | exec.loadp = &dram_arbiter.peerp[1]; | ||
| 33 | exec.writebackp = ®file.writebackp; | ||
| 34 | fetch.bundlep = &decode.bundlep; | ||
| 35 | fetch.commandp = &dram_arbiter.peerp[2]; | ||
| 36 | regfile.decode_restartp = &decode.restartp; | ||
| 37 | regfile.execp = &exec.execp; | ||
| 38 | regfile.storep = &dram_arbiter.peerp[0]; | ||
| 39 | } | ||
| 40 | }; | ||
