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 (
ROM_TYPE
"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 (
CORDIC_W
@ -126,8 +126,9 @@ add_subdirectory (RomGenerators)
set (ROM_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/sources/CordicRoms)
string (
CONFIGURE ${ROM_DIRECTORY}/cordic_rom_${ROM_TYPE}_${CORDIC_W}_${CORDIC_STAGES}_${CORDIC_Q}_${CORDIC_DIVIDER}.hpp
ROM_HEADER
CONFIGURE
${ROM_DIRECTORY}/cordic_rom_${ROM_TYPE}_${CORDIC_W}_${CORDIC_STAGES}_${CORDIC_Q}_${CORDIC_DIVIDER}.hpp
ROM_HEADER
)
add_custom_command (
OUTPUT ${ROM_HEADER}
@ -135,8 +136,12 @@ add_custom_command (
WORKING_DIRECTORY ${ROM_DIRECTORY}
)
set (CORDIC_ROM_HEADER 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)
set (CORDIC_ROM_HEADER
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 (
sources/CCordicRotateRom/CCordicRotateRom.hpp.in
${CMAKE_CURRENT_SOURCE_DIR}/sources/CCordicRotateRom/${CORDIC_ROM_HEADER} @ONLY

View file

@ -34,8 +34,7 @@ project (
)
add_library (
romgen sources/RomGeneratorML/RomGeneratorML.cpp
sources/RomGeneratorConst/RomGeneratorConst.cpp
romgen sources/RomGeneratorML/RomGeneratorML.cpp sources/RomGeneratorConst/RomGeneratorConst.cpp
)
target_include_directories (romgen PUBLIC sources)
@ -74,10 +73,10 @@ set (
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)
configure_file (
sources/main_generator.cpp.in
${current_generator_source} @ONLY
set (
current_generator_source
${CMAKE_CURRENT_SOURCE_DIR}/sources/main_generator_${ROM_TYPE}_${CORDIC_W}_${CORDIC_STAGES}_${CORDIC_Q}_${CORDIC_DIVIDER}.cpp
)
configure_file (sources/main_generator.cpp.in ${current_generator_source} @ONLY)
add_executable (rom_generator ${current_generator_source})
target_link_libraries (rom_generator PUBLIC romgen)

View file

@ -42,7 +42,7 @@ public:
static constexpr double rotation = pi / divider;
static constexpr double q = Tq;
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] {
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};\n", uint16_t(rom.rom[rom.max_length - 1]));
fprintf(rom_file, "\n} // namespace cordic_roms\n\n");
fprintf(rom_file, "#endif // %s\n\n", upper_file_def);
}