Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Object-oriented access bottleneck
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-12-08 (19:09)
From: Brian Hurt <bhurt@s...>
Subject: Re: [Caml-list] Object-oriented access bottleneck
On Mon, 8 Dec 2003 wrote:

> On Mon, 8 Dec 2003, Brian Hurt wrote:
> > I'm writting a place and route program in Ocaml, and hitting a lot of
> > places where I'd like to express things as objects.
> Now there's an interesting discussion! Where in your design do you
> want objects, if you don't mind my asking? What design style (custom,
> standard cell,  FPGA, ...) is your P&R program intended to address?

Initially targeting Virtex II FPGAs, but I'm keeping an eye open for 
supporting other FPGAs, CPLDs, and possibly even standard or custom cell 
placement.  The core algorithm is a genetic algorithm.  At the level of 
the genetic algorithm genomes are a class, as I don't care much how the 
genome is structured.  At this level, performance of member function calls 
is almost irrelevent.  But within a given genome, I have places where 
using objects would be helpfull.

A genome is three things: a set of cells to place, a mapping of how those 
cells are placed into the FPGA, and a cost function.  The cost function is 
at heart a set of "constraints" (I don't like that word, but can think of 
a better one).  The obvious constraint is that several cells are on a 
shared net.  The cost function is then determined by the size of bounding 
box.  Other constraints would be that cell uses a TSB (only two per CLB), 
etc.  There is an obvious object interface at the constraint level.

The mappings are also an opportunity to have a class interface.  I might 
want to have multiple levels of mappings- one mapping handling IOBs, 
another CLBs, another multipliers, etc.  This way I only map IOBs to IOBs, 
and don't have to worry about what happens if I try to put an IOB in a 
CLB.  The top level mapping is then the sum of the sub-mappings.

Maybe I'm not seeing how to do this with not-objects.  

> My admittedly narrow minded bias based EDA tasks is that I'd rather have
> a more powerful system of records than what OCaml currently has, instead
> of classes, and that when I do write code with classes, it's not really using
> late-binding/open-recursion.

What I want to do is to be able to hand some code a hunk of state and 
several functions to act on that state.  The number of functions is large 
enough, and the functions are complex enough, that shared context is 
clumsy.  And I can't think of a way to pass in a reference to a module.

> If you're into EDA though, there are quite a few APIs based on C++ and now
> Java and Python (I'm thinking of OpenAccess here) which may pressure anyone
> writing OCaml bindings into a "me tOO" design.

I'm not working at that level yet.  If worse comes to worse, I'll write a 
small interface program in Java or whatever to deal with the translation.  
Have the Ocaml spit out into a pipe some internal format of the solution, 
and the Java program just parses the solution and passes it along to the 

"Usenet is like a herd of performing elephants with diarrhea -- massive,
difficult to redirect, awe-inspiring, entertaining, and a source of
mind-boggling amounts of excrement when you least expect it."
                                - Gene Spafford 

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: