Skip to content

Commit

Permalink
add doc readme
Browse files Browse the repository at this point in the history
Signed-off-by: Travis F. Collins <[email protected]>
  • Loading branch information
tfcollins committed Jan 18, 2024
1 parent 66862c6 commit 455999c
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 17 deletions.
8 changes: 8 additions & 0 deletions sdoc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

PYTHON = python

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Expand All @@ -18,3 +20,9 @@ help:
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

gen_autodocs:
cd gen_pages ; \
$(PYTHON) gen_sysobj_pages.py ; \
$(PYTHON) gen_rd_svg.py ; \
$(PYTHON) gen_hdl_refdesigns.py
16 changes: 16 additions & 0 deletions sdoc/README_doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Doc Creation

Doc is create by leveraging Sphinx as the documentation engine. To create the entire documentation set you must generate the dynamic pages which document the system object APIs and the reference designs. Then the output targets can be run. This is done by running the following command from the root of the toolbox:

```bash
make -C sdoc gen_hdl_refdesigns html
```

## Updating the System Object Documentation

The system object documentation is generated from the MATLAB code and comments, which requires use of MATLAB itself. By running the script gen_sysobj_doc.m within the *gen_pages* folder, it will create the necessary sysobjs.json file which sphinx will then use to create the individual component pages. This is done by running the following command from the root of the toolbox in MATLAB:

```matlab
cd sdoc/gen_pages
gen_sysobj_doc
```
13 changes: 6 additions & 7 deletions sdoc/gen_pages/_templates/refdesign.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{% include 'header.tmpl' %}
{% block content %}

# {{ obj.name }} Reference Design Integration
Expand All @@ -18,16 +17,16 @@

## Reference Design

<figure markdown>
{% if obj.rd_image == "ad9361" %}
![Reference Design](../assets/rd_ad9361_custom.svg)
```{figure} /_static/assets/rd_ad9361_custom.svg
{% elif obj.rd_image == "adrv9001" %}
![Reference Design](../assets/rd_adrv9001_custom.svg)
```{figure} /_static/assets/rd_adrv9001_custom.svg
{% elif obj.rd_image == "jesd" %}
![Reference Design](../assets/rd_jesd_custom.svg)
```{figure} /_static/assets/rd_jesd_custom.svg
{% endif %}
<figcaption>HDL Reference Design with Custom IP from HDL-Coder. Click on sub-blocks for more documentation.</figcaption>
</figure>
HDL Reference Design with Custom IP from HDL-Coder. Click on sub-blocks for more documentation.
```

The IP-Core generation flow will integrate IP generated from Simulink subsystem into an ADI authored reference design. Depending on the FPGA carrier and FMC card or SoM, this will support different IP locations based on the diagram above.

## HDL Worflow Advisor Port Mappings
Expand Down
21 changes: 12 additions & 9 deletions sdoc/gen_pages/_templates/sysobj.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,24 @@
For more information on changing property values, see <a href="https://www.mathworks.com/help/matlab/matlab_prog/system-design-in-matlab-using-system-objects.html">System Design in MATLAB Using System Objects.</a>
</span>
</div>
<br>


{% for prop in obj.props %}
:::{dropdown} {{ prop.prop_name }}
{{ prop.prop_description }}
:::
{% endfor -%}



{%- for prop in obj.props %}
<div class="property">
<button type="button" onclick="collapse('{{ prop.prop_name }}')" class="collapsible-property collapsible-property-{{ prop.prop_name }}">{{ prop.prop_name }} <span style="text-align:right" class="plus-{{ prop.prop_name }}">+</span></button>
<div class="content content-{{ prop.prop_name }}" style="display: none;">
<p style="padding: 0px;">{{ prop.prop_description }}</p>
</div>
</div>
{%- endfor -%}

{% endblock %}

<br>
<div class="sysobj_desc_title">Example Usage</div>

```
```matlab
{% if obj.type == "Tx" %}
%% Configure device
tx = {{ obj.name }};
Expand Down
2 changes: 1 addition & 1 deletion sdoc/gen_pages/gen_rd_svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def gen_rd_svg():
output += o
continue
# Add link wrapper
output += f'<a xlink:href="{selectable_boxes[id]["link"]}">{gtag}</a>{post_gtag}'
output += f'<a href="{selectable_boxes[id]["link"]}">{gtag}</a>{post_gtag}'
# output += o
# print(sec)
# Add css to change fill color
Expand Down

0 comments on commit 455999c

Please sign in to comment.