Home    Bloggers    Messages    Webinars    Resources   
Tw  |  Fb  |  In  |  Rss
Jan Decaluwe

MyHDL: Thinking Software at the RTL Level

Jan Decaluwe
Page 1 / 2 Next >
Page 1 / 5   >   >>
jandecaluwe
jandecaluwe
2/15/2013 3:03:23 PM
User Rank
Blogger
Re: Without Compare...
@a1js "Otherwise, the idea of equal support for unequal target languages leads inescapbly to the lowest common denominator in terms of usable capabilities of the source language."

Not necessarily, because the MyHDL convertor actually does "a little synthesis of its own".

Normally I don't call it synthesis because the convertor doesn't change the abstraction level. However, it does support useful abstractions that are not natively supported by Verilog, or VHDL, or both.

One set of abstractions comes "for free" as the Python interpreter is used to elaborate the design. For example: structural recursion. See this example. I wouldn't know how to do this in Verilog natively.

Another set are native MyHDL abstractions that the convertor supports. Examples:

intbv - hardware friendly integer-like type without limits on the range (unlike VHDL)

modbv - modular type for modulo arithmetic (borrowed from Ada (!))

@always_seq - process that infers the reset structure automatically

100%
0%
aj1s
aj1s
2/7/2013 9:42:20 PM
User Rank
Guru
Re: Without Compare...
"I will try to explain briefly how MyHDL conversion works, I think this should address most of your questions."

Jan,

Thanks for the explanation. I understand your motivations. The choice to convert an elaborated instance, rather than the myHDL source itself, is certainly much easier.

But it also distorts the comparison between the languages, especially if the converted code is used (whether intended or not) as the basis of the comparison.

I agree whole-heartedly that verilog needs a lot more help in abstraction than does VHDL. But that also means additional accommodations (conversion effort) are due. Otherwise, the idea of equal support for unequal target languages leads inescapbly to the lowest common denominator in terms of usable capabilities of the source language.

Andy

50%
50%
jandecaluwe
jandecaluwe
2/6/2013 3:38:05 PM
User Rank
Blogger
Re: Without Compare...
@aj1s "Secondly, the use of the "found" variable is not necessary... Not using an exit statement misses another opportunity to illustrate your point."

No, here you are jumping to conclusions too fast.

Apart from checking whether the experts are awake :-), I have 3 good reasons not to use an exit condition in this post. They are not related to my personal preferences or inherent restrictions from Python, MyHDL conversion, or Verilog.

The first reason is that I'm following a step-by-step approach, as I explained elsewhere. "found" demonstrates that a variable can meaningfully take different values during a single clock cycle evaluation. To those unfamiliar with using variables in synthesizable code, that's an important message.

The second reason is Verilog related: exit conditions can be done, but result in ugly workaround code involving named loops and disable statements. It is an excellent illustration of how MyHDL conversion can make it easier to write code, but that is all.

The third (blocking) limitation is that while such Verilog code above is perfectly synthesizable and I've never known it otherwise, it turns out that Xilinx ISE doesn't accept it. (Quartus does.) Imagine the damage to the central message if I would have posted this code and then it turned out that "it was not synthesizable"... 

Point 2 and 3 may be useful in future posts, once I'm sure that the message in the present column is understood.

100%
0%
jandecaluwe
jandecaluwe
2/6/2013 5:47:46 AM
User Rank
Blogger
Re: Without Compare...
@Andy "First, it appears that the conversion process from myHDL to verilog/VHDL does a little synthesis on its own."

I will try to explain briefly how MyHDL conversion works, I think this should address most of your questions.

In a MyHDL flow, VHDL/Verilog are used as a back-end format. The conversion goals are as follows:

1) as easy as possible
2) same level of support for both Verilog/VHDL
3) readibility counts to trace back issues

From 1) follows the idea to maximally use the Python interpreter itself. In particular, the convertor doesn't start from source, but from an elaborated instance. As as a side effect, this gives amazing power, because any conversion restriction only applies to code inside processes. Embedded Python scripting comes for free ...

