5

Simple question: I built a quasi-processor simulator that takes a precedence graph, determines priorities (and "ready" instructions), schedules the tasks on available functional units, etc. Pretty much a very basic simulator.

But I realized I should have built it on top of a DES engine, as I have no capacity (other than setting a flag and checking every node on every "clock tick") for saying things like "In 10 cycles, do this" (i.e. raising signals at pre-defined times and handling events that are supposed to happen in the future or when predetermined criteria have been met).

I could obviously implement this myself; built an "event" class, stick them on a queue, and at the end (or beginning) of every cycle, check the queue and see what's on there, but I figure there's no point in reinventing the wheel.

So complex network simulators are obviously WAY overkill. I don't need fancy modeling, or queuing or anything like that. All I need is a built in clock, and the ability to set events to happen, raise flags when things happen, etc, as I described above.

Freeware and C++ would be great.

Anyone have any ideas? (The closest I've come -- thanks to some other somewhat related questions -- is something called SIMLIB.)

Thank you so much!

user770901
  • 414
  • 1
  • 4
  • 15
  • If you have already implemented a scheduler for tasks, couldn't you let timer events be another task? – jxh Jul 01 '12 at 04:42
  • +1 for trying to avoid wheel reinvention. From your question it seems that you would like _some_ additional features from a DES engine (otherwise it's nothing else than a loop and a sorted list of events, so using _any_ specific library seems to be overkill), so what else you need? Scalability (parallel simulation)? Support for random distributions / RNGs? Do you prefer a specific world view (e.g. see http://www.informs-sim.org/wsc10papers/019.pdf)? – Roland Ewald Jul 02 '12 at 13:47
  • Sorry for the delay in response! The scheduler tasks aren't written generically. Timer-based events would require major tinkering and the whole point is to not reinvent the wheel. – user770901 Aug 21 '12 at 21:25

2 Answers2

0

You could try Open Virtual Platforms (OVP). It seems to provide the type of simulator that you are looking for.

Arani
  • 400
  • 6
  • 21
0

Try SystemC, it's a freeware library. I'd warn though that it's not "open-source" since the license is not FOSS-compatible.

Giovanni Funchal
  • 8,934
  • 13
  • 61
  • 110
  • Yeah, no thanks. I've looked at SystemC for other things -- namely FPGA design -- and it fails at that too. The whole project seems like/is a mess. I appreciate the time you to to respond, but I'm not interested in that. Regardless, it's insanely overkill for what I want to do. Setting up what amounts to a behavioral description of my system doesn't make a hell of a lot of sense. – user770901 Aug 21 '12 at 21:27