Fixed point tool conversion
조회 수: 7 (최근 30일)
이전 댓글 표시
Hi there,
How can I convert just a subsystem and not the entire model with the fixed point tool?
The tool, when I try to simulate, converts the overall system in fixed point, which is not my purpose.
Thanks in advance
댓글 수: 0
답변 (2개)
Asvin Kumar
2019년 12월 26일
You can convert a particular subsystem to Fixed Point by selecting it under System Under Design while preparing the system. Check out the example at https://www.mathworks.com/help/releases/R2018a/fixedpoint/ug/tutorial-steps.html#bs4b8ai for more details.
댓글 수: 3
Asvin Kumar
2020년 1월 6일
I see. Is there any way you know to reproduce this issue? So that I can check it out on my end. Or anyone else from the community can confirm.
Evangelos Denaxas
2020년 1월 15일
What could be happening here is that fixed-point leaks out from the system under design by following data type propagation rules. So things that outside your system under design are not "converted" per se but rather propagating the data types they get as input. In order to avoid any of these unexpected issues you may want to properly isolate your system under design with a block called "data type converter". If you put one of these blocks to each line going in and out of your SUD then you'll minimize the chances of fixed-point trickling outside your system.
stozaki
2020년 1월 17일
Please try following script.
model = 'modelName'; % define your model name
sud = [model '/sud']; % define system under design as sybsystem block path
opt = fxpOptimizationOptions(); % Specify options for data type optimization
allowableWL = (10:20); % set allow word length
opt.AllowableWordLengths = allowableWL;
tol = 0.1; % define tolerance
opt.addTolerance([model '/diff'], 1, 'AbsTol', tol); % set tolerance
opt.addTolerance([model '/diff'], 2, 'AbsTol', tol); % set tolerance
opt.UseParallel = false;
optRes = fxpopt(model, sud, opt); % execute
Regards,
Shuhei
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Iterative Fixed-Point Conversion in Simulink에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!