<div dir="ltr"><br><div class="gmail_extra">Hello!.<br></div><div class="gmail_extra">Sorry about the delay in answering. it was "final exam season" and winter break in between.<br></div><div class="gmail_extra">

<br>I've just recently been updated about the project's final purpouse.<br></div><div class="gmail_extra">It must generate code for real time execution on the microcontroller.<br><br>In fact, the diagram to be "compiled" represents a discrete time control system. <br>

This is, not all functions must be implemented, they are limited to discrete time, quantization, sample/hold and some more.<br></div><div class="gmail_extra">Other blocks, for example the integral block, are excluded from the code generation.<br>

</div><div class="gmail_extra">This simplifies a lot.<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Answered inline.<br></div><div class="gmail_extra"><br><div class="gmail_quote">2014-06-26 9:32 GMT-03:00 Clément David <span dir="ltr"><<a href="mailto:clement.david@scilab-enterprises.com" target="_blank">clement.david@scilab-enterprises.com</a>></span>:<br>
<br></div><div class="gmail_quote">[snip]<br><br></div><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><div>
> I am about to begin the developement of a coder that takes a xcos<br>
> diagram and generates C code  suitable to be ran on a ARM Cortex M3<br>
> uC, a STM32FXXX in particular.<br>
<br>
</div>Great ! Do you plan to generate an application using a POSIX-like OS ?<br>
if not, what's the minimal set of feature of your platform (eg.<br>
bare-metal, contiki / Osek like, RTEMS, Embedded Linux, Full Linux) ?<br></blockquote><div><br></div><div>It'll be bare-metal for now. Since it is a single process, I don't think a full OS will be necessary. (An ad-hoc OS?)<br>
At most a hardware abstraction layer.<br>
 <br></div><div> [snip]<br><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br>
> b) Should I begin from scratch? I think I can reuse the xcos parser<br>
> and some other code involving the diagram description.<br>
<br>
</div>In my view, to generate code that perform the same way as the simulator<br>
you have to re-use the cpr structure (help scicos_cpr). The better way<br>
to kick things off is to start from the current generator and start<br>
refactor it (it's a nightmare) / implement some code generator templates<br>
per simulation function.</blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Using well design code generator templates will allow you to both reduce<br>
the actual generated code size and runtime requirements.<br></blockquote><div><br></div><div>The limitation in the set of blocks that will actually be implemented makes this problem very "templatizable".<br><br>
</div><div>I will soon push the code into a github repository.<br><br></div><div>Regards.<br></div><div>Matías Silva Bustos.<br></div></div></div></div>