Commit Graph

8 Commits

Author SHA1 Message Date
Hideto Ueno 9828707817
[Arc][Sim] Lower Sim DPI func to func.func and support dpi call in Arc (#7386)
This PR implements initial support for lowering Sim DPI operations to Arc. 

* sim::LowerDPIFuncPass implements lowering from `sim.dpi.func` to `func.func` that respects C-level ABI. 
* arc::LowerStatePass is modified to allocate states and call functions for `sim.dpi.call` op. 

Currently unclocked call is not supported yet.
2024-08-07 13:51:14 +09:00
fzi-hielscher 458717bc24
[Sim] Add printing operations and transformation from non-procedural to procedural flavor (#7292) 2024-07-17 14:09:59 +02:00
fzi-hielscher 911988f8e1
[Sim] Flatten format string concatenations in canonicalizer (#7316)
Provide an interface to get the flat format string for sim.fmt.concat operations and opportunistically flatten during canonicalization.
2024-07-16 22:35:33 +02:00
fzi-hielscher 0899943a5b
[Sim] Add format string type and format specifier ops (#7208)
Adds just the operations. Appropriate lowerings are to be added in future commits.
2024-07-09 17:31:37 +02:00
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
Nandor Licker 7209c2a145 [NFC] Fix sim tests 2024-03-19 05:34:35 -07:00
Nandor Licker 74ecb32ec9
[Sim] Introduce wrappers on top of `sv.finish`/`sv.fatal` (#6737) 2024-02-23 20:12:10 +02:00
Nandor Licker cc8fabb16d
[Sim] Initial implementation of the `sim` dialect (#6561) 2024-01-10 18:02:39 +02:00