Skip to content

Commit

Permalink
Fixed some 64bit issues on generators.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabrizioferrandi committed Nov 23, 2022
1 parent 5ec1ddb commit f11cfb8
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 7 deletions.
62 changes: 62 additions & 0 deletions QTCreator-PandA-GitHub.files
Original file line number Diff line number Diff line change
Expand Up @@ -1725,8 +1725,70 @@ src/HLS/module_allocation/hls_function_bit_value.cpp
src/HLS/module_allocation/hls_function_bit_value.hpp
src/HLS/module_allocation/omp_allocation.cpp
src/HLS/module_allocation/omp_allocation.hpp
src/HLS/module_generator/ASMModuleGenerator.cpp
src/HLS/module_generator/ASMModuleGenerator.hpp
src/HLS/module_generator/BuiltinWaitCallModuleGenerator.cpp
src/HLS/module_generator/BuiltinWaitCallModuleGenerator.hpp
src/HLS/module_generator/BuiltinWaitCallNModuleGenerator.cpp
src/HLS/module_generator/BuiltinWaitCallNModuleGenerator.hpp
src/HLS/module_generator/KMPBambuCSGetGTIDModuleGenerator.cpp
src/HLS/module_generator/KMPBambuCSGetGTIDModuleGenerator.hpp
src/HLS/module_generator/KMPBambuCSGetTIDModuleGenerator.cpp
src/HLS/module_generator/KMPBambuCSGetTIDModuleGenerator.hpp
src/HLS/module_generator/KMPBambuForkCallModuleGenerator.cpp
src/HLS/module_generator/KMPBambuForkCallModuleGenerator.hpp
src/HLS/module_generator/ModuleGeneratorManager.cpp
src/HLS/module_generator/ModuleGeneratorManager.hpp
src/HLS/module_generator/OpenCSModuleGenerator.cpp
src/HLS/module_generator/OpenCSModuleGenerator.hpp
src/HLS/module_generator/OpenModuleGenerator.cpp
src/HLS/module_generator/OpenModuleGenerator.hpp
src/HLS/module_generator/OpenNModuleGenerator.cpp
src/HLS/module_generator/OpenNModuleGenerator.hpp
src/HLS/module_generator/OpenP1NModuleGenerator.cpp
src/HLS/module_generator/OpenP1NModuleGenerator.hpp
src/HLS/module_generator/PrintfCSModuleGenerator.cpp
src/HLS/module_generator/PrintfCSModuleGenerator.hpp
src/HLS/module_generator/PrintfModuleGenerator.cpp
src/HLS/module_generator/PrintfModuleGenerator.hpp
src/HLS/module_generator/PrintfNModuleGenerator.cpp
src/HLS/module_generator/PrintfNModuleGenerator.hpp
src/HLS/module_generator/PrintfP1NModuleGenerator.cpp
src/HLS/module_generator/PrintfP1NModuleGenerator.hpp
src/HLS/module_generator/ReadWriteDP_arrayModuleGenerator.cpp
src/HLS/module_generator/ReadWriteDP_arrayModuleGenerator.hpp
src/HLS/module_generator/ReadWrite_arrayModuleGenerator.cpp
src/HLS/module_generator/ReadWrite_arrayModuleGenerator.hpp
src/HLS/module_generator/ReadWrite_m_axiModuleGenerator.cpp
src/HLS/module_generator/ReadWrite_m_axiModuleGenerator.hpp
src/HLS/module_generator/Read_acknowledgeModuleGenerator.cpp
src/HLS/module_generator/Read_acknowledgeModuleGenerator.hpp
src/HLS/module_generator/Read_axisModuleGenerator.cpp
src/HLS/module_generator/Read_axisModuleGenerator.hpp
src/HLS/module_generator/Read_fifoModuleGenerator.cpp
src/HLS/module_generator/Read_fifoModuleGenerator.hpp
src/HLS/module_generator/Read_handshakeModuleGenerator.cpp
src/HLS/module_generator/Read_handshakeModuleGenerator.hpp
src/HLS/module_generator/Read_noneModuleGenerator.cpp
src/HLS/module_generator/Read_noneModuleGenerator.hpp
src/HLS/module_generator/Read_validModuleGenerator.cpp
src/HLS/module_generator/Read_validModuleGenerator.hpp
src/HLS/module_generator/Write_acknowledgeModuleGenerator.cpp
src/HLS/module_generator/Write_acknowledgeModuleGenerator.hpp
src/HLS/module_generator/Write_axisModuleGenerator.cpp
src/HLS/module_generator/Write_axisModuleGenerator.hpp
src/HLS/module_generator/Write_fifoModuleGenerator.cpp
src/HLS/module_generator/Write_fifoModuleGenerator.hpp
src/HLS/module_generator/Write_handshakeModuleGenerator.cpp
src/HLS/module_generator/Write_handshakeModuleGenerator.hpp
src/HLS/module_generator/Write_noneDSModuleGenerator.cpp
src/HLS/module_generator/Write_noneDSModuleGenerator.hpp
src/HLS/module_generator/Write_noneModuleGenerator.cpp
src/HLS/module_generator/Write_noneModuleGenerator.hpp
src/HLS/module_generator/Write_none_registeredModuleGenerator.cpp
src/HLS/module_generator/Write_none_registeredModuleGenerator.hpp
src/HLS/module_generator/Write_validModuleGenerator.cpp
src/HLS/module_generator/Write_validModuleGenerator.hpp
src/HLS/scheduling/ASLAP.cpp
src/HLS/scheduling/ASLAP.hpp
src/HLS/scheduling/parametric_list_based.cpp
Expand Down
2 changes: 2 additions & 0 deletions src/HLS/module_generator/BuiltinWaitCallNModuleGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
*
*
* @author Michele Fiorito <[email protected]>
* @author Fabrizio Ferrandi <[email protected]>
* @author Marco Lattuada <[email protected]>
* $Revision$
* $Date$
* Last modified by $Author$
Expand Down
3 changes: 2 additions & 1 deletion src/HLS/module_generator/OpenModuleGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
*
*
* @author Michele Fiorito <[email protected]>
* @author Fabrizio Ferrandi <[email protected]>
* $Revision$
* $Date$
* Last modified by $Author$
Expand Down Expand Up @@ -193,4 +194,4 @@ void OpenModuleGenerator::InternalExec(std::ostream& out, const module* /* mod *

out << fsm;
out << " // verilator lint_on LITENDIAN\n";
}
}
3 changes: 2 additions & 1 deletion src/HLS/module_generator/OpenNModuleGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
*
*
* @author Michele Fiorito <[email protected]>
* @author Fabrizio Ferrandi <[email protected]>
* $Revision$
* $Date$
* Last modified by $Author$
Expand Down Expand Up @@ -193,4 +194,4 @@ void OpenNModuleGenerator::InternalExec(std::ostream& out, const module* /* mod

out << fsm;
out << " // verilator lint_on LITENDIAN\n";
}
}
3 changes: 2 additions & 1 deletion src/HLS/module_generator/OpenP1NModuleGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
*
*
* @author Michele Fiorito <[email protected]>
* @author Fabrizio Ferrandi <[email protected]>
* $Revision$
* $Date$
* Last modified by $Author$
Expand Down Expand Up @@ -236,4 +237,4 @@ void OpenP1NModuleGenerator::InternalExec(std::ostream& out, const module* /* mo

out << fsm;
out << " // verilator lint_on LITENDIAN\n";
}
}
4 changes: 2 additions & 2 deletions src/HLS/module_generator/ReadWriteDP_arrayModuleGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ void ReadWriteDP_arrayModuleGenerator::InternalExec(std::ostream& out, const mod

const auto log2nbyte = _ports_out[1].alignment == 1ULL ?
0U :
(32u - static_cast<unsigned>(__builtin_clzll(_ports_out[1].alignment - 1U)));
(64u - static_cast<unsigned>(__builtin_clzll(_ports_out[1].alignment - 1U)));

const auto addressMaxValue = _ports_out[1].alignment * arraySize - 1U;
const auto nbitAddress =
addressMaxValue == 1ULL ? 1U : (32u - static_cast<unsigned>(__builtin_clzll(addressMaxValue)));
addressMaxValue == 1ULL ? 1U : (64u - static_cast<unsigned>(__builtin_clzll(addressMaxValue)));

if(log2nbyte > 0U)
{
Expand Down
4 changes: 2 additions & 2 deletions src/HLS/module_generator/ReadWrite_arrayModuleGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ void ReadWrite_arrayModuleGenerator::InternalExec(std::ostream& out, const modul

const auto log2nbyte = _ports_out[1].alignment == 1ULL ?
0U :
(32u - static_cast<unsigned>(__builtin_clzll(_ports_out[1].alignment - 1U)));
(64u - static_cast<unsigned>(__builtin_clzll(_ports_out[1].alignment - 1U)));

const auto addressMaxValue = _ports_out[1].alignment * arraySize - 1U;
const auto nbitAddress =
addressMaxValue == 1U ? 1U : (32u - static_cast<unsigned>(__builtin_clzll(addressMaxValue)));
addressMaxValue == 1U ? 1U : (64u - static_cast<unsigned>(__builtin_clzll(addressMaxValue)));

if(log2nbyte > 0U)
{
Expand Down

0 comments on commit f11cfb8

Please sign in to comment.