А что в нем тестировать то…? А тестировать будем прирост производительности при включении тех или иных настроек. В статье будут таблицы сравнения и немного кода.

Введение

И так, MicroBlaze — soft-процессорное ядро, разработанное компанией Xilinx для использования в FPGA (подробнее тут). При проектировании различных SoC, MicroBlaze может оказаться отличным решением. И первое с чем сталкивается разработчик при конфигурации IP-ядра это «Что же там натыкать, чтобы было полезно и не бессмысленно?». Конечно, специалисты, хорошо разбирающиеся в данном ядре, прекрасно знают что им нужно и такого вопроса у них не возникает. Но все же я собираюсь сравнить степень влияния различных настроек на производительность процессора.

В этой статье я не буду рассказывать как настроить проект с MicroBlaze, и работу с SDK(я буду пользоваться Vivado 2019.1, в которой еще нет Vitis).

План тестирования

На второй странице настройке MicroBlaze имеются параметры включения аппаратного вычисления арифметических операций, а также поддержка чисел с плавающей точкой.

Скрин с настройками аппаратных вычислений
Скрин с настройками аппаратных вычислений

В первой части тестирования я последовательно буду собирать проект с включенными различными свойствами. Во второй части я продолжу добавлять различные параметры процессору и сделаю сравнение.

В SDK я подготовил отдельные функции, которые имеют перекос в определенную сторону вычислений, как правило это цикл по массиву в котором производится одно из вычислений - суммирование, деление, умножение, сдвиговые операции, также работа с плавающей точкой.

Оценка производительности будет выполняться за счет внешнего счетчика тактов системного клока, деленного на 8. Счетчик будет сбрасываться перед тестом и фиксироваться его значение по окончанию.

Код для SDK можно посмотреть в конце статьи.

В проекте Vivado я подготовил вот такой BlockDesign:

Для каждой конфигурации MicroBlaze проводилось 12 тестов:

INIT_

Инициализация двух глобальных целочисленных массивов размером 1024 элемента, тип переменных int32_t. Диапазон значений для первого -255:255, диапазон для второго 0:63. Значения выбирались небольшие для дальнейших тестов. В процессе инициализации использовалась сумма и битовые операции XOR и AND.

INIT_F

Инициализация двух глобальных массивов размером 1024 элемента, тип переменных - FLOAT. Диапазон обоих массивов порядка  -16.0:16.0. В процессе инициализации использовались операции умножения.

INIT_DIV

Инициализация двух глобальных целочисленных массивов размером 1024 элемента, тип переменных int32_t. Диапазон значений для первого 2_000_000_000 минус индекс элемента массива; диапазон для второго 2:257. Значения выбирались из соображений подготовки массивов готовых для деления. Первый массив содержит большие числа, второй - маленькие. В процессе инициализации использовалась сумма и вычитание.

MUL32

Тест, работающий с целочисленным массивом, итеративно проходит по массиву и собирает в аккумулятор перемножение значений массивов в виде: mul_acc = op1[j]op2[j]; в конце итерации обновляются по одному элементу в каждом массиве.  

MUL32F

Тест идентичен тесту MUL32, но работает с массивами типа Float.

ADD__

Тест, работающий с целочисленным массивом, итеративно проходит по массиву и собирает в аккумулятор сложение значений массивов в виде: add_acc += op1[j]+op2[j]; в конце итерации обновляются по одному элементу в каждом массиве.

ADD_F

Тест идентичен ADD, но работает с массивами типа Float.

INT_DIV

Тест, работающий со специально подготовленным целочисленным массивом в INIT_DIV, итеративно проходит по массиву и в аккумулятор складывается результат деления в виде: div_acc += op1_div[j]/op2_div[j]; в конце итерации обновляется элемент первого массива, второй массив остается постоянным 2-257.

INT_DIV_F

Идентичен тесту INT_DIV, но работает с массивом Float. А также массив взят после инициализации INIT_F.  Проверка деления на ноль не производилась.

BARREL_SHIFT

Тест раз за разом с локальными целочисленными переменными. Производит ряд операций сдвига и складывает их в локальную сумму, результирующее значение сохраняется в элемент глобального массива, чтобы избежать оптимизации компилятором. (параметр volatile так же был использован)

Следующие тесты - это темная область для автора. Тесты основаны на обсуждении с нейронкой.

D_CACHE

Содержит в себе несколько вариантов проходов по массиву.

1 – последовательное чтение массива (суммирование элементов в аккумулятор).

2 – последовательная запись в память (последовательно перебирается массив и присваивается индекс массива)

3 – псевдослучайное чтение (читаются псевдослучайные значение массива и складываются в аккумулятор)

4 – псевдослучайная запись (записываются значение в псевдослучайный элемент массива)

I_CACHE

Сгенерированы 256 простых функций, содержащие вычисления - умножение и сложение. Сами функции неоднократно случайным образом вызываются в теле цикла.

В процессе тестирования был проведен 21 тест с различными параметрами MicroBlaze, по некоторым тестам пройдусь подробно, а некоторые затрону вскользь.

Погрешность расчета процентов в таблице составляет +-1.

Тесты проводились на отладочной плате Nexys A7-100T

Первая порция тестов. Отдельно включенные параметры.

В этих тестах кэши были отключены, в коде была вызвана функция disable_caches(); которая отключает кэш инструкций и данных, поэтому серьезно относиться к тестам кэша не нужно. 

Включенный параметр

Результат тестов. Сравнение с базовым. Время выполнения.

Потребляемые ресурсы ПЛИС

Без параметров(базовый).

100%

Slice LUTs 868,

Slice Registers 582,

F7 Muxes 108,

Slice 304,

LUT as Logic 765,

LUT as Memory 103

Barrel Shifter

INIT_: -10%

INIT_F: -45%

INIT_DIV: -9%

MUL32: -3%

MUL32F: -47%

ADD__: -13%

ADD_F: -50%

INT_DIV: -0.5%

INT_DIV_F: -40%

BARREL_SHIFT: -82%

D_CACHE: -2%

I_CACHE: -45%

Slice LUTs 1118, +28%

Slice Registers 718, +23%

F7 Muxes 108,

Slice 373, +23%

LUT as Logic 1015, +32%

LUT as Memory 103

Integer Divider

INIT_: -0%

INIT_F: -0%

INIT_DIV: -0%

MUL32: -0%

MUL32F: -0%

ADD__: -0%

ADD_F: -0%

INT_DIV: -88%

INT_DIV_F: -0%

BARREL_SHIFT: -0%

D_CACHE: -0%

I_CACHE: -0%

Slice LUTs 1031,  +18%

Slice Registers 1006,  +72%

F7 Muxes 108,

Slice 400,  + 31%

LUT as Logic 927, + 21%

LUT as Memory 103

Floating Point Unit BASIC

INIT_: -0%

INIT_F: -78%

INIT_DIV: -0%

MUL32: -0%

MUL32F: -98%

ADD__: -0%

ADD_F: -96%

INT_DIV: -0%

INT_DIV_F: -95%

BARREL_SHIFT: -0%

D_CACHE: -0%

I_CACHE: -65%

Slice LUTs 1541, +77%

Slice Registers 1320,  +126%

F7 Muxes 114, +6 примитивов

Slice 558, +83%

LUT as Logic 1427, +86%

LUT as Memory 114,  + 11 примитивов.

DSPs 2 (дополнительные ресурсы)

Integer Miltiplier MUL32

INIT_: -0%

INIT_F: -17%

INIT_DIV: -0%

MUL32: -75%

MUL32F: -23%

ADD__: -0%

ADD_F: -7%

INT_DIV: -0%

INT_DIV_F: -6%

BARREL_SHIFT: -0%

D_CACHE: -56%

I_CACHE: -25%

Slice LUTs 984, +13%

Slice Registers 909, +56%

F7 Muxes 108,

Slice 386, +27%

LUT as Logic 881, +15%

LUT as Memory 103,

DSPs 3 (дополнительный ресурс)

Integer Divider

INIT_: -0%

INIT_F: -0%

INIT_DIV: -0%

MUL32: - 0%

MUL32F: -0%

ADD__: -0%

ADD_F: -0%

INT_DIV: -88%

INT_DIV_F: -0%

BARREL_SHIFT: -0%

D_CACHE: -0%

I_CACHE: -0%

Slice LUTs 1031, +18%

Slice Registers 1006, +72%

F7 Muxes 108,

Slice 400,  + 31%

LUT as Logic 927, +21%

LUT as Memory 104 (+1 примитив)

Из набора этих тестов видно, что параметр Barrel Shifter показывает себя лучше всех, он участвует в большинстве тестов и дает прирост в производительности. При этом ресурсы ПЛИС возрастают относительно не сильно. Особенно это сказывается при сравнении с потреблением DSP.

В тоже время, отдельно включенные ускорители умножения, деления и плавающей точки, гораздо лучше влияют на результат теста, но делают это точечно.

Вторая порция тестов. Параметры будут постепенно добавляться в список.

Включенные параметры

Результат тестов. Сравнение с базовым. Время выполнения.

Потребляемые ресурсы ПЛИС

Без параметров(базовый).

100%

Slice LUTs 868,

Slice Registers 582,

F7 Muxes 108,

Slice 304,

LUT as Logic 765,

LUT as Memory 103

Barrel Shifter

Integer Divider

INIT_: -10%

INIT_F: -45%

INIT_DIV: -9%

MUL32: -3%

MUL32F: -48%

ADD__: -13%

ADD_F: -50%

INT_DIV: -89%

INT_DIV_F: -39%

BARREL_SHIFT: -80%

D_CACHE: -0%

I_CACHE: -45%

Slice LUTs 1234, +42%

Slice Registers 835, +43%

F7 Muxes 108,

Slice 407, +34%

LUT as Logic 1130, +47%

LUT as Memory 104 (+1 примитив)

Barrel Shifter

Integer Divider

Floating Point Unit BASIC

INIT_: -10%

INIT_F: -91%

INIT_DIV: -10%

MUL32: -2.7%

MUL32F: -97%

ADD__: -13%

ADD_F: -96%

INT_DIV: -88%

INT_DIV_F: -94%

BARREL_SHIFT: -81%

D_CACHE: -0%

I_CACHE: -85%

Slice LUTs 1784,

Slice Registers 1265,

F7 Muxes 113,

Slice 556,

LUT as Logic 1670,

LUT as Memory 114,

