Q1
The changes we would require is replacing sin and cos with CORDIC function that outputs approximations of those values.
- Required Code Changes:
- Instead of using HLS math functions cos() and sin(), you would need to:
- Replace them with calls to your custom CORDIC function
- Add the CORDIC lookup tables for angle values
- Resource Usage Impact:
From the report's findings:
- Using CORDIC instead of math functions would:
- Significantly reduce DSP usage (from 21 to 2 DSPs as shown in Table 4)
- Increase LUT usage (from 2,676 to 6,477 LUTs)
- Slightly increase FF usage (from 1,719 to 1,891 FFs)
- Changing CORDIC accuracy would affect resources in the following ways:
- Lower accuracy (fewer rotations) would:
- Reduce latency linearly (26 cycles per 2 rotations according to Section 1.1)
- Keep resource usage relatively stable (as shown in Table 1)
- Different data type precisions would:
- Affect FF and LUT usage based on bit width requirements
- Enable optimization of resource usage by using variable-specific bit widths
- Performance Impact:
The report indicates:
- Baseline math functions have high latency (234 cycles)
- CORDIC implementation reduces latency significantly:
- Down to 48 cycles with add/shift operations
- Further reduced to 41 cycles with optimized data types
- Accuracy vs. Performance tradeoffs:
- 12 rotations: Good balance of accuracy (RMSE θ = 2.737e-4) and latency
- 16 rotations: Better accuracy (RMSE θ = 1.975e-5) but higher latency
- 20 rotations: Minimal accuracy improvement with significant latency cost
Based on these findings, using a custom CORDIC would likely be beneficial for the DFT implementation as it would:
- Reduce DSP usage significantly
- Provide tunable accuracy-performance tradeoffs
- Improve latency compared to math functions
- Allow for optimization of data types for specific variables
The main tradeoff would be increased LUT usage, but the performance and DSP savings could make this worthwhile depending on your specific requirements and constraints.