2) means that indeed, there are compromises because I want equal support for the two. MyHDL is more urgent for Verilog users :-)

3) means that I try to make code readable - however because of 1) it is certainly not how I would write VHDL manually. In particular, the type mapping is done in such a way to make conversion as easy as possible.

 

100%
0%
jandecaluwe
jandecaluwe
2/5/2013 3:54:48 AM
User Rank
Blogger
Re: Hardware-Software Convergence
@Jezmo "Jan I've never been called conventional before I'll have to tell them at work they'll laugh"

Let me be precise. You are a good reference whenever someone thinks that I am exaggerating about the absurdities of the "conventional wisdom" in HDL design.

For example: it is clear that you don't exactly understand how concurrent signal assignments work in VHDL. It also should be obvious to any reasonable observer that using variables instead would solve this confusion for you. Yet you don't even want to look at it.

In short, you choose to ignore a technique that would benefit you more than anybody else.

Tell them that, they'll laugh even harder.

50%
50%
JezmoSSL
JezmoSSL
2/5/2013 12:46:21 AM
User Rank
Blogger
Re: Hardware-Software Convergence
Jan I've never been called conventional before I'll have to tell them at work they'll laugh

50%
50%
cfelton
cfelton
2/4/2013 6:13:04 AM
User Rank
Guru
Re: Hardware-Software Convergence
@jezmo I don't think you are giving most folks here credit,
These are seasoned engineers with a fair amount of design
experience and they are providing interesting topics to
ponder. If we have the tools at our disposal we might as
well use them. Having good examples which work (as Jan
provides) and which don't is very valuable.

Noone appears to be under the illusion that magically, if you
write software for a Von Neumann type computer working hardware
will emerge from thin air. Rather constructive convesations
are being presented which *software* techniques can enhance a
designers effectiveness and quality.

100%
0%
cfelton
cfelton
2/4/2013 5:57:51 AM
User Rank
Guru
Re: Hardware-Software Convergence
@Gracia and @jan. Thanks! The page does need updating there
have been some nice enhancements to MyHDL since I originally
posted the page. Updating the CIC example would be a
worthwhile activity.

50%
50%
cfelton
cfelton
2/4/2013 5:46:51 AM
User Rank
Guru
Re: Hardware-Software Convergence
@Goran HDL is the tool, it is like math. Just knowing math
(or the math) doesn't fully help an engineer. You need to
know what problem(s) you are solving and/or what you are
designing. As Jan eludes in the post, you need to be
hardware aware, know which levels of abstraction assist,
intimate with the tools, and not stuck on old clichés.

Sounds like we are in good company!

The /Yo-Yo/ analogy is interesting, good tools allow the
designer to access and evaluate the different levels of
representation. It does seem like many designers get their
/Yo-Yo/ stuck "walking the dog" and forget to come out of
the low-level abyss.

50%
50%
cfelton
cfelton
2/4/2013 5:24:21 AM
User Rank
Guru
Re: Hardware-Software Convergence
@Gracia- Thanks! I participate in the APP conversations
from time to time. I have been having a ton of fun with
MyHDL. Now I just need to figure out how to allocate more
time for MyHDL designs!

50%
50%
Page 1 / 5   >   >>
More Blogs from Jan Decaluwe
Thanks to its VHDL and Verilog conversion functions, MyHDL development can be seamlessly integrated with standard HDL development flows.
Until a few weeks ago, I knew next to nothing about cellular automata. Therefore, my first step was to try to discover as much as possible as quickly as possible about this application domain.
Why don't we make a little modeling contest out of this? Given a width 'n,' write a reference model in Verilog or VHDL that returns the corresponding Gray code in a representation of your choice...
VHDL and Verilog have served us exceptionally well, but they also have significant issues. In order to realize the full potential of HDL design, we need a better HDL. In this blog, the creator of MyHDL -- Jan Decaluwe -- considers the concept of signal assignments.
flash poll
follow us on twitter
follow Xilinx on twitter
like us on facebook
like Xilinx on facebook
All Programmable Planet     About Us     Contact Us     Help     Register     Twitter     Facebook     RSS