DSPs 2 (дополнительный ресурс)

                    

Barrel Shifter

Integer Divider

Floating Point Unit BASIC

Integer Miltiplier MUL32

INIT_: -10%

INIT_F: -91%

INIT_DIV: -10%

MUL32: -78%

MUL32F: -97%

ADD__: -12%

ADD_F: -96%

INT_DIV: -88%

INT_DIV_F: -94%

BARREL_SHIFT: -80%

D_CACHE: -58%

I_CACHE: -85%

Slice LUTs 1798, +107%

Slice Registers 1285, +120%

F7 Muxes 113, (+5 примитивов)

Slice 586, +92%

LUT as Logic 1683, +120%

LUT as Memory 115, (+12 примитивов)

DSPs 5 (дополнительный ресурс)

В результате тестов видно, что каждый параметр ускоряет свою область тестов, и это очевидно.

Смысл второй порции тестов в том, чтобы попытаться увидеть есть ли прирост производительности при нескольких включенных параметрах в сравнении с одинарным параметром. Например, видно, что Barrel Shifter старается ускорить все доступные ему вычисления (это первый тест в первой порции тестов), но при добавлении к нему в компанию Integer Divider и Floating Point Unit BASIC, прирост наблюдается только в тех местах, где он был и в первой порции тестов. И сравнительного прироста нет, то есть не видна совестная работа ускорителей.  Конечно, имеются некие колебания, но в пределах погрешности.

Изменение параметра Floating Point Unit BASIC на Floating Point Unit EXTENDED прироста не дает, так же и для замены Integer Miltiplier MUL32 на Integer Miltiplier MUL64. Видимо из-за того, что все переменные были не больше 32 бит.

Третья порция тестов. Включение кэша.

При включении кэша у микроблейза добавляются два интерфейса - для доступа к кэшу инструкций и доступу к кэшу данных (M_AXI_DC и M_AXI_IC). Если выбрать автоматическое подключение средствами Vivado, то они цепляются к ближайшему AXI Interconnect, к которому подключена BRAM память (в блок дизайне это axi_bram_ctrl_0). Так же я пытался подключить напрямую к M_AXI_DC и M_AXI_IC отдельную память, но вивада ругалась и я оставил изначальный вариант.

Я не разбираюсь в том, как именно должна работать кэш память, поэтому просто оставил настройки кэшей по-умолчанию и закомментировал функцию disable_caches(). Пока пишу статью я осознал, что возможно стоило вызвать другую функцию enable_caches(), но это не точно.

И так, из всего набора тестов я вычленил только два из них чтобы сравнить в лоб.

Включенные параметры

Результат тестов. Сравнение с базовым. Время выполнения. Функция disable_caches() используется.

Результат тестов. Время выполнения. Функция disable_caches() НЕ используется.

Потребляемые ресурсы ПЛИС

Базовый.

Enable MicroBlaze Debug Module Interface false

Use Instruction and Data Cache false

Enable Exeption false

Use Memory Management false

Enable Discrete Ports false

Enable Barrel Shifter true

Enable Floating Point Unit EXTENDED

Enable Integer Miltiplier MUL64

Enable Integer Divider true

Enable Additional Machine Status Register Instructions true

Enable Pattern Comparator true

Enable Reversed Load/Store and Swap Instructions true

Select Extendet Addresing NONE

Enable Branch Target Cache false

Branch Target Cache Size DEFAULT

100%

-

Slice LUTs 2239,

Slice Registers 1626,

F7 Muxes 112,

Slice 718,

LUT as Logic 2128,

LUT as Memory 111,

DSPs 6

Select Processor Implementation 32 bits

Enable MicroBlaze Debug Module Interface false

Use Instruction and Data Cache true (4kb for each)

Enable Exeption false

Use Memory Management false

Enable Discrete Ports false

Enable Barrel Shifter true

Enable Floating Point Unit EXTENDED

Enable Integer Miltiplier MUL64

Enable Integer Divider true

Enable Additional Machine Status Register Instructions true

Enable Pattern Comparator true

Enable Reversed Load/Store and Swap Instructions true

Select Extendet Addresing NONE

Enable Branch Target Cache false

Branch Target Cache Size DEFAULT

INIT_: +0%

INIT_F: +0%

INIT_DIV: +0%

MUL32: +0%

MUL32F: +0%

ADD__: +0%

ADD_F: +0%

INT_DIV: +0%

INT_DIV_F: +0%

BARREL_SHIFT: +0%

D_CACHE: +0%

I_CACHE: +0%

INIT_: +0%

INIT_F: +0%

INIT_DIV: +0%

MUL32: +0%

MUL32F: +0%

ADD__: +0%

ADD_F: +0%

INT_DIV: +0%

INT_DIV_F: +0%

BARREL_SHIFT: +0%

D_CACHE: +0%

I_CACHE: +0%

Slice LUTs 2682, +20%

Slice Registers 1963, +21%

F7 Muxes 112,

Slice 879, +22%

LUT as Logic 2494, +17%

LUT as Memory 188, +69%

BLOCK RAM 4, (дополнительный ресурс)

DSPs 6

Как видно из результата - наличие кэша не повлияло на производительность. Так же стоит отметить, что в этой таблице вместо -0% я использовал +0%, это связано с тем, что числа все-таки отличались на +1 значение. Например, тест MUL32 выполнялся за 4149505 единиц времени в базовом тесте, а при включении кэша время поднялось на единицу и стало 4149506. Это случилось по всем тестам.

Я прогонял тестирования с различной конфигурацией кэша в микроблейзе и не смог выявить какого-то ожидаемого прироста или ухудшения. Хотя при изменении параметров Enable Branch Target Cache true и Branch Target Cache Size 8 ENTRIES (особенно при увеличении второго параметра) получилось уменьшить потребление ресурсов ПЛИС.

Четвертая порция тестов. Повышение частоты тактирующего сигнала.

Очевидно, что если вся логика системы реализована на ресурсах ПЛИС, то при повышении частоты производительность должна расти пропорционально частоте.

Короткий ответ: да, так и есть.

Все тестирование проходило на частоте 100МГц. Для тестирования зависимости от частоты я изменил частоту на 200МГц и на 50МГц, в результате чего время выполнения задач на всех частотах было одинаковым. Внимание! Время выполнение считалось в тактах системного клока, а не в секундах. Отсюда следует, что производительность MicroBlaze линейно зависит от частоты.

Конечно, тут можно пофилософствовать на тему, что к AXI Interconnect можно подключить разные модули на различной частоте и время доступа будет разным. Но я тестировал не периферию, а сам микроблейз.

Заключение.

Не смотря на большой набор тестов (сырые данные будут ниже), для себя я однозначно определил, что всегда буду включать параметр Barrel Shifter, он участвует в большом количестве арифметических операций.

Кроме того отметил, что отдельные ускорители умножения и деления точечно влияют на производительность, строго отвечая за свою область вычислений.

Код для SDK
файл helloworld.c
/******************************************************************************
*
* Copyright (C) 2009 - 2014 Xilinx, Inc.  All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* Use of the Software is limited solely to applications:
* (a) running on a Xilinx device, or
* (b) that interact with a Xilinx device through a bus or interconnect.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* XILINX  BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Except as contained in this notice, the name of the Xilinx shall not be used
* in advertising or otherwise to promote the sale, use or other dealings in
* this Software without prior written authorization from Xilinx.
*
******************************************************************************/

/*
 * helloworld.c: simple test application
 *
 * This application configures UART 16550 to baud rate 9600.
 * PS7 UART (Zynq) is not initialized by this application, since
 * bootrom/bsp configures it to baud rate 115200
 *
 * ------------------------------------------------
 * | UART TYPE   BAUD RATE                        |
 * ------------------------------------------------
 *   uartns550   9600
 *   uartlite    Configurable only in HW design
 *   ps7_uart    115200 (configured by bootrom/bsp)
 */

//#include <stdio.h>
#include "platform.h"
#include "xil_printf.h"
#include "xil_io.h"
#include "mass_function.h"


#define ITERATIONS 500
#define BUFFER_SIZE 1024
#define FLOAT_SCALE 32.0f
#define DIV_BASE	2000000000

int32_t op1[BUFFER_SIZE];
int32_t op2[BUFFER_SIZE];


float op1_f[BUFFER_SIZE];
float op2_f[BUFFER_SIZE];

int op1_div[BUFFER_SIZE];
int op2_div[BUFFER_SIZE];

extern func_ptr_t func_table[256];



//generate data
uint32_t init_data()
{
	Xil_Out32(XPAR_GPIO_0_BASEADDR, 0);//set reset
	Xil_Out32(XPAR_GPIO_0_BASEADDR, 1);//clear reset
	uint32_t start_timer = Xil_In32(XPAR_GPIO_1_BASEADDR);// timer counter
    register int32_t base_val = -256;
    for(register int i = 0; i < BUFFER_SIZE; i++) {
        // Быстрые битовые операции вместо умножения/деления
        op1[i] = base_val + (i & 0xFF);       // -256 до 255
        op2[i] = (i ^ 0x55) & 0x3F;           // 0-63
    }
	return Xil_In32(XPAR_GPIO_1_BASEADDR) - start_timer;
}

uint32_t init_data_float()
{
	Xil_Out32(XPAR_GPIO_0_BASEADDR, 0);//set reset
	Xil_Out32(XPAR_GPIO_0_BASEADDR, 1);//clear reset
	uint32_t start_timer = Xil_In32(XPAR_GPIO_1_BASEADDR);// timer counter
    // Используем целочисленные вычисления + преобразование
    register float scale_factor = 1.0f / FLOAT_SCALE;
    register int half_buffer = BUFFER_SIZE / 2;

    for(register int i = 0; i < BUFFER_SIZE; i++) {
        // Целочисленные операции + однократное преобразование
        int32_t int_val = i - half_buffer;
        op1_f[i] = int_val * scale_factor;  // Одно умножение вместо деления
        op2_f[i] = int_val * (scale_factor * 0.75f);  // Предвычисленный масштаб

        //if(i%100 == 0) printf("op1: %.4f; op2: %.4f;\r\n", op1_f[i], op2_f[i]);
    }
	return Xil_In32(XPAR_GPIO_1_BASEADDR) - start_timer;
}


