Skip to content

Commit

Permalink
Merge branch 'MPSU:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
gr33nka committed Sep 29, 2023
2 parents 7e467c6 + 23a3119 commit 403cac5
Show file tree
Hide file tree
Showing 57 changed files with 8,357 additions and 11,017 deletions.
56 changes: 56 additions & 0 deletions .github/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Summary

[Порядок выполнения лабораторных работ для групп](index.md)
[Что такое Язык Описания Аппаратуры](Introduction/What%20is%20HDL.md)
[Как работает ПЛИС](Introduction/How%20FPGA%20works.md)

---

# Цикл лабораторных работ

- [Лабораторная №1. Сумматор](Labs/01.%20Adder/README.md)
- [Лабораторная №2. АЛУ](Labs/02.%20Arithmetic-logic%20unit/README.md)
- [Лабораторная №3. Регистровый файл и внешняя память](Labs/03.%20Register%20file%20and%20memory/README.md)
- [Лабораторная №4. Простейшее программируемое устройство](Labs/04.%20Primitive%20programmable%20device/README.md)
- [Лабораторная №5. Основной дешифратор](Labs/05.%20Main%20decoder/README.md)
- [Лабораторная №6. Тракт данных](Labs/06.%20Datapath/README.md)
- [Лабораторная №7. Внешняя память]()
- [Лабораторная №8. Блок загрузки и сохранения](Labs/08.%20Load-store%20unit/README.md)
- [Лабораторная №9. Интеграция LSU](Labs/09.%20LSU%20Integration/README.md)
- [Лабораторная №10. Подсистема прерываний](Labs/10.%20Interrupt%20subsystem/README.md)
- [Лабораторная №11. Интеграция подсистемы прерываний](Labs/11.%20Interrupt%20integration/README.md)
- [Лабораторная №12. Периферийные устройства](Labs/12.%20Peripheral%20units/README.md)
- [Лабораторная №13. Программирование](Labs/13.%20Programming/README.md)

---

# Базовые структуры языка SystemVerilog

- [Модули](Basic%20Verilog%20structures/Modules.md)
- [Мультиплексоры](Basic%20Verilog%20structures/Multiplexors.md)
- [Регистры](Basic%20Verilog%20structures/Registers.md)
- [Конкатенация](Basic%20Verilog%20structures/Concatenation.md)
- [Контроллеры](Basic%20Verilog%20structures/Controllers.md)
- [Тестовое окружение](Basic%20Verilog%20structures/Testbench.md)

---

# Основы Vivado

- [Руководство по установке Vivado](Vivado%20Basics/Install%20Vivado.md)
- [Создание проекта в Vivado](Vivado%20Basics/Vivado%20trainer.md)
- [Структура директорий в проекте Vivado](Vivado%20Basics/Folder%20Structure%20In%20The%20Project.md)
- [Как сгенерировать схему](Vivado%20Basics/How%20to%20open%20a%20schematic.md)
- [Ошибки элаборации](Vivado%20Basics/Elaboration%20failed.md)
- [Шаги имплементации](Vivado%20Basics/Implementation%20steps.md)
- [Запуск симуляции](Vivado%20Basics/Run%20Simulation.md)
- [Руководство по поиску ошибок](Vivado%20Basics/Debug%20manual.md)
- [Руководство по прошивке ПЛИС](Vivado%20Basics/Program%20nexys%20a7.md)
- [Заголовочные файлы в Verilog](Vivado%20Basics/Verilog%20Header.md)
- [Как добавить файл, инициализирующий память](Vivado%20Basics/How%20to%20add%20a%20mem-file.md)

# Остальное

- [RV32I - Стандартный набор целочисленных инструкций RISC-V](Other/rv32i.md)
- [Список типичных ошибок при работе с Vivado и SystemVerilog](Other/FAQ.md)
- [Студенческий сервер](Other/Students%20server.md)
6 changes: 6 additions & 0 deletions .github/book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[book]
authors = ["Andrei Solodovnikov"]
language = "ru"
multilingual = true
src = "./"
title = "Архитектуры процессорных систем"
49 changes: 49 additions & 0 deletions .github/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Курс лабораторных работ

## Полезное

- [Студенческий сервер](Other/Students%20server.md)
- [Создание базового проекта с прошивкой ПЛИС в Vivado](Vivado%20Basics/Vivado%20trainer.md)
- [Базовые конструкции Verilog](Basic%20Verilog%20structures/)
- [Список типичных ошибок в Vivado и SystemVerilog](Other/FAQ.md)
- [Тестовое окружение](Basic%20Verilog%20structures/Testbench.md)

## Порядок выполнения лабораторных работ для групп

### ИБ, ИКТ, КТ, РТ

1. Сумматор ([01. Adder](Labs/01.%20Adder))
2. АЛУ ([02. Arithmetic-logic unit](Labs/02.%20Arithmetic-logic%20unit))
3. Регистровый файл и внешняя память ([03. Register file and memory](Labs/03.%20Register%20file%20and%20memory))
4. Простейшее программируемое устройство ([04. Primitive programmable device](Labs/04.%20Primitive%20programmable%20device))

