opentitan icon indicating copy to clipboard operation
opentitan copied to clipboard

DVSIM suggestions for output after the latest updates

Open rasmus-madsen opened this issue 5 years ago • 8 comments

in the next DV meeting it would be relevant to go over the latest updates of DVsim and the reason behind it. as I actually feel they make dvsim less user friendly than before and would like to know the motivation for the changes. we could also use this as a good segue into a talk about what we would like from dvsim.

some of the thought I have are:

  • the latest updates that always put the scratch in the root - not a big fan. before if you ran from root your scratch was in root. if you ran from your IP folder that's where your scratch is. now if you run from your up folder you have to navigate back to root to find your output. this feels like a step backwards in my book.

  • if a build fails the log is no longer in default, instead it is moved under failed/build.log IMO we don't want older logs lying around in default. it made sense that this was where you found the latest output. I think we should either revert to this option or remove default altogether.

  • in general, I feel that a lot of typing involved in getting to the output of a build to get to a log is now 6 levels the folder hierarchy

  • currently the naming of runs is incremental numbering, would it not make sense to exchange the incremental numbering with the actual seed? this would make it easier to locate specific tests ?

  • should we add a run -analyze option to open the waveform for the latest run? -analyze={simvision,dve,verdi}

rasmus-madsen avatar Apr 15 '21 12:04 rasmus-madsen

Well at least for the first bullet, I like the scratch being in the root so I can delete all the logs in one place (ie by removing single scratch directory). But I always run from root so just my opinion.

senelson7 avatar Apr 15 '21 12:04 senelson7

Well at least for the first bullet, I like the scratch being in the root so I can delete all the logs in one place (ie by removing single scratch directory). But I always run from root so just my opinion.

but if you run from root this was always the case!

rasmus-madsen avatar Apr 15 '21 14:04 rasmus-madsen

My only comment is that dvsim has grown a lot of features and I don't think I'd propose adding yet another. So my suggestion for the "analyze" option you mention is that we just print out the path to the dumped wave file. The user can probably copy and paste and add "dve" or whatever to the front of the command line. That way, dvsim doesn't need to know or care what viewer they are using.

rswarbrick avatar Apr 16 '21 07:04 rswarbrick

@sriyerg @rasmus-madsen can this issue be updated?

msfschaffner avatar Mar 24 '22 23:03 msfschaffner

in the next DV meeting it would be relevant to go over the latest updates of DVsim and the reason behind it. as I actually feel they make dvsim less user friendly than before and would like to know the motivation for the changes. we could also use this as a good segue into a talk about what we would like from dvsim.

some of the thought I have are:

  • the latest updates that always put the scratch in the root - not a big fan. before if you ran from root your scratch was in root. if you ran from your IP folder that's where your scratch is. now if you run from your up folder you have to navigate back to root to find your output. this feels like a step backwards in my book.

These were the reasons for doing so:

  • What @senelson7 mentioned - most people (especially those working on multiple blocks) prefer the scratch to be under the project root directory so that it can be purged in one shot.
  • It aligns with other build systems which also create artifacts in a single directory at the root of the project.
  • There were also other motivations that I forget now :) In general though, it is advisable (but not mandatory) to run dvsim always from the project root directory,
  • if a build fails the log is no longer in default, instead it is moved under failed/build.log IMO we don't want older logs lying around in default. it made sense that this was where you found the latest output. I think we should either revert to this option or remove default altogether.

The default build directory is overwritten in successive builds. It enables the tools to optimize the compile time by incrementally elaborating only the things that changed. On failure, default directory is actually not moved to failed - its actually soft-linked there to enable users to navigate there a bit more easily, especially when the scratch path is cluttered with 1000s of run directories.

  • in general, I feel that a lot of typing involved in getting to the output of a build to get to a log is now 6 levels the folder hierarchy

The scratch path is located at scratch/<branch>/<ip>-sim-<tool>, which is only 3 levels. It used to be even deeper - I condensed the last one to reflect 3 unique qualifiers (block name, ASIC flow, tool used) into a single directory name. I think these are needed. There are valid reasons to keep results across separate branches.

  • currently the naming of runs is incremental numbering, would it not make sense to exchange the incremental numbering with the actual seed? this would make it easier to locate specific tests ?

The motivation of doing so is the number of directories created in the scratch path area will always be fixed to the number of reseeds for each test. Otherwise, we risk creating a monotonically increasing number of directories on successive invocations. The other advantage is, if you run the test once, with a single seed, you will always find it at a fixed path at 0.foo/out. That makes incremental debug easy (just hit reload in Verdi, rather than save signals, close the waveform and open the new one since it lives in a different path now, and reload signals). For ease of locating failing tests with specific seeds, see the failed directory that contains the soft-links - the soft-link name does reflect the seed value.

  • should we add a run -analyze option to open the waveform for the latest run? -analyze={simvision,dve,verdi}

Yes - I did plan for supporting this, but never got to it. This will indeed be useful, but low priority.

sriyerg avatar Mar 25 '22 00:03 sriyerg

Following up on the "analyze" part, I have the following in my bash history:

dve $(find scratch -name '*.vpd' -printf "%A@:%p\n" | sort -nr | head -n1 | cut -d ':' -f 2-)

This runs dve on the .vpd file that was most recently created. Presumably, you can do something similar with .trn files and Simvision.

rswarbrick avatar Mar 25 '22 12:03 rswarbrick

should we add a run -analyze option to open the waveform for the latest run? -analyze={simvision,dve,verdi} it is a nice to have - I think there are other things that are more important.

like UNR support for xcelium.

other than that I think I agree with all @sriyerg comments

rasmus-madsen avatar Mar 28 '22 12:03 rasmus-madsen

Following up on this, I think Sri answered the items rather well. He even changed my mind as I went through! I believe that the only item left here is the potential -analyze option. I'm not really convinced that we'd want it: after all, I probably only know what I want to look at after dvsim has finished.

I'm going to close this issue now. If we do feel like that feature would be useful in dvsim, I suggest we open a more specific issue to discuss / track it there.

rswarbrick avatar Mar 31 '25 07:03 rswarbrick