uint32_t init_data_div()
{
	Xil_Out32(XPAR_GPIO_0_BASEADDR, 0);//set reset
	Xil_Out32(XPAR_GPIO_0_BASEADDR, 1);//clear reset
	uint32_t start_timer = Xil_In32(XPAR_GPIO_1_BASEADDR);// timer counter
    register int32_t base_val = DIV_BASE;
    register uint8_t base_cnt = 0;
    for(register int i = 0; i < BUFFER_SIZE; i++) {
        op1_div[i] = base_val - i;  // Линейное уменьшение
        op2_div[i] = base_cnt + 2;  // Диапазон 2-257
        base_cnt++;
    }
	return Xil_In32(XPAR_GPIO_1_BASEADDR) - start_timer;
}




uint32_t test_multiplication(uint32_t iterations) {
	Xil_Out32(XPAR_GPIO_0_BASEADDR, 0);//set reset
	Xil_Out32(XPAR_GPIO_0_BASEADDR, 1);//clear reset
	uint32_t start_timer = Xil_In32(XPAR_GPIO_1_BASEADDR);// timer counter
	register int32_t mul_acc = 1;
	for(register uint32_t i = 0; i < iterations; i++) {
		for(register uint32_t j = 0; j < BUFFER_SIZE-3; j++) {
			mul_acc *= op1[j]*op2[j];
			mul_acc *= op1[j]*op2[j+1];
			mul_acc *= op1[j]*op2[j+2];
			mul_acc *= op1[j]*op2[j+3];
		}
		op2[i%BUFFER_SIZE] = mul_acc;
		op1[(i + 12)%BUFFER_SIZE] = mul_acc;
		mul_acc = 1;
	}

    return Xil_In32(XPAR_GPIO_1_BASEADDR) - start_timer;
}


uint32_t test_multiplication_float(uint32_t iterations) {
	Xil_Out32(XPAR_GPIO_0_BASEADDR, 0);//set reset
	Xil_Out32(XPAR_GPIO_0_BASEADDR, 1);//clear reset
	uint32_t start_timer = Xil_In32(XPAR_GPIO_1_BASEADDR);// timer counter
	register float mul_acc = 1;
	for(register uint32_t i = 0; i < iterations; i++) {
		for(register uint32_t j = 0; j < BUFFER_SIZE-3; j++) {
			mul_acc *= op1_f[j]*op2_f[j];
			mul_acc *= op1_f[j]*op2_f[j+1];
			mul_acc *= op1_f[j]*op2_f[j+2];
			mul_acc *= op1_f[j]*op2_f[j+3];
		}
		op2_f[i%BUFFER_SIZE] = mul_acc;
		op1_f[(i + 12)%BUFFER_SIZE] = mul_acc;
		mul_acc = 1;
	}

    return Xil_In32(XPAR_GPIO_1_BASEADDR) - start_timer;
}


uint32_t test_add(uint32_t iterations) {
	Xil_Out32(XPAR_GPIO_0_BASEADDR, 0);//set reset
	Xil_Out32(XPAR_GPIO_0_BASEADDR, 1);//clear reset
	uint32_t start_timer = Xil_In32(XPAR_GPIO_1_BASEADDR);// timer counter
	register uint32_t add_acc = 0;
	for(register uint32_t i = 0; i < iterations; i++) {
		for(register uint32_t j = 0; j < BUFFER_SIZE-3; j++) {
			add_acc += op1[j]+op2[j];
			add_acc += op1[j]+op2[j+1];
			add_acc += op1[j]+op2[j+2];
			add_acc += op1[j]+op2[j+3];
		}
		op2[i%BUFFER_SIZE] = add_acc;
		op1[(i + 12)%BUFFER_SIZE] = add_acc;
		add_acc = 0;
	}

    return Xil_In32(XPAR_GPIO_1_BASEADDR) - start_timer;
}



uint32_t test_add_float(uint32_t iterations) {
	Xil_Out32(XPAR_GPIO_0_BASEADDR, 0);//set reset
	Xil_Out32(XPAR_GPIO_0_BASEADDR, 1);//clear reset
	uint32_t start_timer = Xil_In32(XPAR_GPIO_1_BASEADDR);// timer counter
	register float add_acc = 0;
	for(register uint32_t i = 0; i < iterations; i++) {
		for(register uint32_t j = 0; j < BUFFER_SIZE-3; j++) {
			add_acc += op1_f[j]+op2_f[j];
			add_acc += op1_f[j]+op2_f[j+1];
			add_acc += op1_f[j]+op2_f[j+2];
			add_acc += op1_f[j]+op2_f[j+3];
		}
		op2_f[i%BUFFER_SIZE] = add_acc;
		op1_f[(i + 12)%BUFFER_SIZE] = add_acc;
		add_acc = 0;
	}

    return Xil_In32(XPAR_GPIO_1_BASEADDR) - start_timer;
}


uint32_t test_division_int(uint32_t iterations) {
	Xil_Out32(XPAR_GPIO_0_BASEADDR, 0);//set reset
	Xil_Out32(XPAR_GPIO_0_BASEADDR, 1);//clear reset
	uint32_t start_timer = Xil_In32(XPAR_GPIO_1_BASEADDR);// timer counter
	register int div_acc = 0;
	for(register uint32_t i = 0; i < iterations; i++) {
		for(register uint32_t j = 0; j < BUFFER_SIZE-3; j++) {
			div_acc += op1_div[j]/op2_div[j];
			div_acc += op1_div[j]/op2_div[j+1];
			div_acc += op1_div[j]/op2_div[j+2];
			div_acc += op1_div[j]/op2_div[j+3];
		}
		//op2_div[i%BUFFER_SIZE] = div_acc;
		op1_div[(i + 12)%BUFFER_SIZE] = div_acc;
		div_acc = 0;
	}

    return Xil_In32(XPAR_GPIO_1_BASEADDR) - start_timer;
}


uint32_t test_division_float(uint32_t iterations) {
	Xil_Out32(XPAR_GPIO_0_BASEADDR, 0);//set reset
	Xil_Out32(XPAR_GPIO_0_BASEADDR, 1);//clear reset
	uint32_t start_timer = Xil_In32(XPAR_GPIO_1_BASEADDR);// timer counter
	register float div_acc = 0;
	for(register uint32_t i = 0; i < iterations; i++) {
		for(register uint32_t j = 0; j < BUFFER_SIZE-3; j++) {
			div_acc += op1_f[j]/op2_f[j];
			div_acc += op1_f[j]/op2_f[j+1];
			div_acc += op1_f[j]/op2_f[j+2];
			div_acc += op1_f[j]/op2_f[j+3];
		}
		//op2_div[i%BUFFER_SIZE] = div_acc;
		op1_f[(i + 12)%BUFFER_SIZE] = div_acc;
		div_acc = 0;
	}

    return Xil_In32(XPAR_GPIO_1_BASEADDR) - start_timer;
}


uint32_t test_barrel_shifter(uint32_t iterations) {
    Xil_Out32(XPAR_GPIO_0_BASEADDR, 0);  // Сброс таймера
    Xil_Out32(XPAR_GPIO_0_BASEADDR, 1);  // Запуск таймера
    uint32_t start_timer = Xil_In32(XPAR_GPIO_1_BASEADDR);

    volatile uint32_t value = 0x12345678 ^ iterations;
    volatile uint32_t result = 0;

    // Предопределенные шаги сдвига
    const uint8_t shifts[] = {1, 2, 3, 4, 8, 16, 24, 31};
    const int num_shifts = sizeof(shifts) / sizeof(shifts[0]);

    for (register uint32_t i = 0; i < iterations; i++) {
        // Перебираем разные варианты сдвигов
        for (register int s = 0; s < num_shifts; s++) {

            // Разнообразные операции сдвига
            result += value <<  shifts[s];       // Сдвиг влево
            result += value >> (32 -  shifts[s]); // Сдвиг вправо (дополнение)
            result += (value <<  shifts[s]) | (value >> (32 -  shifts[s]));  // Циклический влево
            result += (value >>  shifts[s]) | (value << (32 -  shifts[s]));  // Циклический вправо

            // Комбинированные сдвиги
            result ^= (value << ( shifts[s]/2)) + (value >> ( shifts[s]/2 + 1));
        }

        // Модификация значения для предотвращения оптимизации
        value += result;
    }

    op1[BUFFER_SIZE-1] = value + result;
    op2[BUFFER_SIZE-1] = value - result;

    return Xil_In32(XPAR_GPIO_1_BASEADDR) - start_timer;
}


uint32_t test_data_cache(uint32_t iterations) {
    Xil_Out32(XPAR_GPIO_0_BASEADDR, 0);
    Xil_Out32(XPAR_GPIO_0_BASEADDR, 1);
    uint32_t start_timer = Xil_In32(XPAR_GPIO_1_BASEADDR);

    volatile uint32_t acc = 0;
    const uint32_t mask = BUFFER_SIZE - 1;  // Маска для индексации (BUFFER_SIZE должна быть степенью 2!)
    const uint32_t stride = 65;             // Нечетное число для псевдослучайного доступа

    for (register uint32_t iter = 0; iter < iterations; iter++) {
        // Тест 1: Последовательный доступ (чтение)
        for (register int i = 0; i < BUFFER_SIZE; i++) {
            acc += op1[i];
        }

        // Тест 2: Последовательный доступ (запись)
        for (register int i = 0; i < BUFFER_SIZE; i++) {
            op1[i] = acc + i;
        }

        // Тест 3: Псевдослучайный доступ (чтение)
        for (register int i = 0; i < BUFFER_SIZE; i++) {
            uint32_t idx = (i * stride) & mask;  // Быстрая битовая операция
            acc += op1[idx];
        }

        // Тест 4: Псевдослучайный доступ (запись)
        for (register int i = 0; i < BUFFER_SIZE; i++) {
            uint32_t idx = (i * stride) & mask;  // Быстрая битовая операция
            op1[idx] = acc + i;
        }
    }

    // Финализация результатов
    op1[0] = acc;

    return Xil_In32(XPAR_GPIO_1_BASEADDR) - start_timer;
}



