MATLAB: About HDL Coder in Simulink

HDL Codersimulink

Hello,
I am trying to generate HDL code from simulink. I have connected contant block as input to discrete integrator and getting ramp output. But when i convert to HDL Code, its not generating except library name, entity name and architecture lines. Can you please help me solving this problem..?
Thank you
Regards Prashanth

Best Answer

I suspect that you have three blocks in your model, the third being a terminator, a scope, or something else that doesn't generate HDL code. And, you are generating code for the entire model. The use of a terminator/scope/etc. block indicates that you don't care about the signal output connected to it, so HDL Coder removes the blocks that feed into the terminator. You end up with no blocks or code in your design.
If this is the case, change the terminator/scope/etc. to an output port (or add an output port in parallel to the e.g. scope) and you will get the code that you were expecting.
Alternatively, place just the blocks you want to generate HDL code for into a subsystem, and generate code for that subsystem.