PandA-2024.02
FPle_expr.cpp
Go to the documentation of this file.
1 /*
2  *
3  * _/_/_/ _/_/ _/ _/ _/_/_/ _/_/
4  * _/ _/ _/ _/ _/_/ _/ _/ _/ _/ _/
5  * _/_/_/ _/_/_/_/ _/ _/_/ _/ _/ _/_/_/_/
6  * _/ _/ _/ _/ _/ _/ _/ _/ _/
7  * _/ _/ _/ _/ _/ _/_/_/ _/ _/
8  *
9  * ***********************************************
10  * PandA Project
11  * URL: http://panda.dei.polimi.it
12  * Politecnico di Milano - DEIB
13  * System Architectures Group
14  * ***********************************************
15  * Copyright (C) 2004-2024 Politecnico di Milano
16  *
17  * This file is part of the PandA framework.
18  *
19  * The PandA framework is free software; you can redistribute it and/or modify
20  * it under the terms of the GNU General Public License as published by
21  * the Free Software Foundation; either version 3 of the License, or
22  * (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27  * GNU General Public License for more details.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with this program. If not, see <http://www.gnu.org/licenses/>.
31  *
32  */
43 #include "config_SKIP_WARNING_SECTIONS.hpp"
45 
46 #if SKIP_WARNING_SECTIONS
47 #pragma GCC diagnostic ignored "-Wshadow"
48 #pragma GCC diagnostic ignored "-Wsign-conversion"
49 #pragma GCC diagnostic ignored "-Wconversion"
50 #pragma GCC diagnostic ignored "-Wunused-parameter"
51 #endif
52 
53 #include <cmath>
54 #include <cstring>
55 #include <iosfwd>
56 #include <sstream>
57 #include <vector>
58 
59 #include <cstddef>
60 #include <gmp.h>
61 
62 #include "utils.hpp"
63 #include <gmpxx.h>
64 
65 #include "FPAdderSinglePath.hpp"
66 #include "FPle_expr.hpp"
67 
68 #include "custom_map.hpp"
69 #include <cmath>
70 #include <cstdlib>
71 #include <iomanip>
72 #include <list>
73 #include <locale>
74 #include <sstream>
75 #include <string>
76 #include <vector>
77 
78 #include <cstdio>
79 #include <mpfr.h>
80 
81 #include "flopoco_wrapper.hpp"
82 #include "utility.hpp"
83 
84 using namespace std;
85 
86 namespace flopoco
87 {
88  extern vector<Operator*> oplist;
89 
90 #define DEBUGVHDL 0
91 
92  FPle_expr::FPle_expr(Target* _target, int wE, int wF) : Operator(_target)
93  {
94  ostringstream name;
95 
96  name << "FPle_expr_" << wE << "_" << wF;
97  setName(name.str());
98 
99  setCopyrightString("Fabrizio Ferrandi (2011-2018)");
100 
101  /* Set up the IO signals */
102 
103  addFPInput("X", wE, wF);
104  addFPInput("Y", wE, wF);
105  addOutput("R", 1);
106 
107  /* VHDL code description */
108  manageCriticalPath(_target->localWireDelay() + _target->lutDelay());
109  vhdl << tab << declare("nX", wE + wF + 3) << " <= X" << range(wE + wF + 2, wE + wF + 1) << " & not(X"
110  << of(wE + wF) << ") & X" << range(wE + wF - 1, 0) << ";" << endl;
111  auto* value_difference = new FPAdderSinglePath(_target, wE, wF, wE, wF, wE, wF);
112  value_difference->changeName(getName() + "value_difference");
113  oplist.push_back(value_difference);
114  inPortMap(value_difference, "X", "Y");
115  inPortMap(value_difference, "Y", "nX");
116  outPortMap(value_difference, "R", "valueDiff");
117  vhdl << instance(value_difference, "value_difference");
118  syncCycleFromSignal("valueDiff");
119  setCriticalPath(value_difference->getOutputDelay("R"));
120 
121  manageCriticalPath(_target->localWireDelay() + _target->lutDelay());
122  vhdl << tab << "R(0) <= '1' when (valueDiff" << of(wE + wF) << "='0' or (valueDiff"
123  << range(wE + wF + 2, wE + wF + 1) << " = \"00\")) else '0';" << endl;
124  }
125 
126  FPle_expr::~FPle_expr() = default;
127 
128  void FPle_expr::emulate(TestCase*)
129  {
130  // TODO
131  }
132 
134  {
135  }
136 
137 } // namespace flopoco
Forward declarations of FloPoCo classes.
ub1 tab[]
void buildStandardTestCases(TestCaseList *tcl) override
Definition: FPle_expr.cpp:133
Definition of hash function for EdgeDescriptor.
Definition: graph.hpp:1321
redefinition of map to manage ordered/unordered structures
~FPle_expr() override
destructor
This file collects some utility functions and macros.
void emulate(TestCase *tc) override
Definition: FPle_expr.cpp:128
Wrapper to FloPoCo for VHDL code generation.
FPle_expr module for flopoco.
vector< Operator * > oplist
Definition: FPge_expr.cpp:88

Generated on Mon Feb 12 2024 13:02:56 for PandA-2024.02 by doxygen 1.8.13