uint32_t test_icache(uint32_t iterations) {
    Xil_Out32(XPAR_GPIO_0_BASEADDR, 0);  // Сброс таймера
    Xil_Out32(XPAR_GPIO_0_BASEADDR, 1);  // Запуск таймера
    uint32_t start_timer = Xil_In32(XPAR_GPIO_1_BASEADDR);

    volatile uint32_t acc = 0, res = 0;
    uint32_t prng = 0x12345678;

    for (uint32_t i = 0; i < iterations; i++) {
        // Простой PRNG для выбора случайной функции
        prng = (prng * 1103515245) + 12345;
        uint8_t func_index = (prng >> 16) & 0xFF;

        // Вызов случайной функции из таблицы
        res = func_table[func_index](i+1);

        // Используем результат, чтобы предотвратить оптимизацию
        acc += prng + res;
    }

    // Сохраняем результат для предотвращения оптимизации
    op1[0] = acc;

    return Xil_In32(XPAR_GPIO_1_BASEADDR) - start_timer;
}





int main()
{
    init_platform();
    //disable_caches();

    uint32_t timer;

    xil_printf("Hello World\n\r");



    int i;
    for(i=0;i < 1; i++){

    	//INIT test
		timer = init_data();
		xil_printf("INIT_: work time %d \n\r", timer);
		timer = init_data_float();
		xil_printf("INIT_F: work time %d \n\r", timer);
		timer = init_data_div();
		xil_printf("INIT_DIV: work time %d \n\r", timer);

		//MUL data
		timer = test_multiplication(ITERATIONS);
		xil_printf("MUL32: work time %d \n\r", timer);
		timer = test_multiplication_float(ITERATIONS);
		xil_printf("MUL32F: work time %d \n\r", timer);

		//ADD test
		init_data();
		init_data_float();
		timer = test_add(ITERATIONS);
		xil_printf("ADD__: work time %d \n\r", timer);
		timer = test_add_float(ITERATIONS);
		xil_printf("ADD_F: work time %d \n\r", timer);


		//DIV test
		timer = test_division_int(ITERATIONS);
		xil_printf("INT_DIV: work time %d \n\r", timer);
		init_data_float();
		timer = test_division_float(ITERATIONS);
		xil_printf("INT_DIV_F: work time %d \n\r", timer);


		//barrel shifter test
		timer = test_barrel_shifter(ITERATIONS);
		xil_printf("BARREL_SHIFT: work time %d \n\r", timer);

		//data cache test
		timer = test_data_cache(ITERATIONS);
		xil_printf("D_CACHE: work time %d \n\r", timer);

		//i-cache test
		timer = test_icache(ITERATIONS*256);
		xil_printf("I_CACHE: work time %d \n\r", timer);

    }

    xil_printf("The End\n\r");
    cleanup_platform();
    return 0;
}
Файл mass_function.h
/*
 * mass_function.h
 *
 *  Created on: 16 авг. 2025 г.
 *      Author: mihail
 */

#ifndef SRC_MASS_FUNCTION_H_
#define SRC_MASS_FUNCTION_H_


#define DECLARE_TEST_FUNC(n) \
__attribute__((noinline)) int test_func_##n(uint32_t i) { \
    volatile int a = n * 123 + i; \
    volatile int b = n * 456 + 789 - i; \
    volatile int c = (a & 0xFF) | (b & 0xFF00); \
    volatile float d = c * 0.001f; \
    return (int) (d + n * 0.1f); \
}


DECLARE_TEST_FUNC(0)
DECLARE_TEST_FUNC(1)
DECLARE_TEST_FUNC(2)
DECLARE_TEST_FUNC(3)
DECLARE_TEST_FUNC(4)
DECLARE_TEST_FUNC(5)
DECLARE_TEST_FUNC(6)
DECLARE_TEST_FUNC(7)
DECLARE_TEST_FUNC(8)
DECLARE_TEST_FUNC(9)
DECLARE_TEST_FUNC(10)
DECLARE_TEST_FUNC(11)
DECLARE_TEST_FUNC(12)
DECLARE_TEST_FUNC(13)
DECLARE_TEST_FUNC(14)
DECLARE_TEST_FUNC(15)
DECLARE_TEST_FUNC(16)
DECLARE_TEST_FUNC(17)
DECLARE_TEST_FUNC(18)
DECLARE_TEST_FUNC(19)
DECLARE_TEST_FUNC(20)
DECLARE_TEST_FUNC(21)
DECLARE_TEST_FUNC(22)
DECLARE_TEST_FUNC(23)
DECLARE_TEST_FUNC(24)
DECLARE_TEST_FUNC(25)
DECLARE_TEST_FUNC(26)
DECLARE_TEST_FUNC(27)
DECLARE_TEST_FUNC(28)
DECLARE_TEST_FUNC(29)
DECLARE_TEST_FUNC(30)
DECLARE_TEST_FUNC(31)
DECLARE_TEST_FUNC(32)
DECLARE_TEST_FUNC(33)
DECLARE_TEST_FUNC(34)
DECLARE_TEST_FUNC(35)
DECLARE_TEST_FUNC(36)
DECLARE_TEST_FUNC(37)
DECLARE_TEST_FUNC(38)
DECLARE_TEST_FUNC(39)
DECLARE_TEST_FUNC(40)
DECLARE_TEST_FUNC(41)
DECLARE_TEST_FUNC(42)
DECLARE_TEST_FUNC(43)
DECLARE_TEST_FUNC(44)
DECLARE_TEST_FUNC(45)
DECLARE_TEST_FUNC(46)
DECLARE_TEST_FUNC(47)
DECLARE_TEST_FUNC(48)
DECLARE_TEST_FUNC(49)
DECLARE_TEST_FUNC(50)
DECLARE_TEST_FUNC(51)
DECLARE_TEST_FUNC(52)
DECLARE_TEST_FUNC(53)
DECLARE_TEST_FUNC(54)
DECLARE_TEST_FUNC(55)
DECLARE_TEST_FUNC(56)
DECLARE_TEST_FUNC(57)
DECLARE_TEST_FUNC(58)
DECLARE_TEST_FUNC(59)
DECLARE_TEST_FUNC(60)
DECLARE_TEST_FUNC(61)
DECLARE_TEST_FUNC(62)
DECLARE_TEST_FUNC(63)
DECLARE_TEST_FUNC(64)
DECLARE_TEST_FUNC(65)
DECLARE_TEST_FUNC(66)
DECLARE_TEST_FUNC(67)
DECLARE_TEST_FUNC(68)
DECLARE_TEST_FUNC(69)
DECLARE_TEST_FUNC(70)
DECLARE_TEST_FUNC(71)
DECLARE_TEST_FUNC(72)
DECLARE_TEST_FUNC(73)
DECLARE_TEST_FUNC(74)
DECLARE_TEST_FUNC(75)
DECLARE_TEST_FUNC(76)
DECLARE_TEST_FUNC(77)
DECLARE_TEST_FUNC(78)
DECLARE_TEST_FUNC(79)
DECLARE_TEST_FUNC(80)
DECLARE_TEST_FUNC(81)
DECLARE_TEST_FUNC(82)
DECLARE_TEST_FUNC(83)
DECLARE_TEST_FUNC(84)
DECLARE_TEST_FUNC(85)
DECLARE_TEST_FUNC(86)
DECLARE_TEST_FUNC(87)
DECLARE_TEST_FUNC(88)
DECLARE_TEST_FUNC(89)
DECLARE_TEST_FUNC(90)
DECLARE_TEST_FUNC(91)
DECLARE_TEST_FUNC(92)
DECLARE_TEST_FUNC(93)
DECLARE_TEST_FUNC(94)
DECLARE_TEST_FUNC(95)
DECLARE_TEST_FUNC(96)
DECLARE_TEST_FUNC(97)
DECLARE_TEST_FUNC(98)
DECLARE_TEST_FUNC(99)
DECLARE_TEST_FUNC(100)
DECLARE_TEST_FUNC(101)
DECLARE_TEST_FUNC(102)
DECLARE_TEST_FUNC(103)
DECLARE_TEST_FUNC(104)
DECLARE_TEST_FUNC(105)
DECLARE_TEST_FUNC(106)
DECLARE_TEST_FUNC(107)
DECLARE_TEST_FUNC(108)
DECLARE_TEST_FUNC(109)
DECLARE_TEST_FUNC(110)
DECLARE_TEST_FUNC(111)
DECLARE_TEST_FUNC(112)
DECLARE_TEST_FUNC(113)
DECLARE_TEST_FUNC(114)
DECLARE_TEST_FUNC(115)
DECLARE_TEST_FUNC(116)
DECLARE_TEST_FUNC(117)
DECLARE_TEST_FUNC(118)
DECLARE_TEST_FUNC(119)
DECLARE_TEST_FUNC(120)
DECLARE_TEST_FUNC(121)
DECLARE_TEST_FUNC(122)
DECLARE_TEST_FUNC(123)
DECLARE_TEST_FUNC(124)
DECLARE_TEST_FUNC(125)
DECLARE_TEST_FUNC(126)
DECLARE_TEST_FUNC(127)
DECLARE_TEST_FUNC(128)
DECLARE_TEST_FUNC(129)
DECLARE_TEST_FUNC(130)
DECLARE_TEST_FUNC(131)
DECLARE_TEST_FUNC(132)
DECLARE_TEST_FUNC(133)
DECLARE_TEST_FUNC(134)
DECLARE_TEST_FUNC(135)
DECLARE_TEST_FUNC(136)
DECLARE_TEST_FUNC(137)
DECLARE_TEST_FUNC(138)
DECLARE_TEST_FUNC(139)
DECLARE_TEST_FUNC(140)
DECLARE_TEST_FUNC(141)
DECLARE_TEST_FUNC(142)
DECLARE_TEST_FUNC(143)
DECLARE_TEST_FUNC(144)
DECLARE_TEST_FUNC(145)
DECLARE_TEST_FUNC(146)
DECLARE_TEST_FUNC(147)
DECLARE_TEST_FUNC(148)
DECLARE_TEST_FUNC(149)
DECLARE_TEST_FUNC(150)
DECLARE_TEST_FUNC(151)
DECLARE_TEST_FUNC(152)
DECLARE_TEST_FUNC(153)
DECLARE_TEST_FUNC(154)
DECLARE_TEST_FUNC(155)
DECLARE_TEST_FUNC(156)
DECLARE_TEST_FUNC(157)
DECLARE_TEST_FUNC(158)
DECLARE_TEST_FUNC(159)
DECLARE_TEST_FUNC(160)
DECLARE_TEST_FUNC(161)
DECLARE_TEST_FUNC(162)
DECLARE_TEST_FUNC(163)
DECLARE_TEST_FUNC(164)
DECLARE_TEST_FUNC(165)
DECLARE_TEST_FUNC(166)
DECLARE_TEST_FUNC(167)
DECLARE_TEST_FUNC(168)
DECLARE_TEST_FUNC(169)
DECLARE_TEST_FUNC(170)
DECLARE_TEST_FUNC(171)
DECLARE_TEST_FUNC(172)
DECLARE_TEST_FUNC(173)
DECLARE_TEST_FUNC(174)
DECLARE_TEST_FUNC(175)
DECLARE_TEST_FUNC(176)
DECLARE_TEST_FUNC(177)
DECLARE_TEST_FUNC(178)
DECLARE_TEST_FUNC(179)
DECLARE_TEST_FUNC(180)
DECLARE_TEST_FUNC(181)
DECLARE_TEST_FUNC(182)
DECLARE_TEST_FUNC(183)
DECLARE_TEST_FUNC(184)
DECLARE_TEST_FUNC(185)
DECLARE_TEST_FUNC(186)
DECLARE_TEST_FUNC(187)
DECLARE_TEST_FUNC(188)
DECLARE_TEST_FUNC(189)
DECLARE_TEST_FUNC(190)
DECLARE_TEST_FUNC(191)
DECLARE_TEST_FUNC(192)
DECLARE_TEST_FUNC(193)
DECLARE_TEST_FUNC(194)
DECLARE_TEST_FUNC(195)
DECLARE_TEST_FUNC(196)
DECLARE_TEST_FUNC(197)
DECLARE_TEST_FUNC(198)
DECLARE_TEST_FUNC(199)
DECLARE_TEST_FUNC(200)
DECLARE_TEST_FUNC(201)
DECLARE_TEST_FUNC(202)
DECLARE_TEST_FUNC(203)
DECLARE_TEST_FUNC(204)
DECLARE_TEST_FUNC(205)
DECLARE_TEST_FUNC(206)
DECLARE_TEST_FUNC(207)
DECLARE_TEST_FUNC(208)
DECLARE_TEST_FUNC(209)
DECLARE_TEST_FUNC(210)
DECLARE_TEST_FUNC(211)
DECLARE_TEST_FUNC(212)
DECLARE_TEST_FUNC(213)
DECLARE_TEST_FUNC(214)
DECLARE_TEST_FUNC(215)
DECLARE_TEST_FUNC(216)
DECLARE_TEST_FUNC(217)
DECLARE_TEST_FUNC(218)
DECLARE_TEST_FUNC(219)
DECLARE_TEST_FUNC(220)
DECLARE_TEST_FUNC(221)
DECLARE_TEST_FUNC(222)
DECLARE_TEST_FUNC(223)
DECLARE_TEST_FUNC(224)
DECLARE_TEST_FUNC(225)
DECLARE_TEST_FUNC(226)
DECLARE_TEST_FUNC(227)
DECLARE_TEST_FUNC(228)
DECLARE_TEST_FUNC(229)
DECLARE_TEST_FUNC(230)
DECLARE_TEST_FUNC(231)
DECLARE_TEST_FUNC(232)
DECLARE_TEST_FUNC(233)
DECLARE_TEST_FUNC(234)
DECLARE_TEST_FUNC(235)
DECLARE_TEST_FUNC(236)
DECLARE_TEST_FUNC(237)
DECLARE_TEST_FUNC(238)
DECLARE_TEST_FUNC(239)
DECLARE_TEST_FUNC(240)
DECLARE_TEST_FUNC(241)
DECLARE_TEST_FUNC(242)
DECLARE_TEST_FUNC(243)
DECLARE_TEST_FUNC(244)
DECLARE_TEST_FUNC(245)
DECLARE_TEST_FUNC(246)
DECLARE_TEST_FUNC(247)
DECLARE_TEST_FUNC(248)
DECLARE_TEST_FUNC(249)
DECLARE_TEST_FUNC(250)
DECLARE_TEST_FUNC(251)
DECLARE_TEST_FUNC(252)
DECLARE_TEST_FUNC(253)
DECLARE_TEST_FUNC(254)
DECLARE_TEST_FUNC(255)

