Example of Surelog/UHDM usage #782
Replies: 11 comments 3 replies
-
HTML report: |
Beta Was this translation helpful? Give feedback.
-
UHDM Usage: |
Beta Was this translation helpful? Give feedback.
-
"Another long-tem goal is to write a tool to track all the possible transaction paths inside the SoC": |
Beta Was this translation helpful? Give feedback.
-
All of these template files have no |
Beta Was this translation helpful? Give feedback.
-
You don't need to look at the template directory, it is used to create UHDM (Internal). I'm pointing to some examples there because it eats its own dog food: some UHDM code manually written uses the machine generated UHDM code. The best examples are under util and tests (Although the tests are using Google tests - no main - and are compiled using Cmake). |
Beta Was this translation helpful? Give feedback.
-
Also: https://github.com/chipsalliance/Surelog/blob/master/src/hellodesign.cpp |
Beta Was this translation helpful? Give feedback.
-
I understand there is also a Python API. Are there Python examples showing how to parse/elaborate/load an existing UHDM file, and traverse it using the Python API? |
Beta Was this translation helpful? Give feedback.
-
Noone has done it before. But if you are familiar with C++ why not stay in C++ all the way? |
Beta Was this translation helpful? Give feedback.
-
The Surelog Python API is mostly unused, it is a binding over the Antlr Parse tree, so pre-elaboration. It does not do anything with generate statements for instance, so pretty limited. |
Beta Was this translation helpful? Give feedback.
-
Go ahead! Please tell me if you get stuck. |
Beta Was this translation helpful? Give feedback.
-
Python API for UHDM is now supported. Closing this discussion. |
Beta Was this translation helpful? Give feedback.
-
How do you plan to use Surelog/UHDM next (if that can be disclosed)?
Use the Yosys plugin ?
Analyse the design using UHDM ?
...
I'm just beginning to study UHDM and still overwhelmed by the README. About 10 years ago I evaluated a product from a small startup called Invionics that allowed me to parse an entire Verilog design (using a commercial parser, I think it was cheetah, not Verific), and gave me a Python API to traverse the design tree, modules, instances, ports, etc.
Anyway, this is not an official project, I'm just trying the stuff.
My first objective was to build an HTML design browser. I already hacked one in python, which, given a Verilog design, it would build a static HTML file (no server needed) where I could fold the module hierarchy with instance names, and by clicking on a module, it would load it on the right side of the window.
Given its limited scope (only trace hierarchy, not signals), and the fact that it was more like a glorified regex beast that a real parser, it was OK. It did handle preprocessor defines, file lists, but it can't really handle stuff like if generate so it obviously parsed too much. It became too limiting and I wanted something better.
So the first project is to replicate it based on util/uhdm-hier.cpp as a starting point.
I'm also missing a tool that will give me a fully elaborated view of a design to make sure I got all the generate stuff correctly.
Another long-tem goal is to write a tool to track all the possible transaction paths inside the SoC, it has dozens of masters and slaves, using a simple company internal bus, and I would like to construct a table of all paths from each master to every slave connected to it, with the full path across the various design hierarchies, as well as the latency of each path (in clock cycles).
So while I started taking a look at UHDM, I see very little in term of user documentation and examples. Many of the source files mentioned in the UHDM README are not stand-alone programs, making it somewhat hard to see how they are actually used.
Perhaps by adding a github "Discussions" section to the UHDM repo will give a place where questions of "how to" could be asked and answered, which would be more appropriate than opening an Issue .
Beta Was this translation helpful? Give feedback.
All reactions