HDL Coder: How to create a resettable delay that triggers on rising edge
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Dominik Hiltbrunner
el 9 de Dic. de 2020
Comentada: Dominik Hiltbrunner
el 11 de Dic. de 2020
Hello Community
I'm trying to implement a limited counter which has a variable upper limit, i.e. the upper limit is given by a signal.
This proposed solution does this. The problem is that this solution is not HDL code generation compatible. If I try to generate VHDL code, I get the follwing error from the resettable delay block:
Only 'Level' external reset mode on the Delay block is supported in 'Classic' mode.
If I set the External reset to "Level" mode, the behaviour is no longer correct.
What do I have to do in order to create a resettable delay block that behaves in the same way as a flip flop that resets on the rising edge?
Furthermore, what is the "Classic mode" in this error message? I cannot find an answer to this in the documentation.
0 comentarios
Respuesta aceptada
Kiran Kintali
el 10 de Dic. de 2020
Editada: Kiran Kintali
el 10 de Dic. de 2020
Please find attached two variations of the model generating HDL code.
One using MATLAB function block with the following code
function y = fcn(u)
persistent count;
if isempty(count)
count = int8(0);
end
if count > u
count = int8(0);
end
y = count;
if count <= u
count = count + 1;
end
end
Other using basic Simulink blocks
Más respuestas (0)
Ver también
Categorías
Más información sobre Speed Optimization en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!