typedef int (*func_ptr_t)();

// Таблица из 256 функций
func_ptr_t func_table[256] = {
    test_func_0,
    test_func_1,
    test_func_2,
    test_func_3,
    test_func_4,
    test_func_5,
    test_func_6,
    test_func_7,
    test_func_8,
    test_func_9,
    test_func_10,
    test_func_11,
    test_func_12,
    test_func_13,
    test_func_14,
    test_func_15,
    test_func_16,
    test_func_17,
    test_func_18,
    test_func_19,
    test_func_20,
    test_func_21,
    test_func_22,
    test_func_23,
    test_func_24,
    test_func_25,
    test_func_26,
    test_func_27,
    test_func_28,
    test_func_29,
    test_func_30,
    test_func_31,
    test_func_32,
    test_func_33,
    test_func_34,
    test_func_35,
    test_func_36,
    test_func_37,
    test_func_38,
    test_func_39,
    test_func_40,
    test_func_41,
    test_func_42,
    test_func_43,
    test_func_44,
    test_func_45,
    test_func_46,
    test_func_47,
    test_func_48,
    test_func_49,
    test_func_50,
    test_func_51,
    test_func_52,
    test_func_53,
    test_func_54,
    test_func_55,
    test_func_56,
    test_func_57,
    test_func_58,
    test_func_59,
    test_func_60,
    test_func_61,
    test_func_62,
    test_func_63,
    test_func_64,
    test_func_65,
    test_func_66,
    test_func_67,
    test_func_68,
    test_func_69,
    test_func_70,
    test_func_71,
    test_func_72,
    test_func_73,
    test_func_74,
    test_func_75,
    test_func_76,
    test_func_77,
    test_func_78,
    test_func_79,
    test_func_80,
    test_func_81,
    test_func_82,
    test_func_83,
    test_func_84,
    test_func_85,
    test_func_86,
    test_func_87,
    test_func_88,
    test_func_89,
    test_func_90,
    test_func_91,
    test_func_92,
    test_func_93,
    test_func_94,
    test_func_95,
    test_func_96,
    test_func_97,
    test_func_98,
    test_func_99,
    test_func_100,
    test_func_101,
    test_func_102,
    test_func_103,
    test_func_104,
    test_func_105,
    test_func_106,
    test_func_107,
    test_func_108,
    test_func_109,
    test_func_110,
    test_func_111,
    test_func_112,
    test_func_113,
    test_func_114,
    test_func_115,
    test_func_116,
    test_func_117,
    test_func_118,
    test_func_119,
    test_func_120,
    test_func_121,
    test_func_122,
    test_func_123,
    test_func_124,
    test_func_125,
    test_func_126,
    test_func_127,
    test_func_128,
    test_func_129,
    test_func_130,
    test_func_131,
    test_func_132,
    test_func_133,
    test_func_134,
    test_func_135,
    test_func_136,
    test_func_137,
    test_func_138,
    test_func_139,
    test_func_140,
    test_func_141,
    test_func_142,
    test_func_143,
    test_func_144,
    test_func_145,
    test_func_146,
    test_func_147,
    test_func_148,
    test_func_149,
    test_func_150,
    test_func_151,
    test_func_152,
    test_func_153,
    test_func_154,
    test_func_155,
    test_func_156,
    test_func_157,
    test_func_158,
    test_func_159,
    test_func_160,
    test_func_161,
    test_func_162,
    test_func_163,
    test_func_164,
    test_func_165,
    test_func_166,
    test_func_167,
    test_func_168,
    test_func_169,
    test_func_170,
    test_func_171,
    test_func_172,
    test_func_173,
    test_func_174,
    test_func_175,
    test_func_176,
    test_func_177,
    test_func_178,
    test_func_179,
    test_func_180,
    test_func_181,
    test_func_182,
    test_func_183,
    test_func_184,
    test_func_185,
    test_func_186,
    test_func_187,
    test_func_188,
    test_func_189,
    test_func_190,
    test_func_191,
    test_func_192,
    test_func_193,
    test_func_194,
    test_func_195,
    test_func_196,
    test_func_197,
    test_func_198,
    test_func_199,
    test_func_200,
    test_func_201,
    test_func_202,
    test_func_203,
    test_func_204,
    test_func_205,
    test_func_206,
    test_func_207,
    test_func_208,
    test_func_209,
    test_func_210,
    test_func_211,
    test_func_212,
    test_func_213,
    test_func_214,
    test_func_215,
    test_func_216,
    test_func_217,
    test_func_218,
    test_func_219,
    test_func_220,
    test_func_221,
    test_func_222,
    test_func_223,
    test_func_224,
    test_func_225,
    test_func_226,
    test_func_227,
    test_func_228,
    test_func_229,
    test_func_230,
    test_func_231,
    test_func_232,
    test_func_233,
    test_func_234,
    test_func_235,
    test_func_236,
    test_func_237,
    test_func_238,
    test_func_239,
    test_func_240,
    test_func_241,
    test_func_242,
    test_func_243,
    test_func_244,
    test_func_245,
    test_func_246,
    test_func_247,
    test_func_248,
    test_func_249,
    test_func_250,
    test_func_251,
    test_func_252,
    test_func_253,
    test_func_254,
    test_func_255
};



#endif /* SRC_MASS_FUNCTION_H_ */
Сырые данные тестов:

TEST 1:

Select Processor Implementation 32 bits
Enable MicroBlaze Debug Module Interface false
Use Instruction and Data Cache false
Enable Exeption false
Use Memory Management false
Enable Discrete Ports false
Enable Barrel Shifter false
Enable Floating Point Unit NONE
Enable Integer Miltiplier NONE
Enable Integer Divider false
Enable Additional Machine Status Register Instructions false
Enable Pattern Comparator false
Enable Reversed Load/Store and Swap Instructions true
Select Extendet Addresing NONE
Enable Branch Target Cache false
Branch Target Cache Size DEFAULT

Hello World
INIT_: work time 2564
INIT_F: work time 350733
INIT_DIV: work time 2821
MUL32: work time 18523530
MUL32F: work time 233098629
ADD__: work time 4149755
ADD_F: work time 160816062
INT_DIV: work time 107306028
INT_DIV_F: work time 202886883
BARREL_SHIFT: work time 277071
D_CACHE: work time 13947881
I_CACHE: work time 30481681
The End

Потребление ресурсов ПЛИС модулем микроблейз:
Slice LUTs 868, Slice Registers 582, F7 Muxes 108, Slice 304, LUT as Logic 765, LUT as Memory 103

