From a2c9de8fcc63a954b6486846b80c402a85d956ca Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Fri, 11 Nov 2022 16:29:22 -0800 Subject: Multi-word fetch bundles and icache with realistic dram latency --- uarch/core.h | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'uarch/core.h') diff --git a/uarch/core.h b/uarch/core.h index 0f9be74..a6772f3 100644 --- a/uarch/core.h +++ b/uarch/core.h @@ -2,11 +2,14 @@ #include +#include "infra/arbiter.h" #include "infra/pipetrace.h" #include "infra/port.h" #include "io/model.h" #include "isa/checker.h" #include "isa/isa.h" +#include "memory/cache.h" +#include "memory/dram.h" struct core; @@ -14,7 +17,7 @@ struct fetch_bundle { infra::transaction tr; unsigned int gen; unsigned int pc; - unsigned int word; + memory::line data; }; struct fetch_restart { @@ -26,9 +29,12 @@ struct fetch_restart { struct fetch_stage : public infra::sim { core &c; + memory::inline_cache<8, 2> cache; + unsigned int gen = 0; unsigned int pc; bool didrestart = false; + bool outstandingfill = false; fetch_stage(core &c); @@ -49,6 +55,7 @@ struct decode_stage : public infra::sim { std::array ctlregs; std::uint64_t icount; instruction_context inst; + bool outstandingfill = false; decode_stage(core &c); @@ -58,11 +65,20 @@ struct decode_stage : public infra::sim { struct core { iomodel &system; funcchecker checker; - funcmem mem; + memory::dram mem{12}; + infra::port mem_commandp; + + infra::priority_arbiter mem_command_arb; + + infra::port fetch_mem_commandp; + infra::port fetch_mem_responsep; infra::port fetch_bundlep; std::optional fetch_restarto; + infra::port decode_mem_commandp; + infra::port decode_mem_responsep; + // Construction order is execution order within a cycle, so this list should be back-to-front (for zero-cycle restarts) decode_stage decode{*this}; fetch_stage fetch{*this}; @@ -70,5 +86,10 @@ struct core { core(iomodel &model) : system(model) , checker(model) - { } + { + mem.commandp = &mem_commandp; + mem_command_arb.outp = &mem_commandp; + mem_command_arb.peerp[0] = &decode_mem_commandp; + mem_command_arb.peerp[1] = &fetch_mem_commandp; + } }; -- cgit v1.2.3