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

New documentation structure: ch. GHDL Usage #296

Closed
eine opened this issue Feb 25, 2017 · 15 comments
Closed

New documentation structure: ch. GHDL Usage #296

eine opened this issue Feb 25, 2017 · 15 comments
Labels
Documentation: General General documentation issues. Help wanted
Milestone

Comments

@eine
Copy link
Collaborator

eine commented Feb 25, 2017

Following #280, I need some help to finish chapter 2:

  • There is a list of commands/options in Roadmap, which I obtained with ghdl -h, but I couldn't find any reference in the doc. Which should be documented and which can be kept in the todo-list?

  • I added a subsection named 'Export waveforms' to 'Simulation and runtime':

    • Undocumented –vcd-nodate do not write date in VCD file. Relevant?
    • In the manual of GtkWave it is explained that a pipe can be used to pass a waveform directly, so that interactive simulation is possible. However, only VCD is mentioned. Can it be done with either FST or GHW?
  • A also added a 'Export design hierarchy' subsection:

    • The json format is not documented, except it should be self-documented. Maybe worth adding a small example? A sentence explaining what is exported would be very helpful.
    • The XML format (for –file-to-xml) is not documented and it may change as it shows internal stuff.
      • --file-to-xml FILEs Dump AST in XML
      • The AST in not mentioned in the documentation. I think that including this feature is related to synthesis. Can you provide a short paragraph explaining it's use case and why does the AST change 'often'? Something like: GHDL uses an internal Abstract Syntax Tree (AST) to represent the structure of an elaborated design. This structure holds all the information that GHDL knows about the design. Then, due to the addition or modification of features, it's format changes quite often. Therefore, using........ is recommended, since it's products are more stable between releases. The XML output is meant for...
@tgingold
Copy link
Member

tgingold commented Feb 25, 2017 via email

@Paebbels Paebbels added Documentation: General General documentation issues. Help wanted labels Feb 27, 2017
@eine
Copy link
Collaborator Author

eine commented Mar 1, 2017

While checking #200, @Paebbels and me realized that @tgingold makes difference between 'commands' and 'options'. However, Sphinx only supports 'programs' and 'options': http://www.sphinx-doc.org/en/1.5.1/domains.html#directive-option, where 'program' is 'ghdl' now.

As a result, there is no clean way to reference GHDL 'commands' through intersphinx files. There are two possible solutions:

  • Make each 'command' be a 'program'. The problem with this approach is that, as long as I am aware about, Sphinx does not support defining 'options' for multiple 'programs'. Therefore, we should repeat all the common options.
  • Make the 'commands' be 'options'. The user would tell the difference depending on where are described in the doc. Documentation writers should be aware that, although the same syntax is used, the usage is not the same.

I'm going with the latter. Any ideas?

@Paebbels
Copy link
Member

Paebbels commented Mar 1, 2017

A command in GHDL's words is just a parameter (or option in Sphinx's words). So e.g. -a should be documented as .. option:: -a.

You can then reduce the amount of indexdirectives, because options are automatically indexed.

@tgingold
I know you like the short command names, but other tools usually have commands without a dash and use commonly longer words. E.g. git clone or svn checkout. Some programs support short forms too like svn co for checkout.

Maybe GHDL should have analyze, elaborate, ... or ana, elab, ... as a command name and -a, -e for backward compatibility. Especially, with new commands, the space of meaningful one-character names becomes smaller.

@tgingold
Copy link
Member

tgingold commented Mar 1, 2017 via email

@tgingold
Copy link
Member

tgingold commented Mar 1, 2017 via email

@tgingold
Copy link
Member

tgingold commented Mar 1, 2017 via email

@eine
Copy link
Collaborator Author

eine commented Mar 1, 2017

A command in GHDL's words is just a parameter (or option in Sphinx's words). So e.g. -a should be documented as .. option:: -a.
You can then reduce the amount of indexdirectives, because options are automatically indexed.

I am actually following a triple approach:

  • I converted all the 'commands' to options. Then a reference is created in the index.
  • I added a manual index of the form 'cmd XXXXX' or 'cmd library XXXXX' to let the user know which options are commands.
  • Commands have a header, so that they are shown in the sidebar.

