tags:

views:

51

answers:

2

Consider the problem of circuit evaluation, where the input is a boolean circuit C and an input string x and you want to compute C(x). (Assume fan-in 2 if you like.)

This is a 'trivial' problem algorithmically, however it appears non-trivial to implement when C can be huge (think several million gates) and memory management becomes an issue.

There are several ways this problem can be approached, trading off memory, time, and disc access. But before going through all this work myself, does anyone know of any existing implementations of algorithms for this problem? It would be surprising to me if none exist...

+1  A: 

For C/C++, the standard digital circuit design & simulation system for more than 10 years now is SystemC.

It is a library that allows you to design digital logic in C++. There are supporting software that allows you to do timing analysis and even generate schematic netlist for C code.

I've only played with it a little before deciding that I was more comfortable with Verilog. But it is a mature piece of software with lots of industry support. Googling around will yield a lot of information including several tutorial pages.

slebetman
Is it open source?
The reference implementation by the OSCI is. Check out their license:http://www.systemc.org/about/org_docs/license/
slebetman
SystemC is actually an IEEE standard. So apart from the reference implementation by OSCI there are also other commercial implementations - just like there are many implementation of the C standard library.
slebetman
I think I'm looking for something different. I don't need a program for *designing* circuits, I need a program for *evaluating* circuits. (Presumably, as part of this there will have to be some standardized format for specifying circuits to be evaluated. But my main interest is the evaluation algorithm.)
The two things are one and the same. What SystemC does is simply compile what is given. The compiled program can then be run. Running the program effectively simulates the circuit. SystemC doesn't actually design anything, just like a C compiler doesn't actually write programs - programmers write programs.
slebetman
Thanks for your help.But I apologize because I must be missing something: Nowhere on the SystemC site do I see any code (source or executable) for download.
A: 

It sounds like Binary Decision Diagrams could be used for your task? There are well-known algorithms (and implementations) of these which are very compact in terms of memory usage, given that they are designed to be used on huge state spaces.

Gian