Jump to content
  • 0

HDL Coder with Zedboard


paolo_unice

Question

Hi everyone;

I want to build a real-time control system using the Zedboard. I want to connect the board using the Pmod modules to the actuator and the sensor, and I want to ask you if it is a good idea to do it throught the Simulink HDL Coder. So, My first question is: is it possible to interface the Pmod AD/DA with the board using simulink coder? And how?

I did it in Vivado in VHDL but now I want to build the overall system in Simulink and I don't have idea how to do it.

Thank you so much. Paolo

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

@paolo_unice,

You may be asking in the wrong forum.  I'm sure if you asked in the simulink forum, you'd get a different answer.  But, for now, I'll give you my own background.

As a government official, in my past life and years ago, I was asked to evaluate the simulink design process and tool flow.  A contractor we had hired loved the flow and swore by it.  So, he did a bunch of work for us and delivered it to us using simulink.  Here are some of the conclusions from my experience with the project:

  1. Simulink files can only be read with simulink.  If, years down the line, you decide you can no longer afford simulink, you will lose any and all of the code you have written for it.  (This happened to us.  The project died, we had no more reason to maintain our license, but years later I wanted to use and examine some of the circuits we had created--I could not do so.)
  2. It is very difficult to do diff's of binary objects, whereas diff's of text files (either VHDL or Verilog) is fairly easy to do.  Hence measuring changes is easier with text than simulink.
  3. Sure, simulink can be used to create verilog or VHDL ... but like most computer generated code, no one will be able to read it.
  4. At one time, I wanted to find how the contractor had built a particular circuit within his simulink design.  With VHDL or Verilog, I would've started from the external bits at the top level, and just followed them into the design.  However, with his simulink design, I had to do a search through the various components of his design before I could find (about four levels deep) the pins that connected to the part in question.
  5. In VHDL or Verilog, you are presented with the low level details of how an implementation must work.  These details, such as how many bits a particular number gets, where the decimal point is, etc., are very important to a design.  When I watched my contractor work with simulink, these details were hidden behind menus, so it was harder to tell if the fine print was done properly.

So, to answer your question, is it a good idea to put something through a simulink encoder process, my answer would be that I would not recommend it.

I'm sure others would give you other answers.

I also had the opportunity to work on a design where I wanted MATLAB's scripting capabilities, and I wanted to mix these with my design.  I chose instead to build my own very simple interface (4 hrs complexity), to then get relevant parts and pieces of my design in and out of matlab.  Simulink wasn't required, I saved a boatload of money, and had all the info I needed on my design.

As for whether or not interfacing something with simulink is possible, ... you might wish to check on the simulink forum.

Just my two cents,

Dan

P.S.  I just built a decoder for the PModMIC3 A/D, and I have built an example of testing it from C++ that you can find here, if you are at all interested in alternatives.  I think the PModMIC3 uses a similar A/D based interface.

Link to comment
Share on other sites

Thank you @D@n, I understand your point of view. I want to find a solution in Simulink because someone requires it to me, and I'm more skilled with the Mathworks products.

I tried to open the Vivado project created by Simulink and you're right, it's quite impossible to read it. I hope I will find a solution.

 

Bye, Paolo.

Link to comment
Share on other sites

To all,

I wanted to add a few notes to this discussion.

High complexity of modern control systems can be dealt with by extensive modeling and optimization on the design stage. Simulink has tools to deal with this. It was the main tool in several of my projects all the way from proposal stage to the design and implementation.

FYI, all car computers were designed with it. A car computer code is mostly a bunch of nested state machines and PID controllers. All of it can be tested automatically before going into hardware production.  They also generate code automatically and the beauty of this that it works and bugs free.

Personally I generated only C-code from the custom Simulink motor control model. The code was readable, although name were cryptic, which we changed. By the way it is always difficult to read code written by somebody else, but everyone should be able to understand block diagrams.

As with every new tool one should choose wisely because it requires investment in $$ and time (which is also $$). Learning curve is steep. Modeling is as good as the model you created. It can easily produce a lot of good looking but false results. Custom system will also need to create custom libraries. However, in my opinion it is indispensable in the system design.

It should be noted that the license is perpetual but requires annual subscription fee to obtain updates. It is optional.

Looking at the rising complexity of the systems and expectations to produce at lower cost / shorter time I don't see other way but to use automatic code generation.

Also when we face deadlines the HDL development can be very stressful and I appreciate any tool that help me to reduce it.

Hope it makes sense.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...