Дракон в мешке: от LLVM к C++ и проблемам неопределенного поведенияPlatonov Sergey
В этом докладе Дмитрий кратко рассказывает о таком звере, как LLVM, о котором много кто слышал, но немногие щупали.
Что такое компилятор на самом деле? Как происходит компиляция программы, как работают оптимизации и, наконец, откуда берется неопределенное поведение в детерменированных программах на C++?
Дракон в мешке: от LLVM к C++ и проблемам неопределенного поведенияPlatonov Sergey
В этом докладе Дмитрий кратко рассказывает о таком звере, как LLVM, о котором много кто слышал, но немногие щупали.
Что такое компилятор на самом деле? Как происходит компиляция программы, как работают оптимизации и, наконец, откуда берется неопределенное поведение в детерменированных программах на C++?
Оптимизация трассирования с использованием Expression templatesPlatonov Sergey
В докладе будет рассказано о тех фундаментальных причинах, приводящих к неоптимальному коду в продукте, будет предложен подход, лишённый найденных недостатков.
Докладываемый подход опирается на технологию Expression Templates, которая позволяет уменьшить количество действий и объём ресурсов, которые требуются для выполнения неких промежуточных действий в процессе формирования каждой записи в журнал. Эта технология используется для уменьшения количества промежуточных операций при вычислении сложных математических выражений. Новизна докладываемого подхода в том, что тот же самый принцип, на котором основана технология Expression Templates можно применить для того, чтобы целенаправленно исключить те промежуточные действия, которые в конечном итоге приводят к неоптимальному коду.
Завершается доклад обсуждением полученного эффекта, путей возможного дальнейшего развития и возможностей применения этой же технологии в других задачах.
Евгений Крутько — Опыт внедрения технологий параллельных вычислений для повыш...Yandex
Евгений Крутько, НИЦ «Курчатовский институт».
В докладе на примере программы моделирования динамики движения конструкций по методу конечных элементов рассматриваются возможности и практика распараллеливания вычислений. Речь в нём пойдёт как о технике создания новых вычислительных потоков, так и об использовании стандартов openMP и MPI.
Tech Talks @NSU: Как приручить дракона: введение в LLVMTech Talks @NSU
http://techtalks.nsu.ru
Видеозапись: http://www.youtube.com/watch?v=v7uBLSm6ft8
06 октября 2015. Как приручить дракона: введение в LLVM (Дмитрий Кашицын, HDsoft)
«В этом докладе мы кратко расскажем о таком звере, о котором много кто слышал, но немногие щупали. Что такое компилятор на самом деле? Чем LLVM отличается от других компиляторов? Как в LLVM происходит компиляция программы, как работают оптимизации? Наконец, какой путь проходит программа от разбора исходного текста до генерации исполняемого файла?
Лекция будет обзорной и не потребует от слушателей глубоких знаний теории компиляторов.»
Лекция прочитана в рамках проекта Tech Talks @NSU – серии открытых лекций о разработке ПО и карьере в IT, проводимых в Новосибирском государственном университете.
Подробности: http://techtalks.nsu.ru
10 июня 2015. Дмитрий Кашицын (HDsoft) дает обзор LLVM.
http://techtalks.nsu.ru
Видеозапись: https://plus.google.com/events/ctes98f7uhf19t5jlvlbk24dan4
В этом докладе мы кратко расскажем о таком звере, как LLVM, о котором много кто слышал, но немногие щупали. Что такое компилятор на самом деле? Чем LLVM отличается от других компиляторов? Как в LLVM происходит компиляция программы, как работают оптимизации? Наконец, какой путь проходит программа от разбора исходного текста до генерации исполняемого файла?
Лекция будет обзорной и не потребует от слушателей глубоких знаний теории компиляторов.
Лекция прочитана в рамках проекта Tech Talks @NSU – серии открытых лекций о разработке ПО и карьере в IT, проводимых в Новосибирском государственном университете.
Подробности: http://techtalks.nsu.ru
Intel IPP Samples for Windows - работа над ошибкамиTatyanazaxarova
Это моя очередная заметка о том, как PVS-Studio делает программы более надёжными. То есть где, и какие ошибки он обнаруживает. На этот раз под молоток попали примеры, демонстрирующие работу с библиотекой IPP 7.0 (Intel Performance Primitives Library).
Андрей Карпов
Вы узнаете, что такое статический анализ кода и историю его развития. Узнаете, как эффективно применять инструменты статического анализа в своей работе, увидите практические примеры использования этой методологии. Доклад ориентирован на программистов, использующих языки Си/Си++, но будет полезен всем
The document provides instructions for extending a UDP server to handle additional commands for reading the state of GPIO pins connected to LEDs on a board. The UDP server extension should accept "read gpio<PORT> <PIN>" commands to check the status of LEDs connected to pins 13, 12, 14, and 15, and reply with the pin and state like "GPIOD.15=1". The ncat utility can be used as a UDP client to send commands to control the LEDs or get their status by communicating with ports 5678 and 1234 of the UDP server, respectively.
This document provides an agenda and overview of topics related to the transport layer and networking essentials. The agenda includes discussions of the transport layer, UDP overview, TCP communication process, the socket API, and tools and utilities. Specific topics that will be covered include the role and functions of the transport layer, UDP features and headers, TCP reliability mechanisms like connection establishment and termination, sequence numbers and acknowledgments, window sliding, and data loss/retransmission. The document also provides brief overviews and usage examples for common networking tools like ifconfig, nmcli, route, ping, traceroute, netstat, dig, ncat, nmap, tcpdump, and wireshark.
This document provides an overview of connecting the STM32F407x microcontroller on the GlobalLogic Embedded Starter Kit to Ethernet. It discusses the STM32F407x Ethernet interface, HAL Ethernet driver, Lightweight TCP/IP stack, and examples of implementing TCP client/server and an HTTP server. The KSZ8081RND PHY chip is used along with the RMII interface. The document also outlines configuring LwIP and developing a UDP server to control LEDs on the board via commands from a UDP client.
The document provides an agenda and overview of key topics related to networking essentials including the network layer, IPv4 and IPv6 packets and addresses, and network address translation (NAT). Specifically, it discusses network layer characteristics such as addressing, encapsulation, routing and de-encapsulation. It also examines IPv4 packet headers, fragmentation, and maximum transmission units. IPv6 is introduced as improving on IPv4 by providing increased address space and simplified packet handling. Network address translation is defined as a method for mapping an IP address space to overcome IPv4 address depletion.
This document provides an overview of networking concepts including network types, medium access control protocols, TCP/IP protocol suite, addressing, Ethernet frames, ARP, and standards organizations. It begins with an agenda that lists these topics and includes diagrams to illustrate CSMA/CD, the OSI model, TCP/IP encapsulation, and Ethernet encapsulation. Examples are provided for different network devices, addressing formats and protocols.
This document is a training presentation on I2C interface. It discusses understanding I2C, the internal structure of I2C modules, the I2C interface in an embedded starter kit schematic, using an I2C PWM LED controller, and using I2C in blocking mode. The individual task is to control LED brightness using I2C PWM outputs by modifying the duty cycle, frequency, and number of outputs.
The document describes a workshop for the GlobalLogic Embedded Starter Kit (GL ESK). It includes instructions for a "Hello World" project using the kit to blink an LED. It also provides guidance on additional exercises including controlling more LEDs with buttons, using interrupts to check buttons, and debugging techniques. The document recommends downloading documentation and sources from GitHub and provides information on the STM32F407 microcontroller and Discovery board used with the kit.
This document is a training module on using UART interfaces. It discusses UART fundamentals, the UART interface on an embedded starter kit, the internal structure of UART modules, and how to use UART in both polling and interrupt modes. Learners are assigned the tasks of modifying an existing UART code to control additional LEDs and print sensor values to a terminal using UART communication.
Bare metal training_04_adc_temp_sensorRoman Brovko
This document outlines the goals, theory, and practice of a training on using analog to digital converters (ADCs) in polling and interrupt modes. The training covers the internal structure of ADCs, using an on-board temperature sensor, reading voltage values from an external potentiometer, and reading multiple ADC channels. Trainees are assigned individual tasks like controlling LED brightness based on temperature sensor readings.
This document provides an overview of a training on timers and PWM for bare metal embedded systems. The goals are to learn clock control, generate 1Hz signals using delays and timers, and create PWM signals at predefined duty cycles. It explains clock control diagrams and settings, and provides code examples to generate a 1Hz signal using delays, use Timer4 to toggle a pin in an interrupt handler, and set up PWM on Timer4 Channel 3. Finally, it lists an individual task to control 4 LEDs with PWM using different channels and buttons to fade the LEDs in/out.
Bare metal training_02_le_ds_and_buttonsRoman Brovko
This document provides an overview of training materials for an embedded starter kit focused on bare metal programming of LEDs and buttons. The goals are to create firmware to control LEDs and read button presses, learn about the hardware operation of LEDs and buttons, and learn GPIO input/output and interrupt basics. It introduces GPIO configuration as digital I/O with pull-up/down resistors or analog, covers GPIO pin functionality, and discusses using interrupts to address the delay issues of polling button states in a main loop. The practice section has the learner set up a project to control an LED based on a button press via polling initially, then refactors to use interrupts to eliminate delays.
This document outlines a training for creating a "Hello World" firmware project for an embedded starter kit using the Keil IDE. The goals are to create an LED blinking firmware, learn the hardware basics of the starter kit, and learn how to create, build, flash and debug firmware projects. Trainees will go through adding LEDs to the project, implementing a custom blinking sequence, and stepping through the code using the debugger.
This document provides instructions for installing software prerequisites for a bare metal embedded training using a GlobalLogic starter kit. The instructions include downloading and installing: 1) An ST-Link driver to interface with the board; 2) Keil uVision IDE for embedded development; and 3) STM32 CubeMx for configuration. Completing these steps prepares the hardware and software for the trainings by setting up the development environment and debugger connection to the board.
The document discusses several topics related to advanced C language programming including:
1. Decomposing a program into multiple files by creating libraries and header files.
2. The structure of a software component including public header files, private header files, and library object files.
3. Techniques for building a program such as compilation, linking, and conditional compilation.
2. Содержание
• Основные директивы
• Директивы: примеры
• Макрокоманда
• MIN, MAX macros
• SUM, MULT macros
• Bit Modifications macros
23.05.2019 0:20 Introduction 2
3. Основные директивы
3
Директива Описание
#include вставляет текст из указанного файла
#define задаёт макроопределение (макрос) или символическую константу
#undef отменяет предыдущее определение
#line препроцессор изменяет номер текущей строки и имя
компилируемого файла
#error выдача диагностического сообщения и остановка компиляции
#pragma действие, зависящее от конкретной реализации компилятора
4. Основные директивы
4
Директива Описание
#if осуществляет условную компиляцию при
истинности константного выражения
#ifdef осуществляет условную компиляцию при
определённости символической константы
#ifndef осуществляет условную компиляцию при
неопределённости символической константы
#else ветка условной компиляции при ложности выражения
#elif ветка условной компиляции, образуемая слиянием else и if
#endif конец ветки условной компиляции
5. Директивы: пример #1
5
#include "main.h“
#define BUFFER_SIZE_MAX 1024
#line 500
int main(void)
{
unsigned int i;
while (1)
{
// Insert some code here...
}
return 0;
}
7. Макрокоманда
Макрокоманда или макрос — это символьное
имя в шаблонах, заменяемое при обработке
препроцессором на последовательность
символов.
Часто макросы применяют для выполнения
рутинных действий
7
15. SET_BIT macro
15
#define SET_BIT(p,n) ((p) |= (1 << (n)))
a = 0x03;
SET_BIT(a, 7);
Разворачиваем пошагово…
a |= (1 << 7)
a |= (0b10000000)
a = 0b00000011 |
0b10000000
------------
a = 0b10000011
В итоге выходит
a = 0x83
16. CLEAR_BIT macro
16
#define CLEAR_BIT(p,n) ((p) &= ~(1 << (n)))
a = 0xFF;
CLEAR_BIT(a, 3);
Разворачиваем пошагово…
a &= ~(1 << 3)
a &= ~(0b00001000)
a &= (0b11110111)
a = 0b11111111 &
0b11110111
------------
a = 0b11110111
В итоге выходит
a = 0xF7
17. TOGGLE_BIT macro
17
#define TOGGLE_BIT(p,n) ((p) ^= (1 << (n)))
a = 0x55;
TOGGLE_BIT(a, 6);
Разворачиваем пошагово…
a ^= (1 << 6)
a ^= 0b01000000
a = 0b01010101 ^
0b01000000
------------
a = 0b00010101
В итоге выходит
a = 0x15