-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Type inference now more efficient (will only look at first value if generator is not used) - Better exceptions - Hopefully removes matplotlib dependency
- Loading branch information
1 parent
c5f72bf
commit 7a49690
Showing
14 changed files
with
205 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#! /bin/bash | ||
mkdir build -p && cd build && python3 -m pip install .. && cd .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[project] | ||
name = "python2verilog" | ||
version = "0.2.8" | ||
version = "0.2.9" | ||
authors = [{ name = "Kerry Wang", email = "[email protected]" }] | ||
description = "Converts a subset of python generator functions into synthesizable sequential SystemVerilog" | ||
readme = "README.md" | ||
|
@@ -14,6 +14,9 @@ classifiers = [ | |
"Homepage" = "https://github.com/WorldofKerry/Python2Verilog/" | ||
"Bug Tracker" = "https://github.com/WorldofKerry/Python2Verilog/issues" | ||
|
||
[build-system] | ||
requires = ["setuptools", "typing-extensions"] | ||
|
||
[project.optional-dependencies] | ||
full = ["matplotlib", "numpy", "dash_cytoscape", "dash"] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
""" | ||
Exceptions | ||
""" | ||
import ast | ||
|
||
|
||
class UnknownValueError(Exception): | ||
""" | ||
An unexpected 'x' or 'z' was encountered in simulation | ||
""" | ||
|
||
|
||
class UnsupportedSyntaxError(Exception): | ||
""" | ||
Python syntax was not within the supported subset | ||
""" | ||
|
||
def __init__(self, *args: object) -> None: | ||
super().__init__( | ||
"Python syntax was not within the supported subset", | ||
*args, | ||
) | ||
|
||
@classmethod | ||
def from_pyast(cls, node: ast.AST): | ||
""" | ||
Based on AST error | ||
""" | ||
inst = cls(f"Unsupported Python syntax {ast.dump(node)}") | ||
return inst | ||
|
||
|
||
class TypeInferenceError(Exception): | ||
""" | ||
Type inferrence failed, either use the function in code or provide type hints | ||
""" | ||
|
||
def __init__(self, *args: object) -> None: | ||
super().__init__( | ||
"Input/output type inferrence failed, " | ||
"either use the function in Python code or provide type hints", | ||
*args, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.