Re: SVD_to_D: Generate over 100k lines of highly-optimized microcontroller mmapped-IO code in the blink of an eye

2017-07-31 Thread Andrey via Digitalmars-d-announce

On Monday, 31 July 2017 at 08:51:16 UTC, Mike wrote:

https://github.com/JinShil/svd_to_d

SVD_to_D is a command-line utility that generates D code from 
ARM Cortex-M SVD files.


[...]



Thanks for your work. Not many people in D community thinking 
about embedded one


Re: DMD library available as DUB package

2017-07-31 Thread Johan Engelen via Digitalmars-d-announce

On Sunday, 30 July 2017 at 23:41:40 UTC, Johan Engelen wrote:

On Tuesday, 18 July 2017 at 12:07:27 UTC, Jacob Carlborg wrote:
During the dconf hackathon I set out to create a DUB package 
for DMD to be used as a library. This has finally been merged 
[1] and is available here [2]. It contains the lexer and the 
parser.


This is great news of course!

But I have some bad news ;-)
Now that the Lexer nicely separated, it is very easy for me to 
testdrive libFuzzer+AddressSanitizer on the lexer and... Expect 
many bug reports in the next days.


OK, this wasn't entirely fair.
1. I didn't read the API: the buffer needs to be null-terminated.
2. With a fix [1] to prevent reading beyond the input buffer, I 
have yet to find a new bug.


The fuzzer is running now... I wonder how long it takes to find 
the next bug, if any.


-Johan

[1] https://github.com/dlang/dmd/pull/7050


Re: covered - processes output of code coverage analysis performed by the D programming language compiler

2017-07-31 Thread jmh530 via Digitalmars-d-announce

On Monday, 31 July 2017 at 13:06:44 UTC, Anton Fediushin wrote:
Hello! I am glad to announce a new command-line tool which 
should make development

 a little easier.



You could add a mixin template that injects the 
"version(D_Coverage)" code.


covered - processes output of code coverage analysis performed by the D programming language compiler

2017-07-31 Thread Anton Fediushin via Digitalmars-d-announce
Hello! I am glad to announce a new command-line tool which should 
make development

 a little easier.

Program, compiled with `-cov` switch, generates *.lst files. They 
contain program source, number of executions of each line and 
total code coverage of the file.
Those files are quite useful for small programs/libraries, but 
not that useful for big ones.


Covered processes *.lst files, and reports only useful 
information. Behaviour can be changed with command-line options:


  '--coverage' reports code coverage in % for each file.
  '--blame' shows list of files ordered by code coverage.
  '--average' reports average code coverage for files.

Covered works for lists of files and directories, so '--blame' 
can be used to find less covered files, and '--average' to 
compute average code coverage of the project.


More documentation is available on project page on GitHub: 
https://github.com/ohdatboi/covered
It is also added to DUB package registry: 
http://code.dlang.org/packages/covered


Also, I am looking for huge projects, so I can test covered on 
them. Reply here or start an issue on GitHub if you know one.


SVD_to_D: Generate over 100k lines of highly-optimized microcontroller mmapped-IO code in the blink of an eye

2017-07-31 Thread Mike via Digitalmars-d-announce

https://github.com/JinShil/svd_to_d

SVD_to_D is a command-line utility that generates D code from ARM 
Cortex-M SVD files.


SVD files are XML files that describe, in great detail, the 
memory layout and characteristics of registers in an ARM Cortex-M 
microcontroller. See 
https://github.com/posborne/cmsis-svd/tree/master/data for a 
curated list of SVD files for many ARM Cortex-M microcontrollers 
from various silicon vendeors.


From the information in an SVD file, code for accessing the 
microcontroller's memory-mapped-io registers can be automatically 
generated, and SVD_to_D does exactly that.


For a large microcontroller like the SM32F7, the amount of code 
generated can be more than 100k lines.  See an example of 
generated D code here: 
https://github.com/JinShil/svd_to_d/tree/master/examples/stm32f7x9


The code generated by SVD_to_D depends on this memory-mapped-IO 
library: https://github.com/JinShil/memory_mapped_io  That 
library uses D's CTFE and meta-programming features to generate 
highly optimized code (for both size and speed) at compile-time 
with additional features such as type safety and 
compile-time-enforced mutability.


Enjoy!

Mike