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

#include <Tile.h>

Inheritance diagram for Tile:
NetworkTile ProcessingTile

Public Member Functions

 Tile (uint32_t x, uint32_t y)
 This file is part of project URSA. More...
 
 ~Tile ()
 Destructor: cleans up allocated memory. More...
 
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
 
HermesRouter * _router
 
Signal< uint32_t > * _signal_id
 

Detailed Description

Definition at line 44 of file Tile.h.

Constructor & Destructor Documentation

§ Tile()

Tile::Tile ( 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. Initialize internal entities and binds hardware wires

Parameters
xX-coordinate of the tile in the NoC
yY-coordinate of the tile in the NoC

Definition at line 38 of file Tile.cpp.

38  {
39 
40  //map id wire to memory (local storage)
41  uint32_t id = (ORCA_NOC_WIDTH * y) + x;
42 
43  stringstream ss;
44  ss << std::setw(3) << std::setfill('0') << id;
45 
46  _name = ss.str();
47 
48  _signal_id = new Signal<uint32_t>(MAGIC_TILE_ID, this->GetName() + ".id");
49  _signal_id->Write(id);
50 
51  //peripherals
52  _router = new HermesRouter(this->GetName() + ".router", x, y);
53 }
#define MAGIC_TILE_ID
Definition: _MemoryMap.h:28
std::string _name
Definition: Tile.h:48
HermesRouter * _router
Definition: Tile.h:50
void Write(T val)
Writes some value to the bus.
Definition: Signal.cpp:127
std::string GetName()
Get current tile name.
Definition: Tile.cpp:92
Signal< uint32_t > * _signal_id
Definition: Tile.h:51

§ ~Tile()

Tile::~Tile ( )

Destructor: cleans up allocated memory.

Definition at line 58 of file Tile.cpp.

58  {
59 
60  delete(_signal_id);
61 
62  //delete hardware modules
63  delete(_router);
64 
65 }
HermesRouter * _router
Definition: Tile.h:50
Signal< uint32_t > * _signal_id
Definition: Tile.h:51

Member Function Documentation

§ GetName()

std::string Tile::GetName ( )

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 ( )

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 ( )

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

§ SetName()

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

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

Member Data Documentation

§ _name

std::string Tile::_name
private

Definition at line 48 of file Tile.h.

§ _router

HermesRouter* Tile::_router
private

Definition at line 50 of file Tile.h.

§ _signal_id

Signal<uint32_t>* Tile::_signal_id
private

Definition at line 51 of file Tile.h.


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