The invention provides a programmable logic unit
simulation and
code generation system and method, a medium device and a program product, and the
system comprises a graphical
programming module which responds to user configuration operation based on a graphical
programming environment to carry out module building so as to build a
simulation model; the file analysis and
code generation module is used for analyzing a file output by the
simulation model and generating a corresponding code; when it is monitored that the simulation model changes, corresponding codes are generated according to the new simulation model; and the target hardware code configuration module is used for calling the code generated by the file analysis and
code generation module and converting the code into a code adaptive to the operation of the target hardware so as to carry out hardware-in-loop simulation. Through the technical scheme provided by the invention, the design, simulation and code generation of a digital circuit can be easily realized by combining the existing Simulink
software with some script codes, so that the
customer support cost is greatly reduced for
chip manufacturers; a circuit is constructed intuitively, simply and conveniently; simulink has a lower
learning curve, so that a user can quickly master; signals acquired by a
microcontroller (MCU) can be supported to be used as simulation input; the development process is simplified and the development cost is reduced; manual coding errors are avoided, and the development efficiency and the code quality are improved.