mirror of
https://github.com/DrasLorus/CORDIC_Rotate_APFX.git
synced 2024-09-16 23:52:21 +02:00
f0035238bf
- Fix the MC (Monte-Carlo) to the proper algoritm name, ML (maximum likelyhood) and remove HalfPi since the use of divider allow to theoretically support any pi / 2^k, k an integer. In reality, a too low rotation would require more stages than 7 but it is for futur improvements. - Make use of `divider` template to provide rotation grain finer than pi / 2. Validated (unit-tested) with pi / 4 with the same margins than pi / 2 (2% of error with floating scaling, 3% with fixed scaling). - Fix rom size which now use N_STAGES+1 bits instead of 8 regardless of N_STAGES. Simplify the cordic method implementation, which unexpectedly (and fortunately) improved its performance.
36 lines
1.2 KiB
C++
36 lines
1.2 KiB
C++
/*
|
|
*
|
|
* Copyright 2022 Camille "DrasLorus" Monière.
|
|
*
|
|
* This file is part of CORDIC_Rotate_APFX.
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU
|
|
* Lesser General Public License as published by the Free Software Foundation, either version 3 of
|
|
* the License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
|
|
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public License along with this program.
|
|
* If not, see <https://www.gnu.org/licenses/>.
|
|
*
|
|
*/
|
|
|
|
#include "RomGeneratorConst/RomGeneratorConst.hpp"
|
|
#include "RomGeneratorML/RomGeneratorML.hpp"
|
|
|
|
#include <fstream>
|
|
#include <iostream>
|
|
#include <string>
|
|
|
|
using namespace std;
|
|
|
|
int main(int, char **) {
|
|
|
|
const char filename[] = "cordic_rom_@ROM_TYPE@_@CORDIC_W@_@CORDIC_STAGES@_@CORDIC_Q@_@CORDIC_DIVIDER@.hpp";
|
|
|
|
generate_rom_header_@ROM_TYPE@<@CORDIC_W@, @CORDIC_STAGES@, @CORDIC_Q@, @CORDIC_DIVIDER@>(filename);
|
|
|
|
return EXIT_SUCCESS;
|
|
}
|