Skip to content

Commit

Permalink
[skip-ci] add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuree committed Dec 28, 2023
1 parent ab08ec5 commit 81f3bd5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ Now we can use the class directly with the SystemVerilog binding:
assert(a.min() == 1);
To use an array as a function argument, use `DataType.IntArray`.
As the name indicates, pysv currently only support `int32_t` arrays of any
To use an array as a function argument, use ``DataType.IntArray``.
As the name indicates, pysv currently only support ``int32_t`` arrays of any
dimension. More data types supports will be worked on in the future.
Here is an example of how to use it in Python:

Expand Down
7 changes: 7 additions & 0 deletions docs/basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ Whereas in C/C++ we will see the following function definition:
Notice that your function can take normal input arguments. All the output arguments will be
generated after the inputs.


If we want to pass a SystemVerilog open array to Python and used in libraries such as numpy,
you can use ``DataType.IntArray``. Currently only ``int32_t`` type is supported. Because it
uses ``py::memoryview`` under the hood, the array will not be coppied. Instead, it is
accessed via a multable array view. As a result, the system can handle arbitrary number of
dimensions.

Library compilation
-------------------
In order to use pysv in your testbench, you first need to compile the python
Expand Down

0 comments on commit 81f3bd5

Please sign in to comment.