+ Post New Thread
Page 1 of 2 1 2 LastLast
Results 1 to 20 of 24
  1. #1
    Full Member level 4
    Points: 1,999, Level: 10

    Join Date
    Jun 2014
    Posts
    209
    Helped
    0 / 0
    Points
    1,999
    Level
    10

    Tool for transforming python code to FPGA for Machine Learning

    Hello, Is there any tool that can transform python code for Machine Learning into VHDL (preferably), so that can be uploaded to a Xilinx Spartan 3E FPGA?

  2. #2
    Super Moderator
    Points: 83,981, Level: 70
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    17,075
    Helped
    3858 / 3858
    Points
    83,981
    Level
    70

    Re: Tool for transforming python code to FPGA for Machine Learning

    Hi,

    Maybe there is...but it's against the idea software vs hardware,

    It's an often made mistake to look/write HDL like software.
    Software is processed sequentially, one instruction after the other.
    Hardware processes all at once. There are no instructions.

    Use a microcontroller when you want to write software.
    Use a PLD and HDL when you need hardware.

    They work completeley different. Each has it's benefits and drawbacks.

    Klaus
    Please don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.


    1 members found this post helpful.

  3. #3
    Advanced Member level 5
    Points: 38,675, Level: 48
    Achievements:
    7 years registered

    Join Date
    Jun 2010
    Posts
    6,983
    Helped
    2063 / 2063
    Points
    38,675
    Level
    48

    Re: Tool for transforming python code to FPGA for Machine Learning

    MyHDL is a python based tool for writing python and converting to HDL.
    But you have to write the code specifically for MyHDL, you cannot just convert any old python.


    1 members found this post helpful.

    •   AltAdvertisement

        
       

  4. #4
    Full Member level 4
    Points: 1,460, Level: 8
    FlyingDutch's Avatar
    Join Date
    Dec 2017
    Location
    Bydgoszcz - Poland
    Posts
    190
    Helped
    28 / 28
    Points
    1,460
    Level
    8

    Re: Tool for transforming python code to FPGA for Machine Learning

    Quote Originally Posted by adwnis123 View Post
    Hello, Is there any tool that can transform python code for Machine Learning into VHDL (preferably), so that can be uploaded to a Xilinx Spartan 3E FPGA?
    Hi,

    it will be rather effortless to find way to to deploy trained ANN to FPGA. I am talking for most populat frameworks for deep learning (ANN) written in Python "TensorFlow" and "Keras". You are making model and train ANN in Keras for example and then deploy trained ANN to FPGA. So far I try Keras and TensorFlow with GPUs (Nvidia GeForce GTX1050 TI) and it is working fine, I didn't try it with FPGAs, but these links may be helpful:

    https://www.easics.com/products/deep-learning-fpga

    https://github.com/hls-fpga-machine-learning/hls4ml

    https://github.com/hls-fpga-machine-learning

    https://github.com/hls-fpga-machine-...keras-training

    https://github.com/danielholanda/LeFlow

    Regards


    1 members found this post helpful.

  5. #5
    Full Member level 4
    Points: 1,999, Level: 10

    Join Date
    Jun 2014
    Posts
    209
    Helped
    0 / 0
    Points
    1,999
    Level
    10

    Re: Tool for transforming python code to FPGA for Machine Learning

    Ok I am following this here:
    https://fastmachinelearning.org/hls4...UICKSTART.html
    but it requires Vivado. Is there a free version of Vivado for Ubuntu or should I buy it? Because it requires credentials here: https://www.xilinx.com/support/download.html
    I am a hobbyist not a company.
    Last edited by adwnis123; 28th March 2020 at 21:17.



  6. #6
    Advanced Member level 5
    Points: 38,675, Level: 48
    Achievements:
    7 years registered

    Join Date
    Jun 2010
    Posts
    6,983
    Helped
    2063 / 2063
    Points
    38,675
    Level
    48

    Re: Tool for transforming python code to FPGA for Machine Learning

    The vivado webpack is free. It only supports the smaller devices though.


    1 members found this post helpful.

  7. #7
    Full Member level 4
    Points: 1,460, Level: 8
    FlyingDutch's Avatar
    Join Date
    Dec 2017
    Location
    Bydgoszcz - Poland
    Posts
    190
    Helped
    28 / 28
    Points
    1,460
    Level
    8

    Re: Tool for transforming python code to FPGA for Machine Learning

    Quote Originally Posted by TrickyDicky View Post
    The vivado webpack is free. It only supports the smaller devices though.
    Hello,

    as @TrickyDicky said "Vivado HLS" (Webpack version) is free. You must create free account at xilinx.com and get "Webpack license" and copy it to catalog which is available from Vivado (the best is to add this catalog to PATH environment variable of Windows or Linux). This free licence allow to work with most of types of Xilinx FPGAs, for example Artix-7, Spartan-7, Zybo. These families of FPGAs should be enough for basic AI and deep learning.

    Regards


    1 members found this post helpful.

  8. #8
    Advanced Member level 4
    Points: 8,973, Level: 22
    Achievements:
    7 years registered Created Blog entry
    dpaul's Avatar
    Join Date
    Jan 2008
    Location
    Germany
    Posts
    1,344
    Helped
    288 / 288
    Points
    8,973
    Level
    22
    Blog Entries
    1

    Re: Tool for transforming python code to FPGA for Machine Learning

    Did you look into PYNQ and the libraries therein?

    http://www.pynq.io/
    FPGA enthusiast!


    1 members found this post helpful.

  9. #9
    Full Member level 4
    Points: 1,999, Level: 10

    Join Date
    Jun 2014
    Posts
    209
    Helped
    0 / 0
    Points
    1,999
    Level
    10

    Re: Tool for transforming python code to FPGA for Machine Learning

    When I go to the xilinx site to get the 30-day license for Vivado, it requires a "Host ID Value". What do I put here?
    Also, I cannot understand why Xilinx gives me only 30-day license, since I am not going to make money from the software...I am only a hobbyist...



  10. #10
    Advanced Member level 5
    Points: 38,675, Level: 48
    Achievements:
    7 years registered

    Join Date
    Jun 2010
    Posts
    6,983
    Helped
    2063 / 2063
    Points
    38,675
    Level
    48

    Re: Tool for transforming python code to FPGA for Machine Learning

    The webpack is a free version with no limits. The 30 day license is a 30 day trial of a full paid for licence. The webpack only supports the lower end devices. If you have a device not supported by the webpack, you'll need a full paid for licence. WHy should it matter if you're a hobbiest or not?

    even amateur photographers have to pay for Photoshop, why should Xilinx be any different?

    https://www.xilinx.com/products/desi...o-webpack.html


    1 members found this post helpful.

    •   AltAdvertisement

        
       

  11. #11
    Full Member level 4
    Points: 1,999, Level: 10

    Join Date
    Jun 2014
    Posts
    209
    Helped
    0 / 0
    Points
    1,999
    Level
    10

    Re: Tool for transforming python code to FPGA for Machine Learning

    I have downloaded: "Vivado HLx 2019.2: All OS installer Single-File Download" does this support Webpack? (I want to use it with PYNQ-Z1) or should I have to download it from the link you post it: https://www.xilinx.com/products/desi...o-webpack.html ??

    Yes, of course, there are cameras with 50-70$, if Xilinx wants this level of money for a license I can afford it...no problem!!



  12. #12
    Advanced Member level 5
    Points: 38,675, Level: 48
    Achievements:
    7 years registered

    Join Date
    Jun 2010
    Posts
    6,983
    Helped
    2063 / 2063
    Points
    38,675
    Level
    48

    Re: Tool for transforming python code to FPGA for Machine Learning

    That install is fine - and when installing select "webPACK" as the install option


    1 members found this post helpful.

  13. #13
    Full Member level 4
    Points: 1,999, Level: 10

    Join Date
    Jun 2014
    Posts
    209
    Helped
    0 / 0
    Points
    1,999
    Level
    10

    Re: Tool for transforming python code to FPGA for Machine Learning

    Quote Originally Posted by FlyingDutch View Post
    Hello,

    as @TrickyDicky said "Vivado HLS" (Webpack version) is free. You must create free account at xilinx.com and get "Webpack license" and copy it to catalog which is available from Vivado (the best is to add this catalog to PATH environment variable of Windows or Linux). This free licence allow to work with most of types of Xilinx FPGAs, for example Artix-7, Spartan-7, Zybo. These families of FPGAs should be enough for basic AI and deep learning.

    Regards
    Ok I have installed WebPack Vivado finally. I am following these instructions....
    https://fastmachinelearning.org/hls4...UICKSTART.html
    How do I add the path on Ubuntu?

    Thank you...

    - - - Updated - - -

    Also, this error:

    mojito@ubuntu:~/Desktop/vivado/hls4ml/example-models$ hls4ml convert -c keras-config.yml
    hls4ml: command not found
    I cannot understand, I am following the instructions...!!



  14. #14
    Full Member level 4
    Points: 1,460, Level: 8
    FlyingDutch's Avatar
    Join Date
    Dec 2017
    Location
    Bydgoszcz - Poland
    Posts
    190
    Helped
    28 / 28
    Points
    1,460
    Level
    8

    Re: Tool for transforming python code to FPGA for Machine Learning

    Quote Originally Posted by adwnis123 View Post
    Ok I have installed WebPack Vivado finally. I am following these instructions....
    https://fastmachinelearning.org/hls4...UICKSTART.html
    How do I add the path on Ubuntu?

    I cannot understand, I am following the instructions...!!
    Hi try this:

    https://askubuntu.com/questions/1093...nment-variable

    Regards


    1 members found this post helpful.

  15. #15
    Full Member level 4
    Points: 1,999, Level: 10

    Join Date
    Jun 2014
    Posts
    209
    Helped
    0 / 0
    Points
    1,999
    Level
    10

    Re: Tool for transforming python code to FPGA for Machine Learning

    Thank you,

    Any idea why I get this error?

    mojito@ubuntu:~/Desktop/vivado/hls4ml/example-models$ hls4ml convert -c keras-config.yml
    hls4ml: command not found
    I mean I am following exactly the steps posted here:

    https://fastmachinelearning.org/hls4...UICKSTART.html

    which says:

    git clone https://github.com/hls-fpga-machine-learning/hls4ml.git
    cd hls4ml/
    pip install .

    cd example-models/

    hls4ml convert -c keras-config.yml



  16. #16
    Full Member level 4
    Points: 1,460, Level: 8
    FlyingDutch's Avatar
    Join Date
    Dec 2017
    Location
    Bydgoszcz - Poland
    Posts
    190
    Helped
    28 / 28
    Points
    1,460
    Level
    8

    Re: Tool for transforming python code to FPGA for Machine Learning

    Quote Originally Posted by adwnis123 View Post
    Thank you,

    Any idea why I get this error?

    I mean I am following exactly the steps posted here:

    https://fastmachinelearning.org/hls4...UICKSTART.html

    which says:
    Hi,
    does file keras-config.yml to arise? If not it might be problem with privileges. Another reason might be not met dependencies after installation.

    Best Regards


    1 members found this post helpful.

  17. #17
    Full Member level 4
    Points: 1,999, Level: 10

    Join Date
    Jun 2014
    Posts
    209
    Helped
    0 / 0
    Points
    1,999
    Level
    10

    Re: Tool for transforming python code to FPGA for Machine Learning

    Ok, I have managed after many days to make it work... However I get this error:

    Code:
    ERROR: [HLS 200-70] Part 'xcku115-flvb2104-2-i' is not installed.
    command 'ap_source' returned error code
        while executing
    "source build_prj.tcl"
        ("uplevel" body line 1)
        invoked from within
    "uplevel \#0 [list source $arg] "
    when running this command:

    Code:
    hls4ml build -p my-hls-test -a
    I believe this is a component for the paid version right?? I have installed Vivado Webpack..!

    Thank you...



  18. #18
    Full Member level 4
    Points: 1,460, Level: 8
    FlyingDutch's Avatar
    Join Date
    Dec 2017
    Location
    Bydgoszcz - Poland
    Posts
    190
    Helped
    28 / 28
    Points
    1,460
    Level
    8

    Re: Tool for transforming python code to FPGA for Machine Learning

    Hello,

    "xcku115-flvb2104-2-i" is high-end Ultrascale FPGA. Are you doing your project for Ultrascale FPGA? Maybe you should change in project properties type of using FPGA chip?

    Best Regards


    1 members found this post helpful.

  19. #19
    Full Member level 4
    Points: 1,999, Level: 10

    Join Date
    Jun 2014
    Posts
    209
    Helped
    0 / 0
    Points
    1,999
    Level
    10

    Re: Tool for transforming python code to FPGA for Machine Learning

    I changed the target FPGA! Nothing works! I believe it's time to transform myself the python code to Vivado from scratch... Too many days wasted!



  20. #20
    Full Member level 4
    Points: 1,999, Level: 10

    Join Date
    Jun 2014
    Posts
    209
    Helped
    0 / 0
    Points
    1,999
    Level
    10

    Re: Tool for transforming python code to FPGA for Machine Learning

    Is it possible to build a CNN on Matlab and transform it to vhdl code? Has anyone experience on this? Thanks...



    •   AltAdvertisement

        
       

--[[ ]]--