41 std::string HermesRouter::GetPortName(
int port) {
43 case SOUTH:
return "SOUTH";
44 case NORTH:
return "NORTH";
45 case WEST:
return "WEST";
46 case EAST:
return "EAST";
47 default:
return "LOCAL";
64 for (
int i = 0; i < 5; i++) {
70 #ifdef ROUTER_ENABLE_COUNTERS 73 _counter_active =
new Signal<uint32_t>(
GetName() +
".counters.active");
83 #ifdef ROUTER_ENABLE_COUNTERS 84 delete _counter_active;
87 for (
int i = 0; i < 5; i++)
94 for (
int i = 0; i < 5; i++) {
120 for (
int i = 0; i < 5; i++) {
137 for (
int i = 0; i < 5; i++) {
141 #ifdef ROUTER_PORT_CONNECTED_CHECKING 144 ss << this->
GetName() <<
": unable to route to unknown port" 146 std::runtime_error(ss.str());
149 if (
_ib[i] ==
nullptr) {
151 ss << this->
GetName() <<
": unable to route from unknown port" 153 std::runtime_error(ss.str());
180 #ifdef ROUTER_ENABLE_COUNTERS 194 #ifdef ROUTER_ENABLE_COUNTERS 196 _counter_active->Inc(1);
203 #ifdef ROUTER_ENABLE_COUNTERS 204 Signal<uint32_t>* TRouter::GetSignalCounterActive() {
205 return this->_counter_active;
250 std::stringstream ss;
253 for (
int i = 0; i < 5; i++) {
254 if (
_ob[i] !=
nullptr)
255 ss <<
"{" <<
_ob[i]->GetName() <<
"} ";
SimulationTime Run()
Implementation of the Process' interface.
std::string GetPortName(int port)
Get the name of the port of id equals to <port>
Buffer< FlitType > * GetOutputBuffer(uint32_t p)
Get a pointer to one of the output buffers.
void push(T)
Pushes an object to the back of the buffer.
void Reset()
Resets the instance to its starting state.
This class models a TimedModel.
void SetOutputBuffer(Buffer< FlitType > *b, uint32_t port)
int16_t _switch_control[5]
T top()
Peeks at the top of the buffer.
HermesRouter(std::string name, uint32_t x_pos, uint32_t y_pos)
Ctor.
Buffer< FlitType > * _ib[5]
std::string GetName()
Getter method for the <_name> field.
int16_t _flits_to_send[5]
Buffer< FlitType > * _ob[5]
uint32_t size()
Counts elements from the buffer.
Buffer< FlitType > * GetInputBuffer(uint32_t p)
void pop()
Removes the object at the front of the buffer.
uint32_t GetRouteXY(FlitType flit)
return this