### ПИН, ПМ

1. Сумматор ([01. Adder](Labs/01.%20Adder))
2. АЛУ ([02. Arithmetic-logic unit](Labs/02.%20Arithmetic-logic%20unit))
3. Регистровый файл и внешняя память ([03. Register file and memory](Labs/03.%20Register%20file%20and%20memory))
4. Простейшее программируемое устройство ([04. Primitive programmable device](Labs/04.%20Primitive%20programmable%20device))
5. Основной дешифратор ([05. Main decoder](Labs/05.%20Main%20decoder))
6.
1. Тракт данных ([06. Datapath](Labs/06.%20Datapath))
2. Интеграция блока загрузки и сохранения ([09. LSU Integration](Labs/09.%20LSU%20Integration))
3. Интеграция подсистемы прерываний ([11. Interrupt Integration](Labs/11.%20Interrupt%20integration))
7. Периферийные устройства ([12. Peripheral units](Labs/12.%20Peripheral%20units))
8. Программирование ([13. Programming](Labs/13.%20Programming))

### ИВТ

1. АЛУ ([02. Arithmetic-logic unit](Labs/02.%20Arithmetic-logic%20unit))
2.
1. Память ([03. Register file and memory](Labs/03.%20Register%20file%20and%20memory)),
2. Простейшее программируемое устройство ([04. Primitive programmable device](Labs/04.%20Primitive%20programmable%20device))
3. Основной дешифратор ([05. Main decoder](Labs/05.%20Main%20decoder))
4. Тракт данных ([06. Datapath](Labs/06.%20Datapath))
5.
1. Модуль загрузки и сохранения ([08. Load-store unit](Labs/08.%20Load-store%20unit))
2. Интеграция блока загрузки и сохранения ([09. LSU Integration](Labs/09.%20LSU%20Integration))
6.
1. Контроллер прерываний ([10. Interrupt subsystem](Labs/10.%20Interrupt%20subsystem))
2. Интеграция подсистемы прерываний ([11. Interrupt Integration](Labs/11.%20Interrupt%20integration))
7. Периферийные устройства ([12. Peripheral units](Labs/12.%20Peripheral%20units))
8. Программирование ([13. Programming](Labs/13.%20Programming))
4 changes: 4 additions & 0 deletions .github/prepare.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

mkdir src
cp .github/book.toml .github/SUMMARY.md .github/index.md ./
62 changes: 62 additions & 0 deletions .github/workflows/mdbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Sample workflow for building and deploying a mdBook site to GitHub Pages
#
# To get started with mdBook see: https://rust-lang.github.io/mdBook/index.html
#
name: Deploy mdBook site to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
env:
MDBOOK_VERSION: 0.4.21
steps:
- uses: actions/checkout@v3
- name: Install mdBook
run: |
chmod +x .github/prepare.sh
.github/prepare.sh
mkdir bin
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.34/mdbook-v0.4.34-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
bin/mdbook build
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Build with mdBook
run: bin/mdbook build
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./book

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
Binary file modified .pic/Labs/lab_12_periph/fig_01.drawio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed .pic/Labs/lab_12_periph/fig_02.drawio.png
Binary file not shown.
Binary file added .pic/Labs/lab_12_periph/fig_02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .pic/Labs/lab_12_periph/fig_02.xlsx
Binary file not shown.
Binary file added .pic/Other/Further readings/arm.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .pic/Other/Further readings/code.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .pic/Other/Further readings/digitaldesign.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .pic/Other/Further readings/harris.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .pic/Other/Further readings/manga.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .pic/Other/Further readings/orlov.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .pic/Other/Further readings/patterson1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .pic/Other/Further readings/patterson2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .pic/Other/Further readings/svbook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .pic/Other/Further readings/tanenbaum.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .pic/Other/Further readings/vt.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions Basic Verilog structures/Controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Для того, чтобы лучше понять, что от вас требуется в рамках лабораторной работы по периферийным устройствам, рассмотрим процесс разработки структурной схемы (не SystemVerilog-описания) для контроллера светодиодов.

В первую очередь, здесь будет продублирована выдержка из спецификации на этот контроллер (общая часть раздела "[Описание контроллеров периферийных устройств](../../Labs/7.%20Peripheral%20units/README.md#описание-контроллеров-периферийных-устройств)", а также подраздел "[Светодиоды](../../Labs/7.%20Peripheral%20units/README.md#светодиоды)"):
В первую очередь, здесь будет продублирована выдержка из спецификации на этот контроллер (общая часть раздела "[Описание контроллеров периферийных устройств](../Labs/12.%20Peripheral%20units/README.md#описание-контроллеров-периферийных-устройств)", а также подраздел "[Светодиоды](../Labs/12.%20Peripheral%20units/README.md#светодиоды)"):

## Спецификация контроллера

Expand All @@ -28,7 +28,7 @@

В случае отсутствия **запроса на чтения**, на выход `read_data_o` должно подаваться значение `32'hfa11_1eaf`. Это никак не повлияет на работу процессора, но будет удобно в процессе отладки на временной диаграмме (тоже самое было сделано в процессе разработки памяти данных).

