用于流程/任务调度的简单离散事件仿真库(C ++)?

时间:2021-05-17 02:15:30

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).

但是我意识到我应该在DES引擎上构建它,因为我没有容量(除了设置标志并检查每个“时钟滴答”上的每个节点),因为它说“在10个循环中,执行此操作”(即在预定时间提高信号并处理将来应该发生的事件或者当满足预定标准时的事件。

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.

免费软件和C ++会很棒。

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

有人有主意吗? (我最接近的 - 感谢其他一些相关的问题 - 就是所谓的SIMLIB。)

Thank you so much!

非常感谢!

2 个解决方案

#1


0  

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

您可以尝试开放虚拟平台(OVP)。它似乎提供了您正在寻找的模拟器类型。

#2


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.

试试SystemC,这是一个免费软件库。我警告说它不是“开源”,因为许可证不是FOSS兼容的。

#1


0  

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

您可以尝试开放虚拟平台(OVP)。它似乎提供了您正在寻找的模拟器类型。

#2


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.

试试SystemC,这是一个免费软件库。我警告说它不是“开源”,因为许可证不是FOSS兼容的。