Brian Daniels
0e4b841cb3
Removing need for memap to printed through toolchains
2016-10-11 18:24:01 -05:00
Brian Daniels
655c37715c
Handling output of parallelized test building.
...
This makes use of the reports generated by the building of tests to
prevent output from interleaving when the build is parallelized. This
required some changes to memap to return a generated string from
the 'generate_output' function. I also had an option to stop the prints
from memap to prevent text from interleaving
2016-10-11 15:34:20 -05:00
Brian Daniels
14aff069b1
Modifying behavior of 'silent' option in toolchains
...
The 'silent' option has always been present in the toolchains API, however
it did not actually stop anything from being printed. Instead, it just
changed what was added to the build log. This make the 'silent' stop all
prints, but ensures that the output for the toolchain is still preserved
and accessible via the 'get_output' function.
2016-10-11 14:31:06 -05:00
Sam Grove
872363d809
Merge pull request #2854 from theotherjimmy/find-duplicates
...
[Tools] Find and report duplicates
2016-09-30 18:30:00 -05:00
Jimmy Brisson
5f8fbac56f
Add documentation of exposed functions
2016-09-30 15:14:22 -05:00
Jimmy Brisson
e012185602
Use toolchain notify for printing when finding dupes
2016-09-30 15:14:22 -05:00
Jimmy Brisson
9f7c82a37f
Deduplicate find-duplicate functionality
2016-09-30 15:13:53 -05:00
Jimmy Brisson
a85a384973
Add duplicate detection to project compilation
2016-09-30 15:13:53 -05:00
Jimmy Brisson
e2b248a4aa
Correct percent printing
2016-09-30 15:09:54 -05:00
Sam Grove
1047ab4562
Merge pull request #2834 from bridadan/memap-consolidate
...
[tools] Making memap output consistent across output formats
2016-09-30 14:59:31 -05:00
Jimmy Brisson
7348b0131b
Add Debug or Release to labels depending on flags
...
This is a policy decision and it should /really/ be in the config system
ATM it's here for backward compatibility
2016-09-30 13:01:16 -05:00
Jimmy Brisson
fd04ea2125
Added property based regression test to travis
2016-09-29 10:20:05 -05:00
Jimmy Brisson
d88852d150
Replace -o with profiles
2016-09-29 10:20:05 -05:00
Jimmy Brisson
ceda396e18
Add simple build profiles to toolchains
2016-09-28 17:25:24 -05:00
Brian Daniels
e8b06874a3
Making memap output consistent across output formats
...
This commit fixes an issue where the output from memap.py was not
consistent across all output formats. This issue stemmed from the fact
that a few important calculations were being performed at output
generation time. This has been moved to the 'parse' function and saved for
future use by the 'generate' functions.
Because this commit saves more data to the MemapParser instance, there
were some name collisions. The public member 'mem_summary' has been
renamed to 'mem_report'. 'mem_report' contains the data structure used by
the json generator. This includes both the section data and the memory
summary. The 'mem_summary' member now just contains the summary. The
summary includes total allocated heap, total static RAM, etc.
2016-09-27 16:51:16 -05:00
Sam Grove
28f9b27918
Merge pull request #2788 from theotherjimmy/print-percent
...
Print percent complete when building
2016-09-24 16:48:03 -05:00
Jimmy Brisson
2fe201cf10
Print percent complete when building
2016-09-22 15:10:03 -05:00
Jimmy Brisson
d4f9820577
Refactor Target and Config away from global variables
2016-09-20 16:09:22 -05:00
Sam Grove
a6f4b58405
Merge pull request #2675 from sarahmarshy/toolchain_path_check
...
Revise checking toolchain path
2016-09-16 17:31:41 -05:00
Sarah Marsh
8670598115
Abstract check_executable added
2016-09-13 16:26:58 -05:00
Sarah Marsh
ab92a5ace2
Toolchain check generic in mbedToolchain
2016-09-13 13:59:11 -05:00
Sarah Marsh
61dee45dca
Revise checking toolchain path
2016-09-12 18:54:39 -05:00
Jimmy Brisson
f48aa248b7
Correct adding repo_files
2016-09-12 16:19:55 -05:00
Tony Wu
c50b5c6651
Tools - Fix fill section size variation
...
The linking order of object files affects the actual code placement,
which in turn affects the size of fill section due to the number of
zeros required to maintain appropriate data/code alignment may change.
This is observed when building on Mac and Linux host.
example: mbed compile -m K64F -t GCC_ARM (build 1)
+---------------------+-------+-------+-------+
| Module | .text | .data | .bss |
+---------------------+-------+-------+-------+
| Fill | 120 | 4 | 2381 |
| Misc | 28755 | 2216 | 84 |
| features/frameworks | 4236 | 52 | 744 |
| hal/common | 2745 | 4 | 325 |
| hal/targets | 12116 | 12 | 200 |
| rtos/rtos | 119 | 4 | 0 |
| rtos/rtx | 5721 | 20 | 6786 |
| Subtotals | 53812 | 2312 | 10520 |
+---------------------+-------+-------+-------+
example: mbed compile -m K64F -t GCC_ARM (build 2)
+---------------------+-------+-------+-------+
| Module | .text | .data | .bss |
+---------------------+-------+-------+-------+
| Fill | 128 | 4 | 2381 |
| Misc | 28755 | 2216 | 84 |
| features/frameworks | 4236 | 52 | 744 |
| hal/common | 2745 | 4 | 325 |
| hal/targets | 12116 | 12 | 200 |
| rtos/rtos | 119 | 4 | 0 |
| rtos/rtx | 5721 | 20 | 6786 |
| Subtotals | 53820 | 2312 | 10520 |
+---------------------+-------+-------+-------+
This patch fixes fill section size variation by sorting object
files before passing to linker.
Signed-off-by: Tony Wu <tung7970@gmail.com>
2016-09-10 08:30:01 +08:00
Sarah Marsh
f6a15fd3c8
Refactor export subsystem
...
Makes several broad changes:
- removes dead code that dealt with the online build system
- replaces export function with a much simpler one that:
- does not copy any sources
- the zip file hits the disk
- the mbed_config.h hits the disk
- the project files hit the disk
- nothing else hits the disk
- exporters use Resource object scanned with a toolchain
- progen exporters don't optionally build a project instead they have a
build function that may be called afterwards
- much of the code passes pylint (have a score of 9 or above):
- project.py
- project_api.py
- export/__init__.py
- export/exporters.py
- test/export/build_test.py
2016-09-06 14:24:00 -05:00
Sam Grove
fe1f2b6066
Merge pull request #2563 from sarahmarshy/path_error_rev
...
Check if executble exists
2016-08-26 18:05:50 -05:00
Sarah Marsh
bd0acdc527
Check executable
2016-08-26 17:32:57 -05:00
Sam Grove
ea3526d657
Merge pull request #2418 from sarahmarshy/path_error_rev
...
Readable error when toolchain paths not set. Allow IAR and ARM toolchains to be set in user's PATH.
2016-08-26 13:10:48 -05:00
Sarah Marsh
cd229bacc3
Allow users to set armcc and iccarm in path.
...
Raise exceptin instead of exit.
Corrected error for arm-none-eabi-gcc/g++ set in path.
2016-08-17 09:14:05 -05:00
Jimmy Brisson
cb5e61028d
Format and add docstrings to memmap
2016-08-16 11:48:39 -05:00
Sarah Marsh
51245ceb7a
Exit non-zero for invalid toolchain path
2016-08-10 12:04:11 -05:00
Sarah Marsh
1445886844
Readable error when toolchain paths not set.
...
Fixes #2360 .
New error:
[Error] Toolchain path does not exist for IAR.
Current value: /default/path/that/doesnt/exist
(System exit before any build system calls)
2016-08-10 11:52:45 -05:00
Sam Grove
9d1fbda9fe
Merge pull request #2377 from sarahmarshy/flag_revision
...
Pass only relevant defines at each stage of compilation
2016-08-04 22:10:58 -05:00
Mihail Stoyanov
88564a9ac3
Differentiate ASM and CXX symbols as they are not treated the same in ARMCC and IAR compilers
2016-08-04 18:19:08 +01:00
Mihail Stoyanov
a4c3469b7b
Empty the multiprocessing queue before terminating it
2016-08-02 16:53:58 +01:00
Sam Grove
aec3695cc5
Merge pull request #2188 from screamerbg/build-common
...
[Tools] Unify common routines in build_api.py
2016-07-22 17:04:25 -05:00
Mihail Stoyanov
ac86584c42
Unify common routines in build_api.py
...
Introduce prepare_toolchain() which handles:
* deduplication of src_paths
* config initialization
* toolchain initialization
* toolchain flags
* returns toolchain
Introduce scan_resources() which handles:
* scanning of sources
* scanning of include dirs
* inclusion of addition include dirs
* returns resources
2016-07-22 22:21:39 +01:00
Sam Grove
b10276cbef
Merge pull request #2173 from theotherjimmy/abstract-base-class
...
[toolchains]Abstractify the mbedToolchain base class.
2016-07-21 22:10:49 -05:00
Bogdan Marinescu
51540d08d5
Merge pull request #2177 from mbedmicro/build_on_config_change
...
Rebuild sources if configuration is changed
2016-07-20 14:52:08 +03:00
Mihail Stoyanov
ad87f9da34
Document code and mark which methods are used by the online build system
2016-07-19 11:16:05 +01:00
Mihail Stoyanov
74b7f9e923
mbed Online Build System support:
...
* added/improved global chroot support
* added RESPONSE_FILES flag to support optional response files (on linux the cmd param length is 2 megabytes). Default True
* added unified handling for archive and link response file (similar to includes)
* added COMPILE_C_AS_CPP flag to support compiling of c files as cpp. Default False
* added mbedToolchain.init() for post __init__ hooks
* added caching to mbedToolchain.need_update() to reduce IO hits
* added support to identify compiler warning/error column (supports ARMCC, GCC and IAR). Errors/warnings now report file@line,col
* added global TOOLCHAIN_PATHS which allows overriding/changing of the toolchain paths. Also simplified ARM-related paths
* added target.json to mbed library release (by @0xc0170)* migrated compile_worker() to utils.py for lightweight thread initialization
* improved run_cmd() performance by removing unnecessary check about the command being executed (should be checked once in the relevant toolchain instead)
* removed remnants of Goanna support (should be reimplemented as hooks to compile/link/archive instead)
* fixes for Python 2.7 compatibility (by @0xc0170)
* fixes for Exporters (by @0xc0170)
2016-07-19 11:14:42 +01:00
0xc0170
edf015ad92
Merge branch 'master' into release
...
Conflicts:
tools/export/uvision4.py
tools/export/uvision5.py
2016-07-19 08:44:34 +01:00
Jimmy Brisson
bccbe48f3f
Updated all docstrings to be compatible with PEP 257
...
It's nicer to be compatible with the standards.
I have added one more field to the description of each function:
Side effects. This feild contains the expected side effects of
running a particular method. If the side effects of a method are
None, it is expected that the function does not change anything in
any envoronment and that running it multiple times with the same
arguments will produce the same result every time. That is when
Side effects is non, the method is expected to be pure.
2016-07-15 10:51:47 -05:00
Jimmy Brisson
4fc8c56410
Replace pass with rais NotImplemented in each abstact method
...
The methods themselfes do nothing within the abstract base class
mbedToolchain. This change enforces that toolchains do not call
these methods that contain no implementation.
2016-07-15 10:17:35 -05:00
Jimmy Brisson
17833e8f58
Abstractify the mbedToolchain base class
...
The mbedToolchain class calls many members of it's subclasses, expecting
them to implement a particular API. This change adds a requirement to
each subclass that requires them to implement this expected API.
The API consists of these methods:
- parse_dependencies
- parse_ouptut
- get_config_option
- compile_c
- compile_cpp
- link
- archive
- binary
2016-07-15 10:07:56 -05:00
Bogdan Marinescu
a558c49240
Rebuild sources if configuration is changed
...
This commit adds a check for configuration data changes. If a change in
configuration data is detected, all the sources in the tree are rebuilt.
This is a fix for #2073 . #2162 was originally proposed as a fix, but it
was agreed that `--preinclude` is a more convenient way to include
configuration data, since it can be used to change the behaviour of
source files that don't include "mbed_config.h" directly, which is a big
advantage when importing 3rd party source trees. Compared to #2162 , this
commit has the disadvantage of rebuilding all the source files if a
configuration change is detected, but it was agreed that the advantage
of using `--preinclude` outweighs the disadvantage of the increased
compilation time.
2016-07-15 16:37:46 +03:00
Jimmy Brisson
bac254c7a3
Add documentation of the notify parameter to mbedToolchain
2016-07-11 09:41:23 -05:00
Jimmy Brisson
6b8bde9471
Update event dict with toolchain, use toolchain for wrapping
2016-07-11 09:41:23 -05:00
0xc0170
359d33cc16
Revert part of the FPU change
...
We keep target.core names, it defines if CPU contains FPU, as it's common - Cortex M4F/M7F.
We add Cortex M7FD for double precision FPU.
2016-07-11 10:39:23 +01:00
Przemek Wirkus
12a01f61ca
Add summary for test building
...
When users are building tests with `mbed compile --tests` whey will by default
get memory map breakdown report.
This can be suppresed in the future with command line switch. For now it is
visible each time users build test cases.
List is sorted by project name created with `build_project` API.
Changes:
* `build_project` now returns tuple (this breaks build_api.build_project API!)
* Memmap script got a aggregation function to print summary from small 'JSON'
partial reports.
* Report is generated by `test_api.build_tests` function only!
Example:
```
+----------------------------------------------------------------------+--------+-----------+-------------+------------+-------+-------+-----------+
| name | target | toolchain | total_flash | static_ram | stack | heap | total_ram |
+----------------------------------------------------------------------+--------+-----------+-------------+------------+-------+-------+-----------+
| features-feature_ipv4-tests-mbedmicro-net-nist_internet_time_service | K64F | GCC_ARM | 132136 | 62288 | 32768 | 65536 | 160592 |
| features-feature_ipv4-tests-mbedmicro-net-tcp_client_echo | K64F | GCC_ARM | 125613 | 62448 | 32768 | 65540 | 160756 |
| features-feature_ipv4-tests-mbedmicro-net-tcp_client_hello_world | K64F | GCC_ARM | 125949 | 62448 | 32768 | 65540 | 160756 |
| features-feature_ipv4-tests-mbedmicro-net-udp_echo_client | K64F | GCC_ARM | 123613 | 62276 | 32768 | 65536 | 160580 |
| features-storage-tests-cfstore-add_del | K64F | GCC_ARM | 96080 | 13052 | 32768 | 65540 | 111360 |
| features-storage-tests-cfstore-close | K64F | GCC_ARM | 95520 | 12004 | 32768 | 65540 | 110312 |
| features-storage-tests-cfstore-create | K64F | GCC_ARM | 99144 | 13036 | 32768 | 65540 | 111344 |
| features-storage-tests-cfstore-example1 | K64F | GCC_ARM | 98592 | 12368 | 32768 | 65536 | 110672 |
| features-storage-tests-cfstore-example2 | K64F | GCC_ARM | 95232 | 12012 | 32768 | 65540 | 110320 |
| features-storage-tests-cfstore-example3 | K64F | GCC_ARM | 95264 | 11856 | 32768 | 65536 | 110160 |
| features-storage-tests-cfstore-example4 | K64F | GCC_ARM | 92632 | 12012 | 32768 | 65540 | 110320 |
| features-storage-tests-cfstore-example5 | K64F | GCC_ARM | 92344 | 11856 | 32768 | 65536 | 110160 |
| features-storage-tests-cfstore-find | K64F | GCC_ARM | 96344 | 13028 | 32768 | 65540 | 111336 |
| features-storage-tests-cfstore-find2 | K64F | GCC_ARM | 93192 | 12004 | 32768 | 65540 | 110312 |
| features-storage-tests-cfstore-flash | K64F | GCC_ARM | 97784 | 12532 | 32768 | 65540 | 110840 |
| features-storage-tests-cfstore-flush | K64F | GCC_ARM | 96464 | 12012 | 32768 | 65540 | 110320 |
| features-storage-tests-cfstore-flush2 | K64F | GCC_ARM | 95056 | 12004 | 32768 | 65540 | 110312 |
| features-storage-tests-cfstore-init | K64F | GCC_ARM | 93120 | 12012 | 32768 | 65540 | 110320 |
| features-storage-tests-cfstore-misc | K64F | GCC_ARM | 96808 | 12516 | 32768 | 65540 | 110824 |
| features-storage-tests-cfstore-open | K64F | GCC_ARM | 98632 | 12540 | 32768 | 65540 | 110848 |
| features-storage-tests-cfstore-read | K64F | GCC_ARM | 94112 | 12540 | 32768 | 65540 | 110848 |
| features-storage-tests-cfstore-write | K64F | GCC_ARM | 94488 | 12004 | 32768 | 65540 | 110312 |
| features-storage-tests-flash_journal-basicapi | K64F | GCC_ARM | 104712 | 21236 | 32768 | 65540 | 119544 |
| frameworks-utest-tests-unit_tests-basic_test | K64F | GCC_ARM | 71534 | 11468 | 32768 | 65540 | 109776 |
| frameworks-utest-tests-unit_tests-case_async_validate | K64F | GCC_ARM | 74598 | 11468 | 32768 | 65540 | 109776 |
| frameworks-utest-tests-unit_tests-case_control_async | K64F | GCC_ARM | 74630 | 11476 | 32768 | 65540 | 109784 |
| frameworks-utest-tests-unit_tests-case_control_repeat | K64F | GCC_ARM | 72790 | 11452 | 32768 | 65540 | 109760 |
| frameworks-utest-tests-unit_tests-case_selection | K64F | GCC_ARM | 72302 | 11468 | 32768 | 65540 | 109776 |
| frameworks-utest-tests-unit_tests-case_setup_failure | K64F | GCC_ARM | 72630 | 11468 | 32768 | 65540 | 109776 |
| frameworks-utest-tests-unit_tests-case_teardown_failure | K64F | GCC_ARM | 72790 | 11468 | 32768 | 65540 | 109776 |
| frameworks-utest-tests-unit_tests-control_type | K64F | GCC_ARM | 82462 | 11468 | 32768 | 65540 | 109776 |
| frameworks-utest-tests-unit_tests-minimal_async_scheduler | K64F | GCC_ARM | 72182 | 11468 | 32768 | 65540 | 109776 |
| frameworks-utest-tests-unit_tests-minimal_scheduler | K64F | GCC_ARM | 71998 | 11468 | 32768 | 65540 | 109776 |
| frameworks-utest-tests-unit_tests-test_assertion_failure_test_setup | K64F | GCC_ARM | 71710 | 11460 | 32768 | 65540 | 109768 |
| frameworks-utest-tests-unit_tests-test_setup_case_selection_failure | K64F | GCC_ARM | 71702 | 11468 | 32768 | 65540 | 109776 |
| frameworks-utest-tests-unit_tests-test_setup_failure | K64F | GCC_ARM | 71710 | 11468 | 32768 | 65540 | 109776 |
| tests-integration-basic | K64F | GCC_ARM | 67566 | 10780 | 32768 | 65540 | 109088 |
| tests-integration-threaded_blinky | K64F | GCC_ARM | 68326 | 10780 | 32768 | 65540 | 109088 |
| tests-mbed_drivers-c_strings | K64F | GCC_ARM | 74438 | 11468 | 32768 | 65540 | 109776 |
| tests-mbed_drivers-callback | K64F | GCC_ARM | 88310 | 11972 | 32768 | 65540 | 110280 |
| tests-mbed_drivers-dev_null | K64F | GCC_ARM | 90213 | 10784 | 32768 | 65540 | 109092 |
| tests-mbed_drivers-echo | K64F | GCC_ARM | 71918 | 11468 | 32768 | 65540 | 109776 |
| tests-mbed_drivers-generic_tests | K64F | GCC_ARM | 77624 | 11468 | 32768 | 65540 | 109776 |
| tests-mbed_drivers-rtc | K64F | GCC_ARM | 85854 | 11308 | 32768 | 65540 | 109616 |
| tests-mbed_drivers-stl_features | K64F | GCC_ARM | 80726 | 11476 | 32768 | 65540 | 109784 |
| tests-mbed_drivers-ticker | K64F | GCC_ARM | 70974 | 11308 | 32768 | 65540 | 109616 |
| tests-mbed_drivers-ticker_2 | K64F | GCC_ARM | 70790 | 11308 | 32768 | 65540 | 109616 |
| tests-mbed_drivers-ticker_3 | K64F | GCC_ARM | 71038 | 11308 | 32768 | 65540 | 109616 |
| tests-mbed_drivers-timeout | K64F | GCC_ARM | 70886 | 11308 | 32768 | 65540 | 109616 |
| tests-mbed_drivers-wait_us | K64F | GCC_ARM | 70414 | 11308 | 32768 | 65540 | 109616 |
| tests-mbedmicro-mbed-attributes | K64F | GCC_ARM | 71534 | 11460 | 32768 | 65540 | 109768 |
| tests-mbedmicro-mbed-call_before_main | K64F | GCC_ARM | 73112 | 10780 | 32768 | 65540 | 109088 |
| tests-mbedmicro-mbed-cpp | K64F | GCC_ARM | 73400 | 10780 | 32768 | 65540 | 109088 |
| tests-mbedmicro-mbed-div | K64F | GCC_ARM | 73176 | 10780 | 32768 | 65540 | 109088 |
| tests-mbedmicro-rtos-mbed-basic | K64F | GCC_ARM | 68390 | 10780 | 32768 | 65540 | 109088 |
| tests-mbedmicro-rtos-mbed-isr | K64F | GCC_ARM | 74480 | 10780 | 32768 | 65540 | 109088 |
| tests-mbedmicro-rtos-mbed-mail | K64F | GCC_ARM | 74992 | 11300 | 32768 | 65540 | 109608 |
| tests-mbedmicro-rtos-mbed-mutex | K64F | GCC_ARM | 74048 | 10780 | 32768 | 65540 | 109088 |
| tests-mbedmicro-rtos-mbed-queue | K64F | GCC_ARM | 74912 | 11300 | 32768 | 65540 | 109608 |
| tests-mbedmicro-rtos-mbed-semaphore | K64F | GCC_ARM | 74296 | 10780 | 32768 | 65540 | 109088 |
| tests-mbedmicro-rtos-mbed-signals | K64F | GCC_ARM | 74328 | 10780 | 32768 | 65540 | 109088 |
| tests-mbedmicro-rtos-mbed-threads | K64F | GCC_ARM | 75214 | 11460 | 32768 | 65540 | 109768 |
| tests-mbedmicro-rtos-mbed-timer | K64F | GCC_ARM | 68430 | 10780 | 32768 | 65540 | 109088 |
| tests-storage_abstraction-basicapi | K64F | GCC_ARM | 107808 | 28908 | 32768 | 65540 | 127216 |
+----------------------------------------------------------------------+--------+-----------+-------------+------------+-------+-------+-----------+
```
Refactored after code review
Refactored parse() function
Polishing
Moved memory usage reporting function call to test.py to group all reporters in one place
Bug-fix: on ARM toolchain we were not fetching statistics from last element of memap result list
2016-07-07 08:35:20 +01:00