rust_hdl icon indicating copy to clipboard operation
rust_hdl copied to clipboard

Add package declaration in declarative part

Open Chris44442 opened this issue 1 year ago • 3 comments

This is addressing the first two tasks of #225

Chris44442 avatar May 30 '24 14:05 Chris44442

@Schottkyc137

This is what I came up with. I am not sure if the changes in analysis/design_unit.rs are sensible. I am still not quite 100% what is going on in that particular code region tbh lol. Oh and I only added one test. Not sure if we need more.

Chris44442 avatar May 30 '24 19:05 Chris44442

So far things look good to me. One thing to be wary of is that the package declaration might not be visible in the global scope. In other words,

package foo is
begin
  -- ...
end package foo;

Would mean that foo can be imported globally (I.e. use foo.bar would make bar visible) whereas

entity baz

package foo is
begin
  -- ...
end package foo;

end baz;

would probably mean that foo can only be accessed from within baz. I'm unsure what the LRM says in this regard though.

Also, I think that we should have more tests. The main purpose of the thorough testing is for regressions, I.e. checking that things also work after auxiliary changes.

I'm somewhat busy at the moment, so I can only give any further, code specific review later; latest however Sunday.

That being said thanks again for taking up this issue!

Schottkyc137 avatar May 31 '24 13:05 Schottkyc137

Alright thanks, I will have a look at your notes later this day.

I have also pushed the Disconnection Specification to my fork. It now parses, but analysing Disconnect still does nothing for now. I will try to figure out how the analyse stuff works next, so I can try to implement it. The thing with Disconnect though is that it also depends on Guarded, which only seems partially implemented at the moment.

Chris44442 avatar May 31 '24 14:05 Chris44442