TEST 2:

Select Processor Implementation 32 bits
Enable MicroBlaze Debug Module Interface false
Use Instruction and Data Cache false
Enable Exeption false
Use Memory Management false
Enable Discrete Ports false
Enable Barrel Shifter true
Enable Floating Point Unit NONE
Enable Integer Miltiplier NONE
Enable Integer Divider false
Enable Additional Machine Status Register Instructions false
Enable Pattern Comparator false
Enable Reversed Load/Store and Swap Instructions true
Select Extendet Addresing NONE
Enable Branch Target Cache false
Branch Target Cache Size DEFAULT

Hello World
INIT_: work time 2308
INIT_F: work time 195152
INIT_DIV: work time 2565
MUL32: work time 18012905
MUL32F: work time 123429725
ADD__: work time 3639130
ADD_F: work time 80447398
INT_DIV: work time 106795466
INT_DIV_F: work time 123474053
BARREL_SHIFT: work time 52946
D_CACHE: work time 13691881
I_CACHE: work time 16794784
The End

Потребление ресурсов ПЛИС модулем микроблейз:
Slice LUTs 1118, Slice Registers 718, F7 Muxes 108, Slice 373, LUT as Logic 1015, LUT as Memory 103

TEST 3:

Select Processor Implementation 32 bits
Enable MicroBlaze Debug Module Interface false
Use Instruction and Data Cache false
Enable Exeption false
Use Memory Management false
Enable Discrete Ports false
Enable Barrel Shifter true
Enable Floating Point Unit NONE
Enable Integer Miltiplier NONE
Enable Integer Divider true
Enable Additional Machine Status Register Instructions false
Enable Pattern Comparator false
Enable Reversed Load/Store and Swap Instructions true
Select Extendet Addresing NONE
Enable Branch Target Cache false
Branch Target Cache Size DEFAULT

Hello World
INIT_: work time 2308
INIT_F: work time 195152
INIT_DIV: work time 2565
MUL32: work time 18012905
MUL32F: work time 123429725
ADD__: work time 3639130
ADD_F: work time 80447398
INT_DIV: work time 12572442
INT_DIV_F: work time 123474053
BARREL_SHIFT: work time 52946
D_CACHE: work time 13691881
I_CACHE: work time 16794784
The End

Потребление ресурсов ПЛИС модулем микроблейз:
Slice LUTs 1234, Slice Registers 835, F7 Muxes 108, Slice 407, LUT as Logic 1130, LUT as Memory 104

TEST 4:

Select Processor Implementation 32 bits
Enable MicroBlaze Debug Module Interface false
Use Instruction and Data Cache false
Enable Exeption false
Use Memory Management false
Enable Discrete Ports false
Enable Barrel Shifter true
Enable Floating Point Unit BASIC
Enable Integer Miltiplier NONE
Enable Integer Divider true
Enable Additional Machine Status Register Instructions false
Enable Pattern Comparator false
Enable Reversed Load/Store and Swap Instructions true
Select Extendet Addresing NONE
Enable Branch Target Cache false
Branch Target Cache Size DEFAULT

Hello World
INIT_: work time 2308
INIT_F: work time 31353
INIT_DIV: work time 2565
MUL32: work time 18012905
MUL32F: work time 5681067
ADD__: work time 3639130
ADD_F: work time 5681005
INT_DIV: work time 12572442
INT_DIV_F: work time 11894061
BARREL_SHIFT: work time 52946
D_CACHE: work time 13691881
I_CACHE: work time 4687688
The End

Потребление ресурсов ПЛИС модулем микроблейз:
Slice LUTs 1784, Slice Registers 1265, F7 Muxes 113, Slice 556, LUT as Logic 1670, LUT as Memory 114, DSPs 2

команды компилятора:
mb-gcc -Wall -O0 -g3 -c -fmessage-length=0 -MT"src/helloworld.o" -I../../test_microblaze_bsp/microblaze_0/include -mlittle-endian -mxl-barrel-shift -mno-xl-soft-div -mcpu=v11.0 -mxl-soft-mul -mhard-float -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"src/helloworld.d" -MT"src/helloworld.o" -o "src/helloworld.o" "../src/helloworld.c"

mb-gcc -Wl,-T -Wl,../src/lscript.ld -L../../test_microblaze_bsp/microblaze_0/lib -mlittle-endian -mxl-barrel-shift -mno-xl-soft-div -mcpu=v11.0 -mxl-soft-mul -mhard-float -Wl,--no-relax -Wl,--gc-sections -o "test_microblaze.elf" ./src/helloworld.o ./src/platform.o -Wl,--start-group,-lxil,-lgcc,-lc,--end-group

TEST 5:

Select Processor Implementation 32 bits
Enable MicroBlaze Debug Module Interface false
Use Instruction and Data Cache false
Enable Exeption false
Use Memory Management false
Enable Discrete Ports false
Enable Barrel Shifter true
Enable Floating Point Unit BASIC
Enable Integer Miltiplier MUL32
Enable Integer Divider true
Enable Additional Machine Status Register Instructions false
Enable Pattern Comparator false
Enable Reversed Load/Store and Swap Instructions true
Select Extendet Addresing NONE
Enable Branch Target Cache false
Branch Target Cache Size DEFAULT

Hello World
INIT_: work time 2308
INIT_F: work time 31353
INIT_DIV: work time 2565
MUL32: work time 4149505
MUL32F: work time 5681067
ADD__: work time 3639130
ADD_F: work time 5681005
INT_DIV: work time 12572442
INT_DIV_F: work time 11894061
BARREL_SHIFT: work time 52946
D_CACHE: work time 5890256
I_CACHE: work time 4399688
The End

Потребление ресурсов ПЛИС модулем микроблейз:
Slice LUTs 1798, Slice Registers 1285, F7 Muxes 113, Slice 586, LUT as Logic 1683, LUT as Memory 115, DSPs 5

TEST 6:

Select Processor Implementation 32 bits
Enable MicroBlaze Debug Module Interface false
Use Instruction and Data Cache false
Enable Exeption false
Use Memory Management false
Enable Discrete Ports false
Enable Barrel Shifter true
Enable Floating Point Unit EXTENDED
Enable Integer Miltiplier MUL64
Enable Integer Divider true
Enable Additional Machine Status Register Instructions false
Enable Pattern Comparator false
Enable Reversed Load/Store and Swap Instructions true
Select Extendet Addresing NONE
Enable Branch Target Cache false
Branch Target Cache Size DEFAULT

Hello World
INIT_: work time 2308
INIT_F: work time 6405
INIT_DIV: work time 2565
MUL32: work time 4149505
MUL32F: work time 5681067
ADD__: work time 3639130
ADD_F: work time 5681005
INT_DIV: work time 12572442
INT_DIV_F: work time 11894061
BARREL_SHIFT: work time 52946
D_CACHE: work time 5890256
I_CACHE: work time 1807944
The End

Потребление ресурсов ПЛИС модулем микроблейз:
Slice LUTs 2184, Slice Registers 1620, F7 Muxes 112, Slice 698, LUT as Logic 2073, LUT as Memory 111, DSPs 6

TEST 7:

Select Processor Implementation 32 bits
Enable MicroBlaze Debug Module Interface false
Use Instruction and Data Cache false
Enable Exeption false
Use Memory Management false
Enable Discrete Ports false
Enable Barrel Shifter true
Enable Floating Point Unit EXTENDED
Enable Integer Miltiplier MUL64
Enable Integer Divider true
Enable Additional Machine Status Register Instructions true
Enable Pattern Comparator true
Enable Reversed Load/Store and Swap Instructions true
Select Extendet Addresing NONE
Enable Branch Target Cache false
Branch Target Cache Size DEFAULT

Hello World
INIT_: work time 2308
INIT_F: work time 6405
INIT_DIV: work time 2565
MUL32: work time 4149505
MUL32F: work time 5681067
ADD__: work time 3639130
ADD_F: work time 5681005
INT_DIV: work time 12572442
INT_DIV_F: work time 11894061
BARREL_SHIFT: work time 52946
D_CACHE: work time 5890256
I_CACHE: work time 1807944
The End

Потребление ресурсов ПЛИС модулем микроблейз:
Slice LUTs 2239, Slice Registers 1626, F7 Muxes 112, Slice 718, LUT as Logic 2128, LUT as Memory 111, DSPs 6

TEST 8:

Select Processor Implementation 32 bits
Enable MicroBlaze Debug Module Interface false
Use Instruction and Data Cache true (4kb for each)
Enable Exeption false
Use Memory Management false
Enable Discrete Ports false
Enable Barrel Shifter true
Enable Floating Point Unit EXTENDED
Enable Integer Miltiplier MUL64
Enable Integer Divider true
Enable Additional Machine Status Register Instructions true
Enable Pattern Comparator true
Enable Reversed Load/Store and Swap Instructions true
Select Extendet Addresing NONE
Enable Branch Target Cache false
Branch Target Cache Size DEFAULT

с выполненной функцией disable_caches();
Hello World
INIT_: work time 2310
INIT_F: work time 6406
INIT_DIV: work time 2566
MUL32: work time 4149506
MUL32F: work time 5681069
ADD__: work time 3639131
ADD_F: work time 5681006
INT_DIV: work time 12572443
INT_DIV_F: work time 11894062
BARREL_SHIFT: work time 52947
D_CACHE: work time 5890257
I_CACHE: work time 1807945
The End

с отключенной функцией disable_caches();

Hello World
INIT_: work time 2310
INIT_F: work time 6406
INIT_DIV: work time 2566
MUL32: work time 4149506
MUL32F: work time 5681069
ADD__: work time 3639131
ADD_F: work time 5681006
INT_DIV: work time 12572443
INT_DIV_F: work time 11894062
BARREL_SHIFT: work time 52947
D_CACHE: work time 5890257
I_CACHE: work time 1807945
The End

Потребление ресурсов ПЛИС модулем микроблейз:
Slice LUTs 2682, Slice Registers 1963, F7 Muxes 112, Slice 879, LUT as Logic 2494, LUT as Memory 188, BLOCK RAM 4, DSPs 6

TEST 9:

