Implementing logarithmic function via Simulink HDL Coder
11 ビュー (過去 30 日間)
古いコメントを表示
I need to implement a logarithmic function in Simulink that can be used for generating HDL code using HDL Coder. The Log block in Simulink appears to only support native floating point data types for use with HDL Coder, and an evenly stepped LUT does not provide good enough precision per resources used.
Is there any other preferred way of implementing logarithmic functions in Simulink/HDL Coder?
0 件のコメント
回答 (1 件)
Kiran Kintali
2024 年 3 月 25 日
Can you share a bit more about your application and requirements for log?
These results can be generated based on your target chip, latency constraints. I am sharing few sample details for basic log operation in single precision for your review.
>> openExample('hdlcoder/SynthesisBenchmarkOfNativeFloatingPointOperatorsExample')
>> load('hdlcoder_synthesis_benchmark.mat')
>> whos
Name Size Bytes Class Attributes
NFPSynthesisResults 1x1 339902 struct
>> NFPSynthesisResults.Vivado.HardwareDetails
Tool: 'Xilinx Vivado'
ChipFamily: 'Virtex7'
DeviceName: 'xc7v2000t'
PackageName: 'fhg1761'
SpeedValue: '-2'
Version: '2018.3'
>> NFPSynthesisResults.Vivado.MinLatency
Fmax Slices SliceRegs LUTs DSPs RAMs URAMs Latency DataPathDelay Slack LogicLevels LogicDelay RouteDelay
______ ______ _________ _____ ____ ____ _____ _______ _____________ ______ ___________ __________ __________
op_Log 235.29 661 1383 2072 5 0 0 20 4.25 -2.574 14 1.279 2.971
op_Log10 217.86 749 1210 2286 9 0 0 17 4.59 -2.619 15 1.647 2.943
op_Log10_Denorm_on 217.86 749 1210 2286 9 0 0 17 4.59 -2.619 15 1.647 2.943
op_Log2 287.19 667 1022 2054 6 0 0 16 3.482 -2.539 1 3.102 0.38
op_Log_Denorm_on 235.29 661 1383 2072 5 0 0 20 4.25 -2.574 14 1.279 2.971
You can generate more recent results using the instructions in the page.
2 件のコメント
Kiran Kintali
2024 年 4 月 12 日
Attaching sample algorithm that could be a starting point for your usecase. You can plugin the algorithm in a MATLAB function block.
参考
カテゴリ
Help Center および File Exchange で FPGA, ASIC, and SoC Development についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!