Skip to content
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

Conv C code compilation error #21

Closed
schegde opened this issue Aug 16, 2022 · 7 comments
Closed

Conv C code compilation error #21

schegde opened this issue Aug 16, 2022 · 7 comments

Comments

@schegde
Copy link

schegde commented Aug 16, 2022

To generate the RISCV firmwares for BARVINN simulation, I am trying to compile the convolution C code in csrc/conv/ . So I installed the rv32 RISCV compilation toolchain as per the Picorv32 instructions. When I do make all in the conv folder, I get the following error:
image

I am actually not able to find the definitions for these macros across the entire repo(including in csrc/conv/common/pito.h :
image

Could you confirm about these?

@hossein1387
Copy link
Owner

Could you please confirm on which branch of Pito/BARVINN and MVU you are?

@schegde
Copy link
Author

schegde commented Aug 16, 2022

I am currently on origin/master <-> 3649e73 for BARVINN ; origin/master <-> 5e24521b for PITO_RISCV ; and aff7d9d4 for MVU

@hossein1387
Copy link
Owner

hossein1387 commented Aug 16, 2022

I am in the process of adding a memory subsystem to BARVINN and our first FPGA target is ALVEO U200. The DMA engine is under construction and the code you see is a left over of this development.

If you just want to try a simple Conv kernel on BARVINN, you can comment line 46 and 54 and the code will perform a Convolution between an input of size 1x3x32x32 and weight size of 64x64x3x3. The computation is divided between 8 MVUs. This code assumes that the data is already prepared in the correct format in input and weight buffers. The purpose of the DMA calls is actually to request the host to send over data in the correct format for the computation.

To use DMA engine and the host, you can follow my work on mem_sub_system branch on Pito. I should have some results soon.

@schegde
Copy link
Author

schegde commented Aug 16, 2022

Ahh, I see that makes sense. Thanks for the added clarification about the the DMA engine part being under construction. Sorry for the confusion, you had mentioned about that in #20 . With the lines commented, I am able to generate the firmware files!. I will give a try with full BARVINN simulation now.

@schegde schegde closed this as completed Aug 16, 2022
@hossein1387
Copy link
Owner

Awesome! let me know if you have more questions!

@schegde
Copy link
Author

schegde commented Aug 18, 2022

Sorry, needed a bit more clarification. You mentioned the csrc/conv2d.c will do 3x32x32 input with 64x64x3x3 weight. Shouldn't the weights be 3x64x3x3 since we only have 3 input channels? Also for preparing the input and weight RAMs , I can use the MVU_Code_gen repository to generate the weight.hex and input.hex necessary for the conv_tester.sv simulation, right?

@hossein1387
Copy link
Owner

oops, I meant input size is 1x64x32x32. And yes, you can use MVU_Code_gen to generate weights and input necessary for the conv_tester.sv.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants