16#include "sparta/log/MessageSource.hpp"
17#include "sparta/statistics/Counter.hpp"
18#include "sparta/statistics/ContextCounter.hpp"
19#include "sparta/statistics/WeightedContextCounter.hpp"
21#include "CoreTypes.hpp"
22#include "FlushManager.hpp"
46 PARAMETER(uint32_t, num_to_dispatch, 3,
"Number of instructions to dispatch")
47 PARAMETER(uint32_t, dispatch_queue_depth, 10,
"Depth of the dispatch buffer")
48 PARAMETER(std::vector<double>, context_weights, std::vector<double>(1,1),
49 "Relative weight of each context")
95 const uint32_t num_to_dispatch_;
96 uint32_t credits_rob_ = 0;
97 uint32_t credits_fpu_ = 0;
98 uint32_t credits_alu0_ = 0;
99 uint32_t credits_alu1_ = 0;
100 uint32_t credits_br_ = 0;
101 uint32_t credits_lsu_ = 0;
104 void sendInitialCredits_();
107 void fpuCredits_ (
const uint32_t&);
108 void alu0Credits_(
const uint32_t&);
109 void alu1Credits_(
const uint32_t&);
110 void brCredits_(
const uint32_t&);
111 void lsuCredits_ (
const uint32_t&);
112 void robCredits_(
const uint32_t&);
115 void dispatchQueueAppended_(
const InstGroup &);
116 void dispatchInstructions_();
119 void handleFlush_(
const FlushManager::FlushingCriteria & criteria);
134 StallReason current_stall_ = NOT_STALLED;
138 std::array<sparta::CycleCounter, N_STALL_REASONS> stall_counters_{{
140 "Dispatch not stalled, all instructions dispatched",
143 "No credits from ROB",
163 static_cast<uint32_t
>(ExampleInst::TargetUnit::N_TARGET_UNITS)>
164 unit_distribution_ {{
184 "count_insts_per_unit",
185 "Unit distributions",
186 static_cast<uint32_t
>(ExampleInst::TargetUnit::N_TARGET_UNITS),
187 "dispatch_inst_count",
198 "weighted_count_insts_per_unit",
199 "Weighted unit distributions",
200 static_cast<uint32_t
>(ExampleInst::TargetUnit::N_TARGET_UNITS),
211 "context_count_alu0_insts",
212 "ALU0 instruction count",
214 "dispatch_alu0_inst_count",
221 "Total number of instructions dispatched",
222 getStatisticSet(),
"count_alu0_insts + count_alu1_insts + count_fpu_insts + count_lsu_insts"
File that defines Data[In,Out]Port<DataT>
A set of sparta::Parameters per sparta::ResourceTreeNode.
#define PARAMETER(type, name, def, doc)
Parameter declaration.
File that defines the SignalInPort.
File that defines the SingleCycleUniqueEvent class.
#define CREATE_SPARTA_HANDLER(clname, meth)
Basic Node framework in sparta device tree composite pattern.
File that defines the Unit class, a common grouping of sets and loggers.
Parameters for Dispatch model.
static const char name[]
Name of this resource. Required by sparta::UnitFactory.
A container type that allows a modeler to build, store, and charge counts to a specific context.
@ COUNT_NORMAL
Counter counts the number of times something happens like one would expect. This is a weakly monotoni...
Represents a counter of type counter_type (uint64_t). 2 and greater than 0 with a ceiling specified....
Represents a cycle counter.
DataInPort receives data from sender using a DataOutPort.
DataOutPort is used for transferring any data to another module.
@ VIS_NORMAL
Normal visibility (default)
Generic container of Parameters.
const Clock * getClock() const
An event that can only be schedule one cycle into the future.
Contains a statistic definition (some useful information which can be computed)
Node in a composite tree representing a sparta Tree item.
The is the base class for user defined blocks in simulation.
sparta::EventSet unit_event_set_
The Unit's event set.
sparta::PortSet unit_port_set_
The Unit's Ports.
StatisticSet * getStatisticSet()
Return the stat set.
This is an example context counter subclass used to show how users may supply their own "aggregated v...
@ Tick
Most operations (combinational logic) occurs in this phase.
@ Flush
Phase where flushing of pipelines, etc can occur.