<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 23/03/15 09:37, Maciej Fijalkowski
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAK5idxTzbQhJnkAM8D=c+5LzSJC1oQ91RpF-AmYh-FDOkj8ahw@mail.gmail.com"
      type="cite">
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 12px;"
        lang="x-unicode">
        <pre wrap="">On Mon, Mar 23, 2015 at 10:53 AM, Henry Gomersall <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:heng@cantab.net"><heng@cantab.net></a> wrote:
</pre>
        <blockquote type="cite" style="color: #000000;">
          <pre wrap=""><span class="moz-txt-citetags">> </span>On 23/03/15 08:33, Maciej Fijalkowski wrote:
</pre>
          <blockquote type="cite" style="color: #000000;">
            <pre wrap=""><span class="moz-txt-citetags">>></span>
<span class="moz-txt-citetags">>> </span>I must say we had quite a bit of a discussion and it seems we did not
<span class="moz-txt-citetags">>> </span>understand what are you trying to achieve. What is the goal of what
<span class="moz-txt-citetags">>> </span>you're doing? Translating MyHDL (or verilog) to rpython and compiling
<span class="moz-txt-citetags">>> </span>it? Something else? Writing the converter itself in RPython?
</pre>
          </blockquote>
          <pre wrap=""><span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span>Ah, my apologies for not being clear. The goal is to translate RPython
<span class="moz-txt-citetags">> </span>(MyHDL) to VHDL or Verilog.
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span>Essentially, the valid <span class="moz-txt-underscore"><span class="moz-txt-tag">_</span>convertible<span class="moz-txt-tag">_</span></span> MyHDL would have the constraint of
<span class="moz-txt-citetags">> </span>being restricted to RPython. This is essentially a mix of hardware specific
<span class="moz-txt-citetags">> </span>types, some simple types and control flow (it's inside a simple generator,
<span class="moz-txt-citetags">> </span>and the function is wrapped in a decorator to provide some hardware specific
<span class="moz-txt-citetags">> </span>semantics, but I suspect this is not helpful detail).
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span>So, we have a series of generators in which the generator code, and all
<span class="moz-txt-citetags">> </span>types referenced inside the generator are either written in RPython, or are
<span class="moz-txt-citetags">> </span>conceptually a base type (that is, a type that should not be burrowed into
<span class="moz-txt-citetags">> </span>and is a direct representation of a hardware feature), that describes the
<span class="moz-txt-citetags">> </span>activity of hardware.
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span>The intention would be to use PyPy to translate these RPython blocks into
<span class="moz-txt-citetags">> </span>VHDL or Verilog.
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span>There is support code that is normal python that surrounds these generators
<span class="moz-txt-citetags">> </span>which is normal Python, but that is just essentially to set up the name
<span class="moz-txt-citetags">> </span>space and attributes of the generator, which is then returned as the active
<span class="moz-txt-citetags">> </span>object.
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span>Does that all make more sense?
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span>Cheers,
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span>Henry
</pre>
        </blockquote>
        <pre wrap="">RPython does not emit verilog or vhdl. How are you going to address
that problem? Also, what precisely are you achieving by using RPython
toolchain?
</pre>
      </div>
    </blockquote>
    <br>
    No it doesn't. The VHDL/Verilog parts need to be written.<br>
    <br>
    There is a task of inferring flow from a restricted subset of
    Python, from which V* can be generated. Any solution to the problem
    looks remarkably like what I understand is being done by RPython.
    Would you suggest a better strategy?<br>
    <br>
    The current solution is built on traversing the AST and special
    casing certain inferred structures. The IR is never explicit and so
    it's hard to do much with the flow graph. The concept is that by
    building on the RPython flow object space as an intermediate
    representation, much more flexibility can be added to the
    convertible code (e.g. inferring translated structures from the IR,
    rather than from the code).<br>
    <br>
    Cheers,<br>
    <br>
    Henry<br>
  </body>
</html>