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

Documentation - installation instructions? #3

Open
filker0 opened this issue Feb 18, 2022 · 4 comments
Open

Documentation - installation instructions? #3

filker0 opened this issue Feb 18, 2022 · 4 comments

Comments

@filker0
Copy link

filker0 commented Feb 18, 2022

The documentation does not appear to include instructions for installation of SweetAda; a "getting started" section would be very helpful.

For example, does one simply download and unpack the toolchain and add "<unpack_dir>/SweetAda/bin" to the PATH, or is there more to it than that? It looks like perhaps one needs to download the SweetAda snapshot, unpack it into a directory on the host system, change the name of the top level SweetAda directory to "SweetAda", then unpack the toolchain(s) over top of that.

@gabriele-galeotti
Copy link
Owner

The documentation does not appear to include instructions for installation of SweetAda; a "getting started" section would be very helpful.

For example, does one simply download and unpack the toolchain and add "<unpack_dir>/SweetAda/bin" to the PATH, or is there more to it than that? It looks like perhaps one needs to download the SweetAda snapshot, unpack it into a directory on the host system, change the name of the top level SweetAda directory to "SweetAda", then unpack the toolchain(s) over top of that.

Yeah, sorry about the documentation. I will try to correct and fill informations ASAP.

Well, more or less, yes.

