Skip to content

Commit 8d0cc17

Browse files
committed
CHG: Use pycparser as a git submodule
1 parent 2714b60 commit 8d0cc17

34 files changed

+25
-11150
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
@@ -2,6 +2,9 @@
22
import sys
33

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

710
# FSM funcs cant be main functions

src/C_TO_LOGIC.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@
1616
import SW_LIB
1717
import SYN
1818
import VHDL
19-
from pycparser import c_ast, c_parser
19+
2020
from utilities import REPO_ABS_DIR
2121

22+
# TODO: Temporarily import from submodule, remove this hack when we create a proper pipelinec setup.py
23+
sys.path.append('../submodule/pycparser/pycparser')
24+
from pycparser import c_ast, c_parser
25+
2226
# Global default constants for inferring different VHDL implementations of operators
2327
MULT_STYLE_INFERRED = "infer"
2428
MULT_STYLE_FABRIC = "fabric"
@@ -98,7 +102,10 @@ def GET_CPP_INCLUDES_LIST(): # -> list[str]: needs typing library?
98102
path_list += ["-I" + thing_path]
99103
# Also include src files in git root dir
100104
dir_path = REPO_ABS_DIR()
105+
106+
# TODO: Temporarily include both paths to avoid breakage while still refactoring
101107
path_list += ["-I" + dir_path + "/"]
108+
path_list += ["-I" + dir_path + "/pipelinec/include/"]
102109

103110
# For now global __PIPELINEC__ define lives here
104111
path_list += ["-D__PIPELINEC__"]

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
@@ -13,6 +13,9 @@
1313
import SYN
1414
import VERILATOR
1515
import VIVADO
16+
17+
# TODO: Temporarily import from submodule, remove this hack when we create a proper pipelinec setup.py
18+
sys.path.append('../submodule/pycparser/pycparser')
1619
from pycparser import c_ast
1720

1821
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)