llvm / llvm/circt

[ESI] [Cosim] DPI cosim Capnp server polling

Open
#2,122 0 comments 0 reactions 0 assignees View on GitHub
ESI
Dominant language
C++
Stars
2.2k
Forks
524
Avg merge
3d 2h
Merged PRs (30d)
46

Description

https://github.com/llvm/circt/blob/efd420ec9cf402b341c027fe9c435c8c29ab5912/lib/Dialect/ESI/cosim/cosim_dpi_server/Server.cpp#L207

Currently, the capnp DPI server polls for events in order to "listen" for the stop signal. I spent some time trying to get this working properly, but this hack is the best I could do. Ideally, the simulation thread would send a signal to the cosim capnp server through some libkj mechanism. Less ideally but better than what we've got, one would run the libkj event loop with a timeout.

More recently, libkj was documented: https://github.com/capnproto/capnproto/blob/master/kjdoc/tour.md
and a question was asked on how to run the event loop with a timeout: https://groups.google.com/g/capnproto/c/BU8olURJ6fE/m/Do117V12AQAJ?pli=1

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at lib/Dialect/ESI/cosim/cosim_dpi_server/Server.cpp around line 207, where the capnp DPI server polls for the stop signal. Read the linked libkj event-loop documentation and timeout discussion before choosing an approach. Done means the server can observe the simulation stop signal without the current polling hack.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.