Select Processor Implementation 32 bits
Enable MicroBlaze Debug Module Interface false
Use Instruction and Data Cache true (4kb for each)
Enable Exeption true
Use Memory Management true
Enable Discrete Ports false
Enable Barrel Shifter true
Enable Floating Point Unit EXTENDED
Enable Integer Miltiplier MUL64
Enable Integer Divider true
Enable Additional Machine Status Register Instructions true
Enable Pattern Comparator true
Enable Reversed Load/Store and Swap Instructions true
Select Extendet Addresing NONE
Enable Branch Target Cache false
Branch Target Cache Size DEFAULT

Hello World
INIT_: work time 2310
INIT_F: work time 6406
INIT_DIV: work time 2566
MUL32: work time 4149506
MUL32F: work time 5681069
ADD__: work time 3639131
ADD_F: work time 5681006
INT_DIV: work time 12572443
INT_DIV_F: work time 11894062
BARREL_SHIFT: work time 52947
D_CACHE: work time 5890257
I_CACHE: work time 1807945
The End

Упали тайминги между кэшем инструкци и LMB память.

Потребление ресурсов ПЛИС модулем микроблейз:
Slice LUTs 3709, Slice Registers 3224, F7 Muxes 160, F8 Muxes 6, Slice 1344, LUT as Logic 3518, LUT as Memory 191,BLOCK RAM 5, DSPs 6

TEST 10:

Select Processor Implementation 32 bits
Enable MicroBlaze Debug Module Interface false
Use Instruction and Data Cache true (4kb for each)
Enable Exeption true
Use Memory Management true
Enable Discrete Ports false
Enable Barrel Shifter true
Enable Floating Point Unit EXTENDED
Enable Integer Miltiplier MUL64
Enable Integer Divider true
Enable Additional Machine Status Register Instructions true
Enable Pattern Comparator true
Enable Reversed Load/Store and Swap Instructions true
Select Extendet Addresing NONE
Enable Branch Target Cache false
Branch Target Cache Size DEFAULT

Hello World
INIT_: work time 2310
INIT_F: work time 6406
INIT_DIV: work time 2566
MUL32: work time 4149506
MUL32F: work time 5681069
ADD__: work time 3639131
ADD_F: work time 5681006
INT_DIV: work time 12572443
INT_DIV_F: work time 11894062
BARREL_SHIFT: work time 52947
D_CACHE: work time 5890257
I_CACHE: work time 1807945
The End

Для каждого кэша включил галочку Use Distributed RAM for Tags. Тайминги востановились
Потребление ресурсов ПЛИС модулем микроблейз:
Slice LUTs 4054, Slice Registers 3265, F7 Muxes 160, F8 Muxes 6, Slice 1473, LUT as Logic 3599, LUT as Memory 455,BLOCK RAM 3, DSPs 6

TEST 11:

Select Processor Implementation 32 bits
Enable MicroBlaze Debug Module Interface false
Use Instruction and Data Cache true (4kb for each)
Enable Exeption true
Use Memory Management true
Enable Discrete Ports false
Enable Barrel Shifter true
Enable Floating Point Unit EXTENDED
Enable Integer Miltiplier MUL64
Enable Integer Divider true
Enable Additional Machine Status Register Instructions true
Enable Pattern Comparator true
Enable Reversed Load/Store and Swap Instructions true
Select Extendet Addresing NONE
Enable Branch Target Cache true
Branch Target Cache Size 8 ENTRIES

Hello World
INIT_: work time 2054
INIT_F: work time 6150
INIT_DIV: work time 2310
MUL32: work time 4022131
MUL32F: work time 5553569
ADD__: work time 3511382
ADD_F: work time 5553631
INT_DIV: work time 12444694
INT_DIV_F: work time 11766313
BARREL_SHIFT: work time 52197
D_CACHE: work time 5378758
I_CACHE: work time 1775946
The End

Тайминги упали, сильнее чем в прошлый раз. Гдето внутри микроблейза, между памятями. "тотал негатив слэк" == -1307
Потребление ресурсов ПЛИС модулем микроблейз:
Slice LUTs 4296, Slice Registers 3488, F7 Muxes 165, F8 Muxes 6, Slice 1572, LUT as Logic 3775, LUT as Memory 521, BLOCK RAM 3, DSPs 6

TEST 12:

Select Processor Implementation 32 bits
Enable MicroBlaze Debug Module Interface false
Use Instruction and Data Cache true (4kb for each)
Enable Exeption true
Use Memory Management true
Enable Discrete Ports false
Enable Barrel Shifter true
Enable Floating Point Unit EXTENDED
Enable Integer Miltiplier MUL64
Enable Integer Divider true
Enable Additional Machine Status Register Instructions true
Enable Pattern Comparator true
Enable Reversed Load/Store and Swap Instructions true
Select Extendet Addresing NONE
Enable Branch Target Cache true
Branch Target Cache Size 512 ENTRIES

Параметр Line Length для каждого кэша поднял с 4 до 8.

Hello World
INIT_: work time 2054
INIT_F: work time 6150
INIT_DIV: work time 2310
MUL32: work time 4021757
MUL32F: work time 5553320
ADD__: work time 3511382
ADD_F: work time 5553257
INT_DIV: work time 12444694
INT_DIV_F: work time 11766313
BARREL_SHIFT: work time 51823
D_CACHE: work time 5378134
I_CACHE: work time 1775946
The End

Тайминги упали, но меньше чем в прошлый раз. "тотал негатив слэк" == -594
Потребление ресурсов ПЛИС модулем микроблейз:
Slice LUTs 4125, Slice Registers 3391, F7 Muxes 166, F8 Muxes 6, Slice 1497, LUT as Logic 3768, LUT as Memory 357, BLOCK RAM 3, DSPs 6

TEST 13:

Select Processor Implementation 32 bits
Enable MicroBlaze Debug Module Interface false
Use Instruction and Data Cache true (4kb for each)
Enable Exeption true
Use Memory Management true
Enable Discrete Ports false
Enable Barrel Shifter true
Enable Floating Point Unit EXTENDED
Enable Integer Miltiplier MUL64
Enable Integer Divider true
Enable Additional Machine Status Register Instructions true
Enable Pattern Comparator true
Enable Reversed Load/Store and Swap Instructions true
Select Extendet Addresing NONE
Enable Branch Target Cache true
Branch Target Cache Size 512 ENTRIES

Параметр Line Length для каждого кэша поднял до 16.

для параметра "Enable Exeption" включил следующие пункты:
Enable Floating Point Unit Exceptions
Enable Integer Divide Exception
Enable Instruction-side AXI Exeption
Enable Data-side AXI Exception
Enable Illegal Instruction Exeption
Enable Unaligned Data Exeption
Generate Illegal Instruction for NULL Instruction

Hello World
INIT_: work time 2054
INIT_F: work time 6150
INIT_DIV: work time 2310
MUL32: work time 4021757
MUL32F: work time 5553320
ADD__: work time 3511382
ADD_F: work time 5553315
INT_DIV: work time 12444694
INT_DIV_F: work time 11766563
BARREL_SHIFT: work time 51823
D_CACHE: work time 5378134
I_CACHE: work time 1775946
The End

Тайминги упали. "тотал негатив слэк" == -964
Потребление ресурсов ПЛИС модулем микроблейз:
Slice LUTs 4098, Slice Registers 3500, F7 Muxes 182, F8 Muxes 7, Slice 1439, LUT as Logic 3794, LUT as Memory 304, BLOCK RAM 4, DSPs 6

Время сборки проекта 7 минут. хотя кажется дольше. Перегенерация икроблейза занимает еще 3 минуты, так что всего 10 минут время сборки. на этом тесте.

TEST 14:

Select Processor Implementation 64 bits
Enable MicroBlaze Debug Module Interface false
Use Instruction and Data Cache true (4kb for each)
Enable Exeption true
Use Memory Management true
Enable Discrete Ports false
Enable Barrel Shifter true
Enable Floating Point Unit EXTENDED
Enable Integer Miltiplier MUL64
Enable Integer Divider true
Enable Additional Machine Status Register Instructions true
Enable Pattern Comparator true
Enable Reversed Load/Store and Swap Instructions true
Select Extendet Addresing NONE
Enable Branch Target Cache true
Branch Target Cache Size 512 ENTRIES

Параметр Line Length для каждого кэша 16.

для параметра "Enable Exeption" включил следующие пункты:
Enable Floating Point Unit Exceptions
Enable Integer Divide Exception
Enable Instruction-side AXI Exeption
Enable Data-side AXI Exception
Enable Illegal Instruction Exeption
Enable Unaligned Data Exeption
Generate Illegal Instruction for NULL Instruction

Результатов нет. видимо проблема в битности системы.

На частоте 100 МГц тайминги упали. "тотал негатив слэк" == -1912, поэтому для этого теста понижаю частоту до 50 МГц и вот результат. Тайминги встали.
Потребление ресурсов ПЛИС модулем микроблейз:
Slice LUTs 6602, Slice Registers 4738, F7 Muxes 220, F8 Muxes 5, Slice 2188, LUT as Logic 6176, LUT as Memory 426, BLOCK RAM 5, DSPs 13 значения ресурсов при 100 МГц
Slice LUTs 6577, Slice Registers 4595, F7 Muxes 220, F8 Muxes 5, Slice 2157, LUT as Logic 6157, LUT as Memory 426, BLOCK RAM 5, DSPs 13 значения ресурсов при 50 МГц

TEST 15:

Select Processor Implementation 32 bits
Enable MicroBlaze Debug Module Interface false
Use Instruction and Data Cache false
Enable Exeption true
Use Memory Management true
Enable Discrete Ports false
Enable Barrel Shifter true
Enable Floating Point Unit EXTENDED
Enable Integer Miltiplier MUL64
Enable Integer Divider true
Enable Additional Machine Status Register Instructions true
Enable Pattern Comparator true
Enable Reversed Load/Store and Swap Instructions true
Select Extendet Addresing NONE
Enable Branch Target Cache false
Branch Target Cache Size 512 ENTRIES

для параметра "Enable Exeption" включил следующие пункты:
Enable Floating Point Unit Exceptions
Enable Integer Divide Exception
Enable Instruction-side AXI Exeption
Enable Data-side AXI Exception
Enable Illegal Instruction Exeption
Enable Unaligned Data Exeption
Generate Illegal Instruction for NULL Instruction

Hello World
INIT_: work time 2308
INIT_F: work time 6405
INIT_DIV: work time 2565
MUL32: work time 4149505
MUL32F: work time 5681068
ADD__: work time 3639130
ADD_F: work time 5681062
INT_DIV: work time 12572442
INT_DIV_F: work time 11894311
BARREL_SHIFT: work time 52946
D_CACHE: work time 5890256
I_CACHE: work time 1807944
The End

