summaryrefslogtreecommitdiff
path: root/cpu.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpu.h')
-rw-r--r--cpu.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/cpu.h b/cpu.h
new file mode 100644
index 0000000..5ef45a0
--- /dev/null
+++ b/cpu.h
@@ -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
18struct 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 = &regfile.instp;
31 dram_arbiter.outp = &dram.commandp;
32 exec.loadp = &dram_arbiter.peerp[1];
33 exec.writebackp = &regfile.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};