-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'work/MiV-RV32IMAF-runtime' into 'master'
Add MiV-RV32IMAF runtime See merge request eng/toolchain/bb-runtimes!105
- Loading branch information
Showing
19 changed files
with
1,517 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
Microsemi MIV_RV32IMAF_L1_AHB Runtimes | ||
====================================== | ||
|
||
This BSP supports the Microsemi MIV_RV32IMAF_L1_AHB softcore processor for | ||
the Microsemi FPGAs. | ||
|
||
Required FPGA IP | ||
---------------- | ||
|
||
* MIV_RV32IMAF_L1_AHB | ||
* CoreUARTapb (for Ada.Text_IO) | ||
|
||
Runtimes Supported | ||
------------------ | ||
|
||
* Light | ||
* Light Tasking | ||
* Embedded | ||
|
||
Using the runtimes | ||
------------------ | ||
|
||
As a prerequisite, GNAT Pro for RISC-V32 ELF needs to be installed. To use the | ||
runtime, copy the runtime to the compiler installation or another location: | ||
|
||
(1) Compiler Installation | ||
~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Copy the runtime to the `<riscv32-elf gnat install>/riscv32-elf/lib/gnat/` | ||
folder. You can then select the runtime in GNAT Studio from the Toolchain pane | ||
of the Project Properties dialog box or set the following in your GPR file: | ||
|
||
for Runtime ("ada") use "light-tasking-am64xr5"; | ||
|
||
(2) Other Locations | ||
~~~~~~~~~~~~~~~~~~ | ||
|
||
Move the runtime into another directory and then in the project file provide | ||
the full or relative path from the project file: | ||
|
||
for Runtime ("ada") use "/path/to/runtime/embedded-miv_rv32imaf"; | ||
|
||
Alternatively, you can set the GPR_RUNTIME_PATH to the folder containing the | ||
runtime to be able to just specify the runtime name. | ||
|
||
Rebuilding the Runtime | ||
---------------------- | ||
|
||
If you need to make changes to the runtime's BSP you can rebuild with GPRbuild. | ||
|
||
For the Light runtime: gprbuild -P runtime_build.gpr | ||
|
||
For the Light-Tasking and Embedded runtimes: gprbuild -P ravenscar_build.gpr | ||
|
||
Note: if you were provided the runtime in a certification context, please reach | ||
out to AdaCore before modifying the runtime. | ||
|
||
Resources Used | ||
-------------- | ||
|
||
The Light-Tasking and Embedded runtimes use the RISC-V mtime and mtimecmp | ||
registers to implement Ada semantics for time, i.e., delay statements and | ||
package Ada.Real_Time. | ||
|
||
Ada.Text_IO is configured to utilise the Microsemi CoreUARTapb IP. See the | ||
Text I/O section for more details. | ||
|
||
Memory Layout | ||
------------- | ||
|
||
The runtime is configured for the following memory space: | ||
|
||
ram (rwx) : ORIGIN = 0x80000000, LENGTH = 512K | ||
ram_io (rwx) : ORIGIN = 0x70000000, LENGTH = 512K | ||
|
||
The size of each region can be modified by updating the linker script in | ||
ld/memory-map.ld. | ||
|
||
A single loader option is provided: RAM. The RAM loader stores and runs the | ||
program out of RAM at the memory address 0x80000000. Both the memory-map.ld | ||
and common-RAM.ld may be modified to suit the application. | ||
|
||
System Clock | ||
------------ | ||
|
||
The runtime is configured for a 80 MHz clock. If your MIV_RV32IMAF_L1_AHB is | ||
fed with a different clock rate, update the System_Clock constant in | ||
System.BB.Board_Parameters (gnat/s-bbbopa.ads) and rebuild the runtime. | ||
|
||
Interrupts | ||
---------- | ||
|
||
The runtime supports 32 IRQ interrupts. Interrupt priorities are not supported | ||
by the Light Tasking and Embedded runtimes. The interrupt names are located in | ||
Ada.Interrupts.Names (gnarl/a-intnam.ads). | ||
|
||
Text I/O | ||
-------- | ||
|
||
The runtime provides a minimal version of the Ada.Text_IO package supporting | ||
character- and string-based input and output routines for basic I/O needs. It | ||
is recommended to implement your own I/O packages based around your I/O | ||
channel of choice. | ||
|
||
The bodies of the Ada.Text_IO routines call through to a device-specific I/O | ||
package named System.Text_IO. See the package body in the file `s-textio.adb` | ||
in the gnat directory for more details. | ||
|
||
System.Text_IO is configured to use CoreUARTapb at address 16#6010_0000#, with | ||
a 115200 baud rate, one stop bit, no parity using system clock source. It | ||
implements a simple polling UART driver. | ||
|
||
The base address of the CoreUARTapb can be changed in System.BB.Parameters | ||
(gnat/s-bbbopa.ads). The CoreUARTapb configuration in System.Text_IO package | ||
may be modified as required. | ||
|
||
The user is free to use the CoreUARTapb device if Ada.Text_IO is not used. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
-- | ||
-- Copyright (C) 2023, AdaCore | ||
-- | ||
|
||
-- This is a version for the MIV-RV32 | ||
package Ada.Interrupts.Names is | ||
|
||
-- All identifiers in this unit are implementation defined | ||
|
||
pragma Implementation_Defined; | ||
|
||
---------------- | ||
-- Interrupts -- | ||
---------------- | ||
|
||
-- System tick | ||
Sys_Tick_Interrupt : constant Interrupt_ID := -1; | ||
|
||
-- Target Specific Names | ||
|
||
Timer_0 : constant Interrupt_ID := 8; | ||
Timer_1 : constant Interrupt_ID := 12; | ||
Console : constant Interrupt_ID := 15; | ||
Timer_2 : constant Interrupt_ID := 20; | ||
Timer_3 : constant Interrupt_ID := 26; | ||
|
||
-- General IRQ Names | ||
|
||
IRQ1 : constant Interrupt_ID := 1; | ||
IRQ2 : constant Interrupt_ID := 2; | ||
IRQ3 : constant Interrupt_ID := 3; | ||
IRQ4 : constant Interrupt_ID := 4; | ||
IRQ5 : constant Interrupt_ID := 5; | ||
IRQ6 : constant Interrupt_ID := 6; | ||
IRQ7 : constant Interrupt_ID := 7; | ||
IRQ8 : constant Interrupt_ID := 8; | ||
IRQ9 : constant Interrupt_ID := 9; | ||
IRQ10 : constant Interrupt_ID := 10; | ||
IRQ11 : constant Interrupt_ID := 11; | ||
IRQ12 : constant Interrupt_ID := 12; | ||
IRQ13 : constant Interrupt_ID := 13; | ||
IRQ14 : constant Interrupt_ID := 14; | ||
IRQ15 : constant Interrupt_ID := 15; | ||
IRQ16 : constant Interrupt_ID := 16; | ||
IRQ17 : constant Interrupt_ID := 17; | ||
IRQ18 : constant Interrupt_ID := 18; | ||
IRQ19 : constant Interrupt_ID := 19; | ||
IRQ20 : constant Interrupt_ID := 20; | ||
IRQ21 : constant Interrupt_ID := 21; | ||
IRQ22 : constant Interrupt_ID := 22; | ||
IRQ23 : constant Interrupt_ID := 23; | ||
IRQ24 : constant Interrupt_ID := 24; | ||
IRQ25 : constant Interrupt_ID := 25; | ||
IRQ26 : constant Interrupt_ID := 26; | ||
IRQ27 : constant Interrupt_ID := 27; | ||
IRQ28 : constant Interrupt_ID := 28; | ||
IRQ29 : constant Interrupt_ID := 29; | ||
IRQ30 : constant Interrupt_ID := 30; | ||
IRQ31 : constant Interrupt_ID := 31; | ||
|
||
end Ada.Interrupts.Names; |
Oops, something went wrong.