Потребление ресурсов ПЛИС модулем микроблейз:
Slice LUTs 3099, Slice Registers 2671, F7 Muxes 171, F8 Muxes 6, Slice 1079, LUT as Logic 2987, LUT as Memory 112, BLOCK RAM 1, DSPs 6

TEST 16:

Все параметры остались прежними, это будет видно ниже. кроме одного, я поднял частоту до 200 МГц, и если результаты этого теста(16 по счету) будут идентичными с тестом 15(прерыдущим), значит можно сделать вывод что вся система линейно поднимает производительность в зависимости от тактирующей частоты. Так как и таймер и процессор работают на одинаковой частоте и они не различают длительность такта они различают лишь срабатывание переключения тактирующегто сигнала. Но если показатели будут значительно отличаться значит в МикроБлейзе имеются механизмы которые асинхронные и на прямую не зависят от тактирующего сигнала.

Select Processor Implementation 32 bits
Enable MicroBlaze Debug Module Interface false
Use Instruction and Data Cache false
Enable Exeption true
Use Memory Management true
Enable Discrete Ports false
Enable Barrel Shifter true
Enable Floating Point Unit EXTENDED
Enable Integer Miltiplier MUL64
Enable Integer Divider true
Enable Additional Machine Status Register Instructions true
Enable Pattern Comparator true
Enable Reversed Load/Store and Swap Instructions true
Select Extendet Addresing NONE
Enable Branch Target Cache false
Branch Target Cache Size 512 ENTRIES

для параметра "Enable Exeption" включил следующие пункты:
Enable Floating Point Unit Exceptions
Enable Integer Divide Exception
Enable Instruction-side AXI Exeption
Enable Data-side AXI Exception
Enable Illegal Instruction Exeption
Enable Unaligned Data Exeption
Generate Illegal Instruction for NULL Instruction

Hello World
INIT_: work time 2308
INIT_F: work time 6405
INIT_DIV: work time 2565
MUL32: work time 4149505
MUL32F: work time 5681068
ADD__: work time 3639130
ADD_F: work time 5681062
INT_DIV: work time 12572442
INT_DIV_F: work time 11894311
BARREL_SHIFT: work time 52946
D_CACHE: work time 5890256
I_CACHE: work time 1807944
The End

Тайминги упали. "тотал негатив слэк" == -10307

Потребление ресурсов ПЛИС модулем микроблейз:
Slice LUTs 3170, Slice Registers 2779, F7 Muxes 171, F8 Muxes 6, Slice 1041, LUT as Logic 3058, LUT as Memory 112, BLOCK RAM 1, DSPs 6

TEST 17:

Еще раз повторяю тот же самый тест что и предыдущие разы, но с частотой в 50 МГц. Важно будет сравнить показатели этих трех тестов. Я оЖидаю что значения тестов будут сопостовимы между собой. Если нет то это привлечет большое внимание.

Select Processor Implementation 32 bits
Enable MicroBlaze Debug Module Interface false
Use Instruction and Data Cache false
Enable Exeption true
Use Memory Management true
Enable Discrete Ports false
Enable Barrel Shifter true
Enable Floating Point Unit EXTENDED
Enable Integer Miltiplier MUL64
Enable Integer Divider true
Enable Additional Machine Status Register Instructions true
Enable Pattern Comparator true
Enable Reversed Load/Store and Swap Instructions true
Select Extendet Addresing NONE
Enable Branch Target Cache false
Branch Target Cache Size 512 ENTRIES

для параметра "Enable Exeption" включил следующие пункты:
Enable Floating Point Unit Exceptions
Enable Integer Divide Exception
Enable Instruction-side AXI Exeption
Enable Data-side AXI Exception
Enable Illegal Instruction Exeption
Enable Unaligned Data Exeption
Generate Illegal Instruction for NULL Instruction

Hello World
INIT_: work time 2308
INIT_F: work time 6405
INIT_DIV: work time 2565
MUL32: work time 4149505
MUL32F: work time 5681068
ADD__: work time 3639130
ADD_F: work time 5681062
INT_DIV: work time 12572442
INT_DIV_F: work time 11894311
BARREL_SHIFT: work time 52946
D_CACHE: work time 5890256
I_CACHE: work time 1807944
The End

Потребление ресурсов ПЛИС модулем микроблейз:
Slice LUTs 3095, Slice Registers 2613, F7 Muxes 171, F8 Muxes 6, Slice 1104, LUT as Logic 2983, LUT as Memory 112, BLOCK RAM 1, DSPs 6

TEST 18:

Select Processor Implementation 32 bits
Enable MicroBlaze Debug Module Interface false
Use Instruction and Data Cache false
Enable Exeption false
Use Memory Management false
Enable Discrete Ports false
Enable Barrel Shifter false
Enable Floating Point Unit NONE
Enable Integer Miltiplier NONE
Enable Integer Divider true
Enable Additional Machine Status Register Instructions false
Enable Pattern Comparator false
Enable Reversed Load/Store and Swap Instructions true
Select Extendet Addresing NONE
Enable Branch Target Cache false
Branch Target Cache Size DEFAULT

Hello World
INIT_: work time 2564
INIT_F: work time 350733
INIT_DIV: work time 2821
MUL32: work time 18523530
MUL32F: work time 233098629
ADD__: work time 4149755
ADD_F: work time 160816062
INT_DIV: work time 13083005
INT_DIV_F: work time 202886883
BARREL_SHIFT: work time 277071
D_CACHE: work time 13947881
I_CACHE: work time 30481681
The End

Потребление ресурсов ПЛИС модулем микроблейз:
Slice LUTs 1031, Slice Registers 1006, F7 Muxes 108, Slice 400, LUT as Logic 927, LUT as Memory 103

TEST 19:

Select Processor Implementation 32 bits
Enable MicroBlaze Debug Module Interface false
Use Instruction and Data Cache false
Enable Exeption false
Use Memory Management false
Enable Discrete Ports false
Enable Barrel Shifter false
Enable Floating Point Unit BASIC
Enable Integer Miltiplier NONE
Enable Integer Divider false
Enable Additional Machine Status Register Instructions false
Enable Pattern Comparator false
Enable Reversed Load/Store and Swap Instructions "не помню какое было значение"
Select Extendet Addresing NONE
Enable Branch Target Cache false
Branch Target Cache Size DEFAULT

Hello World
INIT_: work time 2564
INIT_F: work time 78286
INIT_DIV: work time 2821
MUL32: work time 18523530
MUL32F: work time 6191692
ADD__: work time 4149755
ADD_F: work time 6191630
INT_DIV: work time 107306028
INT_DIV_F: work time 12404624
BARREL_SHIFT: work time 277071
D_CACHE: work time 13947881
I_CACHE: work time 10377677
The End

Потребление ресурсов ПЛИС модулем микроблейз:
Slice LUTs 1541, Slice Registers 1320, F7 Muxes 114, Slice 558, LUT as Logic 1427, LUT as Memory 114, DSPs 2

TEST 20:

Select Processor Implementation 32 bits
Enable MicroBlaze Debug Module Interface false
Use Instruction and Data Cache false
Enable Exeption false
Use Memory Management false
Enable Discrete Ports false
Enable Barrel Shifter false
Enable Floating Point Unit NONE
Enable Integer Miltiplier MUL32
Enable Integer Divider false
Enable Additional Machine Status Register Instructions false
Enable Pattern Comparator false
Enable Reversed Load/Store and Swap Instructions false
Select Extendet Addresing NONE
Enable Branch Target Cache false
Branch Target Cache Size DEFAULT

Hello World
INIT_: work time 2564
INIT_F: work time 256899
INIT_DIV: work time 2821
MUL32: work time 4660130
MUL32F: work time 180739461
ADD__: work time 4149755
ADD_F: work time 150674185
INT_DIV: work time 107306028
INT_DIV_F: work time 190821576
BARREL_SHIFT: work time 277071
D_CACHE: work time 6146256
I_CACHE: work time 23077716
The End

Потребление ресурсов ПЛИС модулем микроблейз:
Slice LUTs 984, Slice Registers 909, F7 Muxes 108, Slice 386, LUT as Logic 881, LUT as Memory 103, DSPs 3

TEST 21:

Select Processor Implementation 32 bits
Enable MicroBlaze Debug Module Interface false
Use Instruction and Data Cache false
Enable Exeption true
Use Memory Management false
Enable Discrete Ports false
Enable Barrel Shifter false
Enable Floating Point Unit NONE
Enable Integer Miltiplier NONE
Enable Integer Divider true
Enable Additional Machine Status Register Instructions false
Enable Pattern Comparator false
Enable Reversed Load/Store and Swap Instructions false
Select Extendet Addresing NONE
Enable Branch Target Cache false
Branch Target Cache Size DEFAULT

Hello World
INIT_: work time 2564
INIT_F: work time 350733
INIT_DIV: work time 2821
MUL32: work time 18523530
MUL32F: work time 233098629
ADD__: work time 4149755
ADD_F: work time 160816062
INT_DIV: work time 13083005
INT_DIV_F: work time 202886883
BARREL_SHIFT: work time 277071
D_CACHE: work time 13947881
I_CACHE: work time 30481681
The End

Потребление ресурсов ПЛИС модулем микроблейз:
Slice LUTs 1031, Slice Registers 1006, F7 Muxes 108, Slice 400, LUT as Logic 927, LUT as Memory 104

Комментарии (3)


  1. Strijar
    26.08.2025 13:26

    В голосовании нет возможности выбрать 2 варианта. У меня MicroBlaze работает DSP сопроцессором рядом с ARM внутри Zynq (: Возможно сделаю статью про это


    1. yamifa_1234 Автор
      26.08.2025 13:26

      статья это хорошо!) тем более действительно возникли вопросы о том почему микроблейз как DSP процессор. что он такое выполняет и почему это не реализовать в логике ПЛИС.
      P.S. а то что вашего варианта нет в голосовании, то я даже не ожидал что такая связка будет.


  1. KurtkaBeyn
    26.08.2025 13:26

    Вопрос с кешами, думаю, надо проработать)

    Ещё было бы удобнее если бы код был выложен где-то на гите вместе с сырыми результатами, а здесь уже только ссылки на файлы. Либо продублировать. Если кто-то захочет повторить, то копировать отсюда не очень удобно.