|
uint24_t |
|
|
|
 |
Ответов
|
Jan 26 2010, 10:16
|

Гуру
     
Группа: Модераторы
Сообщений: 8 455
Регистрация: 15-05-06
Из: Рига, Латвия
Пользователь №: 17 095

|
Цитата(Злодей @ Jan 26 2010, 11:19)  Бутлодер для mega128 малость не влезает в 2k флэша, а нужно впихнуть. 1) Есть множество ключей компиляции, игры с которыми позволяют уменьшить код. 2) Попробуйте самый свежий WinAVR 20100110 - в нем сильно оптимизирована работа с eeprom. 3) Также очень помогает встраивание функций, вызываемых один раз. 4) Можно оптимизировать сам исходник. AVR231 у меня влез в 2К с запасом. Вот мои ключи: Код CFLAGS += -ffunction-sections CFLAGS += -fdata-sections
# code optimisation CFLAGS += -fno-ivopts #CFLAGS += -mcall-prologues #CFLAGS += -fno-tree-scev-cprop #CFLAGS += -fno-split-wide-types #CFLAGS += -fno-inline-small-functions
CFLAGS += --param inline-call-cost=0 <- это число подобрать. #CFLAGS += -fno-reorder-blocks #CFLAGS += -fno-reorder-blocks-and-partition #CFLAGS += -fno-reorder-functions #CFLAGS += -fno-toplevel-reorder CFLAGS += -fno-move-loop-invariants #CFLAGS += -fno-unroll-loops #CFLAGS += -fno-unroll-all-loops #CFLAGS += --param max-unroll-times=0
LDFLAGS += -Wl,--gc-sections LDFLAGS += -Wl,--relax попробуйте раскомментировать/закомментировать некоторые из них.
--------------------
На любой вопрос даю любой ответ"Write code that is guaranteed to work, not code that doesn’t seem to break" ( C++ FAQ)
|
|
|
|
|
Jan 27 2010, 10:37
|

неотягощённый злом
     
Группа: Свой
Сообщений: 2 746
Регистрация: 31-01-08
Из: Санкт-Петербург
Пользователь №: 34 643

|
Цитата(Сергей Борщ @ Jan 26 2010, 13:16)  Вот мои ключи... Есть такой ключ, что всем ключам ключ: Код CFLAGS += --combine CFLAGS += -fwhole-program
--------------------
“Будьте внимательны к своим мыслям - они начало поступков” (Лао-Цзы)
|
|
|
|
|
Jan 27 2010, 10:52
|

Гуру
     
Группа: Модераторы
Сообщений: 8 455
Регистрация: 15-05-06
Из: Рига, Латвия
Пользователь №: 17 095

|
Цитата(demiurg_spb @ Jan 27 2010, 12:37)  Есть такой ключ, что всем ключам ключ: Код CFLAGS += --combine CFLAGS += -fwhole-program Вчера потратил 2 часа, пытаясь собрать с его помощью первый попавшийся проект на С++. Так и не удалось. Ругался undefined variable на все глобальные объекты и переменные. Без этого ключа все собирается и работает.
--------------------
На любой вопрос даю любой ответ"Write code that is guaranteed to work, not code that doesn’t seem to break" ( C++ FAQ)
|
|
|
|
|
Jan 27 2010, 12:00
|

неотягощённый злом
     
Группа: Свой
Сообщений: 2 746
Регистрация: 31-01-08
Из: Санкт-Петербург
Пользователь №: 34 643

|
Using the GNU Compiler Collection. For gcc version 4.3.4 Цитата -fwhole-program Assume that the current compilation unit represents whole program being compiled. All public functions and variables with the exception of main and those merged by attribute externally_visible become static functions and in a affect gets more aggressively optimized by interprocedural optimizers. While this option is equivalent to proper use of static keyword for programs consisting of single file, in combination with option ‘--combine’ this flag can be used to compile most of smaller scale C programs since the functions and variables become local for the whole combined compilation unit, not for the single source file itself.This option is not supported for Fortran programs.
-combine If you are compiling multiple source files, this option tells the driver to pass all the source files to the compiler at once (for those languages for which the compiler can handle this). This will allow intermodule analysis (IMA) to be performed by the compiler. Currently the only language for which this is supported is C. If you pass source files for multiple languages to the driver, using this option, the driver will invoke the compiler(s) that support IMA once each, passing each compiler all the source files appropriate for it. For those languages that do not support IMA this option will be ignored, and the compiler will be invoked once for each source file in that language. If you use this option in conjunction with -save-temps, the compiler will generate multiple pre-processed files (one for each source file), but only one (combined) .o or .s file.
--------------------
“Будьте внимательны к своим мыслям - они начало поступков” (Лао-Цзы)
|
|
|
|
Сообщений в этой теме
Злодей uint24_t Jan 26 2010, 09:19 demiurg_spb Цитата(Злодей @ Jan 26 2010, 12:19) Если ... Jan 26 2010, 09:31   Злодей Цитата(Сергей Борщ @ Jan 27 2010, 13:52) ... Jan 28 2010, 09:51    ARV Цитата(Злодей @ Jan 28 2010, 12:51) Ключ ... Jan 28 2010, 10:04     _Pasha Цитата(ARV @ Jan 28 2010, 13:04) придется... Jan 28 2010, 10:53    Сергей Борщ Цитата(Злодей @ Jan 28 2010, 11:51) Ключ ... Jan 28 2010, 11:16    ReAl Цитата(Злодей @ Jan 28 2010, 11:51) Ключ ... Jan 28 2010, 14:50     singlskv Цитата(ReAl @ Jan 28 2010, 17:50) Стереот... Jan 28 2010, 23:44 SysRq Убрать таблицу векторов прерываний, если не нужна ... Jan 29 2010, 20:52 SysRq Ежели кого не сильно затруднит, выложите пожалуйст... Mar 12 2011, 12:50 demiurg_spb Это мой Makefile для проекта из соседнего топика п... Mar 13 2011, 09:50
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0
|
|
|