Skip to content

Commit 51119ac

Browse files
committed
CHG: Use pycparser as a git submodule
1 parent 92c8206 commit 51119ac

34 files changed

+21
-11149
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "submodule/pycparser"]
2+
path = submodule/pycparser
3+
url = https://github.com/eliben/pycparser

src/C_TO_FSM.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
import os
44

55
import C_TO_LOGIC
6+
7+
# TODO: Temporarily import from submodule, remove this hack when we create a proper pipelinec setup.py
8+
sys.path.append('../submodule/pycparser/pycparser')
69
from pycparser import c_ast, c_generator
710

811
# FSM funcs cant be main functions

src/C_TO_LOGIC.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
# TODO fall back to clang tools?
2525
raise Exception("'cpp' C preprocessor is not installed!")
2626

27+
# TODO: Temporarily import from submodule, remove this hack when we create a proper pipelinec setup.py
28+
sys.path.append('../submodule/pycparser/pycparser')
29+
from pycparser import c_ast, c_parser
30+
2731
# Global default constants for inferring different VHDL implementations of operators
2832
MULT_STYLE_INFERRED = "infer"
2933
MULT_STYLE_FABRIC = "fabric"

src/RAW_VHDL.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
import C_TO_LOGIC
66
import SW_LIB
77
import VHDL
8-
from pycparser import c_ast, c_parser # bleh for now
8+
9+
# TODO: Temporarily import from submodule, remove this hack when we create a proper pipelinec setup.py
10+
sys.path.append('../submodule/pycparser/pycparser')
11+
from pycparser import c_ast
912

1013

1114
# Declare variables used internally to c built in C logic

src/SW_LIB.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
import C_TO_LOGIC
99
import SYN
1010
import VHDL
11+
12+
# TODO: Temporarily import from submodule, remove this hack when we create a proper pipelinec setup.py
13+
sys.path.append('../submodule/pycparser/pycparser')
1114
from pycparser import c_ast
1215

1316
# Hey lets bootstrap for fun

src/VHDL.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
import SYN
1515
import VERILATOR
1616
import VIVADO
17+
18+
# TODO: Temporarily import from submodule, remove this hack when we create a proper pipelinec setup.py
19+
sys.path.append('../submodule/pycparser/pycparser')
1720
from pycparser import c_ast
1821

1922
VHDL_FILE_EXT = ".vhd"

src/pycparser/__init__.py

Lines changed: 0 additions & 92 deletions
This file was deleted.

src/pycparser/__init__.pyc

-2.74 KB
Binary file not shown.

0 commit comments

Comments
 (0)