orca-sim
Public Member Functions | Private Attributes | List of all members
NetworkTile Class Reference

This file is part of project URSA. More...

#include <NetworkTile.h>

Inheritance diagram for NetworkTile:
Tile

Public Member Functions

 NetworkTile (uint32_t x, uint32_t y)
 This file is part of project URSA. More...
 
 ~NetworkTile ()
 
NetBridge * GetSocket ()
 
std::string ToString ()
 
HermesRouter * GetRouter ()
 Get current router of the PE. More...
 
Signal< uint32_t > * GetSignalId ()
 Get current signal for tile ID. More...
 
std::string GetName ()
 Get current tile name. More...
 
void SetName (std::string)
 Set a name to this tile. More...
 

Private Attributes

std::string _name
 
NetBridge * _socket
 

Detailed Description

This file is part of project URSA.

More information on the project can be found at URSA's repository at GitHub

http://https://github.com/andersondomingues/ursa

Copyright (C) 2018 Anderson Domingues, ti.an.nosp@m.ders.nosp@m.ondom.nosp@m.ingu.nosp@m.es@gm.nosp@m.ail..nosp@m.com

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Definition at line 45 of file NetworkTile.h.

Constructor & Destructor Documentation

§ NetworkTile()

NetworkTile::NetworkTile ( uint32_t  x,
uint32_t  y 
)

This file is part of project URSA.

More information on the project can be found at URSA's repository at GitHub

http://https://github.com/andersondomingues/ursa

Copyright (C) 2018 Anderson Domingues, ti.an.nosp@m.ders.nosp@m.ondom.nosp@m.ingu.nosp@m.es@gm.nosp@m.ail..nosp@m.com

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Default constructor. Instantiate and bind internal hardware to each other.

Definition at line 38 of file NetworkTile.cpp.

38  : Tile(x, y){
39 
40  //update naming of internal hardware parts (from internal class)
41  this->GetRouter()->SetName(this->GetName() + ".router");
42 
43  //peripherals
44  _socket = new NetBridge(this->GetName() + ".bridge");
45 
46  _socket->SetOutputBuffer(this->GetRouter()->GetInputBuffer(LOCAL));
47  this->GetRouter()->SetOutputBuffer(_socket->GetInputBuffer(), LOCAL);
48 }
NetBridge * _socket
Definition: NetworkTile.h:50
#define LOCAL
std::string GetName()
Get current tile name.
Definition: Tile.cpp:92
HermesRouter * GetRouter()
Get current router of the PE.
Definition: Tile.cpp:83
Tile(uint32_t x, uint32_t y)
This file is part of project URSA.
Definition: Tile.cpp:38

§ ~NetworkTile()

NetworkTile::~NetworkTile ( )

Definition at line 50 of file NetworkTile.cpp.

50  {
51 
52  delete(_socket);
53 }
NetBridge * _socket
Definition: NetworkTile.h:50

Member Function Documentation

§ GetName()

std::string Tile::GetName ( )
inherited

Get current tile name.

Returns
The name of the tile

Definition at line 92 of file Tile.cpp.

92  {
93  return _name;
94 }
std::string _name
Definition: Tile.h:48

§ GetRouter()

HermesRouter * Tile::GetRouter ( )
inherited

Get current router of the PE.

Returns
A pointer to the instance of router

Definition at line 83 of file Tile.cpp.

83  {
84  return _router;
85 }
HermesRouter * _router
Definition: Tile.h:50

§ GetSignalId()

Signal< uint32_t > * Tile::GetSignalId ( )
inherited

Get current signal for tile ID.

Returns
A pointer to the instance of signal

Definition at line 100 of file Tile.cpp.

100  {
101  return _signal_id;
102 }
Signal< uint32_t > * _signal_id
Definition: Tile.h:51

§ GetSocket()

NetBridge * NetworkTile::GetSocket ( )

Definition at line 55 of file NetworkTile.cpp.

55  {
56  return _socket;
57 }
NetBridge * _socket
Definition: NetworkTile.h:50

§ SetName()

void Tile::SetName ( std::string  name)
inherited

Set a name to this tile.

Parameters
nameName to be given to the tile. Please note that the name is autogenerated in accordance to the structure of the tile, so updating the name of the tile may not reflect on the naming of internal structures (to fix)

Definition at line 112 of file Tile.cpp.

112  {
113  _name = name;
114 }
std::string _name
Definition: Tile.h:48

§ ToString()

std::string NetworkTile::ToString ( )

Definition at line 59 of file NetworkTile.cpp.

59  {
60  stringstream ss;
61  ss << _name << "={" << _socket->GetName()
62  << ", " << this->GetRouter()->GetName() << "}";
63 
64  return ss.str();
65 }
NetBridge * _socket
Definition: NetworkTile.h:50
std::string _name
Definition: NetworkTile.h:49
HermesRouter * GetRouter()
Get current router of the PE.
Definition: Tile.cpp:83

Member Data Documentation

§ _name

std::string NetworkTile::_name
private

Definition at line 49 of file NetworkTile.h.

§ _socket

NetBridge* NetworkTile::_socket
private

Definition at line 50 of file NetworkTile.h.


The documentation for this class was generated from the following files: