[myhdl-list] Re: A question of philosophy?
Brought to you by:
jandecaluwe
From: Jan D. <ja...@ja...> - 2005-04-27 21:17:22
|
Haitao Zhang wrote: > It seems to me there are three different demands put on HDLs: hardware > description itself is mostly declarative (in the sense they describe > structural relationship that can not directly execute on a sequential > program semantics); but it also has a time axis to it (even though > hardware can only be structural some times it is more convenient to be > able to pretend that we can specify it by defining what we want along > the time axis); AND at times we want to add a imperative component to > it: think of parameter evaluation, conditional generation, or even > like myhdl that natively supports simulation. There is tension in > language design if one wants to do all three well. The "normal" HDLs > lack a strong support for the last aspect, while Python is a > inherently sequential language and makes the first (structural) aspect > harder to carry out (?) without some contortion along the way (the > tension between declaration, partial eval, and evaluation). I don't > know if there is a good solution, but I wonder if Jan or anyone else > has given this question some thoughts. Yes, I have given these matters lots of thought, but as you raised an large amount of issues at the same time, I found it hard to formulate an answer with a size suited for posting :-) Let me only say this. I don't think there is an essential semantic difference in the sense you refer to, between traditional HDLs and MyHDL. The essential need is massive light-weight parallelism. For this purpose, Python generators are just fine. Structure is simply what you build on top of that, with more or less syntactic sugar. The essential contribution of MyHDL as I see it, is that is a HDL with "scripting power". In better words, it is a very high-level, dynamically typed language. Whether this is actually relevant for hardware design remains to be proven, but I think so. In other computing domains it is; if not, we wouldn't be using any Perl, Python, Ruby, tcl, or php, but we would use C++ or Java for everything. My final remark is about "sequential" statements. It seems to me that you fall into the classic HDL trap of mixing two completely different meanings of the word. In hardware, "sequential" means "clocked" or "along the time axis". The opposite is "combinatorial". However, in a computer program, it refers to the relevance of the order of the statements. Here, a synonym is "procedural" (preferred) and the opposite is "declarative". My point is that these two meanings of the same word have little to do with each other. For example: in HDL design, the easiest way to describe a combinatorial (= non-sequential) function, is often a procedural (= sequential) description. It is no coincidence that all HDLs that really became popular (such as Verilog and VHDL) have strong support for procedural descriptions. Regards, Jan -- Jan Decaluwe - Resources bvba - http://jandecaluwe.com Losbergenlaan 16, B-3010 Leuven, Belgium Using Python as a hardware description language: http://jandecaluwe.com/Tools/MyHDL/Overview.html |