How do you make D-FF for HDL coders in simulink?

7 views (last 30 days)
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.

Answers (1)

Kiran Kintali
Kiran Kintali on 31 Oct 2021
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.
>> eml_hdl_design_patterns
% open registers / flip flops / delays section
% you can see how to use Simulink delay block or MATLAB persistent
% variables to model state
>> hdlcoder_delays_eml
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




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!