OpenASIP  2.0
Public Member Functions | Public Attributes | Private Member Functions | List of all members
BlocksLSU Class Reference

#include <BlocksLSU.hh>

Inheritance diagram for BlocksLSU:
Inheritance graph
Collaboration diagram for BlocksLSU:
Collaboration graph

Public Member Functions

 BlocksLSU (TTAMachine::Machine &mach, const std::string &name, std::list< std::string > sources, TTAMachine::AddressSpace &asData, std::shared_ptr< TTAMachine::Socket > in1sock, std::shared_ptr< TTAMachine::Socket > in2sock)
 
 ~BlocksLSU ()
 

Public Attributes

TTAMachine::FunctionUnitlsu
 
- Public Attributes inherited from BlocksFU
std::vector< TTAMachine::HWOperation * > ops
 
TTAMachine::FunctionUnitfu
 
TTAMachine::FUPortin1
 
TTAMachine::FUPortin2
 
TTAMachine::FUPortout
 
std::shared_ptr< TTAMachine::Socketin1sock
 
std::shared_ptr< TTAMachine::Socketin2sock
 
TTAMachine::Socketoutsock
 
std::list< std::string > sources
 
std::string name
 

Private Member Functions

void ConfigurePipeline (TTAMachine::ExecutionPipeline *pipeline, bool isLoadOp)
 
void BindPorts (TTAMachine::HWOperation *hwOp, bool isLoadOp)
 
TTAMachine::HWOperationCreateHWLoadOp (const std::string &name)
 
TTAMachine::HWOperationCreateHWStoreOp (const std::string &name)
 

Additional Inherited Members

- Protected Member Functions inherited from BlocksFU
 BlocksFU (TTAMachine::Machine &mach, const std::string &name, std::list< std::string > sources, std::shared_ptr< TTAMachine::Socket > in1sock, std::shared_ptr< TTAMachine::Socket > in2sock)
 
 ~BlocksFU ()
 

Detailed Description

Definition at line 41 of file BlocksLSU.hh.

Constructor & Destructor Documentation

◆ BlocksLSU()

BlocksLSU::BlocksLSU ( TTAMachine::Machine mach,
const std::string &  name,
std::list< std::string >  sources,
TTAMachine::AddressSpace asData,
std::shared_ptr< TTAMachine::Socket in1sock,
std::shared_ptr< TTAMachine::Socket in2sock 
)

BlocksLSU with default instructions

Parameters
machThe TTA machine where the LSU needs to be added.
nameThe name of the LSU.
sourcesA list of sources that are attached to this unit's input.
asDataThe address space containing the program data.
in1sock(shared) pointer to the TTA socket for in1 input port.
in2sock(shared) pointer to the TTA socket for in2 input port.

Definition at line 47 of file BlocksLSU.cc.

52  // Function unit and ports
53  lsu = this->fu;
54  // Set adress space to data
55  lsu->setAddressSpace(&asData);
56 
57  // HWOps
58  ops.push_back(CreateHWLoadOp("ld32"));
59  ops.push_back(CreateHWLoadOp("ldu16"));
60  ops.push_back(CreateHWLoadOp("ldu8"));
61  ops.push_back(CreateHWStoreOp("st16"));
62  ops.push_back(CreateHWStoreOp("st8"));
63  ops.push_back(CreateHWStoreOp("st32"));
64  ops.push_back(CreateHWLoadOp("copy"));
65 }

References CreateHWLoadOp(), CreateHWStoreOp(), BlocksFU::fu, lsu, BlocksFU::ops, and TTAMachine::FunctionUnit::setAddressSpace().

Here is the call graph for this function:

◆ ~BlocksLSU()

BlocksLSU::~BlocksLSU ( )
inline

Definition at line 49 of file BlocksLSU.hh.

49  {
50  while (!ops.empty()) {
51  delete ops.back();
52  ops.pop_back();
53  }
54  }

References BlocksFU::ops.

Member Function Documentation

◆ BindPorts()

void BlocksLSU::BindPorts ( TTAMachine::HWOperation hwOp,
bool  isLoadOp 
)
private

Bind the operation's operands to FU ports.

Parameters
hwOpA pointer to the hardware operation of which the operands need to be binded to FU ports.
isLoadOpA boolean that indicates whether the operation given is a load operation(true) or store operation(false).

Definition at line 132 of file BlocksLSU.cc.

132  {
133  if (isLoadOp) { // Load operation
134  hwOp->bindPort(1, *in1); // Memory address to read
135  hwOp->bindPort(2, *out); // Data
136  } else { // Store operation
137  hwOp->bindPort(1, *in1); // Memory address to write
138  hwOp->bindPort(2, *in2); // Data to write
139  }
140 }

References TTAMachine::HWOperation::bindPort(), BlocksFU::in1, BlocksFU::in2, and BlocksFU::out.

Referenced by CreateHWLoadOp(), and CreateHWStoreOp().

Here is the call graph for this function:

◆ ConfigurePipeline()

void BlocksLSU::ConfigurePipeline ( TTAMachine::ExecutionPipeline pipeline,
bool  isLoadOp 
)
private

Configure the operation pipeline.

Parameters
pipelineA pointer to the execution pipeline of the operation of which the pipeline needs to be configured.
isLoadOpA boolean that indicates whether the operation given is a load operation(true) or store operation(false).

