❌ About FreshRSS

Normal view

There are new articles available, click to refresh the page.
Before yesterdayAda Forum - Latest topics

Gnatd.v elaboration

By: kevlar700
22 November 2023 at 15:11

I wonder. Is gnatd.v a better option than
pragma preelaborate

Is preelaborate more compiler portable? Though I do not use the features that it protects against such as dynamic dispatch, so it is simply an unneeded restriction for me with Gnat. However gnatd.v seems to offer more such as in regard to uninitialised variables? Assuming it works as I had no compile issues :joy:.

see 7.7

https://docs.adacore.com/spark2014-docs/html/lrm/packages.html

2 posts - 2 participants

Read full topic

Spark with a private global log store

By: kevlar700
7 November 2023 at 18:21

I have a log package with a private global variable that passes silver mode except for a couple of low upper bound string issues. It has a fixed sized global variable as the log store.

However any external procedure running in spark mode that tries to execute a log function is wanted by spark to have the state or log store listed in it’s global aspect even though it has no access to the private log store directly.

I assume that I am missing something and shall keep reading but any help would be much appreciated? It isn’t workable for me to create global aspects for any procedure that uses my log package. I guess I could pass the log store but I am not sure that that is a good solution.

Thanks

3 posts - 2 participants

Read full topic

SPARK vs codepeer with regard to volatility

By: kevlar700
15 February 2023 at 18:18

In general Spark mode can be straight forward (atleast for Silver) but appears to be more work than it is worth for any file that withs a lot of volatiles like those generated by svd2ada.

Would you agree or encourage me to persevere across the learning curve?

Is codepeer a good alternative in this case?

5 posts - 2 participants

Read full topic

Does Initialize_Scalars require a Full runtime or does light need s-scaval.ads?

By: kevlar700
16 January 2023 at 14:34

When I add
pragma Initialize_Scalars

To my local configuration pragmas on a light runtime.

I get

hal.ads:164:04: error: construct not allowed in configurable run-time mode
hal.ads:164:04: error: file s-scaval.ads not found
hal.ads:164:04: error: entity “System.Scalar_Values.Is_Isf” not available

The complete output follows.

gprbuild --target=arm-eabi -d -P/mnt/crypt/elansys/code/Ada/stm32l4r9_hal/stm32l4r9_hal.gpr -XMODE=Compile -XADAFLAGS= -g -j12 -gnat2022 -largs -Wl,-Map=map.txt
Compile
[Ada] stm32_svd-spi.ads
[Ada] stm32_svd-swpmi.ads
[Ada] stm32_svd-rcc.ads
[Ada] stm32_svd-lcd.ads
[Ada] stm32_svd-fpu.ads
[Ada] stm32_svd-opamp.ads
[Ada] stm32_svd-dma.ads
[Ada] stm32_svd-octospim.ads
[Ada] stm32_svd-rtc.ads
[Ada] stm32_svd-syscfg.ads
[Ada] stm32_svd-octospi.ads
[Ada] stm32_svd-crc.ads
hal.ads:164:04: error: construct not allowed in configurable run-time mode
hal.ads:164:04: error: file s-scaval.ads not found
hal.ads:164:04: error: entity “System.Scalar_Values.Is_Isf” not available
hal.ads:164:04: error: construct not allowed in configurable run-time mode
hal.ads:164:04: error: file s-scaval.ads not found
hal.ads:164:04: error: entity “System.Scalar_Values.Is_Isf” not available
hal.ads:164:04: error: construct not allowed in configurable run-time mode
hal.ads:164:04: error: file s-scaval.ads not found
hal.ads:164:04: error: entity “System.Scalar_Values.Is_Isf” not available
hal.ads:164:04: error: construct not allowed in configurable run-time mode
hal.ads:164:04: error: file s-scaval.ads not found
hal.ads:164:04: error: entity “System.Scalar_Values.Is_Isf” not available
hal.ads:164:04: error: construct not allowed in configurable run-time mode
hal.ads:164:04: error: file s-scaval.ads not found
hal.ads:164:04: error: entity “System.Scalar_Values.Is_Isf” not available
hal.ads:164:04: error: construct not allowed in configurable run-time mode
hal.ads:164:04: error: file s-scaval.ads not found
hal.ads:164:04: error: entity “System.Scalar_Values.Is_Isf” not available
hal.ads:164:04: error: construct not allowed in configurable run-time mode
hal.ads:164:04: error: file s-scaval.ads not found
hal.ads:164:04: error: entity “System.Scalar_Values.Is_Isf” not available
hal.ads:164:04: error: construct not allowed in configurable run-time mode
hal.ads:164:04: error: file s-scaval.ads not found
hal.ads:164:04: error: entity “System.Scalar_Values.Is_Isf” not available
hal.ads:164:04: error: construct not allowed in configurable run-time mode
hal.ads:164:04: error: file s-scaval.ads not found
hal.ads:164:04: error: entity “System.Scalar_Values.Is_Isf” not available
hal.ads:164:04: error: construct not allowed in configurable run-time mode
hal.ads:164:04: error: file s-scaval.ads not found
hal.ads:164:04: error: entity “System.Scalar_Values.Is_Isf” not available
hal.ads:164:04: error: construct not allowed in configurable run-time mode
hal.ads:164:04: error: file s-scaval.ads not found
hal.ads:164:04: error: entity “System.Scalar_Values.Is_Isf” not available
hal.ads:164:04: error: construct not allowed in configurable run-time mode
hal.ads:164:04: error: file s-scaval.ads not found
hal.ads:164:04: error: entity “System.Scalar_Values.Is_Isf” not available