On top of that, I modified the declaration of every option (commands and options), to add < >. This is a major improvement since allows to use linked references like:

:option:`-e`
:option:`--work`
:option:`--PREFIX`

Check:

@tgingold
Copy link
Member

tgingold commented Mar 1, 2017 via email

@eine
Copy link
Collaborator Author

eine commented Mar 1, 2017

But there is still a possible issue: if both command CMD1 and CMD2 have an option OPT with the same name, we cannot document OPT two times. (Not sure that such a clash exists).

That would be the case if ghdl -e and ghdl -r where different 'programs'. But in the latter approach, they are they same program, 'ghdl' with two different 'options'. It is now described in a way such that all options can be used with any other (from Sphinx's point of view).

I think that, even if you add 'ghdl analyze' and so, we should keep with this approach. If not, we would be facing the problem you describe: 'ghdl analyze' and 'ghdl elaborate' would share some options. Therefore, we would need to describe all twice (once in each 'program space').

@Paebbels
Copy link
Member

Paebbels commented Mar 1, 2017

But there is still a possible issue: if both command CMD1 and CMD2 have an option OPT with the same name, we cannot document OPT two times.

I think this is solvable. I let autoprogram document the PoC script, which has lots of commands with overlapping parameters. They all got documented. I need to find the temp files of autoprogram so we can see what it generates in such a case.

@eine
Copy link
Collaborator Author

eine commented Mar 1, 2017

Tell me when you think it's ok for a merge.

I still need some time to check it.

However #297 is ready to be merged, if you agree.

@eine
Copy link
Collaborator Author

eine commented Mar 1, 2017

@tgingold, I think it's ready now. See http://ghdl-devfork.readthedocs.io/en/new-documentation-structure/using/QuickStartGuide.html

There are two missing points:

  • Quick Start Guide / Further examples has no content (yet). I'll move forward to the remaining chapters, and check this later.
  • --vpi=FILENAME and --vpi-trace[=FILE] should go in Invoking GHDL / VPI build commands or in Simulation and runtime? In the latter, in which subsection?

Furthermore, it'd be great to add some more content to section Simulation and runtime / Debugging, where I added some of the previously undocumented features.

Since I'm going to start with ch 3 (Getting GHDL), I think you can merge my new-documentation-structure branch to your new-documentation-structure branch. Then, you can improve the parts you find unclear in ch 2, so that possible collisions are minimized.

As a reference, after ch 3, I'll go with ch 4, then ch 5. Last, I'll review all of them to integrate the suggestions you do. Meanwhile I'll periodically check your branch, to integrate any changes. This way, I hope that all my PRs will be fast-forwarded.

@tgingold
Copy link
Member

tgingold commented Mar 1, 2017 via email

@eine
Copy link
Collaborator Author

eine commented Mar 1, 2017

That should go to simulation and runtime, as this is a runtime option. Not sure we need a specific subsection.

Sorry, I meant in which of the current four subsections in Simulation and runtime it should go, not to add a specific one. Didn't explain myself correctly.

These subsections are:

  • Simulation options
    • --assert-level
    • --ieee-asserts
    • --stop-time
    • --stop-delta
    • --disp-time
    • --unbuffered
    • --sdf
    • --help
  • Export waveforms
    • --read-opt-file
    • --write-opt-file
    • --vcd
    • --vcdgz
    • --vcd-nodate
    • --fst
    • --wave
  • Export hierarchy and references
    • --disp-tree
    • --no-run
    • --xref-html
    • --psl-report
    • --file-to-xml
  • Debugging
    • --trace-signals
    • --trace-processes
    • --stats
    • --disp-order
    • --disp-sources
    • --disp-sig-types
    • --disp-signals-map
    • --disp-signals-table
    • --checks
    • --activity
    • --dump-rti
    • --bootstrap

On top of telling where to put --vpi and --vpi-trace, you might want to reorder some of those, remove any of the subsections, etc. Write the order youd like here, and I'll update it in the next iteration.

@tgingold
Copy link
Member

tgingold commented Mar 2, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation: General General documentation issues. Help wanted
Projects
None yet
Development

No branches or pull requests

3 participants