The Sparta Modeling Framework
Loading...
Searching...
No Matches
Rename.hpp
1// <Rename.h> -*- C++ -*-
2
3
4#pragma once
5
6#include <string>
7
13#include "CoreTypes.hpp"
14#include "FlushManager.hpp"
15
16namespace core_example
17{
18
28 class Rename : public sparta::Unit
29 {
30 public:
33 {
34 public:
37 { }
38
39 PARAMETER(uint32_t, num_to_rename, 4, "Number of instructions to rename")
40 PARAMETER(uint32_t, rename_queue_depth, 10, "Number of instructions queued for rename")
41 };
42
50 const RenameParameterSet * p);
51
53 static const char name[];
54
55 private:
56 InstQueue uop_queue_;
57 sparta::DataInPort<InstGroup> in_uop_queue_append_ {&unit_port_set_, "in_uop_queue_append", 1};
58 sparta::DataOutPort<uint32_t> out_uop_queue_credits_ {&unit_port_set_, "out_uop_queue_credits"};
59 sparta::DataOutPort<InstGroup> out_dispatch_queue_write_ {&unit_port_set_, "out_dispatch_queue_write"};
60 sparta::DataInPort<uint32_t> in_dispatch_queue_credits_ {&unit_port_set_, "in_dispatch_queue_credits", sparta::SchedulingPhase::Tick, 0};
61
62 // For flush
64 {&unit_port_set_, "in_reorder_flush", sparta::SchedulingPhase::Flush, 1};
65
66 sparta::UniqueEvent<> ev_rename_insts_ {&unit_event_set_, "rename_insts", CREATE_SPARTA_HANDLER(Rename, renameInstructions_)};
67
68 const uint32_t num_to_rename_per_cycle_;
69 uint32_t credits_dispatch_ = 0;
70 bool stop_checking_db_access_ = false;
71
73 void sendInitialCredits_();
74
76 void creditsDispatchQueue_(const uint32_t &);
77
79 void decodedInstructions_(const InstGroup &);
80
82 void renameInstructions_();
83
85 void handleFlush_(const FlushManager::FlushingCriteria & criteria);
86
87 };
88}
File that defines Data[In,Out]Port<DataT>
A set of sparta::Parameters per sparta::ResourceTreeNode.
#define PARAMETER(type, name, def, doc)
Parameter declaration.
#define CREATE_SPARTA_HANDLER(clname, meth)
Basic Node framework in sparta device tree composite pattern.
File that defines the UniqueEvent class.
File that defines the Unit class, a common grouping of sets and loggers.
Parameters for Rename model.
Definition Rename.hpp:33
static const char name[]
Name of this resource. Required by sparta::UnitFactory.
Definition Rename.hpp:53
DataInPort receives data from sender using a DataOutPort.
Definition DataPort.hpp:289
DataOutPort is used for transferring any data to another module.
Definition DataPort.hpp:77
Generic container of Parameters.
Node in a composite tree representing a sparta Tree item.
Definition TreeNode.hpp:205
A type of Event that uniquely schedules itself on the schedule within a single time quantum....
The is the base class for user defined blocks in simulation.
Definition Unit.hpp:38
sparta::EventSet unit_event_set_
The Unit's event set.
Definition Unit.hpp:114
sparta::PortSet unit_port_set_
The Unit's Ports.
Definition Unit.hpp:111
@ Tick
Most operations (combinational logic) occurs in this phase.
@ Flush
Phase where flushing of pipelines, etc can occur.