Open chenbo-again opened 6 days ago
SVA support in ImportVerilog would be absolutely amazing! :partying_face: :rocket:
You could definitely try to directly lower to ops in the LTL` dialect. I'm not entirely sure if this will work, but it's worth experimenting with. Directly going to LTL is similar to directly emitting HW/Comb/Seq in ImportVerilog: it's theoretically possible, but SV has a very weird type system and semantics that make a direct conversion very complicated.
A few weird things in SVA are going to be annoying. One thing I remember are very strange clock inference rules for sequences and properties, where you have to traverse the AST to find a parent always @(*edge ...)
construct, or a @(*edge ...)
property, or a clocking block, or a default clocking block, to figure out what the clock for an LTL sequence is. LTL also has no concept of property and sequence declarations and reuse, variable capture, etc..
My guess is that you'll want to capture the SVAs in the Moore dialect pretty quickly, because there are going to be some impedance mismatches between the low-level nature of LTL and the craziness that is SystemVerilog. But you definitely don't have to start out with that :smiley:! Make sure to emit errors for all the SVA expressions and cases that are not supported :smiley:
Hello fabian and hailong: @fabianschuiki @hailongSun2000 I'm trying to implement SVA for moore, and the main problem is how to implement property and sequence for moore, I find that dialect LTL is a good choice to model SVA.
I think it's a good choice to directly convert SVA to LTL and bypass Moore, we can saving out time and avoid to model sva property again.