CGRA-ME
ModuleFPUnit.h
Go to the documentation of this file.
1 #ifndef __FPUNITMODULES__H__
2 #define __FPUNITMODULES__H__
3 
4 #include <CGRA/Module.h>
5 
6 class FPAdd: public Module
7 {
8  public:
9  FPAdd(std::string name, Location, unsigned size); //module definition
10  virtual ~FPAdd(); //class destructor
11  virtual std::string GenericName() override; //generates generic name for adder
12  virtual nlohmann::json CoreIRGenFunctionality() override; //generates functionality for adder
13 };
14 
15 class FPMult: public Module
16 {
17  public:
18  FPMult(std::string name, Location, unsigned size); //module definition
19  virtual ~FPMult(); //class destructor
20  virtual std::string GenericName() override; //generates generic name for multiplier
21  virtual nlohmann::json CoreIRGenFunctionality() override; //generates functionality for multiplier
22 };
23 
24 class FPDiv: public Module
25 {
26  public:
27  FPDiv(std::string name, Location, unsigned size); //module definition
28  virtual ~FPDiv(); //class destructor
29  virtual std::string GenericName() override; //generates generic name for divider
30  virtual nlohmann::json CoreIRGenFunctionality() override; //generates functionality for divider
31 };
32 
33 class FPSqrt: public Module
34 {
35  public:
36  FPSqrt(std::string name, Location, unsigned size); //module definition
37  virtual ~FPSqrt(); //class destructor
38  virtual std::string GenericName() override; //generates generic name for sqrt
39  virtual nlohmann::json CoreIRGenFunctionality() override; //generates functionality for sqrt
40 };
41 
43 {
44  public:
45  InputIEEE2FloPoCo(std::string name, Location, unsigned size); //module definition
46  virtual ~InputIEEE2FloPoCo(); //class destructor
47  virtual std::string GenericName() override; //generates generic name for input
48  virtual nlohmann::json CoreIRGenFunctionality() override; //generates functionality for input
49 };
50 
52 {
53  public:
54  OutputFloPoCo2IEEE(std::string name, Location, unsigned size); //module definition
55  virtual ~OutputFloPoCo2IEEE(); //class destructor
56  virtual std::string GenericName() override; //generates generic name for output
57  virtual nlohmann::json CoreIRGenFunctionality() override; //generates functionality for output
58 };
59 
61 {
62  public:
63  OutputConvert2Int(std::string name, Location, unsigned size, std::vector<OpGraphOpCode> supported_modes); //module definition
64  virtual ~OutputConvert2Int(); //class destructor
65  virtual std::string GenericName() override; //generates generic name for OutputSelect
66  virtual nlohmann::json CoreIRGenFunctionality() override; //generates functionality for OutputSelect
67  MRRG* createMRRG(unsigned II) override; //creates Modulo Routing Resource Graph
68  static const std::map<OpGraphOpCode, LLVMMode> all_modes;
69  auto& getSupportedModes() const { return supported_modes; }
70  protected:
71  unsigned size;
72  std::vector<OpGraphOpCode> supported_modes;
73 };
74 
75 class OutputConvert2FP: public Module
76 {
77  public:
78  OutputConvert2FP(std::string name, Location, unsigned size, std::vector<OpGraphOpCode> supported_modes); //module definition
79  virtual ~OutputConvert2FP(); //class destructor
80  virtual std::string GenericName() override; //generates generic name for OutputSelect
81  virtual nlohmann::json CoreIRGenFunctionality() override; //generates functionality for OutputSelect
82  MRRG* createMRRG(unsigned II) override; //creates Modulo Routing Resource Graph
83  static const std::map<OpGraphOpCode, LLVMMode> all_modes;
84  auto& getSupportedModes() const { return supported_modes; }
85  protected:
86  unsigned size;
87  std::vector<OpGraphOpCode> supported_modes;
88 };
89 
90 
91 class FPUnit: public Module
92 {
93  public:
94  FPUnit(std::string name, Location, std::vector<OpGraphOpCode> supported_modes, unsigned size, int II, int latency); //module definition
95  virtual ~FPUnit(); //class destructor
96  virtual MRRG* createMRRG(unsigned II) override; //creates Modulo Routing Resource Graph
97  virtual BitConfig getBitConfig(
98  const MRRG& mrrg, const OpGraph & og,
99  const Mapping& map,
100  const ConfigCell& ccell,
101  const MRRGNodesFromOpNode& mrrg_nodes_from_op_node,
102  const MRRGNodesFromValNode& mrrg_nodes_from_val_node
103  ) const override;
104  virtual std::string GenericName() override; // Generates a generic name for the module
105  int getII() const { return pipeline_mode.II; }
106  int getLatency() const { return pipeline_mode.latency; }
107  auto& getSupportedModes() const { return supported_modes; }
108  static const std::map<OpGraphOpCode, LLVMMode> all_modes;
109  protected:
111  std::vector<OpGraphOpCode> supported_modes;
112 };
113 #endif
FPDiv::GenericName
virtual std::string GenericName() override
Definition: ModuleFPUnit.cpp:237
BitConfig
Definition: BitSetting.h:58
OutputConvert2Int::all_modes
static const std::map< OpGraphOpCode, LLVMMode > all_modes
Definition: ModuleFPUnit.h:68
Module::name
std::string name
Definition: Module.h:341
ConfigCell
Definition: Module.h:825
OutputFloPoCo2IEEE::CoreIRGenFunctionality
virtual nlohmann::json CoreIRGenFunctionality() override
Definition: ModuleFPUnit.cpp:551
MRRG
Definition: MRRG.h:216
MRRGNodesFromOpNode
std::map< OpGraphOp *, std::set< MRRG::NodeDescriptor > > MRRGNodesFromOpNode
Definition: Module.h:146
Location
Definition: Module.h:156
OutputConvert2FP::supported_modes
std::vector< OpGraphOpCode > supported_modes
Definition: ModuleFPUnit.h:87
OutputFloPoCo2IEEE::OutputFloPoCo2IEEE
OutputFloPoCo2IEEE(std::string name, Location, unsigned size)
Definition: ModuleFPUnit.cpp:534
Module.h
FPUnit::getII
int getII() const
Definition: ModuleFPUnit.h:105
OutputConvert2FP::all_modes
static const std::map< OpGraphOpCode, LLVMMode > all_modes
Definition: ModuleFPUnit.h:83
FPDiv::CoreIRGenFunctionality
virtual nlohmann::json CoreIRGenFunctionality() override
Definition: ModuleFPUnit.cpp:243
FPUnit::~FPUnit
virtual ~FPUnit()
Definition: ModuleFPUnit.cpp:1154
FPAdd::FPAdd
FPAdd(std::string name, Location, unsigned size)
Definition: ModuleFPUnit.cpp:6
FPAdd::CoreIRGenFunctionality
virtual nlohmann::json CoreIRGenFunctionality() override
Definition: ModuleFPUnit.cpp:27
FPMult
Definition: ModuleFPUnit.h:15
InputIEEE2FloPoCo::InputIEEE2FloPoCo
InputIEEE2FloPoCo(std::string name, Location, unsigned size)
Definition: ModuleFPUnit.cpp:434
FPSqrt::~FPSqrt
virtual ~FPSqrt()
Definition: ModuleFPUnit.cpp:428
OutputConvert2FP::~OutputConvert2FP
virtual ~OutputConvert2FP()
Definition: ModuleFPUnit.cpp:777
FPMult::GenericName
virtual std::string GenericName() override
Definition: ModuleFPUnit.cpp:129
FPUnit::getSupportedModes
auto & getSupportedModes() const
Definition: ModuleFPUnit.h:107
FPUnit::all_modes
static const std::map< OpGraphOpCode, LLVMMode > all_modes
Definition: ModuleFPUnit.h:108
InputIEEE2FloPoCo
Definition: ModuleFPUnit.h:42
OutputConvert2Int::size
unsigned size
Definition: ModuleFPUnit.h:71
OutputConvert2FP::CoreIRGenFunctionality
virtual nlohmann::json CoreIRGenFunctionality() override
Definition: ModuleFPUnit.cpp:665
OutputConvert2Int
Definition: ModuleFPUnit.h:60
MRRGNodesFromValNode
std::map< OpGraphVal *, std::set< MRRG::NodeDescriptor > > MRRGNodesFromValNode
Definition: Module.h:147
PipelineMode::latency
int latency
Definition: Module.h:375
FPDiv::FPDiv
FPDiv(std::string name, Location, unsigned size)
Definition: ModuleFPUnit.cpp:223
PipelineMode::II
int II
Definition: Module.h:374
OutputConvert2Int::createMRRG
MRRG * createMRRG(unsigned II) override
Definition: ModuleFPUnit.cpp:955
InputIEEE2FloPoCo::~InputIEEE2FloPoCo
virtual ~InputIEEE2FloPoCo()
Definition: ModuleFPUnit.cpp:528
Mapping
Definition: Mapping.h:31
InputIEEE2FloPoCo::CoreIRGenFunctionality
virtual nlohmann::json CoreIRGenFunctionality() override
Definition: ModuleFPUnit.cpp:452
FPUnit::createMRRG
virtual MRRG * createMRRG(unsigned II) override
Definition: ModuleFPUnit.cpp:1158
FPSqrt::FPSqrt
FPSqrt(std::string name, Location, unsigned size)
Definition: ModuleFPUnit.cpp:331
FPMult::FPMult
FPMult(std::string name, Location, unsigned size)
Definition: ModuleFPUnit.cpp:115
FPAdd::GenericName
virtual std::string GenericName() override
Definition: ModuleFPUnit.cpp:21
OutputFloPoCo2IEEE
Definition: ModuleFPUnit.h:51
FPUnit::getLatency
int getLatency() const
Definition: ModuleFPUnit.h:106
FPDiv
Definition: ModuleFPUnit.h:24
FPUnit
Definition: ModuleFPUnit.h:91
OutputConvert2Int::~OutputConvert2Int
virtual ~OutputConvert2Int()
Definition: ModuleFPUnit.cpp:950
Module
Definition: Module.h:163
FPMult::CoreIRGenFunctionality
virtual nlohmann::json CoreIRGenFunctionality() override
Definition: ModuleFPUnit.cpp:135
OutputConvert2FP
Definition: ModuleFPUnit.h:75
PipelineMode
Definition: Module.h:373
OutputConvert2FP::GenericName
virtual std::string GenericName() override
Definition: ModuleFPUnit.cpp:659
FPUnit::pipeline_mode
PipelineMode pipeline_mode
Definition: ModuleFPUnit.h:110
OutputFloPoCo2IEEE::GenericName
virtual std::string GenericName() override
Definition: ModuleFPUnit.cpp:545
OutputConvert2Int::GenericName
virtual std::string GenericName() override
Definition: ModuleFPUnit.cpp:833
OutputConvert2Int::OutputConvert2Int
OutputConvert2Int(std::string name, Location, unsigned size, std::vector< OpGraphOpCode > supported_modes)
Definition: ModuleFPUnit.cpp:814
OutputConvert2Int::supported_modes
std::vector< OpGraphOpCode > supported_modes
Definition: ModuleFPUnit.h:72
FPAdd::~FPAdd
virtual ~FPAdd()
Definition: ModuleFPUnit.cpp:106
FPUnit::FPUnit
FPUnit(std::string name, Location, std::vector< OpGraphOpCode > supported_modes, unsigned size, int II, int latency)
Definition: ModuleFPUnit.cpp:997
FPMult::~FPMult
virtual ~FPMult()
Definition: ModuleFPUnit.cpp:214
FPSqrt
Definition: ModuleFPUnit.h:33
OutputConvert2FP::createMRRG
MRRG * createMRRG(unsigned II) override
Definition: ModuleFPUnit.cpp:782
FPAdd
Definition: ModuleFPUnit.h:6
OutputConvert2FP::OutputConvert2FP
OutputConvert2FP(std::string name, Location, unsigned size, std::vector< OpGraphOpCode > supported_modes)
Definition: ModuleFPUnit.cpp:640
FPDiv::~FPDiv
virtual ~FPDiv()
Definition: ModuleFPUnit.cpp:322
FPUnit::supported_modes
std::vector< OpGraphOpCode > supported_modes
Definition: ModuleFPUnit.h:111
FPUnit::getBitConfig
virtual BitConfig getBitConfig(const MRRG &mrrg, const OpGraph &og, const Mapping &map, const ConfigCell &ccell, const MRRGNodesFromOpNode &mrrg_nodes_from_op_node, const MRRGNodesFromValNode &mrrg_nodes_from_val_node) const override
Definition: ModuleFPUnit.cpp:1112
OutputConvert2Int::CoreIRGenFunctionality
virtual nlohmann::json CoreIRGenFunctionality() override
Definition: ModuleFPUnit.cpp:839
FPSqrt::CoreIRGenFunctionality
virtual nlohmann::json CoreIRGenFunctionality() override
Definition: ModuleFPUnit.cpp:350
OutputConvert2FP::size
unsigned size
Definition: ModuleFPUnit.h:86
OpGraph
Definition: OpGraph.h:215
OutputConvert2Int::getSupportedModes
auto & getSupportedModes() const
Definition: ModuleFPUnit.h:69
FPSqrt::GenericName
virtual std::string GenericName() override
Definition: ModuleFPUnit.cpp:344
FPUnit::GenericName
virtual std::string GenericName() override
Definition: ModuleFPUnit.cpp:985
OutputFloPoCo2IEEE::~OutputFloPoCo2IEEE
virtual ~OutputFloPoCo2IEEE()
Definition: ModuleFPUnit.cpp:627
InputIEEE2FloPoCo::GenericName
virtual std::string GenericName() override
Definition: ModuleFPUnit.cpp:446
OutputConvert2FP::getSupportedModes
auto & getSupportedModes() const
Definition: ModuleFPUnit.h:84