Newer
Older
<img src="logo.png" width="278" height="100">
# B-ASIC - Better ASIC Toolbox
B-ASIC is an ASIC toolbox for Python 3 that simplifies circuit design and optimization.
## Development
How to build and debug the library during development.
### Prerequisites
The following packages are required in order to build the library:
* cmake 3.8+
Angus Lothian
committed
* gcc 7+/clang 7+/msvc 16+
* fmtlib
* pybind11 2.3.0+
Angus Lothian
committed
* Python:
Angus Lothian
committed
* pyside2
To build a binary distribution, the following additional packages are required:
* Python:
* wheel
To run the test suite, the following additional packages are required:
* Python:
* pytest
* pytest-cov (for testing with coverage)
To generate the documentation, the following additional packages are required:
* doxygen
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
### Using CMake directly
How to build using CMake.
#### Configuring
In `B-ASIC`:
```
mkdir build
cd build
cmake ..
```
#### Building (Debug)
In `B-ASIC/build`:
```
cmake --build .
```
The output gets written to `B-ASIC/build/lib`.
#### Building (Release)
In `B-ASIC/build`:
```
cmake --build . --config Release
```
The output gets written to `B-ASIC/build/lib`.
### Using setuptools to create a package
How to create a package using setuptools that can be installed using pip.
#### Setup (Binary distribution)
In `B-ASIC`:
```
python3 setup.py bdist_wheel
```
The output gets written to `B-ASIC/dist/b_asic-<version>-<python_tag>-<abi_tag>-<platform_tag>.whl`.
#### Setup (Source distribution)
In `B-ASIC`:
```
python3 setup.py sdist
```
The output gets written to `B-ASIC/dist/b-asic-<version>.tar.gz`.
#### Installation (Binary distribution)
In `B-ASIC/dist`:
```
pip install b_asic-<version>-<python_tag>-<abi_tag>-<platform_tag>.whl
```
#### Installation (Source distribution)
In `B-ASIC/dist`:
```
pip install b-asic-<version>.tar.gz
```
### Running tests
How to run the tests using pytest in a virtual environment.
#### Linux/OS X
In `B-ASIC`:
```
python3 -m venv env
source env/bin/activate
pip install .
pytest
```
#### Windows
In `B-ASIC` (as admin):
```
python3 -m venv env
.\env\Scripts\activate.bat
pip install .
pytest
```
#### Test with coverage
```
pytest --cov=b_asic --cov-report html test
```
Angus Lothian
committed
### Generating documentation
In `B-ASIC`:
```
doxygen
```
The output gets written to `B-ASIC/doc`.
## Usage
How to build and use the library as a user.
### Installation
```
pip install b_asic
```
### Importing
```
python3
>>> import b_asic as asic
>>> help(asic)
```
## License
B-ASIC is distributed under the MIT license.
See the included LICENSE file for more information.