compilation of stm32_svd-crc.ads failed
compilation of stm32_svd-octospi.ads failed
compilation of stm32_svd-syscfg.ads failed
compilation of stm32_svd-rtc.ads failed
compilation of stm32_svd-octospim.ads failed
compilation of stm32_svd-dma.ads failed
compilation of stm32_svd-opamp.ads failed
compilation of stm32_svd-fpu.ads failed
compilation of stm32_svd-lcd.ads failed
compilation of stm32_svd-rcc.ads failed
compilation of stm32_svd-swpmi.ads failed
compilation of stm32_svd-spi.ads failed

gprbuild: *** compilation phase failed
[2023-01-16 14:11:59] process exited with status 4, 23% (27/113), elapsed time: 00.31s

7 posts - 3 participants

Read full topic

Gnat arm elf 12.2.1 (alire) undefined reference to strlen

By: kevlar700
29 December 2022 at 19:33

Merry xmas all.

I simplified my Last Chance Handler by using

Interfaces.C.Strings.Value

The compiler output undefined reference to ‘strlen’

light-cortex-m4f/adalib/libgnat.a(i-cstrin.o)

I could go back to my manual string null termination finding function. Or should I look into Gnat. Could someone point me to the right place to report and or submit a patch (is it gerrit that GCC uses or something)?

7 posts - 3 participants

Read full topic

Gnat Studio, SPARK and -XMODE

By: kevlar700
2 December 2022 at 18:14

I’m not sure of the best way of setting -XMODE=Analyse in Gnat Studio. I wonder if the view mode could set it.

However, I found setting it under preferences => Build Targets by replacing %X works well for me.

It’s also worth realising that there are advanced and basic build targets with basic view being the default.

2 posts - 2 participants

Read full topic

Gnat Studio highlight occurences

By: kevlar700
15 November 2022 at 13:29

Many IDEs highlight occurences of the current selection. I have seen the Occurences plugin. Is there an automated option upon mouse double click?

Edit: I shall just add a keyboard shortcut for find all references.

Edit 2: I thought I had tried setting the ephemeral highlighting colour and restarting Gnat Studio. Perhaps I didn’t restart as it is working today.

1 post - 1 participant

Read full topic

Favourite books about Ada/Spark

By: kevlar700
16 October 2022 at 18:35

Programming in Ada 20xx by John Barnes
Ada Distilled by Richard Riehle

https://en.m.wikibooks.org/wiki/Ada_Programming

Please list any favourites or references that you personally turn to?

6 posts - 4 participants

Read full topic

Spark SVD warnings

By: kevlar700
6 October 2022 at 19:20

When SVD files are a subproject you get a lot of warnings when running gnatprove on the base address.

Address => NVIC_Base

‘writing to “NVIC_Periph” is assumed to have no effects on other non-volatile objects.’

Is there a good way to quieten those. Such as exclude the SVD sub project or ideally just silence that particular warning?

If I use the --no-subprojects flag then I get some .ali incorrectly formatted fatal errors.

Perhaps I should use this for faster contract generation anyway. However, I believe case statements in .gpr files prevent gnat studio from being able to edit automatically (I can always comment and uncomment the case statements as needed though)

https://docs.adacore.com/spark2014-docs/html/ug/en/spark_mode.html#specifying-files-to-analyze

project My_Project is

type Modes is (“Compile”, “Analyze”);
Mode : Modes := External (“MODE”, “Compile”);

case Mode is
when “Compile” =>
for Source_Dirs use (…);
when “Analyze” =>
for Source_Dirs use (“dir1”, “dir2”);
for Source_Files use (“file1.ads”, “file2.ads”, “file1.adb”, “file2.adb”);
end case;

end My_Project;

2 posts - 1 participant

Read full topic

❌
❌