Marty
Rationale
-------------
As embedded system development progressed throughout the 1970's and 1980's,
much of the product development cycle was spent working in the lab with a
hardware breadboard connected to a logic analyzer and a microprocessor
emulator. After weeks of lab development refining the prototype, many more
weeks were usually spent testing the prototype in the field under real world
conditions. This field testing often resulted in additional changes that
required additional lab testing. As a result, hardware development cycles
were often measured in terms of months and years instead of in terms of
weeks. As technology progressed throughout the 1990's and 2000's, computer
simulation in a number of different areas (circuit, logic, mechanical,
fluid, electromagnetic, etc.) reduced or completely eliminated much of the
required lab work. Designs were simulated, prototypes were fabricated,
verification tests were run, and the final prototypes were sent straight to
the field for real world testing. With designers having access to fast
simulators, the cycle times needed to correct field issues was significantly
reduced. Simulation has helped companies reduce their development schedules
by many months. As we move forward into the current decade, with multi-core
PC's loaded with gigabytes of ram and terabytes of disk, companies are
beginning to do most of the real world field testing right on the computer
using large, highly sophisticated physical models. These physical models
often contain hundreds of thousands (sometimes millions) of lines of C++ or
Fortran. An example illustrating the use of large physical modeling is how
UAV's are simulated flying through windy mountain passes and canyons with
all the engines, propellers, servos, ailerons, radars, and flight processors
actively running. Additionally, cars are now simulated in skid and crash
tests with the engine, drive train, suspension, anti-lock brakes, fuel
injection, and steering systems all fully engaged. These car models often
include a simulated driver or crash dummy as well. And not to be forgotten,
Nasa has simulated every Space Shuttle and deep space mission in this manner
for many years. Full real world system simulation has dramatically reduced
product development times by eliminating the need for extensive lab and
field testing. It is evident that we are entering the age of multi-language,
multi-disciplinary system simulation in which products go straight from the
simulator to a field evaluation unit then right to production. The need for
hardware simulation capability in this process, namely having access to
Verilog, VHDL, and Ada compilers, in addition to support for C, C++, and
Fortran is thus a mission critical requirement. This is the rationale for
pursuing the project.
Scope
--------
I am anticipating three phases of implementation.
The initial phase will have the following objectives:
* Develop individual compiler front ends for Verilog (using C) and VHDL
(using Ada)
* Develop a sufficiently complete Ada compiler for compiling the VHDL
front end
* Integrate Verilog, VHDL, and Ada compilers into the existing OW
framework
* Develop initial C interface libraries (VPI/VHPI) for Verilog and VHDL
Verilog, VHDL, and Ada will be separate, individual compilers that will
generate object files compatible with the existing linker, debugger, and
other tools. Ada has merits of its own, but it is syntactically very close
to VHDL and is an effective language for implementing the VHDL compiler
front end. It would be worthwhile developing a minimal Ada compiler just
capable enough to compile a VHDL front end written in Ada. Verilog is
syntactically close to C. I believe the existing C compiler front end could
be copied and easily modified to parse Verilog. The intent is to have all
three compilers use as much of the existing code generator software as
possible and to have Verilog and VHDL share a common runtime library that
will include a logic simulator. A logic simulator is a program that
evaluates and propagates logic switching events throughout a hardware design
using a data structure called an event wheel, or more technically a circular
event queue. Both Verilog and VHDL will additionally have separate runtime
libraries for C interface functions (VPI for Verilog, VHPI for VHDL) that
will need to be developed. The compiler will parse each HDL design file (.v
or .vhd), converting it directly into an object file (.obj). A simulation
executable file (.exe) is then created by linking all the HDL object files
(.obj) with a common simulator runtime library (.lib). This is what is
referred to as compiled simulation. The resulting simulation executable
(.exe) can be run either by itself to produce text and binary output files,
run along with a waveform viewer to produce real-time signal traces, or run
within the debugger along with the HDL and C/C++/Fortran source files in
what is called source level debugging. Since Verilog and VHDL object files
(.obj) will be compatible with all the other OW tools, C, C++, and Fortran
behavioral models will be able to be linked along with the HDL design files
then simulated and debugged together.
The second phase will have the following objectives:
* Develop a common logic synthesis back end for Verilog and VHDL
* Extend Verilog and VHDL compliance to the latest standards
* Further develop the C interface libraries (VPI/VHPI) for Verilog and
VHDL
* Develop a waveform viewer and a schematics editor for evaluating output
results
In synthesis mode, logic synthesis routines will replace the machine op-code
optimization routines in the existing compiler back end. Logic synthesis
works by generating and manipulating either logic gates or structures called
the configurable logic blocks of field programmable gate arrays, known as
FPGA CLB's. This is in contrast to generating and manipulating the cpu
op-codes that are processed by the existing compiler back end. Logic
synthesis algorithms are somewhat related to the existing op-code
optimization algorithms in that they modify the gates or CLB's generated
under the constraints of size and speed, or more specifically the
constraints of circuit area and logic delay. Synthesis algorithms differ in
that they use a different data structure called a binary decision diagram,
also known as a BDD, during the optimization process. The compiler parses
the HDL source files (.v or .vhd) and presents the synthesis routines with a
list of intermediate symbols representing the HDL design. The set of
existing intermediate symbols will need to be extended to include objects
like modules, processes, and signals that are present in HDL designs but are
not currently supported by the C, C++, and Fortran standards. The synthesis
routines convert these intermediate symbols into BDD's that are then
manipulated based on area and delay constraints provided for the hardware
design. Once optimized, the BDD's are then either converted to object files
(.obj) for gate level simulation or are converted to a hardware net-list for
integrated circuit (IC) or field programmable gate array (FPGA)
implementation. A hardware net-list is a listing of all the logic device
inputs and outputs along with all the logic signals interconnect them. In
the last stage of logic synthesis, referred to as retargeting, one must
choose a specific logic family or FPGA device from a given hardware vendor.
The vendor's specific device, or target library will include all the gate
and/or CLB definitions, the gate and/or CLB pin-outs, and all the
predetermined timing delays for the particular logic family or FPGA device.
In addition to processing the vendor timing delays, the final synthesis
routines will also request physical wiring delays that are generated by an
external IC or FPGA layout tool. This external delay processing, known as
timing back-annotation, is implemented using a timing file called the
standard delay file (.sdf). Gate level simulation takes into account all the
vendor target library delays and all the wiring delays determined by
external physical layout tools. The C interface libraries VPI for Verilog
and VHPI for VHDL will also need further enhancement. Additionally, since
the Verilog, VHDL, and Ada standards are currently in flux, much like those
for Fortran, additional work will be needed to update the compilers to the
latest specifications. Verilog is specified by IEEE 1364, VHDL by IEEE 1076,
and Ada by ISO/IEC 8652.
The third phase will have the following objectives:
* Add code generators and simulation models for embedded microcontrollers
* Add virtual system emulation and debugging support
* Add static timing capability to the logic synthesis routines
* Further enhance Ada language compliance and support
To augment the system's ability to simulate and debug embedded software,
code generators and simulation models will be developed for common embedded
microcontrollers, such as those in the 68K, Mips, and Arm families. Of
these, I suspect that Arm support will be a priority. The goal will be to
cross-compile the real-time source code to a given target cpu then engage
the source level debugger while the machine code executes on a Verilog or
VHDL simulation model of the target microcontroller. Since most embedded
systems have flash memories, UART's, timers, external logic, A/D and D/A
converters, buttons, displays, Ethernet and USB ports, and a real world
external environment, simulation models of these common components and
support for a built-in virtual machine environment (similar to QEMM) would
be both highly useful and desirable. Having all this support inclusive to
Open Watcom would be a major objective. Additionally, further system
enhancements will include adding static timing analysis capability to the
logic synthesis routines and further augmenting Ada language compliance.
Static timing analysis is a back end process that computes the worst case
timing delays through a gate logic network determining if critical set-up
and hold-time requirements are met for the flip-flop storage elements. This
is an analysis technique that eases the workload of verifying timing
requirements for full gate level simulations (most often a daunting
exercise). Static timing analysis has the ability to analyze a full gate
level design for the extremes of voltage and temperature, a technique known
as 4-corner testing.
Forum
--------
As the project moves forward, we are considering establishing a new
newsgroup to facilitate further discussion. This will be the news group:
openwatcom.users.hdl
Moving forward, I expect to be an active participant in the .contributors,
.hdl, and .fortran news groups while being generally available in chat room
#watcom at irc.freenode.net in the evenings and weekends CST US.
Timeframe
--------------
I would like to begin working on the project definition this fall while
coding efforts are underway for Fortran 2012. Phase 1 coding for the Verilog
and VHDL compilers could commence sometime after the OW 2.0 release this
spring. Coding for phase 2 and 3 is probably going to take a full year after
that. The coding priority right now is to complete Fortran 2012 for
integration into RC1 early next year.
Links
-------
Here are a few links that I hope you will find useful.
Hamburg VHDL Archive
http://tams.informatik.uni-hamburg.de/research/vlsi/vhdl
IEEE VHDL P1076 Working Group
http://www.eda.org/twiki/bin/view.cgi/P1076/WebHome
EDA Industry Working Groups
http://vhdl.org
GHDL (Gnu VHDL) Project
http://home.gna.org/ghdl
FreeHDL & Savant Projects
http://www.freehdl.seul.org
http://secs.ceas.uc.edu/~paw/savant
IEEE P1364-2005 Working Group
http://www.verilog.com/IEEEVerilog.html
Verilog Dot Com
http://www.verilog.com
Icarus Verilog
http://iverilog.icarus.com
Veriwell Verilog
http://sourceforge.net/projects/veriwell
MVSIS Project (Berkeley)
http://embedded.eecs.berkeley.edu/Respep/Research/mvsis
ABC Project (Berkeley)
http://www.eecs.berkeley.edu/~alanmi/abc
Ada Standards
http://www.adaic.org/ada-resources/standards
Boeing Flies on 99% Ada
http://archive.adaic.com/projects/atwork/boeing.html
-----------
When it comes to ada however I would like to pipe in a bit, it is a bit
complex to implement, I personally know 2 such projects that never got
finished despite having finance and people behind it etc., and a number
of projects that did get finished were a bit "lacking" to say the least.
The only working open source implementations had companies and finance
behind the development.
Although originally designed to be safe the complexity of ada is such
that it has been rejected for some safety concious tasks precisely
because of that, mathematically proving a solution as safe was deemed to
be an impossible task, parts of the European high speed train security
systems are written in the terminally obscure language variant
Safe-Modula 2 for that reason, i.e. very similar to ada but
infinitesimally simpler thus much less work to prove and in fact it was
deemed less work and thus safer to implement a compiler from scratch
than to use an existing ada compiler
If I may I would like offer 2 alternative proposals:
1) Implement an Oberon-07 front end to Watcom from scratch using the
Wirth book and possibly some code as the basis, it is a very simple but
very functional language, I know of at the least 4 people that have made
complete compilers for 3 different processor architectures from that
source in a matter of weeks/months *on their own, in their spare time*.
After that implement ada in steps from that front end, Oberon and Ada
are in some respects very different languages, however the basics are
the same, they are both Pascal derivatives and the underlying concepts
are very similar and in many instances the same.
The complexity of implementing ada has meant that there are out there a
number of sub-set that are reasonably well defined and function on their
own as full programming languages that could function as stepping
stones, e.g. define a series of functional ada sub-sets of incremental
complexity that can be used and tested on their own until you reach a
full ada implementation.
Doing this you will in addition get at the least one language extra to
the Watcom project which may be a boon or a detraction, mileage may vary
If the oberon 4 Debugger could be somehow hijacked into the project even
better, it is the simplest most functional debugger I have seen but I
man not sure about what license it was released under
http://www.inf.ethz.ch/personal/wirth/Articles/Oberon/Oberon07.Report.pdf
The oberon-07 language report
Oberon p0rn
2) Take the BSD licensed Pascal and/or Modula-2 front-ends from the
Amsterdam Compiler Kit and port them to Watcom and then build from them
as above. They are archaic but perfectly functional or at the least the
M2 one was when I looked at it a few years back, in fact the maintainer
of the ACK has suggested that someone actually does that as he is
occupied with updating it for use with C frontend and x86 backend these
days since that is what the Minix project needs and the 2 front endes
are not likely to make it to the 6.0 version of the system.
IMHO -- No. I've been coding since the late 60s, assembler and Fortran consistently with
other languages coming and going (e.g., COBOL, PL/I, C, Pascal, AWK, Lisp &c)
Recently we've starting going to FPGA based systems (instead of 8051 style) and I've been
using Xilinx ISE to "compile" VHDL into bit-files and FlashRom programming files. One
of the students (senior honors thesis, then continuing with a Master's) did the base work,
and I inherited the project.
HDLs and programming languages often have very similar syntax, but the semantics are radically
different. HDLs describe hardware, i.e., circuitry. Parallelism is automatic unless sequentiality
is forced upon the implementation. Issues such as meta-stability and race-conditions need be
considered. (OK -- yes, in various real-time situations, software needs to consider race conditions,
but ...).
Some similarity does exist, but, the rather good agreement and similarity in syntax tends to be
deceiving, as the semantical similarity is much less.
I've never done much with simulation languages (e.g., Simula) but the little I know of them I
would expect their semantics to be closer to that of HDLs than either procedural or functional
programming languages. Perhaps OO stuff also has more semantic similarity. But the two big
HDLs, VHDL and Verilog, are Ada-like and C-like (respectively) in syntax. Syntactically neither is
very like any OO (with which I have but passing familiarity).
So, (again emphasizing MHOO), hacking a parser together, fairly straightforward. Expanding the intermediate for new constructs, fairly straightforward. Back end -- big time headache, highly
non-trivial -- and for targeting ?what? Xilinx? Altera? any of the bit players? And which
families?
Plus, is the IDE to be extended to allow for schematic display from HDLs? Schematic capture? How
about state machine diagrams -- generation and display? Input? <arrgh>
Get Xilinx ISE (webpack version is free) and play with some of the example projects if you want to
get an idea of the scope of the project.
Easier to add an ADA front-end, or even a COBOL front-end, than to develop all the HDL handling tools.
Probably more complex than any common HLL in fact because of the requirement
of the compiler to maintain a project level (library) view of a program, all
its relationships etc. It's like configuration management and compilation
all rolled into one.
> The only working open source implementations had companies and finance
> behind the development.
In fact they had government money (your tax dollars if you're American)
behind them. Adacore (GNAT) was based on a publicly funded project at NYU
(New York University). The other big toolchain vendors are all almost
strictly federal sales. Lots of money (and talent) involved.
> Although originally designed to be safe the complexity of ada is such
> that it has been rejected for some safety concious tasks precisely
> because of that,
That is silly and untrue. SPARK is a safe subset of Ada with reduced
complexity. It's been around a fairly long time and even Ada itself is
demonstrably safer and more lucid than the best C++ or Java.
> mathematically proving a solution as safe was deemed to be an impossible
> task,
As it is in all complex programming projects
> After that implement ada in steps from that front end, Oberon and Ada
> are in some respects very different languages, however the basics are
> the same, they are both Pascal derivatives and the underlying concepts
> are very similar and in many instances the same.
Calling Ada a Pascal derivative is a dramatic oversimplication and also
imparts nothing useful to a person reading that statement.
Modula-2 is dead for all intents and purposes. I don't say it's a bad
language, it's interesting and solves some of the fundamental
not-ready-for-real-programming issues baked into Pascal. But it's not a
language to be resurrected. Ada is still in production, still has an active
standards committee, still has hundreds of millions of dollars behind it. I
don't think OpenWatcom can put together an Ada compiler though.
> Modula-2 is dead for all intents and purposes. I don't say it's a bad
> language, it's interesting and solves some of the fundamental
> not-ready-for-real-programming issues baked into Pascal. But it's not a
> language to be resurrected. Ada is still in production, still has an active
> standards committee, still has hundreds of millions of dollars behind it. I
> don't think OpenWatcom can put together an Ada compiler though.
>
M2's current status is neither here nor there, I was pointing out that a
basis for a start of a compiler front end exists and it is well worth
taking a look, the license is BSD and unless there are other reason for
rejecting it (which there may well be, and in fact are likely to exist)
nothing harmful can come out of it
Doing a quick search I could not find any other code that could be
appropriated, other front end implementations of ada or related
languages all have distribution restrictions that make them incompatible
with the watcom license
And this would not be a first, a number of other ada compilers
historically started out from Pascal, and is just an idea anyway
Neat
>
> This project is in the very early stages; there is essentially nothing
> there right now. Due to other pressures on my time I don't expect to
> make any significant progress for a while but to give myself at least a
> little structure I have set a release date of December 31, 2020.
If some of my friends experience is to go by that is a bit optimistic ....
>> Although originally designed to be safe the complexity of ada is such
>> that it has been rejected for some safety concious tasks precisely
>> because of that, mathematically proving a solution as safe was deemed to
>> be an impossible task...
>
> The SPARK subset of Ada is used for safety critical systems in a number
> of contexts. It is possible to mathematically prove the correctness of
> programs using SPARK (for some suitable definition of "correctness"). I
> ought to know; I use SPARK daily in connection with a project I'm
> working on at Vermont Technical College.
Yes, but it is still more complex than it needs be for a safe system
>
> Full Ada is also used in a number of safety critical contexts, such as
> flight control systems on various aircraft, to name one example. In any
> case it is far easier to verify programs in Ada than in C or even C++,
> but that's not saying much as both C and C++ are highly unsafe.
yes, they sort of cheat as they use multiple computers, I think Airbus
has triplets for each decision for critical system, at the least 2 have
to agree before an action is taken
It's
> more interesting to compare Ada vs C with advanced tool support, or to
> compare Ada vs some other modern language designed for robust systems
> such as Eiffel. Comparing Ada directly with C is like kicking a man who
> is down.
It is also apples and oranges, C is a subset of a 60's system language
and for things like drivers it is if nothing else a great step forward
from assembly, but seeing mission critical or highly distributed systems
written in C rather than something like Erlang makes me cringe
>
> That is silly and untrue. SPARK is a safe subset of Ada with reduced
> complexity. It's been around a fairly long time and even Ada itself is
> demonstrably safer and more lucid than the best C++ or Java.
>
Er... but C and Java are not structured languages, so even Turbo Prolog,
Atari Logo, DOS batch files, Commodore 64 Comal and Apple Integer BASIC
are more safe than these 2, you could just as well compare Ada to
Javascript and PHP and state that it is inherently safer, meaningless
comparison.
SPARK is sill too big for safety as the sole factor, and SPARK was the
toolset that was rejected in favour of SM2 in the example I took,
funnily enough. The SPARK project started in the very early 80's and
took what, 10 - 15 years to be deemed robust enough to be used in a safe
environment (Program Validation Limited, the company that took over the
SPARK project from U. of Southampton was founded in 1983 expressly for
that purpose, despite what Wikipedia says the SPARK project pre-dates
Ada 83).
The SM2 was delivered in weeks
>> mathematically proving a solution as safe was deemed to be an impossible
>> task,
>
> As it is in all complex programming projects
>
There is a huge gap between the words impossible and difficult, given
that in at the least one instance this has happened impossible does not
apply across the board
> Calling Ada a Pascal derivative is a dramatic oversimplication and also
> imparts nothing useful to a person reading that statement.
Are the theatrics necessary ?
Ada is quite literally a Pascal derivative, the first experimental
compilers were derived from Pascal compilers it was not until later when
a proper definition of it had been hammered out that it was redone in
SETL (spelling?). I know people mention Algol 68 as the basis of Ada but
the semantics of ada are those of Pascal not of Algol, hence a
derivative in any meaning of the word just like Pascal is a derivative
of Algol, it is now radically different in some ways, the object system
and the massive Ada library is obviously missing and the language
continues to diverge slowly but the basic semantics and structure not
so, I thinks peoples experience of later versions of Turbo Pascal tends
to colour their view of the language a bit too much.
Remember that people used to port their pascal code to ada with minimal
changes in the 80's, that was usually UCSD Pascal, Dec or ISO at the
time obviously ...
A parser than handles Pascal/M2/Any other Wirth family language is very
close to being able to handle basic Ada language itself, that it lacks
the library etc. has nothing to do with with the front end itself. That
is the reason that I suggested it, nothing more, nothing less.
Marty
Unless you just really love Ada or really need some crucial
standardized features (tasks?), I don't see why it has to be Ada, per
se. And if your only goal is to bootstrap a VHDL front-end, you don't
need to write your own Ada for that, just use GNAT (or one of several
others). Ask yourself what features you need first, then worry about
what kind of syntax you want. (It's not so much that they're all the
same, they're not, but some of them explicitly glean features from
other languages. And of course some are better supported than others.
But this is probably all hypothetical anyways.)
On Oct 10, 2:22 pm, Olafur Gunnlaugsson <oligunnla...@gmail.com>
wrote:
> ann 10/10/2011 16:30, skrifa i Anonymous:
>
> > Modula-2 is dead for all intents and purposes.
Normally that would sound like quite a stretch, but it's probably
"mostly" true. :-/ The amount of compilers, books, source code,
and users isn't nearly enough for it to be considered anywhere near
top tier (or truly active) anymore. For whatever odd reasons, it seems
to have been most popular from 1987-1991.
> > I don't say it's a bad
> > language, it's interesting and solves some of the fundamental
> > not-ready-for-real-programming issues baked into Pascal.
Right, it's a quite nice language (IMHO) and has a lot going for it.
But some people moved on to other languages, Wirth (Oberon) and
Odersky (Scala) included! Even some of the people who moved on to
other similar languages (Modula-3) have moved on to other other
languages (Cardelli -> C#, F#). Java and Python borrowed quite a bit
from M3.
Actually M3 is (I suppose) a cousin to Oberon and Object Pascal with
feature parity similar to C++ and Ada. But I suppose M2 is
"cleaner" (or at least easier) to implement. Even FreePascal can
target JVM now (and similarly various Oberon dialects target .NET). My
point is there is (intentionally) a lot of overlap there.
> > But it's not a language to be resurrected.
Well, depends on how dead you really think it is. If it's good, use
it, simple as that. If you want something else, that's fine too.
Nobody's stopping you from building such a compiler.
Two (very loosely speaking) "free" ISO M2 compilers exist (XDS, GM2),
and one more commercially for Mac (p1) also. XDS seems not updated
since 2005 (and by default non-commercial only??). But GM2 (GPL3) and
p1 (commercial) are still being updated very recently.
> Ada is still in production, still has an active
> > standards committee, still has hundreds of millions of dollars behind it. I
> > don't think OpenWatcom can put together an Ada compiler though.
Modula-2 has a standard (ISO 10514, 1996) and two official optional
extensions (1997, 1998). Apparently the big selling points are the
standardized library (albeit weird), COMPLEX, TRY..CATCH, etc.
> M2's current status is neither here nor there, I was pointing out that a
> basis for a start of a compiler front end exists and it is well worth
> taking a look, the license is BSD and unless there are other reason for
> rejecting it (which there may well be, and in fact are likely to exist)
> nothing harmful can come out of it
The sole maintainer for ACK these days has never even finalized the
6.0 release. Traditionally it used (his words) an "extremely arcane"
build process for old *nix machines. (Now 6.0 uses some weird embedded
Lua stuff, heh. Yes, I built it like once or twice for PuppyLinux. It
doesn't really support barely any OSes anymore, at least not 6.0, plus
5.6 is too old. The Linux support is a "dirty hack.") I don't even
think the compiler suite was updated past 1994 before he touched it
(mid 2000s). Just FYI, it only supports PIM3, no ISO anything, thus
you may or may not like that.
It's written in C, so "in theory" (famous last words) it could be
buildable by OW. And yes, BSD-licensed.
> Doing a quick search I could not find any other code that could be
> appropriated, other front end implementations of ada or related
> languages all have distribution restrictions that make them incompatible
> with the watcom license
>
> And this would not be a first, a number of other ada compilers
> historically started out from Pascal, and is just an idea anyway
(unverified but easy to check later, if anyone cares)
SmallAda was the Pascal-y subset written in Turbo Pascal. GWU NYU
Ada83 was in C. [Old] Augusta (very wimpy subset) was written in
unstructured BASIC and later ported to Turbo Pascal. And of course
GNAT uses the GCC backend but the frontend is written in itself. Heck,
you may have better luck with P2C (or similar).
There are a number of tools out there to experiment with HDLs. But from my
position (down in the trenches) HDL tools are of little value (except maybe
in the classroom) unless they target hardware. I don't know how many
tutorials I've seen that spend most of their time talking about simulation
related directives and almost no time about how a construct actually maps to
a flip-flop. Not that simulation doesn't have a place, but if people
weren't designing hardware, HDLs wouldn't exist, and that point seems to be
lost on many people.
OK, so what's my point? As has been mentioned, the back end is completely
orthogonal to software compiling. If we had a few hundred programmers
anxiously waiting for somthing to do, maybe this would be a useful idea.
However, given that we are only slowly working towards a credible C++
implementation, I don't see a lot of people looking for new challenges that
are almost unrelated to OWs mission. It would take mostly an entirely
different group of people to understand the requirements and issues and be
able to contribute to a competitive implementation. If economics are any
indication, commercial HDL tools are about 10 times the cost of commercial
C/C++ compilers. Granted some of that is because there is a smaller
customer base.
At the end of the day, to be worth the effort to create it, it would have to
seamlessly integrate into the back-ends of Xilinx's ISE and similar products
from Actel, Altera, etc. Since ISE already has a reasonably credible front
end (at least for small to medium projects) that is freely downloadable from
their web site, it would have to have some pretty impressive specs to gain
much of a user base..
Wilton
Marty
"Rugxulo" wrote in message
news:c932b578-35b2-464a...@g25g2000yqh.googlegroups.com...
Marty
"Wilton Helm" wrote in message news:j788qr$6ro$1...@www.openwatcom.org...
On Oct 13, 10:13 pm, "Marty Stanquist" <martys...@att.net> wrote:
>
> This is true. Ada is just one approach. With Verilog and VHDL having
> published BNF's, you could also parse them in C using tools such as Lex and
> Yacc or using a more direct approach similar to that used in f77.
(To quote Peter in an earlier related message in this thread):
"As part of my Augusta project I will have an Ada parser. Could that
parser be used as a starting point for a VHDL parser? Maybe. However,
my
parser uses the ANTLR parser generator and is ultimately in Java.
These
tools are not part of the Open Watcom ecosystem so a VHDL compiler in
Open Watcom would probably need a different parser than the one I'm
building."
You could probably also use Coco/R (or one of its variants), which
isn't as exclusively tied to C/C++ as yacc/bison and lex/flex. It's
been ported to a variety of host languages and also has several
example grammars for various languages too.
> �ann 10/10/2011 16:30, skrifa�i Anonymous:
>
> >
> > That is silly and untrue. SPARK is a safe subset of Ada with reduced
> > complexity. It's been around a fairly long time and even Ada itself is
> > demonstrably safer and more lucid than the best C++ or Java.
> >
>
> Er... but C and Java are not structured languages,
That's debateable but anyway not relevant to a safety discussion. Safety has
to do with *type* safety and enforcement, pointer/memory management, runtime
bounds checking on all types, general error handling capabilities, etc. all
things Ada does much better than most other HLL. I said C++ btw and you
changed it to C. C is less safe than C++ or Java, obviously.
> so even Turbo Prolog, Atari Logo, DOS batch files, Commodore 64 Comal and
> Apple Integer BASIC are more safe than these 2, you could just as well
> compare Ada to Javascript and PHP and state that it is inherently safer,
> meaningless comparison.
The comparison I made is useful because C++ and Java are about the only
other languages used where safety is on the requirements list at all (of
course they fall very short) and considered more or less equivalent from a
functional standpoint (can accomplish similar things) with Ada. None of the
languages you listed are. The three I mentioned are compiled languages with
runtimes and have other important similarities. I don't understand your list.
> The SM2 was delivered in weeks
Yes, we agreed Ada is complicated. But Modula-2 isn't a replacement for Ada,
it's a replacement for Pascal and how fast something can be delivered isn't
a worthy goal for something of value. It's a goal if you want something
cheap. You have can have it cheap but it won't be fast or good.
> There is a huge gap between the words impossible and difficult, given
> that in at the least one instance this has happened impossible does not
> apply across the board
It applies in any meaningful context. One scenario does not a proof make.
> > Calling Ada a Pascal derivative is a dramatic oversimplication and also
> > imparts nothing useful to a person reading that statement.
>
> Are the theatrics necessary ?
What theatrics? I could rightfully call Pascal an ALGOL derived language.
There was nothing new at all in Pascal except the one-pass compilation
system and the emphasis on write once compile many times design. Pascal is
an academic exercise, it's not a language for production. It's not any kind
of a foundation language and misunderstanding it to believe it is is
harmful.
> Ada is quite literally a Pascal derivative, the first experimental
> compilers were derived from Pascal compilers
Citation please. What I read about the Ada language competition leads me to
believe all the compilers were custom written and the papers submitted also
seem to reflect that.
> it was not until later when a proper definition of it had been hammered
> out that it was redone in SETL (spelling?).
SETL was used for prototyping an *educational* version of Ada called
Ada/Ed. AFAIK it was never used in production and it was certainly not used
to write the GNAT (NYU) Ada even though GNAT was written at the same place
as Ada/Ed. And what does this have to do with our discussion? The only
commonality is that Pascal and Ada/Ed are both useless for real-world
problems for many reasons, including efficiency of generated code. They can
be considered proof of concept, not much more than that.
> Remember that people used to port their pascal code to ada with minimal
> changes in the 80's, that was usually UCSD Pascal, Dec or ISO at the
> time obviously ...
I can port Ada to PL/I and back more or less the same way except for a few
features. Pascal did relatively nothing, of course it's easy to port to any
common block structured language *from* Pascal to ALGOL68, PL/I, Modula-2.
That also doesn't mean much except as an academic exercise.
> A parser than handles Pascal/M2/Any other Wirth family language is very
> close to being able to handle basic Ada language itself, that it lacks
> the library etc. has nothing to do with with the front end itself. That
> is the reason that I suggested it, nothing more, nothing less.
I would like to hear from compiler writers who really know Ada because I
don't agree with your conclusion. I think you are oversimplifying things
because the basic syntax of Ada is not what makes Ada powerful. The
extensive type checking and tracking of program relationships and runtime
checks are what make Ada Ada.
> I would like to hear from compiler writers who really know Ada because I
> don't agree with your conclusion. I think you are oversimplifying things
> because the basic syntax of Ada is not what makes Ada powerful. The
> extensive type checking and tracking of program relationships and runtime
> checks are what make Ada Ada.
My experience building an Ada compiler is limited right now, but it
seems to me that the syntax of Ada is not particularly complex. Aside
from a few fairly well understood ambiguities, I believe parsing Ada to
be straightforward. I'll know better after I get my parser working. :)
This is to be contrasted with C++ which is nightmarish to parse. It is
an unfortunate aspect of C++ that so much effort must be expended to
parse it. That's effort that could have been used instead in improving
other aspects of the compiler. Also the complexities of parsing C++
inhibits tool support. Fortunately projects like clang are trying to
address this by provided a highly modular compiler that allows tools to
just call the parser like a library. Very cool stuff. Kudos to the clang
guys.
The complexity of Ada is definitely mostly in its semantics which are
very rich with many subtleties. In my Augusta project I intend to
approach the problem by first building a parser for the full language,
since I don't think that will be too scary (probably with some
restrictions related to symbol table handling). After that I will focus
on the SPARK subset of Ada. A compiler that can only compile SPARK would
still be useful to some and yet much easier to build. SPARK removes a
large number of features from the full language. Once that is done I'll
worry about adding on the additional features in some manner.
Peter