mirror of
https://github.com/MPSU/APS.git
synced 2026-06-10 11:13:33 +00:00
English version draft
Assisted-by: Claude:claude-4.6-sonnet
This commit is contained in:
@@ -1,99 +1,99 @@
|
||||
# Менеджер проекта (Project Manager)
|
||||
# Project Manager
|
||||
|
||||
Окно Project Manager позволяет управлять проектом: добавлять и редактировать исходные коды проекта, изучить краткое ревью по утилизации ресурсов ПЛИС, используемых для реализации проекта, просматривать логи и сообщения о результатах сборки проекта и многое другое.
|
||||
The Project Manager window allows you to manage the project: add and edit project source files, view a brief summary of FPGA resource utilization, browse build logs and messages, and much more.
|
||||
|
||||
В первую очередь нас интересует окно исходных кодов проекта, которое называется `Design Sources` и представлено на _рис. 1_.
|
||||
The primary area of interest is the project sources window, called `Design Sources`, shown in _Fig. 1_.
|
||||
|
||||
## Окно Design Sources
|
||||
## The Design Sources Window
|
||||
|
||||
Данное окно находится по умолчанию в верхнем левом углу окна Project Manager (в случае, если вы случайно закрыли это окно, вы можете вернуть его обратно через меню `Windows->Sources`).
|
||||
By default, this window is located in the upper-left corner of the Project Manager window. If you accidentally close it, you can restore it via the `Windows -> Sources` menu.
|
||||
|
||||