Definition at line 151 of file BlocksLSU.cc.

152  {
153  if (isLoadOp) {
154  pipeline->addPortRead(1, 0, 1);
155  pipeline->addPortWrite(2, 0, 1);
156  } else {
157  pipeline->addPortRead(1, 0, 1);
158  pipeline->addPortRead(2, 0, 1);
159  }
160 }

References TTAMachine::ExecutionPipeline::addPortRead(), and TTAMachine::ExecutionPipeline::addPortWrite().

Referenced by CreateHWLoadOp(), and CreateHWStoreOp().

Here is the call graph for this function:

◆ CreateHWLoadOp()

HWOperation * BlocksLSU::CreateHWLoadOp ( const std::string &  name)
private

Creates a hardware load operation.

Parameters
nameThe name of the hardware operation. This needs to exactly match the name in OSEd.

Definition at line 103 of file BlocksLSU.cc.

103  {
104  HWOperation* op = new HWOperation(name, *lsu);
105  BindPorts(op, true);
106  ConfigurePipeline(op->pipeline(), true);
107  return op;
108 }

References BindPorts(), ConfigurePipeline(), lsu, BlocksFU::name, and TTAMachine::HWOperation::pipeline().

Referenced by BlocksLSU().

Here is the call graph for this function:

◆ CreateHWStoreOp()

HWOperation * BlocksLSU::CreateHWStoreOp ( const std::string &  name)
private

Creates a hardware store operation.

Parameters
nameThe name of the hardware operation. This needs to exactly match the name in OSEd.

Definition at line 116 of file BlocksLSU.cc.

116  {
117  HWOperation* op = new HWOperation(name, *lsu);
118  BindPorts(op, false);
119  ConfigurePipeline(op->pipeline(), false);
120  return op;
121 }

References BindPorts(), ConfigurePipeline(), lsu, BlocksFU::name, and TTAMachine::HWOperation::pipeline().

Referenced by BlocksLSU().

Here is the call graph for this function:

Member Data Documentation

◆ lsu

TTAMachine::FunctionUnit* BlocksLSU::lsu

Definition at line 43 of file BlocksLSU.hh.

Referenced by BlocksLSU(), CreateHWLoadOp(), and CreateHWStoreOp().


The documentation for this class was generated from the following files:
BlocksLSU::ConfigurePipeline
void ConfigurePipeline(TTAMachine::ExecutionPipeline *pipeline, bool isLoadOp)
Definition: BlocksLSU.cc:151
BlocksFU::ops
std::vector< TTAMachine::HWOperation * > ops
Definition: BlocksFU.hh:59
BlocksFU::in1
TTAMachine::FUPort * in1
Definition: BlocksFU.hh:61
TTAMachine::HWOperation
Definition: HWOperation.hh:52
TTAMachine::HWOperation::bindPort
virtual void bindPort(int operand, const FUPort &port)
Definition: HWOperation.cc:269
BlocksFU::fu
TTAMachine::FunctionUnit * fu
Definition: BlocksFU.hh:60
BlocksFU::in2sock
std::shared_ptr< TTAMachine::Socket > in2sock
Definition: BlocksFU.hh:65
BlocksFU::out
TTAMachine::FUPort * out
Definition: BlocksFU.hh:63
TTAMachine::ExecutionPipeline::addPortRead
void addPortRead(int operand, int start, int duration)
Definition: ExecutionPipeline.cc:141
TTAMachine::FunctionUnit::setAddressSpace
virtual void setAddressSpace(AddressSpace *as)
Definition: FunctionUnit.cc:594
BlocksFU::sources
std::list< std::string > sources
Definition: BlocksFU.hh:67
BlocksFU::BlocksFU
BlocksFU(TTAMachine::Machine &mach, const std::string &name, std::list< std::string > sources, std::shared_ptr< TTAMachine::Socket > in1sock, std::shared_ptr< TTAMachine::Socket > in2sock)
Definition: BlocksFU.cc:43
BlocksLSU::lsu
TTAMachine::FunctionUnit * lsu
Definition: BlocksLSU.hh:43
BlocksFU::name
std::string name
Definition: BlocksFU.hh:68
BlocksLSU::CreateHWLoadOp
TTAMachine::HWOperation * CreateHWLoadOp(const std::string &name)
Definition: BlocksLSU.cc:103
TTAMachine::HWOperation::pipeline
ExecutionPipeline * pipeline() const
Definition: HWOperation.cc:201
TTAMachine::ExecutionPipeline::addPortWrite
void addPortWrite(int operand, int start, int duration)
Definition: ExecutionPipeline.cc:167
BlocksFU::in2
TTAMachine::FUPort * in2
Definition: BlocksFU.hh:62
BlocksLSU::CreateHWStoreOp
TTAMachine::HWOperation * CreateHWStoreOp(const std::string &name)
Definition: BlocksLSU.cc:116
BlocksLSU::BindPorts
void BindPorts(TTAMachine::HWOperation *hwOp, bool isLoadOp)
Definition: BlocksLSU.cc:132
BlocksFU::in1sock
std::shared_ptr< TTAMachine::Socket > in1sock
Definition: BlocksFU.hh:64