digsim-engine 1.13.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- digsim_engine-1.13.0/LICENSE.md +32 -0
- digsim_engine-1.13.0/MANIFEST.in +2 -0
- digsim_engine-1.13.0/PKG-INFO +59 -0
- digsim_engine-1.13.0/README.md +30 -0
- digsim_engine-1.13.0/pyproject.toml +58 -0
- digsim_engine-1.13.0/setup.cfg +4 -0
- digsim_engine-1.13.0/src/digsim/circuit/__init__.py +7 -0
- digsim_engine-1.13.0/src/digsim/circuit/_circuit.py +764 -0
- digsim_engine-1.13.0/src/digsim/circuit/_native.py +1029 -0
- digsim_engine-1.13.0/src/digsim/circuit/_waves_writer.py +131 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/__init__.py +52 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_arithmetic.py +266 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_bus_bits.py +103 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_button.py +61 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_buzzer.py +64 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_circuit_port.py +293 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_clock.py +105 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_counter.py +147 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_decoder.py +140 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_dip_switch.py +91 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_flip_flops.py +162 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_gates.py +408 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_hd44780.py +451 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_hd44780_rom.py +118 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_hexdigit.py +107 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_ic.py +96 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_label_wire.py +204 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_led.py +66 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_led_bar.py +67 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_logic_analyzer.py +111 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_memory.py +517 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_memstdout.py +60 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_note.py +40 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_on_off_switch.py +64 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_probe.py +90 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_seven_segment.py +47 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_splitter.py +214 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_static_level.py +54 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_static_value.py +97 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_subcircuit.py +439 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_tristate_buffer.py +81 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_verilog_component.py +26 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_yosys_atoms.py +1373 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_yosys_component.py +1126 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/_yosys_functional.py +1714 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/atoms/__init__.py +28 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/atoms/_component.py +329 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/atoms/_digsim_exception.py +8 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/atoms/_port.py +708 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/ic/4017.json +1062 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/ic/4021.json +286 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/ic/4029.json +1447 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/ic/4094.json +584 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/ic/4511.json +1071 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/ic/74138.json +763 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/ic/74139.json +610 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/ic/74148.json +1368 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/ic/74151.json +303 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/ic/74157.json +248 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/ic/74161.json +674 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/ic/74162.json +631 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/ic/74163.json +673 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/ic/74164.json +267 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/ic/74165.json +319 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/ic/74173.json +403 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/ic/74181.json +2002 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/ic/74182.json +893 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/ic/74193.json +1386 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/ic/74194.json +919 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/ic/74245.json +466 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/ic/74283.json +732 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/ic/74374.json +395 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/ic/7448.json +834 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/ic/74574.json +395 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/ic/74595.json +603 -0
- digsim_engine-1.13.0/src/digsim/circuit/components/ic/7485.json +1042 -0
- digsim_engine-1.13.0/src/digsim/storage_model/__init__.py +19 -0
- digsim_engine-1.13.0/src/digsim/storage_model/_app.py +159 -0
- digsim_engine-1.13.0/src/digsim/storage_model/_circuit.py +266 -0
- digsim_engine-1.13.0/src/digsim/synth/__init__.py +12 -0
- digsim_engine-1.13.0/src/digsim/synth/__main__.py +111 -0
- digsim_engine-1.13.0/src/digsim/synth/_synthesis.py +529 -0
- digsim_engine-1.13.0/src/digsim/utils/__init__.py +25 -0
- digsim_engine-1.13.0/src/digsim/utils/_netlist_graph.py +199 -0
- digsim_engine-1.13.0/src/digsim/utils/_yosys_netlist.py +251 -0
- digsim_engine-1.13.0/src/digsim/verilog/__init__.py +19 -0
- digsim_engine-1.13.0/src/digsim/verilog/__main__.py +78 -0
- digsim_engine-1.13.0/src/digsim/verilog/_formatter.py +225 -0
- digsim_engine-1.13.0/src/digsim/verilog/_lexer.py +218 -0
- digsim_engine-1.13.0/src/digsim_engine.egg-info/PKG-INFO +59 -0
- digsim_engine-1.13.0/src/digsim_engine.egg-info/SOURCES.txt +92 -0
- digsim_engine-1.13.0/src/digsim_engine.egg-info/dependency_links.txt +1 -0
- digsim_engine-1.13.0/src/digsim_engine.egg-info/requires.txt +9 -0
- digsim_engine-1.13.0/src/digsim_engine.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
The Clear BSD License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023-2024, Fredrik Andersson
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
* Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS
|
|
21
|
+
LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
22
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
23
|
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
24
|
+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
25
|
+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
26
|
+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
|
27
|
+
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
28
|
+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
29
|
+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
|
30
|
+
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
31
|
+
|
|
32
|
+
-------------------------------------------------------------------------------
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: digsim-engine
|
|
3
|
+
Version: 1.13.0
|
|
4
|
+
Summary: The simulator of DigSim: digital logic circuits in Python, and Verilog with Yosys
|
|
5
|
+
Author-email: Fredrik Andersson <freand@gmail.com>
|
|
6
|
+
Maintainer-email: Fredrik Andersson <freand@gmail.com>
|
|
7
|
+
Project-URL: homepage, https://github.com/freand76/digsim
|
|
8
|
+
Project-URL: documentation, https://freand76.github.io/digsim/
|
|
9
|
+
Keywords: educational,simulation,digital,verilog
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
17
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
|
+
Requires-Python: >=3.11
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE.md
|
|
21
|
+
Requires-Dist: pyvcd==0.5.0
|
|
22
|
+
Requires-Dist: platformdirs==4.9.4
|
|
23
|
+
Requires-Dist: pydantic==2.14.1
|
|
24
|
+
Requires-Dist: yowasp-yosys==0.70.0.0.post1259
|
|
25
|
+
Requires-Dist: yowasp-runtime==1.96
|
|
26
|
+
Requires-Dist: wasmtime==47.0.1
|
|
27
|
+
Requires-Dist: digsim-native==0.5.0; (sys_platform == "linux" and platform_machine in "x86_64 aarch64") or (sys_platform == "win32" and platform_machine in "AMD64 ARM64") or sys_platform == "darwin"
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
|
|
30
|
+
# digsim-engine
|
|
31
|
+
|
|
32
|
+
The simulator of [DigSim](https://github.com/freand76/digsim), without its GUI: digital
|
|
33
|
+
logic circuits in Python, Verilog synthesized by Yosys (which runs in-process, nothing
|
|
34
|
+
else to install), VCD files for GTKWave, and the circuit files of the GUI.
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
pip install digsim-engine
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
from digsim.circuit import Circuit
|
|
42
|
+
from digsim.circuit.components import AND, PushButton
|
|
43
|
+
|
|
44
|
+
circuit = Circuit(vcd="and.vcd")
|
|
45
|
+
a = PushButton(circuit, "a")
|
|
46
|
+
b = PushButton(circuit, "b")
|
|
47
|
+
gate = AND(circuit, "gate")
|
|
48
|
+
a.O.wire = gate.A
|
|
49
|
+
b.O.wire = gate.B
|
|
50
|
+
circuit.init()
|
|
51
|
+
a.push()
|
|
52
|
+
b.push()
|
|
53
|
+
circuit.run(ns=10)
|
|
54
|
+
print(gate.Y.value) # 1
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The GUI application, `pip install digsim-logic-simulator`, uses this package. See the
|
|
58
|
+
[documentation](https://freand76.github.io/digsim/) for the Python API, Verilog components
|
|
59
|
+
and testbenches with pytest.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# digsim-engine
|
|
2
|
+
|
|
3
|
+
The simulator of [DigSim](https://github.com/freand76/digsim), without its GUI: digital
|
|
4
|
+
logic circuits in Python, Verilog synthesized by Yosys (which runs in-process, nothing
|
|
5
|
+
else to install), VCD files for GTKWave, and the circuit files of the GUI.
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
pip install digsim-engine
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```python
|
|
12
|
+
from digsim.circuit import Circuit
|
|
13
|
+
from digsim.circuit.components import AND, PushButton
|
|
14
|
+
|
|
15
|
+
circuit = Circuit(vcd="and.vcd")
|
|
16
|
+
a = PushButton(circuit, "a")
|
|
17
|
+
b = PushButton(circuit, "b")
|
|
18
|
+
gate = AND(circuit, "gate")
|
|
19
|
+
a.O.wire = gate.A
|
|
20
|
+
b.O.wire = gate.B
|
|
21
|
+
circuit.init()
|
|
22
|
+
a.push()
|
|
23
|
+
b.push()
|
|
24
|
+
circuit.run(ns=10)
|
|
25
|
+
print(gate.Y.value) # 1
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The GUI application, `pip install digsim-logic-simulator`, uses this package. See the
|
|
29
|
+
[documentation](https://freand76.github.io/digsim/) for the Python API, Verilog components
|
|
30
|
+
and testbenches with pytest.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "digsim-engine"
|
|
7
|
+
description = "The simulator of DigSim: digital logic circuits in Python, and Verilog with Yosys"
|
|
8
|
+
# The same version as digsim-logic-simulator (../pyproject.toml), which pins it
|
|
9
|
+
version = "1.13.0"
|
|
10
|
+
authors = [{name = "Fredrik Andersson", email = "freand@gmail.com"}]
|
|
11
|
+
maintainers = [{name = "Fredrik Andersson", email = "freand@gmail.com"}]
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
license-files = ["LICENSE.md"]
|
|
14
|
+
urls = { homepage = "https://github.com/freand76/digsim", documentation = "https://freand76.github.io/digsim/" }
|
|
15
|
+
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 5 - Production/Stable",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3.11",
|
|
20
|
+
"Programming Language :: Python :: 3.12",
|
|
21
|
+
"Programming Language :: Python :: 3.13",
|
|
22
|
+
"Programming Language :: Python :: 3.14",
|
|
23
|
+
"Programming Language :: Python :: 3.15",
|
|
24
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
requires-python = ">=3.11"
|
|
28
|
+
dependencies = [
|
|
29
|
+
"pyvcd==0.5.0",
|
|
30
|
+
"platformdirs==4.9.4",
|
|
31
|
+
"pydantic==2.14.1",
|
|
32
|
+
"yowasp-yosys==0.70.0.0.post1259",
|
|
33
|
+
# Runs Yosys in-process: yowasp-yosys accepts any 1.x, and it decides the wasmtime versions
|
|
34
|
+
"yowasp-runtime==1.96",
|
|
35
|
+
"wasmtime==47.0.1",
|
|
36
|
+
# The native engine (https://github.com/freand76/digsim-native), on the platforms it has
|
|
37
|
+
# wheels for. Without it DigSim simulates in Python
|
|
38
|
+
"digsim-native==0.5.0; (sys_platform == 'linux' and platform_machine in 'x86_64 aarch64') or (sys_platform == 'win32' and platform_machine in 'AMD64 ARM64') or sys_platform == 'darwin'",
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
keywords = ["educational", "simulation", "digital", "verilog"]
|
|
42
|
+
|
|
43
|
+
[tool.setuptools.packages.find]
|
|
44
|
+
where = ["src"]
|
|
45
|
+
namespaces = true
|
|
46
|
+
|
|
47
|
+
[tool.setuptools.package-data]
|
|
48
|
+
# The netlists of the ICs (IntegratedCircuit)
|
|
49
|
+
"digsim.circuit.components.ic" = ["*.json"]
|
|
50
|
+
|
|
51
|
+
[tool.uv]
|
|
52
|
+
# Rebuild the cached package when the sources change, not only pyproject.toml
|
|
53
|
+
cache-keys = [
|
|
54
|
+
{ file = "pyproject.toml" },
|
|
55
|
+
{ file = "MANIFEST.in" },
|
|
56
|
+
{ file = "src/**/*.py" },
|
|
57
|
+
{ file = "src/**/*.json" },
|
|
58
|
+
]
|