I am trying to make a Pattern Detector who will detect the pattern 1101001 by using Moore FSM. My FSM is working fine but when i am trying to generate a HDL code,I am getting many errors and unable to rectify them. Please help me to generate Verilog/VHDL Code. I am unable to do it. I will be very thankful to you,please help me ?

 Réponse acceptée

Kiran Kintali
Kiran Kintali le 6 Oct 2020

0 votes

>> makehdl(gcb)
### Generating HDL for 'Pattern_Detector_19a/Subsystem'.
### Using the config set for model Pattern_Detector_19a for HDL code generation parameters.
### Starting HDL check.
### Begin VHDL Code Generation for 'Pattern_Detector_19a'.
### Working on Pattern_Detector_19a/Subsystem/Chart as hdlsrc\Pattern_Detector_19a\Chart.vhd.
### Working on Pattern_Detector_19a/Subsystem as hdlsrc\Pattern_Detector_19a\Subsystem.vhd.
### Generating package file hdlsrc\Pattern_Detector_19a\Subsystem_pkg.vhd.
### Creating HDL Code Generation Check Report Subsystem_report.html
### HDL check for 'Pattern_Detector_19a' complete with 0 errors, 0 warnings, and 0 messages.
### HDL code generation complete.
>> ver
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.6.0.1472908 (R2019a) Update 9
MATLAB License Number: unknown
Operating System: Microsoft Windows 10 Enterprise Version 10.0 (Build 19041)
Java Version: Java 1.8.0_181-b13 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
Can you try the attached model again? As you can see I do not see such error.

4 commentaires

kameshwar saini
kameshwar saini le 6 Oct 2020
Same errors again,but this time only 3 errors.Last error is removed now.
Sir,why am i getting these errors, any idea ?Please help.From 10 AM i am trying this and now its almost 1:00AM.
Kiran Kintali
Kiran Kintali le 6 Oct 2020
Modifié(e) : Kiran Kintali le 6 Oct 2020
can you share your >ver output?
MATLAB Version: 9.6.0.1472908 (R2019a) Update 9
kameshwar saini
kameshwar saini le 7 Oct 2020
I was using old version previously but now i updated to : MATLAB Version: 9.6.0.1472908 (R2019a) Update 9.
Still getting the following errors.
kameshwar saini
kameshwar saini le 7 Oct 2020
I got the mistake , I was generating the HDL code for whole system,while i have to do it for subsystem only.
Now i did it for subsystem, and i able to generate it successfully . Thank you so much sir, I have no words to say thanks to you. Thank you again.

Connectez-vous pour commenter.

Plus de réponses (1)

Kiran Kintali
Kiran Kintali le 6 Oct 2020

1 vote

HDLCoder does not support Stateflow chart configured with floating-point types.
Based on your application you do not need support for floating-point types for this pattern detection example. Changing input types to boolean and changing output assignment to logical true/false for OV variable you can trivially transform the moore chart model to use efficient logic types and generate a hardware friendly state machine.
With these changes I was able to generate code for the model.
>> makehdl(gcb)
### Generating HDL for 'Pattern_Detector/Subsystem'.
### Using the config set for model Pattern_Detector for HDL code generation parameters.
### Running HDL checks on the model 'Pattern_Detector'.
### Begin compilation of the model 'Pattern_Detector'...
### Applying HDL optimizations on the model 'Pattern_Detector'...
### Begin model generation.
### Model generation complete.
### Begin VHDL Code Generation for 'Pattern_Detector'.
### Working on Pattern_Detector/Subsystem/Chart as hdlsrc\Pattern_Detector\Chart.vhd.
### Working on Pattern_Detector/Subsystem as hdlsrc\Pattern_Detector\Subsystem.vhd.
### Generating package file hdlsrc\Pattern_Detector\Subsystem_pkg.vhd.
### Code Generation for 'Pattern_Detector' completed.
### Creating HDL Code Generation Check Report Subsystem_report.html
### HDL check for 'Pattern_Detector' complete with 0 errors, 0 warnings, and 0 messages.
### HDL code generation complete.
If you have trouble loading the model try
web(fullfile(docroot, 'simulink/gui/simulink-preferences-model-file-pane.html'))
slprivate('showprefs') and uncheck "Do not load models created with a newer version of Simulink"
or run this command
>>set_param(0, 'ErrorIfLoadShadowedModel', 'off')

5 commentaires

kameshwar saini
kameshwar saini le 6 Oct 2020
Thank you for trying to help me,but sir i am unable to load the model, I unchecked - "Do not load models created with a newer version of Simulink"
But getting 2 warnings and a blank modal is loaded.
Can you please save it in previous version of MATLAB 2019a,It will be a great help for me. I am too much worried about it,Please kindly help me.
Kiran Kintali
Kiran Kintali le 6 Oct 2020
If you have trouble loading the model try
web(fullfile(docroot, 'simulink/gui/simulink-preferences-model-file-pane.html'))
slprivate('showprefs') and uncheck "Do not load models created with a newer version of Simulink"
or run this command
>>set_param(0, 'ErrorIfLoadShadowedModel', 'off')
kameshwar saini
kameshwar saini le 6 Oct 2020
I tried but the same but did not work for me.
Kiran Kintali
Kiran Kintali le 6 Oct 2020
Attached 19a model.
kameshwar saini
kameshwar saini le 6 Oct 2020
Sir Model is loaded ,but when i am generating HDL code, it is showing following error for me . Why?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Code Generation dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by