caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* HDCaml 0.2.0
@ 2005-11-04 18:26 Tom Hawkins
       [not found] ` <1131138146.26370.11.camel@maze.mythral.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Hawkins @ 2005-11-04 18:26 UTC (permalink / raw)
  To: cf-user, caml-list

HDCaml is a hardware description language embedded in OCaml.  Given a 
digital design in HDCaml, the tools will output a synthesizable Verilog 
netlist with PSL assertions for verification.

Though HDCaml is still in early beta, 0.2 has undergone a major cleanup 
of the API.  All comments are welcome.  To download...

   http://www.confluent.org/


To generate the [undocumented] example...

 > ocaml hdcaml.cma
         Objective Caml version 3.09.0
 

# Hdcaml.Example.all_prims ();;


Enjoy!

-Tom


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [cf-user] HDCaml 0.2.0
       [not found] ` <1131138146.26370.11.camel@maze.mythral.org>
@ 2005-11-05 18:16   ` Tom Hawkins
  2005-11-05 21:52     ` [Caml-list] " Thomas Fischbacher
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Hawkins @ 2005-11-05 18:16 UTC (permalink / raw)
  To: Ray Heasman, cf-user Mailing List, caml-list

Hi Ray,

Ray Heasman wrote:
> Hi Tom,
> 
> Thanks for the update. It evokes a few questions.
> 
> On Fri, 2005-11-04 at 12:26 -0600, Tom Hawkins wrote:
> 
>>HDCaml is a hardware description language embedded in OCaml.  Given a 
>>digital design in HDCaml, the tools will output a synthesizable Verilog 
>>netlist with PSL assertions for verification.
> 
> 
> Is confluence still going to be around? I haven't used it for a few
> months, but I really liked it. I actually wrote useful stuff for work in
> it. I stuck with an older version though, because I needed a consistent
> environment.

It's not going to disappear, but I am no longer actively developing it. 
  However, I'm more than willing to fix the occasional bug.

> 
> 
>>Though HDCaml is still in early beta, 0.2 has undergone a major cleanup 
>>of the API.  All comments are welcome.  To download...
>>

> 
> I have no experience with ocaml, though I intend to play some day. Is
> there any reason I should use HDCaml instead of confluence? Also, I tend
> to prefer VHDL over verilog (I am a bondage-and-discipline programmer),

I think you just answered your own question.  Unlike Confluence, OCaml 
has an excellent type system that catches a vast majority of bugs at 
compile time.  OCaml's type system is far stronger than that of C++, 
Java, and even VHDL.  And unlike these languages, OCaml's compiler is 
smart enough to infer types automatically -- type declarations are 
usually optional.

OCaml and Haskell programmers have an expression: "Once it compiles, it 
usually just works!"

> so I am not overjoyed that HDCaml only does verilog.

The HDCaml Verilog generator is only 90 lines of code.  In time, HDCaml 
will write out VHDL, SystemC, and other popular netlist formats.  Maybe 
you would like to write the VHDL back-end?  There is no better way to 
learn a new language than writing a real application.

> 
> I'm interested if you have some sort of game plan in mind. I started
> losing the plot when you moved to the FNF and generating stuff for
> verification tools.   I have generally worked on small fry designs
> (largest has been 70000 gates) in a pretty informal FPGA environment. I
> like the idea of verification, but I feel you are so far ahead of me
> that I don't even understand what you are trying to do anymore. An
> overview would be very very interesting to me.

The real benefit of HDCaml is that it is embedded in a real [powerful] 
general purpose programming language.  Most of the development tools are 
already in place, including:

- Compiler (ocamlc)
- Interactive Interpreter (ocaml)
- Debugger (ocamldebug)
- Profiling (ocamlprof)
- Source Code Documentation Generator (ocamldoc)
- Standard Libraries (the basic data structures are all ready written)

The other benefit is, the language that describes hardware is the same 
language that can analyze and transform hardware descriptions.  What 
kind of analysis and transformations are possible?  Obviously, we need 
some netlist generators (transforming the intermediate circuit 
representation into VHDL).  Here are a few other examples:

- Custom Reports
   - How many flops, multipliers, and memories are in my design?
- Custom Lint Checks
   - Does my circuit have any combinational loops?
- Custom Optimizations
   - Remove all null effect logic in a circuit.
   - Replace register enables with clock-gating.
- Circuit Visualization
   - Writing the circuit to Graphviz dot.
- Manipulate the Design Hierarchy
   - Expand or collapse design levels.
   - Merge two asynchronous circuits.
- Rough timing estimation.

Most of these "plug-ins" are trivial, requiring only about 30-80 lines 
of OCaml.  We can take this a step further by starting to simulate and 
verify circuits within OCaml.  Here are some possibilities:

- Converting a circuit into a simulatable object.
- Stimulus generation.
   - Directed testing.
   - Constrained random.  (Possibly another OCaml embedded language?)
- Co-simulate with real firmware.  (OCaml can interface with C.)
- VCD generation.  (We all like to look at waveforms.)
- Model checking.
- Automated theorem proving.
   - HOL Light
   - MetaPRL

In short, you'll have a unified environment for design and verification.

-Tom


> Perhaps some homework
> reading material too, seeing as I don't have the time to actually dig
> into real code right now.
> 
> Thanks for your work so far. I really think confluence is an inspired
> idea.
> 
> Keep well,
> Ray
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] Re: [cf-user] HDCaml 0.2.0
  2005-11-05 18:16   ` [cf-user] " Tom Hawkins
@ 2005-11-05 21:52     ` Thomas Fischbacher
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Fischbacher @ 2005-11-05 21:52 UTC (permalink / raw)
  To: Tom Hawkins; +Cc: Ray Heasman, cf-user Mailing List, caml-list


On Sat, 5 Nov 2005, Tom Hawkins wrote:

> OCaml and Haskell programmers have an expression: "Once it compiles, it
> usually just works!"

Well, at least not from my experience. This may be true as long as you do 
algorithmically un-interesting things, but in practice, for code that uses 
more involved bookkeeping, one often still has to do quite extensive 
debugging.

Besides this, I think that HDCaml is a quite neat approach.

-- 
regards,               tf@cip.physik.uni-muenchen.de              (o_
 Thomas Fischbacher -  http://www.cip.physik.uni-muenchen.de/~tf  //\
(lambda (n) ((lambda (p q r) (p p q r)) (lambda (g x y)           V_/_
(if (= x 0) y (g g (- x 1) (* x y)))) n 1))                  (Debian GNU)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-11-05 21:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-04 18:26 HDCaml 0.2.0 Tom Hawkins
     [not found] ` <1131138146.26370.11.camel@maze.mythral.org>
2005-11-05 18:16   ` [cf-user] " Tom Hawkins
2005-11-05 21:52     ` [Caml-list] " Thomas Fischbacher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).