|
||||
|
||||
_Рисунок 1. Окно исходных кодов проекта._
|
||||
_Figure 1. Project sources window._
|
||||
|
||||
Данное окно разделено на три вкладки:
|
||||
The window is divided into three tabs:
|
||||
|
||||
1. Иерархия (Hierarchy)
|
||||
2. Библиотеки (Libraries)
|
||||
3. Порядок сборки (Compile Order)
|
||||
1. Hierarchy
|
||||
2. Libraries
|
||||
3. Compile Order
|
||||
|
||||
В определенных ситуациях в данном окне может появиться и вкладка IP Cores, но в рамках данного курса она нас не интересует.
|
||||
In certain situations, an IP Cores tab may also appear, but it is not relevant for this course.
|
||||
|
||||
Рассмотрим по порядку данные вкладки.
|
||||
Let us review each tab in order.
|
||||
|
||||
### Вкладка Hierarchy
|
||||
### The Hierarchy Tab
|
||||
|
||||
Данная вкладка состоит из четырёх "папок":
|
||||
This tab contains four "folders":
|
||||
|
||||
1. Design Sources;
|
||||
2. Constraints;
|
||||
3. Simulation Sources;
|
||||
4. Utility Sources.
|
||||
1. Design Sources
|
||||
2. Constraints
|
||||
3. Simulation Sources
|
||||
4. Utility Sources
|
||||
|
||||
В рамках текущего курса лабораторных работ мы будем взаимодействовать только с первыми тремя из них.
|
||||
During this course, we will only work with the first three.
|
||||
|
||||
Помните, что несмотря на использование слова "папка", речь идет не о директориях операционной системы. Папки проекта — это всего лишь удобная абстракция для управления иерархией проекта.
|
||||
Note that despite the use of the word "folder", these are not file system directories. Project folders are simply a convenient abstraction for managing the project hierarchy.
|
||||
|
||||
В папке `Design Sources` строится иерархия проектируемых модулей (исходников цифровых схем, которые в будущем могут быть воспроизведены в ПЛИС или заказной микросхеме).
|
||||
The `Design Sources` folder holds the hierarchy of design modules — source files for digital circuits that may eventually be synthesized to an FPGA or an application-specific integrated circuit (ASIC).
|
||||
|
||||
Папка `Constraints` содержит файлы ограничений, помогающих реализовать проект на конкретной ПЛИС (см. ["Этапы реализации проекта в ПЛИС"](../Introduction/Implementation%20steps.md#implementation)).
|
||||
The `Constraints` folder contains constraint files that help implement the project on a specific FPGA (see ["FPGA Implementation Steps"](../Introduction/Implementation%20steps.md#implementation)).
|
||||
|
||||
`Simulation Sources` хранит в себе иерархию верификационного окружения, **включая модули из папки** `Design Sources` — т.е. все модули (как синтезируемые, так и не синтезируемые), которые будут использованы при моделировании.
|
||||
`Simulation Sources` stores the hierarchy of the verification environment, **including modules from the** `Design Sources` folder — that is, all modules (both synthesizable and non-synthesizable) that will be used during simulation.
|
||||
|
||||
> Обратите внимание на то, что вкладка `Hierarchy` не содержит файлов. Здесь отображается иерархия модулей проекта. Один модуль может быть использован несколько раз — и в этом случае он будет столько же раз отображён в иерархии, хотя файл, хранящий описание этого модуля останется один (см. _рис. 6_).
|
||||
> Note that the `Hierarchy` tab does not show files. It displays the module hierarchy of the project. A single module can be instantiated multiple times — in that case it will appear multiple times in the hierarchy, even though the file describing that module remains a single file (see _Fig. 6_).
|
||||
|
||||
#### Добавление файла в проект
|
||||
#### Adding a File to the Project
|
||||
|
||||
Для того, чтобы добавить в проект новый файл, необходимо нажать на значок `+`, расположенный в верхней части окна `Sources` (либо использовать комбинацию горячих клавиш `Alt+A`).
|
||||
To add a new file to the project, click the `+` icon at the top of the `Sources` window (or use the keyboard shortcut `Alt+A`).
|
||||
|
||||
Появится окно добавления исходников. На первой странице этого окна будет необходимо выбрать тип добавляемого файла (см. _рис. 2_).
|
||||
The Add Sources dialog will appear. On the first page, select the type of file to add (see _Fig. 2_):
|
||||
|
||||
- файлы ограничений для синтеза схемы под конкретную ПЛИС (`Constraints`);
|
||||
- файлы проектируемой схемы (`Design Sources`);
|
||||
- файлы верификационного окружения проектируемой схемы (`Simulation Sources`).
|
||||
- Constraint files for synthesizing the design to a specific FPGA (`Constraints`);
|
||||
- Design source files (`Design Sources`);
|
||||
- Verification environment files (`Simulation Sources`).
|
||||
|
||||

|
||||
|
||||
_Рисунок 2. Первая страница окна добавления исходников._
|
||||
_Figure 2. First page of the Add Sources dialog._
|
||||
|
||||
В первую очередь мы хотим описать какую-нибудь простую схему, поэтому необходимо убедиться, что активным выбран пункт `Design Sources`. Выбрав, нажимаем `Next`.
|
||||
Since we want to describe a simple circuit first, make sure `Design Sources` is selected, then click `Next`.
|
||||
|
||||
Появится страница, представленная на _рис. 3_, которая предлагает три варианта добавления исходников.
|
||||
The page shown in _Fig. 3_ will appear, offering three options for adding sources:
|
||||
|
||||
1. добавить существующий файл;
|
||||
2. добавить все имеющиеся файлы в заданной директории;
|
||||
3. создать новый файл.
|
||||
1. Add an existing file;
|
||||
2. Add all files in a specified directory;
|
||||
3. Create a new file.
|
||||
|
||||

|
||||
|
||||
_Рисунок 3. Вторая страница окна добавления исходников._
|
||||
_Figure 3. Second page of the Add Sources dialog._
|
||||
|
||||
Создадим новый файл, нажав на соответствующую кнопку окна. Появится всплывающее окно, предлагающее выбрать тип файла и его имя (см. _рис. 4_). В поле `File Type` выберите `SystemVerilog` (этот тип будет использоваться в качестве основного на протяжении всего курса кроме случаев, когда будет сказано иное). В поле `File Name` задайте имя новому файлу (в рамках примера, имя файла будет `max_min`). Указывать расширение файла не нужно — САПР автоматически его добавит в зависимости от выбранного типа файла. Когда всё будет готово, нажмите на `OK`. После того, как были добавлены (или созданы) все необходимые источники, можно нажать кнопку `Finish` в окне `Add Sources`.
|
||||
Create a new file by clicking the corresponding button. A pop-up window will appear asking you to choose the file type and name (see _Fig. 4_). In the `File Type` field, select `SystemVerilog` (this type will be used throughout the course unless stated otherwise). In the `File Name` field, enter a name for the new file (in this example, the file name will be `max_min`). You do not need to specify a file extension — the EDA tool will add it automatically based on the selected file type. When ready, click `OK`. After all required sources have been added (or created), click `Finish` in the `Add Sources` dialog.
|
||||
|
||||

|
||||
|
||||
_Рисунок 4. Окно создания нового файла._
|
||||
_Figure 4. New file creation dialog._
|
||||
|
||||
В случае, если создавался новый файл, после нажатия на кнопку `Finish` появится окно, предлагающее автоматически создать прототип модуля, указав в графическом интерфейсе направление и разрядность его портов (см. _рис. 5_). В рамках данного примера, откажемся от данного предложения, нажав кнопки `Cancel->Yes`.
|
||||
If a new file was created, after clicking `Finish` a window will appear offering to automatically generate a module prototype by specifying port directions and widths through the GUI (see _Fig. 5_). For this example, decline the offer by clicking `Cancel -> Yes`.
|
||||
|
||||

|
||||
|
||||
_Рисунок 5. Окно описания входов и выходов модуля._
|
||||
_Figure 5. Module port definition dialog._
|
||||
|
||||
После добавления файлов с исходными кодами, Vivado автоматически начнет обновлять иерархию проекта. Вы можете заметить это по появившейся надписи `Updating` с анимацией крутящейся стрелки, показанной на _рис. 6_.
|
||||
After adding the source files, Vivado will automatically begin updating the project hierarchy. You can notice this by the `Updating` label with a spinning arrow animation shown in _Fig. 6_.
|
||||
|
||||

|
||||
|
||||
_Рисунок 6. Уведомление об обновлении иерархии проекта._
|
||||
_Figure 6. Project hierarchy update notification._
|
||||
|
||||
Пока в окне есть данное уведомление, не рекомендуется запускать подпрограммы во `Flow Navigator` (к примеру, пытаться открыть схему, запустить симуляцию/синтез и т.п.), поскольку иерархия проекта ещё не построена и в конечном итоге может либо произойти ошибка, либо будет выполнено действие не для нужного вам модуля.
|
||||
While this notification is visible, it is not recommended to launch any sub-applications from the `Flow Navigator` (for example, opening a schematic, running simulation or synthesis, etc.), because the project hierarchy has not yet been built and doing so may result in an error or an action being applied to the wrong module.
|
||||
|
||||
> В зависимости от того, какие подпрограммы запущены через `Flow Navigator`, в момент вызова окна `Add Sources`, Vivado автоматически будет стараться выбрать наиболее подходящий пункт (что не всегда будет совпадать с вашим намереньем). К примеру, вы описали модуль, запустили симуляцию, чтобы его проверить, а затем решили описать следующий модуль. Из-за того, что в момент вызова окна `Add Sources` в фоне запущена симуляция, в этом окне по умолчанию будет выбран пункт `Simulation Sources`.
|
||||
> Depending on which sub-applications are active in the `Flow Navigator` at the time the `Add Sources` window is opened, Vivado will attempt to select the most appropriate option automatically (which may not always match your intent). For example, if you described a module, launched a simulation to verify it, and then decided to describe the next module, the `Add Sources` window will default to `Simulation Sources` because the simulation is running in the background at that moment.
|
||||
|
||||
После того, как Vivado закончит обновлять иерархию (и, если при создании файла вы отказались указывать порты модуля, нажав на кнопку `Cancel`), рядом с папкой `Design Sources` появится стрелка, позволяющая развернуть эту папку, внутри которой обнаружится подпапка `Non-module Files` с созданным нами файлом. Новый файл пометили таким образом, поскольку он не содержит модуля. Как только в нем окажется описание какого-нибудь модуля, эта подпапка пропадёт.
|
||||
Once Vivado finishes updating the hierarchy (and if you declined to specify module ports by clicking `Cancel`), an arrow will appear next to the `Design Sources` folder, allowing you to expand it. Inside, you will find a `Non-module Files` subfolder containing the newly created file. The file is labeled this way because it does not yet contain a module. Once a module is described in it, the subfolder will disappear.
|
||||
|
||||
Откроем редактор двойным кликом по файлу `max_min.sv` и опишем в нём код, приведённый в листинге 1. В коде _листингов 1-3_ могут содержаться логические ошибки — они запланированы и будут найдены и исправлены в документе "[Руководство по поиску функциональных ошибок](./05.%20Bug%20hunting.md)".
|
||||
Open the editor by double-clicking `max_min.sv` and describe the code shown in Listing 1. The code in _Listings 1–3_ may contain intentional logical errors — these will be identified and corrected in the document "[Guide to Finding Functional Errors](./05.%20Bug%20hunting.md)".
|
||||
|
||||
```Verilog
|
||||
module max_min(
|
||||
@@ -117,11 +117,11 @@ module max_min(
|
||||
endmodule
|
||||
```
|
||||
|
||||
_Листинг 1. Описание модуля max\_min._
|
||||
_Listing 1. Description of the max\_min module._
|
||||
|
||||
Не забудьте сохранить файл после описания в нем модуля нажав в редакторе на значок дискеты, или комбинацию клавиш `Ctrl+S`.
|
||||
Do not forget to save the file after writing the module by clicking the floppy disk icon in the editor or pressing `Ctrl+S`.
|
||||
|
||||
Аналогичным образом, добавьте в `Design Sources` проекта файлы `half_divider` и `vector_abs` и опишите в них модули, представленные в _листингах 2-3_ соответственно (все файлы листингов находятся в репозитории в папке [Vivado Basics/vector_abs](./vector_abs/)). На второй странице окна добавления исходников, представленном на _рис. 3_, вы можете создавать сразу несколько новых файлов. При создании убедитесь, что вы выбрали корректный тип файла.
|
||||
Similarly, add files `half_divider` and `vector_abs` to `Design Sources` and describe the modules shown in _Listings 2–3_ respectively (all listing files are available in the repository under [Vivado Basics/vector_abs](./vector_abs/)). On the second page of the Add Sources dialog shown in _Fig. 3_, you can create multiple new files at once. Make sure you select the correct file type when creating them.
|
||||
|
||||
```Verilog
|
||||
module half_divider(
|
||||
@@ -134,7 +134,7 @@ module half_divider(
|
||||
endmodule
|
||||
```
|
||||
|
||||
_Листинг 2. Описание модуля half\_divider._
|
||||
_Listing 2. Description of the half\_divider module._
|
||||
|
||||
```Verilog
|
||||
module vector_abs(
|
||||
@@ -164,9 +164,9 @@ module vector_abs(
|
||||
endmodule
|
||||
```
|
||||
|
||||
_Листинг 3. Описание модуля vector\_abs._
|
||||
_Listing 3. Description of the vector\_abs module._
|
||||
|
||||
В `Simulation Sources` добавьте файл `tb_vector_abs`, описываемый _листингом 4_.
|
||||
Add the file `tb_vector_abs` to `Simulation Sources` as described in _Listing 4_.
|
||||
|
||||
```Verilog
|
||||
module tb_vector_abs();
|
||||
@@ -229,58 +229,58 @@ end
|
||||
endmodule
|
||||
```
|
||||
|
||||
_Листинг 4. Описание модуля tb\_vector\_abs._
|
||||
_Listing 4. Description of the tb\_vector\_abs module._
|
||||
|
||||
#### Построение иерархии модулей
|
||||
#### Building the Module Hierarchy
|
||||
|
||||
После создания указанных файлов и описания в них модулей из листингов 2-4, иерархия модулей примет следующий вид, представленный на _рис. 7_.
|
||||
After creating the files listed above and describing the modules from Listings 2–4, the module hierarchy will look as shown in _Fig. 7_.
|
||||
|
||||

|
||||
|
||||
_Рисунок 7. Иерархия проекта, представленная в свёрнутом виде._
|
||||
_Figure 7. Project hierarchy shown in collapsed view._
|
||||
|
||||
Нажав на стрелку слева от модуля `vector_abs`, иерархия развернётся (_рис. 8_).
|
||||
Clicking the arrow to the left of the `vector_abs` module will expand the hierarchy (_Fig. 8_).
|
||||
|
||||

|
||||
|
||||
_Рисунок 8. Иерархия проекта, представленная в развёрнутом виде._
|
||||
_Figure 8. Project hierarchy shown in expanded view._
|
||||
|
||||
Обратите внимание на то, что модуль `vector_abs` выделен жирным относительно других модулей. Такое выделение означает, что данный модуль выбран в качестве **модуля верхнего уровня** (**top-level module**). Это означает, это данный модуль и представляет итоговую схему, которую мы проектируем, и что другие подпрограммы во `Flow Navigator`, такие как `RTL ANALYSIS`, `SYNTHESIS`, `IMPLEMENTATION` и `PROGRAM AND DEBUG` будут обрабатывать именно этот модуль. Если вдруг вы захотите работать с другим модулем (например, с модулем, `half_divider`) — его необходимо пометить вручную в качестве модуля верхнего уровня. Для этого необходимо нажать по нему правой кнопкой мыши, и в выпадающем меню выбрать `Set as Top` (см. _рис. 9_).
|
||||
Notice that the `vector_abs` module is displayed in bold compared to the other modules. This indicates that it is selected as the **top-level module**. This means it represents the final design being implemented, and other sub-applications in the `Flow Navigator` — such as `RTL ANALYSIS`, `SYNTHESIS`, `IMPLEMENTATION`, and `PROGRAM AND DEBUG` — will process this module. If you want to work with a different module (for example, `half_divider`), you must manually set it as the top-level module. To do so, right-click it and select `Set as Top` from the drop-down menu (see _Fig. 9_).
|
||||
|
||||

|
||||
|
||||
_Рисунок 9. Выбор модуля верхнего уровня (показана середина выпадающего списка)._
|
||||
_Figure 9. Selecting the top-level module (the middle of the drop-down menu is shown)._
|
||||
|
||||
Обратите внимание на то, как строится иерархия проекта. Модули, являющиеся объектами других модулей "вложены" в эти модули. Причем в иерархии проекта сперва указывается имя объекта модуля, затем через двоеточие имя самого модуля. В скобках указывается имя файла, где модуль описан. Модуль, который не содержится в других модулях, не имеет имени объекта модуля (т.к. нет сущности, которая бы этот объект создавала). Если модуль будет содержать несколько объектов одного и того же модуля, в иерархии будут отображены все эти объекты — именно поэтому нужно понимать, чем иерархия модулей отличается от дерева файлов. Несмотря на то, что модуль описан всего в одном файле, в иерархии проекта может встречаться несколько экземпляров одного и того же модуля.
|
||||
Note how the project hierarchy is structured. Modules that are instantiated inside other modules are "nested" within them. In the hierarchy, the instance name is shown first, followed by a colon and the module name. The file where the module is described is shown in parentheses. A module that is not instantiated inside any other module has no instance name (since there is no entity that creates the instance). If a module contains multiple instances of the same module, all of those instances will be shown in the hierarchy — this is why it is important to understand the difference between the module hierarchy and a file tree. Even though a module is described in a single file, multiple instances of it may appear in the project hierarchy.
|
||||
|
||||
#### Ошибки иерархии
|
||||
#### Hierarchy Errors
|
||||
|
||||
В случае, если при создании какого-либо из файлов вы ошиблись с папкой назначения (добавили файл, предназначенный для `Design Sources` в `Simulation Sources` или наоборот), вы можете перенести этот файл в нужную папку без необходимости его удаления и повторного добавления. Для этого кликните по нужному файлу правой кнопкой мыши и выберите `Move to Design/Simulation sources` (см. _рис. 10_).
|
||||
If you accidentally placed a file in the wrong folder (for example, added a file intended for `Design Sources` to `Simulation Sources` or vice versa), you can move it to the correct folder without deleting and re-adding it. Right-click the file and select `Move to Design/Simulation sources` (see _Fig. 10_).
|
||||
|
||||

|
||||
|
||||
_Рисунок 10. Перенос модуля в нужную папку._
|
||||
_Figure 10. Moving a module to the correct folder._
|
||||
|
||||
После добавления модуля `tb_vector_abs`, посмотрите на иерархию `Simulation Sources`. Обратите внимание на то, что все модули `Design Sources` продублированы в `Simulation Sources`. Это ещё одно отличие от дерева файлов. Физически каждый модуль находится всего в одном файле, здесь представлена иерархия модулей.
|
||||
After adding the `tb_vector_abs` module, look at the `Simulation Sources` hierarchy. Notice that all `Design Sources` modules are duplicated in `Simulation Sources`. This is another distinction from a file tree. Physically, each module exists in only one file; what is shown here is the module hierarchy.
|
||||
|
||||
Можно также заметить, что модуль верхнего уровня в `Simulation Sources` другой. Модуль верхнего уровня в `Simulation Sources` определяет то, какой модуль будет использоваться при симуляции (обычно это тестбенч, внутри которого создан объект проверяемого модуля). Модули верхнего уровня в `Design Sources` и `Simulation Sources` не связаны друг с другом (вам не нужно выбирать модулем верхнего уровня в `Design Sources` тот модуль, что вы будете проверять с помощью тестбенча в `Simulation Sources`).
|
||||
You will also notice that the top-level module in `Simulation Sources` is different. The top-level module in `Simulation Sources` determines which module will be used during simulation (typically a testbench that instantiates the module under test). The top-level modules in `Design Sources` and `Simulation Sources` are independent — you do not need to set the module being tested as the top-level in `Design Sources` in order to verify it using a testbench in `Simulation Sources`.
|
||||
|
||||
Давайте изменим в модуле `tb_vector_abs` название модуля `vector_abs`, использовавшееся при создании объекта `DUT` (например на `vector`). Получившаяся иерархия модулей представлена на _рис. 11_.
|
||||
Let us change the module name `vector_abs` used when instantiating the `DUT` object in `tb_vector_abs` (for example, to `vector`). The resulting module hierarchy is shown in _Fig. 11_.
|
||||
|
||||

|
||||
|
||||
_Рисунок 11. Иерархия проекта с отсутствующим модулем._
|
||||
_Figure 11. Project hierarchy with a missing module._
|
||||
|
||||
Иерархия обновилась, но поскольку в проекте не существует модуля с названием `vector`, это отобразилось соответствующим образом. Поскольку модуль `vector_abs` не является частью модуля `tb_vector_abs`, он перестал быть вложенным модулем и разместился рядом в `Simulation Sources` (в `Design Sources` иерархия осталась прежней, т.к. изменения коснулись только модуля `tb_vector_abs`, расположенного в `Simulation Sources`).
|
||||
The hierarchy was updated, but since there is no module named `vector` in the project, this is reflected accordingly. Since `vector_abs` is no longer part of `tb_vector_abs`, it is no longer a nested module and appears alongside it in `Simulation Sources` (the `Design Sources` hierarchy remains unchanged, as only the `tb_vector_abs` module located in `Simulation Sources` was modified).
|
||||
|
||||
### Вкладка Libraries
|
||||
### The Libraries Tab
|
||||
|
||||
В данной вкладке находятся файлы проекта, сгруппированные по библиотекам. В рамках данного курса, эта вкладка использоваться не будет.
|
||||
This tab contains the project files grouped by library. This tab will not be used during this course.
|
||||
|
||||
### Вкладка Compile Order
|
||||
### The Compile Order Tab
|
||||
|
||||
Обычно Vivado сам определяет порядок компиляции по иерархии проекта. Однако, в некоторых ситуациях он может определить что-то неправильно. На данной вкладке вы можете исправить порядок компиляции (скорее всего, вам может потребоваться эта вкладка, для указания порядка компиляции пакетов SystemVerilog).
|
||||
Vivado normally determines the compilation order from the project hierarchy. However, in some situations it may determine the order incorrectly. This tab allows you to correct the compilation order (most likely you will need this tab to specify the compilation order for SystemVerilog packages).
|
||||
|
||||
## Дополнительные материалы
|
||||
## Additional Resources
|
||||
|
||||
Более подробную информацию по окну `Sources` вы можете найти в руководстве пользователя Vivado: ["Vivado Design Suite User Guide: Using the Vivado IDE (UG893)"](https://docs.xilinx.com/r/en-US/ug893-vivado-ide) (раздел ["Using the Sources Window"](https://docs.xilinx.com/r/en-US/ug893-vivado-ide/Using-the-Sources-Window)).
|
||||
More detailed information about the `Sources` window can be found in the Vivado user guide: ["Vivado Design Suite User Guide: Using the Vivado IDE (UG893)"](https://docs.xilinx.com/r/en-US/ug893-vivado-ide) (section ["Using the Sources Window"](https://docs.xilinx.com/r/en-US/ug893-vivado-ide/Using-the-Sources-Window)).
|
||||
|
||||
Reference in New Issue
Block a user