Если пришел **запрос на запись** или **чтение**, это еще не значит, что контроллер должен его выполнить. В случае, если запрос происходит по адресу, не поддерживающему этот запрос (например **запрос на запись** по адресу поддерживающему только чтение или наоборот), данный запрос должен игнорироваться, а на выходе `read_data_o` должно появиться значение `32'hdead_beef`.
Если пришел **запрос на запись** или **чтение**, это еще не значит, что контроллер должен его выполнить. В случае, если запрос происходит по адресу, не поддерживающему этот запрос (например **запрос на запись** по адресу поддерживающему только чтение), данный запрос должен игнорироваться. В случае **запроса на чтение** по недоступному адресу, на выходе `read_data_o` должно появиться значение `32'hdead_beef`.

К примеру, в случае запроса на чтение по адресу `0x0100004` (четвертый байт в адресном пространстве периферийного устройства "переключатели"), на выходе `read_data_o` должно оказаться значение `32'hdead_beef`. В случае отсутствия запроса на чтение (`req_i == 0` или `write_enable_i == 1`), на выходе `read_data_o` контроллера переключателей должно оказаться значение `32'hfa11_1eaf`.

Expand Down
2 changes: 1 addition & 1 deletion Basic Verilog structures/Multiplexors.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ end

```SystemVerilog
logic Y;
always @(*) begin
always_comb begin
case(S) // Описываем блок case, где значение сигнала S
// будет сравниваться с различными возможными его значениями
1'b0: Y <= D0; // Если S==0, то Y = D0
Expand Down
8 changes: 4 additions & 4 deletions Labs/01. Adder/board files/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@

После этого наше устройство будет выглядеть так:

![../../../.pic/Labs/board%20files/board%20files/nexys_adder1.png](../../../.pic/Labs/board%20files/board%20files/nexys_adder1.png)
![../../../.pic/Labs/board%20files/nexys_adder1.png](../../../.pic/Labs/board%20files/nexys_adder1.png)

Подключенное окружение позволяет производить ввод входных значений (А, В и Pin) с помощью переключателей (номер переключателя отображен на самом краю платы), расположенных на плате. Операнд А задается переключателями 15-8, В: 7-0, Pin: тактовая кнопка BTND (нижняя из 5-ти, расположенных вместе в форме крестовины). Семисегментные индикаторы в шестнадцатиричном формате отображают на левом блоке слагаемые А и В, а на правом - результат сложения. На светодиодах, расположенных над переключателями отображается результат в двоичном формате.

Управление сумматором через плату

![../../../.pic/Labs/board%20files/board%20files/nexys_adder2.png](../../../.pic/Labs/board%20files/board%20files/nexys_adder2.png)
![../../../.pic/Labs/board%20files/nexys_adder2.png](../../../.pic/Labs/board%20files/nexys_adder2.png)

Для прошивки ПЛИС подключите утройство через USB, включите питание переключателем, выполните синтез и имплементацию вашего дизайна и сгенерируйте битстрим. Если на этом этапе у вас возникают ошибки, постарайтесь исправить из с помощью [`инструкции по работе с ошибками синтеза`](../../../Vivado%20Basics/Elaboration%20failed.md). После этого выберите в левом меню `Open Target` - `Auto Connect`, затем `Program Device` и ваше устройство прошьется.

Генерация битстрима
![../../../.pic/Labs/board%20files/board%20files/Program_Device1.png](../../../.pic/Labs/board%20files/board%20files/Program_Device1.png)
![../../../.pic/Labs/board%20files/Program_Device1.png](../../../.pic/Labs/board%20files/Program_Device1.png)

Прошивка ПЛИС
![../../../.pic/Labs/board%20files/board%20files/Program_Device2.png](../../../.pic/Labs/board%20files/board%20files/Program_Device2.png)
![../../../.pic/Labs/board%20files/Program_Device2.png](../../../.pic/Labs/board%20files/Program_Device2.png)

Попробуйте выставить на переключателях различные слагаемые, убедитесь, что все работает исправно и сдавайте работу.
12 changes: 6 additions & 6 deletions Labs/01. Adder/board files/nexys_adder.sv
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ reg [15:0] LEDr;

fulladder32 DUT
(
.A (A),
.B (B),
.Pin (Pin),
.a_i (A),
.b_i (B),
.carry_i (Pin),

.S (S),
.Pout (Pout)
.sum_o (S),
.carry_o (Pout)
);

assign B = {24'b0,SW[7:0]};
Expand Down Expand Up @@ -127,4 +127,4 @@ always @(posedge CLK100) begin
end
end

endmodule
endmodule
2 changes: 1 addition & 1 deletion Labs/01. Adder/tb_fulladder32.sv
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
//////////////////////////////////////////////////////////////////////////////////

module tb_fulladder32();

`define __debug__
parameter TIME_OPERATION = 100;
parameter TEST_VALUES = 3000;

Expand Down
Loading

0 comments on commit 403cac5

Please sign in to comment.