In this setup, configuration.in refers always to the file int the top-level directory of SweetAda.

  1. Download a snapshot here.
  2. Download a toolchain, either a SweetAda one (https://sourceforge.net/projects/sweetada/files/toolchains/), or another that is a rather standard set (that is, gnatmake should be present as one of the executables).
  3. I guess you are on Linux machine. Then, the SweetAda toolchain is packed with prefix = /opt/sweetada, but theoretically it could be relocated in another prefix. If you have another toolchain, install it in the appropriate place. Change the toolchain prefix in configuration.in to reflect the installation:
    TOOLCHAIN_PREFIX := <your_prefix>
  4. If you use a random toolchain, you need also gcc-wrapper and gnat-wrapper utilities. You can build them, go into libutils/toolchain_tools and issue "make gcc-wrapper", "make gnat-wrapper", "make install-wrappers" (I gues you have a standard system gcc installed in your machine). If you have libelf installed in your system you could also build elftool with "make all", "make install". If you don't, set USE_ELFTOOL := N again in configuration.in.
    Else, you can download them in sourceforge, go to https://sourceforge.net/projects/sweetada/files/utilities/. The wrappers, elftool and every utility should be installed in libutils/.

And you should be fine. Double check your system for missing libraries or incompatible libc, etc etc.

If you are experiencing problems, let me know, maybe I am missing something.

G

@filker0
Copy link
Author

filker0 commented Feb 18, 2022 via email

@gabriele-galeotti
Copy link
Owner

Gabriele: Thanks for the quick response. Actually, for now, I’m using “msys2” on Windows 10. I wish I were using Linux. I’m doing a project that uses a Xilinx UltraScale+ MPSoC with more than 1 MicroBlaze core in the PL; the Ada code will be running stand-alone on the MicroBlaze cores, the A53 cluster in the PS will be running Linux. There are some application specific peripherals used to provide communication between the different hard and soft core complexes, and each MicroBlaze has its complement of memory, interrupt controller, timer, etc., and most of the IPC between the cores is done using AXI streams. I can’t say much more about the target. I’m fairly new to Ada, but the requirement we have on my current project is that all of the MicroBlaze software must be in Ada because the customer does not trust software written in C or C++ to be secure or safe enough. I figure I will need to create a standalone BSP package for our MicroBlaze platform that provides the various things that the Xilinx Vitis SDK puts in the “xparameters.h” file (addresses, interrupt vector #s, etc.), and set the compiler options in the “configuration.in” file to match the MicroBlaze IP options in our configuration (barrel shifter, HW multiply, axi stream instructions, etc.) and work out the right linker directives for execute-in-place (the MicroBlaze cannot write to the local Instruction memory, which is separate from the local Data memory, again for safety and security reasons). I will attempt to write a triptych that goes through the steps of taking a HW design from Vivado and creating a platform to be used in SweetAda, and convert it to a tutorial guide that can be used by others to help them create their own platforms for FPGA designs, custom ASICs, custom boards using COTS processor chips, etc., and if I manage to do so, I will submit a Pull request on GitHub. I will probably end up using my personal equipment for the tutorial (I have a Zedboard with a Zynq-7000, not the UltraScale+ MPSoC) and a single MicroBlaze core, which will make the document smaller and more general. This will also take some time, since I need to learn more Ada before I can do much of anything on it. Thank you for creating SweetAda. Thanks, Daniel Glasser (aka “Filker0” and “FilkerZero” on GitHub) From: Gabriele Galeotti @.> Sent: Friday, February 18, 2022 1:12 PM To: gabriele-galeotti/SweetAda @.> Cc: Glasser, Daniel A Collins @.>; Author @.> Subject: Re: [gabriele-galeotti/SweetAda] Documentation - installation instructions? (Issue #3) The documentation does not appear to include instructions for installation of SweetAda; a "getting started" section would be very helpful. For example, does one simply download and unpack the toolchain and add "<unpack_dir>/SweetAda/bin" to the PATH, or is there more to it than that? It looks like perhaps one needs to download the SweetAda snapshot, unpack it into a directory on the host system, change the name of the top level SweetAda directory to "SweetAda", then unpack the toolchain(s) over top of that. Yeah, sorry about the documentation. I will try to correct and fill informations ASAP. Well, more or less, yes. In this setup, configuration.in refers always to the file int the top-level directory of SweetAda. 1. Download a snapshot here. 2. Download a toolchain, either a SweetAda one (https://sourceforge.net/projects/sweetada/files/toolchains/), or another that is a rather standard set (that is, gnatmake should be present as one of the executables). 3. I guess you are on Linux machine. Then, the SweetAda toolchain is packed with prefix = /opt/sweetada, but theoretically it could be relocated in another prefix. If you have another toolchain, install it in the appropriate place. Change the toolchain prefix in configuration.in to reflect the installation: TOOLCHAIN_PREFIX := <your_prefix> 4. If you use a random toolchain, you need also gcc-wrapper and gnat-wrapper utilities. You can build them, go into libutils/toolchain_tools and issue "make gcc-wrapper", "make gnat-wrapper", "make install-wrappers" (I gues you have a standard system gcc installed in your machine). If you have libelf installed in your system you could also build elftool with "make all", "make install". If you don't, set USE_ELFTOOL := N again in configuration.in. Else, you can download them in sourceforge, go to https://sourceforge.net/projects/sweetada/files/utilities/. The wrappers, elftool and every utility should be installed in libutils/. And you should be fine. Double check your system for missing libraries or incompatible libc, etc etc. If you are experiencing problems, let me know, maybe I am missing something. G — Reply to this email directly, view it on GitHub<#3 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADTFK32RJGKU6DR3PMVJUYDU32KZPANCNFSM5OYMCEWQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you authored the thread.Message ID: @.@.>>

Daniel,

I am willing to help you, but take into account that it's entirely in my spare time. Also note that SweetAda is rather generic and provides for some CPUs few to little support, because it's work in progress. I tested a very basic led blink program in the Spartan3E board with MicroBlaze, and virtually in a ML6505-QEMU emulated board, nothing more. Interrupts and other "heavy" things are under development.

That being said, we can try to test something as a "proof of concept", if you are willing.

As a final note, the msys process is rather slow, due to the convoluted interface between uni* system calls and windoz.

Let's start from the MicroBlaze toolchain, targeting an ML605 Spartan board with a MicroBlaze softcore.

You have msys2, ok, SweetAda should work in msys2. Download from sourceforge the last version of the windoz toolchain (https://sourceforge.net/projects/sweetada/files/toolchains/Windows/release-20210725/microblaze-sweetada-elf-20210725W.zip), and unpack it so exists C:\Program Files\SweetAda, which contains bin, include, lib, libexec, etc etc etc.

This way, the configuration.in should work out of the box. Download the SweetAda snapshot and install it in, say, C:\msys64\home\Administrator\sweetada.

Activate the msys shell and go into the sweetada directory.

The first thing is to build the RTS. This should be done before every other thing.

Check if the following utilities are visible in your environment:

  • make
  • sed
  • tr
  • uname
    They are normally part of msys base package. if you have no make, the toolchain contains one. Prefix it with C:\Program Files\SweetAda\bin\ so you can run make.exe from the command line.

Ok, try to build the RTSes:

$ make CPU=MicroBlaze RTS=zfp TOOLCHAIN_NAME=microblaze-sweetada-elf rts
$ make CPU=MicroBlaze RTS=sfp TOOLCHAIN_NAME=microblaze-sweetada-elf rts

If everything went ok:

$ PLATFORM=ML605 make createkernelcfg
$ make configure
$ make all

At this point, you have a little Ada application to be burned in an ML605 board. Congratulations.

If you use the QEMU emulator, you can run it, but I end my post here because I don't know if you was at this point successful.

Maybe we can continue in the next post, it's enough so far.

Good luck and let me know.

@filker0
Copy link
Author

filker0 commented Feb 18, 2022 via email

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