circt/test/Dialect/Sim
Hideto Ueno ee7d59be99
[Sim] Add DPI func/call and lowering (#7042)
This PR adds DPI func/call op and SimToSV lowering. 

`sim.dpi.func` is a just bridge to `sv.func`. This op can be lowered into `func.func` in the future for Arc integration. 

`sim.func.dpi.call` represents SystemVerilog DPI function call. There are two optional operands `clock` and `enable`.

If `clock` is not provided, the callee is invoked when input values are changed. If provided, the dpi function is called at clock's posedge. The result values behave like registers and the DPI function is used as a state transfer function of them. `enable` operand is used to conditionally call the DPI since DPI call could be quite more expensive than native constructs. When `enable` is low, results of unclocked calls are undefined and in SV results they are lowered into `X`. Users are expected to gate result values by another `enable` to model a default value of results. For clocked calls, a low enable means that its register state transfer function is not called. Hence their values will not be modify in that clock.

A function that returns an explicit return is not supported yet.
2024-06-13 19:11:56 +09:00
..
round-trip.mlir [Sim] Add DPI func/call and lowering (#7042) 2024-06-13 19:11:56 +09:00