-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blink Example Fails #285
Comments
Thanks for pointing this out.
Has been some reorganization lately, hoping it's something simple but will
see if it's something funny related to python versions 🤞
…On Sun, Dec 1, 2024, 5:13 AM robin ***@***.***> wrote:
Trying to build the blink.c example (or any other example I've tried) as
described in the wiki <https://github.com/JulianKemmerer/PipelineC/wiki>
doesn't work:
% pipelinec examples/blink.c
██████╗ ██╗██████╗ ███████╗██╗ ██╗███╗ ██╗███████╗ ██████╗
██╔══██╗██║██╔══██╗██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝
██████╔╝██║██████╔╝█████╗ ██║ ██║██╔██╗ ██║█████╗ ██║
██╔═══╝ ██║██╔═══╝ ██╔══╝ ██║ ██║██║╚██╗██║██╔══╝ ██║
██║ ██║██║ ███████╗███████╗██║██║ ╚████║███████╗╚██████╗
╚═╝ ╚═╝╚═╝ ╚══════╝╚══════╝╚═╝╚═╝ ╚═══╝╚══════╝ ╚═════╝
Output directory: /.../PipelineC/pipelinec_output_blink.c_52928
================== Parsing C Code to Logical Hierarchy ================================
Parsing: /.../PipelineC/examples/blink.c
Preprocessing file...
/.../PipelineC/examples/blink.c:1:23: warning: extra tokens at end of #include directive [-Wextra-tokens]
1 | #include "uintN_t.h" // uintN_t types for any N
| ^
| //
1 warning generated.
Parsing C syntax...
pycparser says you messed up: /.../PipelineC/include/uintN_t.h:2:1: before: /
I'm assuming this project uses Python3.9, as it relies on distutils,
however I don't think the documentation mentions this anywhere. I had to
alias my python3 command.
Running pipelinec --help works as expected and exits without error.
Perhaps I'm doing something wrong/my environment is wrong.
Versions:
- PipelineC commit 28786db
<28786db>
(current head)
- python3.9 --version: Python 3.9.20
- MacOS 15.1.1 (Apple M4)
- cpp --version: Apple clang version 16.0.0 (clang-1600.0.26.4)
(Target: arm64-apple-darwin24.1.0)
Additional interesting outputs from examples:
% ./src/pipelinec ./examples/adder_tree.c
██████╗ ██╗██████╗ ███████╗██╗ ██╗███╗ ██╗███████╗ ██████╗
██╔══██╗██║██╔══██╗██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝
██████╔╝██║██████╔╝█████╗ ██║ ██║██╔██╗ ██║█████╗ ██║
██╔═══╝ ██║██╔═══╝ ██╔══╝ ██║ ██║██║╚██╗██║██╔══╝ ██║
██║ ██║██║ ███████╗███████╗██║██║ ╚████║███████╗╚██████╗
╚═╝ ╚═╝╚═╝ ╚══════╝╚══════╝╚═╝╚═╝ ╚═══╝╚══════╝ ╚═════╝
Output directory: /.../PipelineC/pipelinec_output_adder_tree.c_56776
================== Parsing C Code to Logical Hierarchy ================================
Parsing: /.../PipelineC/examples/adder_tree.c
Preprocessing file...
Parsing C syntax...
pycparser says you messed up: /.../PipelineC/examples/adder_tree.c:2:1: before: /
% ./src/pipelinec ./examples/fir.c
██████╗ ██╗██████╗ ███████╗██╗ ██╗███╗ ██╗███████╗ ██████╗
██╔══██╗██║██╔══██╗██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝
██████╔╝██║██████╔╝█████╗ ██║ ██║██╔██╗ ██║█████╗ ██║
██╔═══╝ ██║██╔═══╝ ██╔══╝ ██║ ██║██║╚██╗██║██╔══╝ ██║
██║ ██║██║ ███████╗███████╗██║██║ ╚████║███████╗╚██████╗
╚═╝ ╚═╝╚═╝ ╚══════╝╚══════╝╚═╝╚═╝ ╚═══╝╚══════╝ ╚═════╝
Output directory: /.../PipelineC/pipelinec_output_fir.c_55965
================== Parsing C Code to Logical Hierarchy ================================
Parsing: /.../PipelineC/examples/fir.c
Traceback (most recent call last):
File "/.../PipelineC/./src/pipelinec", line 220, in <module>
parser_state = C_TO_LOGIC.PARSE_FILE(c_file)
File "/.../PipelineC/src/C_TO_LOGIC.py", line 9986, in PARSE_FILE
all_code_files = get_included_files(c_filename)
File "/.../PipelineC/src/C_TO_LOGIC.py", line 214, in get_included_files
include_str = GET_SHELL_CMD_OUTPUT(cmd)
File "/.../PipelineC/src/C_TO_LOGIC.py", line 254, in GET_SHELL_CMD_OUTPUT
raise Exception(e_text)
Exception: Command failed:
cpp -MM -MG -I/.../PipelineC/pipelinec_output_fir.c_55965/var_clock_cross.h -I/.../PipelineC/pipelinec_output_fir.c_55965/type_array_N_t.h -I/.../PipelineC/pipelinec_output_fir.c_55965/type_bytes_t.h -I/.../PipelineC/pipelinec_output_fir.c_55965/func_FSM.h -I/.../PipelineC/pipelinec_output_fir.c_55965/func_SINGLE_INST.h -I/.../PipelineC/ -I/.../PipelineC/pipelinec/include/ -I/.../PipelineC/include/ -D__PIPELINEC__ /.../PipelineC/examples/fir.c
In file included from /.../PipelineC/examples/fir.c:49:
In file included from /.../PipelineC/include/dsp/fir_decim.h:28:
/.../PipelineC/include/dsp/fir.h:34:1: error: _Pragma takes a parenthesized string literal
34 | PRAGMA_MESSAGE(FUNC_WIRES fir_samples_window) // Not worried about delay of this func
| ^
/.../PipelineC/include/compiler.h:66:27: note: expanded from macro 'PRAGMA_MESSAGE'
66 | #define PRAGMA_MESSAGE(x) PRAGMA_MESSAGE_(x)
| ^
/.../PipelineC/include/compiler.h:65:28: note: expanded from macro 'PRAGMA_MESSAGE_'
65 | #define PRAGMA_MESSAGE_(x) _Pragma(#x)
| ^
In file included from /.../PipelineC/examples/fir.c:49:
/.../PipelineC/include/dsp/fir_decim.h:32:1: error: _Pragma takes a parenthesized string literal
32 | PRAGMA_MESSAGE(FUNC_WIRES fir_decim_counter) // Not worried about delay of this func
| ^
/.../PipelineC/include/compiler.h:66:27: note: expanded from macro 'PRAGMA_MESSAGE'
66 | #define PRAGMA_MESSAGE(x) PRAGMA_MESSAGE_(x)
| ^
/.../PipelineC/include/compiler.h:65:28: note: expanded from macro 'PRAGMA_MESSAGE_'
65 | #define PRAGMA_MESSAGE_(x) _Pragma(#x)
| ^
2 errors generated.
fir.o: /.../PipelineC/examples/fir.c \
/.../PipelineC/include/intN_t.h \
/.../PipelineC/include/uintN_t.h \
/.../PipelineC/include/stream/stream.h \
/.../PipelineC/include/compiler.h \
/.../PipelineC/include/bool.h \
/.../PipelineC/include/dsp/fir_decim.h \
/.../PipelineC/include/dsp/fir_decim_names.h \
/.../PipelineC/include/dsp/fir_names.h \
/.../PipelineC/include/dsp/fir.h \
/.../PipelineC/include/binary_tree.h
% ./src/pipelinec ./examples/handshake_io.c
██████╗ ██╗██████╗ ███████╗██╗ ██╗███╗ ██╗███████╗ ██████╗
██╔══██╗██║██╔══██╗██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝
██████╔╝██║██████╔╝█████╗ ██║ ██║██╔██╗ ██║█████╗ ██║
██╔═══╝ ██║██╔═══╝ ██╔══╝ ██║ ██║██║╚██╗██║██╔══╝ ██║
██║ ██║██║ ███████╗███████╗██║██║ ╚████║███████╗╚██████╗
╚═╝ ╚═╝╚═╝ ╚══════╝╚══════╝╚═╝╚═╝ ╚═══╝╚══════╝ ╚═════╝
Output directory: /.../PipelineC/pipelinec_output_handshake_io.c_57595
================== Parsing C Code to Logical Hierarchy ================================
Parsing: /.../PipelineC/examples/handshake_io.c
Traceback (most recent call last):
File "/.../PipelineC/./src/pipelinec", line 220, in <module>
parser_state = C_TO_LOGIC.PARSE_FILE(c_file)
File "/.../PipelineC/src/C_TO_LOGIC.py", line 9986, in PARSE_FILE
all_code_files = get_included_files(c_filename)
File "/.../PipelineC/src/C_TO_LOGIC.py", line 214, in get_included_files
include_str = GET_SHELL_CMD_OUTPUT(cmd)
File "/.../PipelineC/src/C_TO_LOGIC.py", line 254, in GET_SHELL_CMD_OUTPUT
raise Exception(e_text)
Exception: Command failed:
cpp -MM -MG -I/.../PipelineC/pipelinec_output_handshake_io.c_57595/var_clock_cross.h -I/.../PipelineC/pipelinec_output_handshake_io.c_57595/type_array_N_t.h -I/.../PipelineC/pipelinec_output_handshake_io.c_57595/type_bytes_t.h -I/.../PipelineC/pipelinec_output_handshake_io.c_57595/func_FSM.h -I/.../PipelineC/pipelinec_output_handshake_io.c_57595/func_SINGLE_INST.h -I/.../PipelineC/ -I/.../PipelineC/pipelinec/include/ -I/.../PipelineC/include/ -D__PIPELINEC__ /.../PipelineC/examples/handshake_io.c
/.../PipelineC/examples/handshake_io.c:93:1: error: _Pragma takes a parenthesized string literal
93 | DECL_INPUT(uint32_t, s_axis_tdata)
| ^
/.../PipelineC/include/compiler.h:97:14: note: expanded from macro 'DECL_INPUT'
97 | type_t name; \
| ^
/.../PipelineC/include/compiler.h:66:27: note: expanded from macro '\PRAGMA_MESSAGE'
66 | #define PRAGMA_MESSAGE(x) PRAGMA_MESSAGE_(x)
| ^
/.../PipelineC/include/compiler.h:65:28: note: expanded from macro 'PRAGMA_MESSAGE_'
65 | #define PRAGMA_MESSAGE_(x) _Pragma(#x)
| ^
/.../PipelineC/examples/handshake_io.c:93:1: error: _Pragma takes a parenthesized string literal
/.../PipelineC/include/compiler.h:98:27: note: expanded from macro 'DECL_INPUT'
98 | PRAGMA_MESSAGE(MAIN name) \
| ^
/.../PipelineC/include/compiler.h:66:27: note: expanded from macro '\PRAGMA_MESSAGE'
66 | #define PRAGMA_MESSAGE(x) PRAGMA_MESSAGE_(x)
| ^
/.../PipelineC/include/compiler.h:65:28: note: expanded from macro 'PRAGMA_MESSAGE_'
65 | #define PRAGMA_MESSAGE_(x) _Pragma(#x)
| ^
/.../PipelineC/examples/handshake_io.c:94:1: error: _Pragma takes a parenthesized string literal
94 | DECL_INPUT(uint4_t, s_axis_tkeep)
| ^
/.../PipelineC/include/compiler.h:97:14: note: expanded from macro 'DECL_INPUT'
97 | type_t name; \
| ^
/.../PipelineC/include/compiler.h:66:27: note: expanded from macro '\PRAGMA_MESSAGE'
66 | #define PRAGMA_MESSAGE(x) PRAGMA_MESSAGE_(x)
| ^
[removed additional output for brevity, more of the same pragma errors as above]
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
handshake_io.o: \
/.../PipelineC/examples/handshake_io.c \
/.../PipelineC/include/arrays.h \
/.../PipelineC/include/handshake/handshake.h \
/.../PipelineC/include/compiler.h \
/.../PipelineC/include/bool.h \
/.../PipelineC/include/uintN_t.h \
/.../PipelineC/include/stream/stream.h
—
Reply to this email directly, view it on GitHub
<#285>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABFY6VSEANSUG7UMIEX5EB32DLONFAVCNFSM6AAAAABSZQKHSOVHI2DSMVQWIX3LMV43ASLTON2WKOZSG4YDQOJSGU3TQMQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Ah OK - I missed the part about this being on Mac. I am not able to recreate this on my Linux system. PipelineC has only ever been tested on Linux, so I am just starting to speculate about what could be going on for you. (and any python3 version should work fine out of the box, why not specified specific version for non-developers).
Seems like something is wrong dealing with include statements during preprocessing. Is At one point there was an issue of some I am going to make a general issue for 'pipelinec doesnt work on mac' and tag you in it, continue investigating there. In the short term using PipelineC on a Linux machine, virtual even, is the recommended fix. |
If you don't want to jump over to a Linux system to continue, lets discuss further if we can make things work over on Mac #286 👍 |
Right, I just tested it again in a Ubuntu 20.04 VM (via UTM, virtualized so still arm-based) and the This is likely an issue with Apple's |
Trying to build the
blink.c
example (or any other example I've tried) as described in the wiki doesn't work:I'm assuming this project uses
Python3.9
, as it relies ondistutils
, however I don't think the documentation mentions this anywhere. I had to alias mypython3
command.Running
pipelinec --help
works as expected and exits without error.Perhaps I'm doing something wrong/my environment is wrong.
Versions:
28786db
(current head)python3.9 --version
: Python 3.9.20cpp --version
: Apple clang version 16.0.0 (clang-1600.0.26.4) (Target: arm64-apple-darwin24.1.0)Additional interesting outputs from examples:
The text was updated successfully, but these errors were encountered: