Just an auto-formatting correction

This commit is contained in:
Camille Monière 2022-03-14 14:19:42 +01:00
parent f0035238bf
commit 4a0236baea
Signed by: moniere
GPG key ID: 188DD5B072181C0F
3 changed files with 18 additions and 14 deletions

View file

@ -97,9 +97,9 @@ endif ()
set ( set (
ROM_TYPE ROM_TYPE
"ml" "ml"
CACHE STRING "RomGenerator to use, either 'ml' or 'cst'." CACHE STRING "RomGenerator to use, either 'ml' or 'cst'."
) )
set_property(CACHE ROM_TYPE PROPERTY STRINGS "ml" "cst") set_property (CACHE ROM_TYPE PROPERTY STRINGS "ml" "cst")
set ( set (
CORDIC_W CORDIC_W
@ -126,8 +126,9 @@ add_subdirectory (RomGenerators)
set (ROM_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/sources/CordicRoms) set (ROM_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/sources/CordicRoms)
string ( string (
CONFIGURE ${ROM_DIRECTORY}/cordic_rom_${ROM_TYPE}_${CORDIC_W}_${CORDIC_STAGES}_${CORDIC_Q}_${CORDIC_DIVIDER}.hpp CONFIGURE
ROM_HEADER ${ROM_DIRECTORY}/cordic_rom_${ROM_TYPE}_${CORDIC_W}_${CORDIC_STAGES}_${CORDIC_Q}_${CORDIC_DIVIDER}.hpp
ROM_HEADER
) )
add_custom_command ( add_custom_command (
OUTPUT ${ROM_HEADER} OUTPUT ${ROM_HEADER}
@ -135,8 +136,12 @@ add_custom_command (
WORKING_DIRECTORY ${ROM_DIRECTORY} WORKING_DIRECTORY ${ROM_DIRECTORY}
) )
set (CORDIC_ROM_HEADER CCordicRotateRom_${ROM_TYPE}_${CORDIC_W}_${CORDIC_STAGES}_${CORDIC_Q}_${CORDIC_DIVIDER}.hpp) set (CORDIC_ROM_HEADER
set (CORDIC_ROM_SOURCE CCordicRotateRom_${ROM_TYPE}_${CORDIC_W}_${CORDIC_STAGES}_${CORDIC_Q}_${CORDIC_DIVIDER}.cpp) CCordicRotateRom_${ROM_TYPE}_${CORDIC_W}_${CORDIC_STAGES}_${CORDIC_Q}_${CORDIC_DIVIDER}.hpp
)
set (CORDIC_ROM_SOURCE
CCordicRotateRom_${ROM_TYPE}_${CORDIC_W}_${CORDIC_STAGES}_${CORDIC_Q}_${CORDIC_DIVIDER}.cpp
)
configure_file ( configure_file (
sources/CCordicRotateRom/CCordicRotateRom.hpp.in sources/CCordicRotateRom/CCordicRotateRom.hpp.in
${CMAKE_CURRENT_SOURCE_DIR}/sources/CCordicRotateRom/${CORDIC_ROM_HEADER} @ONLY ${CMAKE_CURRENT_SOURCE_DIR}/sources/CCordicRotateRom/${CORDIC_ROM_HEADER} @ONLY

View file

@ -34,8 +34,7 @@ project (
) )
add_library ( add_library (
romgen sources/RomGeneratorML/RomGeneratorML.cpp romgen sources/RomGeneratorML/RomGeneratorML.cpp sources/RomGeneratorConst/RomGeneratorConst.cpp
sources/RomGeneratorConst/RomGeneratorConst.cpp
) )
target_include_directories (romgen PUBLIC sources) target_include_directories (romgen PUBLIC sources)
@ -74,10 +73,10 @@ set (
CACHE STRING "Rotation denominator." CACHE STRING "Rotation denominator."
) )
set (current_generator_source ${CMAKE_CURRENT_SOURCE_DIR}/sources/main_generator_${ROM_TYPE}_${CORDIC_W}_${CORDIC_STAGES}_${CORDIC_Q}_${CORDIC_DIVIDER}.cpp) set (
configure_file ( current_generator_source
sources/main_generator.cpp.in ${CMAKE_CURRENT_SOURCE_DIR}/sources/main_generator_${ROM_TYPE}_${CORDIC_W}_${CORDIC_STAGES}_${CORDIC_Q}_${CORDIC_DIVIDER}.cpp
${current_generator_source} @ONLY
) )
configure_file (sources/main_generator.cpp.in ${current_generator_source} @ONLY)
add_executable (rom_generator ${current_generator_source}) add_executable (rom_generator ${current_generator_source})
target_link_libraries (rom_generator PUBLIC romgen) target_link_libraries (rom_generator PUBLIC romgen)

View file

@ -42,7 +42,7 @@ public:
static constexpr double rotation = pi / divider; static constexpr double rotation = pi / divider;
static constexpr double q = Tq; static constexpr double q = Tq;
static constexpr uint32_t max_length = 2 * divider * Tq; // 2pi / (pi / divider) * q static constexpr uint32_t max_length = 2 * divider * Tq; // 2pi / (pi / divider) * q
static constexpr int64_t scale_factor = int64_t(1U << (In_W - 1)); static constexpr int64_t scale_factor = int64_t(1U << (In_W - 1));
static constexpr double atanDbl[28] { static constexpr double atanDbl[28] {
0.78539816339745, 0.46364760900081, 0.24497866312686, 0.12435499454676, 0.78539816339745, 0.46364760900081, 0.24497866312686, 0.12435499454676,
@ -152,7 +152,7 @@ void generate_rom_header_cst(const char * filename) {
fprintf(rom_file, "%3d, ", uint16_t(rom.rom[u])); fprintf(rom_file, "%3d, ", uint16_t(rom.rom[u]));
} }
fprintf(rom_file, "%3d};\n", uint16_t(rom.rom[rom.max_length - 1])); fprintf(rom_file, "%3d};\n", uint16_t(rom.rom[rom.max_length - 1]));
fprintf(rom_file, "\n} // namespace cordic_roms\n\n"); fprintf(rom_file, "\n} // namespace cordic_roms\n\n");
fprintf(rom_file, "#endif // %s\n\n", upper_file_def); fprintf(rom_file, "#endif // %s\n\n", upper_file_def);
} }