ghdl-yosys-plugin icon indicating copy to clipboard operation
ghdl-yosys-plugin copied to clipboard

Expose src attribute to yosys

Open pepijndevos opened this issue 4 years ago • 5 comments

Currently the source location data present in GHDL is not preserved when creating a Yosys netlist. This PR adds the /src attribute to every cell when present in GHDL.

Note that this does not yet fix the problem where SymbiYosys just displays the instance name, but it's a good change nonetheless. I'll do a bit more digging on the SymbiYosys problem.

This requires PR https://github.com/ghdl/ghdl/pull/898 on GHDL for the Get_Source function.

pepijndevos avatar Aug 20 '19 10:08 pepijndevos

Oh, it might be that it needs a dollar prefixed name Otherwise it thinks it is a labeled assertion (label: assert(x);) and therefore prints the name instead of the location

There appears to be some logic for this in ghdl.cc regarding Sname_Artificial, so maybe there is a bug there. But I'm stuck on magic numbers again. The prefix of my assume gate is a magnificent 378. Ah... ok... I see...

pepijndevos avatar Aug 20 '19 12:08 pepijndevos

Do we need to set the location on all gates, or just on assume/assert ?

tgingold avatar Aug 20 '19 13:08 tgingold

I mean, in principle there is no reason an AND gate can't have a corresponding source location. It's up to the GHDL side which ones are preserved.

pepijndevos avatar Aug 20 '19 13:08 pepijndevos

I'm still completely stuck on why assert/assume are not system names in to_str, so I hope you have an idea what's going on here. Once that's fixed, source locations in SymbiYosys should be working.

pepijndevos avatar Aug 20 '19 13:08 pepijndevos

What's the status of this and ghdl/ghdl#898 ? My understanding is that not a lot of GHDL cells have a location set, but I think it could be merged and extended later with more locations?

pepijndevos avatar Dec 01 '19 09:12 pepijndevos