-
Notifications
You must be signed in to change notification settings - Fork 50
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
PipelineC does not work on Apple Mac #286
Comments
Forwarding on your insight here @playduck
Curious if like plain C text (missing pragmas :-/) gets through any further typedef unsigned char uint1_t;
typedef unsigned long uint25_t;
uint25_t counter;
uint1_t led;
uint1_t blink()
{
if(counter==(33333333-1))
{
led = !led;
counter = 0;
}
else
{
counter += 1;
}
return led;
} i.e. really making sure its just the preprocessor that is the problem... As mentioned on that other issue, there are only a handful of places where |
Back on native MacOS: the
The only difference between the test version and the I then removed the typedef's and replace it with an Playing around in |
Again I got the original
- def preprocess_file(filename, cpp_path="cpp", cpp_args=""):
+ def preprocess_file(filename, cpp_path="clang", cpp_args=["-E"]) -> str: The same change also works identically in my ubuntu VM. |
OK that sounds progress, appreciate the experimentation. iirc the two types of preprocessor use in pipelinec are I am not familiar with equivalent for the includes in this file part c to logic py ~line 206 # Use cpp -MM -MG to parse the #include tree and get all files
# that need to be code gen'd again
# DOES NOT INCLUDE to-be-generated missing files
def get_included_files(c_filename):
includes_list = GET_CPP_INCLUDES_LIST()
includes_text = " ".join(includes_list)
cmd = "cpp -MM -MG " + includes_text + " " + c_filename |
I think I've got it mostly working! I've changed the default flags for the - def preprocess_text(text, cpp_path="cpp", cpp_args=""):
+ def preprocess_text(text, cpp_path="clang", cpp_args=["-E"]):
"""Preprocess a file using cpp.
filename:
Name of the file you want to preprocess.
cpp_path:
cpp_args:
Refer to the documentation of parse_file for the meaning of these
arguments.
When successful, returns the preprocessed file's contents.
Errors from cpp will be printed out.
"""
path_list = [cpp_path]
+ if isinstance(cpp_args, list):
+ path_list += cpp_args
+ elif cpp_args != "":
+ path_list += [cpp_args] And in the other function simply replaced the def get_included_files(c_filename):
includes_list = GET_CPP_INCLUDES_LIST()
includes_text = " ".join(includes_list)
- cmd = "cpp -MM -MG " + includes_text + " " + c_filename
+ cmd = "clang -MM -MG " + includes_text + " " + c_filename Definitely not the cleanest solution to put these in the default function args but it seems to work. |
Oh wow, well thats excellent to hear - getting all the way to synthesis sounds like fantastic progress! Hmm, I feel like ive heard some struggles in the past getting FPGA tools working on Mac working generally ✊ Vivado, and even some open source options :-/ your changes can probably get merged in soon, look straight forward - but would love to hear if you try to install a synth tool, if it works all the way through. For ref some wiki notes https://github.com/JulianKemmerer/PipelineC/wiki/Running-the-Tool |
To be fair working with FPGA's on Mac is neither productive, nor recommended nor for the sane. Matter-of-fact I've not yet gotten a bitstream to build without VMs/Docker, so a full synth run is currently unlikely (And if the synth tools run in a VM I might as well run PipelineC there as well). Getting PipelineC working on native MacOS is more for playing around and for simulating designs. |
😁 Any success in what OSS CAD SUITE offers? https://github.com/YosysHQ/oss-cad-suite-build Re: pipelinec, I think next step is getting some logic to see if on Mac or not and changing out those two places where you fixed If you have any thoughts on how to structure that, happy to hear, can make a PR etc if you like |
PipelineC has very few dependencies: python3 and a C preprocessor. This works out of the box on most Linux distros. However, it does not seem to work out of the box on Mac systems.
There has been confusion about
cpp
being the preprocessor or not, and what command line args it accepts: #166But this will be the general issue where 'why doesn't PipelineC work on Mac?' can be discussed and hopefully fixed 🤞
The text was updated successfully, but these errors were encountered: