Skip to content

Commit 2042012

Browse files
committed
fix docs
1 parent dd69d2b commit 2042012

File tree

99 files changed

+1219
-1862
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+1219
-1862
lines changed

.gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,8 @@ temp
123123

124124
# jar
125125
# *.jar
126-
main.py
127126

128127
# docs
129128
_site/
130-
errors/
129+
testfordocs/
131130
*.lock

docs/AboutPyHCL/AboutPyHCL.md

-138
This file was deleted.

docs/AboutPyHCL/FAQ.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
sort: 1
3+
---
4+
# FAQ
5+
## What is the overhead of PyHCL generated RTL compared to human written Verilog?
6+
PyHCL is a hardware construct language like [Chisel](https://github.com/freechipsproject/chisel3) but more lightweight and more relaxed to use.
7+
8+
## What if PyHCL becomes unsupported in the future?
9+
This question has two sides:
10+
11+
1. PyHCL generates Verilog files, which means that PyHCL will be supported by all EDA tools for many decades.
12+
13+
2. If there is a bug in PyHCL and there is no longer support to fix it, it’s not a deadly situation, because the PyHCL compiler is fully open source. For simple issues, you may be able to fix the issue yourself in few hours. Remember how much time it takes to EDA companies to fix issues or to add new features in their closed tools.
14+
15+
## Does PyHCL keep comments in generated verilog?
16+
No, it doesn’t. Generated files should be considered as a netlist.
17+
## Could PyHCL scale up to big projects?
18+
PyHCL is powered by [FIRRTL](https://github.com/freechipsproject/firrtl), an intermediate representation for digital circuit design.
19+
20+
PyHCL-generated circuits can be compiled to the widely-used HDL Verilog.
21+
22+
Attention: The back end of the compilation is highly experimental.
23+
## How PyHCL came to be?
24+
The dominant hardware design languages in industry are **Verilog** and **VHDL**, however this procedural language, which has been around for decades, can no longer meet the needs of today's increasingly large and complex integrated circuit chip development.
25+
26+
**Chisel**, the pioneer of combining hardware design with high-level programming languages, has proposed the possibility of agile design for hardware by embedding hardware design into the high-level programming language Scala. Embedding a hardware design framework into an object-oriented programming language allows hardware design to enjoy the advantages of object-oriented language ontologies.
27+
28+
However, since Chisel is based on Scala, this language has a small audience, is difficult to learn, and has a low community activity, making it difficult to get started and the learning time period is long, which is not conducive to its promotion. Therefore, our team uses the Python language to design and develop PyHCL to provide a more easy-to-use and concise hardware design framework.
29+
30+
## Why develop a new language when there is VHDL/Verilog/SystemVerilog?
31+
The goal of PyHCL is providing a complete design and verification tool flow for heterogeneous computing systems flexibly using the same design methodology.
32+
## How to use an unreleased version of PyHCL (but committed on git)?
33+

docs/AboutPyHCL/Support.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
sort: 2
3+
---
4+
# Support
5+
[![Build Status](https://travis-ci.com/scutdig/py-hcl.svg?branch=master)](https://travis-ci.com/scutdig/py-hcl)
6+
[![codecov](https://codecov.io/gh/scutdig/py-hcl/branch/master/graph/badge.svg)](https://codecov.io/gh/scutdig/py-hcl)
7+
[![PyPI](https://img.shields.io/pypi/v/py-hcl.svg)](https://pypi.python.org/pypi)
8+
## Communication channels
9+
For bug reporting and feature requests, do not hesitate to create github issues:\
10+
<https://github.com/scutdig/PyChip-py-hcl/issues> \
11+
12+
## Commercial support

docs/AboutPyHCL/Users.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
sort: 3
3+
---
4+
# Users
5+
## Companies
6+
## Repositories
7+

docs/Datatypes/AFix.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
sort: 9
3+
---
4+
# AFix
5+
6+
## Description
7+
## Declaration
8+
## Operations

docs/Datatypes/Bits.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
sort: 2
3+
---
4+
# Bits
5+
6+
## Description
7+
## Declaration
8+
## Operations

docs/Datatypes/Bool.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
sort: 1
3+
---
4+
# Bool
5+
6+
## Description
7+
The Bool type corresponds to `U.w(1)`.
8+
## Declaration
9+
The syntax to declare a boolean value is as follows:
10+
11+
| Syntax | Description | Return |
12+
|:--------------------:|:--------------------------------------------------------------------:|:-------------:|
13+
| Bool | Create a Bool | U.w(1) |
14+
| Bool(value: Boolean) | Create a Bool <br/>assigned with a Python Boolean<br/> (true, false) | U.w(1)(value) |
15+
16+
```python
17+
myBool_1 = Bool # Create a Bool
18+
myBool_1 = Bool(True)
19+
myBOol_2 = Bool(3>5) # same as Bool(False)
20+
io.cout @= myBool_1 # @= is the assignment operator
21+
```
22+
## Operators
23+
All operators available for the Bool type is same as `U.w(1)`

docs/Datatypes/Bundle.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
sort: 5
3+
---
4+
# Bundle!
5+
## Description
6+
The Bundle is a composite type that defines a group of named signals (of any PyHCL basic type) under a single name. It is similar to Chisel Bundle. Actually, in PyHCL's core library, IO is actually a Bundle and translate to FIRRTL later on. As a beginner of PyHCL, you could simply treat Bundle as the struct data structure of C/C++.
7+
## Declaration
8+
The way we define a Bundle is similar to IO:
9+
```python
10+
bun = Bundle(
11+
x=U.w(16),
12+
y=S.w(16),
13+
z=Bool
14+
)
15+
```
16+
`x`, `y`, and `z` are the subfield of Bundle. `Bundle` is a datatype, so it must used in a circuit element:
17+
```python
18+
breg = Reg(Bundle(
19+
x=U.w(16),
20+
y=S.w(16),
21+
z=Bool
22+
))
23+
```
24+
We use `.` operator to access the subfield of the `Bundle`, similar to IO:
25+
```python
26+
breg.x <<= U(12)
27+
breg.y <<= S(4)
28+
breg.z <<= Bool(False)
29+
io.out <<= breg.x
30+
```
31+
> Bundle is still an experimental feature of PyHCL, we suggest that you only include basic types in Bundle.
32+
33+
### Conditional signals
34+
35+
## Operators
36+
### Comparison
37+
### Type cast
38+
### Convert Bits back to Bundle
39+
## IO Element direction

0 commit comments

Comments
 (0)