How do you make D-FF for HDL coders in simulink?
18 ビュー (過去 30 日間)
Hello, I am a student studying semiconductors in Korea.
This time, I'm going to manufacture and verify the circuit as a simulation and implement it as HDL using HDL cord.
I tried two ways to make D-FF.
The first way was to use the D-FF provided by Simulink. The D-FF of the simulation uses a clock, but an error occurred due to the problem of using a trigger.
The second way is to use memory and switch as shown in the circuit attached below. At this time, the following error occurred.
The Memory block is supported only if the 'Inherit Sample Time' property is checked and neither the input nor the output are continuous.
How should I solve this problem?
Or I would appreciate it if you could introduce another way to make D-FF in Simulink.
回答 (1 件)
Kiran Kintali 2021 年 10 月 31 日
Hardware Modeling with MATLAB Code
MATLAB® design and test bench guidelines for HDL code generation
Model for HDL Code Generation
Model a Counter for HDL Code Generation: To write MATLAB code that models hardware and is suitable for HDL code generation, use this design pattern.
Model State with Persistent Variables and System Objects: This example shows how to use persistent variables and System objects to model state and delays in a MATLAB® design for HDL code generation.
Implement RAM Using MATLAB Code: You can write MATLAB code that maps to RAM during HDL code generation by using:
Map Matrices to ROM: To map a matrix constant to ROM:If your MATLAB code meets these requirements, HDL Coder™ inserts a no-reset register at the output of the matrix in the generated code.
% open registers / flip flops / delays section
% you can see how to use Simulink delay block or MATLAB persistent
% variables to model state
You can generated code from above MATLAB and Simulink examples using HDL Coder and observe how the generated code following general industry guidelines Modeling Registers and Counters - Xilinx