Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate a class hierarchy diagram for generated models #207

Open
hs-apotell opened this issue May 7, 2020 · 4 comments
Open

Generate a class hierarchy diagram for generated models #207

hs-apotell opened this issue May 7, 2020 · 4 comments

Comments

@hs-apotell
Copy link
Collaborator

Title says it all. Annotating the class whether or not it is abstract will be helpful.

@alaindargelas
Copy link
Collaborator

BTW, this information is in the Verilog DataModel itself,
this file only contains the DataModel diagrams for easy search, abstract classes are dotted-line:
https:/alainmarcel/UHDM/blob/master/third_party/Verilog_Object_Model.pdf

I find this documentation much better than any automatically generated diagram.

Also, in the existing headers/*.h, the Object Factory is #if 0 #endif for the Abstract classes (You can't make an object).

What form of annotation would you prefer if the above does not suffice?

@hs-apotell
Copy link
Collaborator Author

I find this documentation much better than any automatically generated diagram

The documentation you are pointing to is a good read but not from a quick reference point of view right in the middle of programming session serving as a reference guide. I contend that there is a need for a supporting document.

I find myself asking this question quite often - I need access to function VpiName (or some other function), what is the nearest class that I can typecast a pointer to so that I get the information without having to cast it to the most derived class. This question cannot be answered by just browsing the corresponding header (UHDM::expr doesn't tell me that UHDM::ref_obj subclass' it)

I am still familiarizing myself with the source code. I am sure this pain will ease up with time as I memorize the hierarchy. But I would argue that anyone would have similar questions while onboarding.

Here's a good example from Qt and Java

My primary interest is the class hierarchy which will be immediately useful. The annotation calling out specific class whether or not it is abstract is a wish item.

@hzeller
Copy link
Collaborator

hzeller commented Sep 17, 2021

I once played aroud with generating dot files in #73 , but the graphviz rendering is not entirely useful and looks a bit messy due to the way each edge is rendered.

@hs-apotell
Copy link
Collaborator Author

Check out plantuml and elk layout. Python also has a few graph rendering engines that might be worth checking out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants