gabriele-galeotti / SweetAda

Ada-language framework
https://sweetada.org
Other
34 stars 4 forks source link

Documentation - installation instructions? #3

Open filker0 opened 2 years ago

filker0 commented 2 years ago

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 "/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 commented 2 years ago

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 "/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 := 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 commented 2 years ago

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 "/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 :=
  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 GitHubhttps://github.com/gabriele-galeotti/SweetAda/issues/3#issuecomment-1045040150, 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: @.**@.>>

gabriele-galeotti commented 2 years ago

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 "/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 := 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:

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 commented 2 years ago

Gabriele:

Thank you. I already have the toolchain downloaded. I will follow your instructions and try it in QEMU (I only have access to ZCU102, ZCU106, and Zedboard FPGA dev boards at the moment). We’re apparently getting a commercial Gnat package with some sort of MicroBlaze adapted runtime, but that won’t be available to run from Windows, and the final development will need to be done on a air-gapped network into which that Linux system will be installed (SW engineers are not allowed to have desktop Linux systems on the corporate network at this time; the FPGA folks do have them, but IT security forces us to use Windows, and has (for some reason) made it impossible to use Hyper-V, VirtualBox, or VMWare on our windows workstations. Given that up until 2 years ago (when the new rules were imposed, about the time we were purchased by a larger company), my workflow was largely based on VMWare and/or VirtualBox VMs running Linux. For about 6 months, we were allowed to use Docker containers, but now that’s also forbidden.

I don’t expect you to teach me Ada; I have other resources for that, but I very much appreciate the time you spent on your reply. I, too, am rather busy; I’m the senior platform/foundation software engineer on two separate teams working on different projects, and am involved in several other pursuits. Like you, my time is somewhat in short supply at work, and I have other responsibilities at home that keep me occupied the rest of the time.

I will let you know if I have any questions/problems, though it may take a while to find the time to get through what you’ve given me already.

Thanks again! Daniel

From: Gabriele Galeotti @.> Sent: Friday, February 18, 2022 3:01 PM To: gabriele-galeotti/SweetAda @.> Cc: Glasser, Daniel A Collins @.>; Author @.> Subject: Re: [gabriele-galeotti/SweetAda] Documentation - installation instructions? (Issue #3)

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 #3https://github.com/gabriele-galeotti/SweetAda/issues/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 "/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 := 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)https://github.com/gabriele-galeotti/SweetAda/issues/3#issuecomment-1045040150>, 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:

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.

— Reply to this email directly, view it on GitHubhttps://github.com/gabriele-galeotti/SweetAda/issues/3#issuecomment-1045184033, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADTFK34TJWVUSHM7VHFNT7TU32XR5ANCNFSM5OYMCEWQ. 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: @.***>