aboutsummaryrefslogtreecommitdiff
path: root/README.org
diff options
context:
space:
mode:
authorLibravatar Martin Michalec <martin@michalec.dev>2026-11-08 00:37:41 +0000
committerLibravatar Martin Michalec <martin@michalec.dev>2026-11-08 00:37:41 +0000
commit1cf06615f97bc27f732a880e89e9366140095bf1 (patch)
treea02c356c64b150c164fd72254da33d872f572957 /README.org
downloadcoursework-1cf06615f97bc27f732a880e89e9366140095bf1.tar.gz
publishHEADmaster
Diffstat (limited to 'README.org')
-rw-r--r--README.org159
1 files changed, 159 insertions, 0 deletions
diff --git a/README.org b/README.org
new file mode 100644
index 0000000..b2a580f
--- /dev/null
+++ b/README.org
@@ -0,0 +1,159 @@
1#+title: Cache coherency protocol and eviction policy simulation
2#+subtitle: MESIF-LRU
3#+date: 2024H1
4
5* Task
6:PROPERTIES:
7:CUSTOM_ID: task
8:END:
9#+begin_note
10This is a machine translation.[fn:1]
11#+end_note
12
13What needs to be done? Implement a model that demonstrates the
14operation of the memory subsystem in a symmetric multiprocessor
15system. As a reference, you can use the following demonstrator:
16https://www.scss.tcd.ie/Jeremy.Jones/vivio/caches/MESIHelp.htm -- this
17shows the operation of the MESI protocol with a direct‑mapped cache
18and without replacement policies.
19
20The conditions of your work are more complex:
211) the cache coherence protocol and replacement policy are determined
222) the number of processors in the system is 4;
233) the amount of main memory is 16 addressable cells of 1 byte each;
244) the size of the memory and cache line is 1 byte;
255) the number of cache lines is 4;
266) the cache associativity is 2.
27
28You determine all the necessary attributes for fixing and updating the
29time of the last access to a row or the frequency of access to it
30yourself. In all cases, the time unit is the clock cycle.
31
32The model must display:
331) the contents and address of each main memory cell;
342) tag, data, and state of each cache line (possible states determined
35 by the protocol from your option);
363) Replacement policy metric counter for each cache line;
374) requests via the address, data, and status buses and responses to
38 them (schematically, as in the reference model, without commenting
39 on each request and response);
405) a common machine time clock counter from the moment of startup or
41 reset.
42
43Control commands received from the user: for each processor, read and
44write operations on memory at the specified (selected) address, a
45general reset of the model’s state, the ability to “advance” manually
46through the clock cycles. Please note that the reference model
47implements the ability to perform operations on multiple processors
48simultaneously -- your model should also implement this. The initial
49state of the caches is that all lines are empty; the initial state of
50the memory is that all cells contain the value "0". By analogy with
51the reference model, the write operation increments the value by "1".
52
53Programming languages, frameworks, visualization tools -- any, as long
54as I can run your application on my work PC. If this requires any
55additional software, it would be better to package everything in the
56form of a virtual machine image or container. Beautiful animation,
57coloring, and other decorations are not required and will not be taken
58into account when evaluating the work.
59
60The work must be accompanied by a report. In addition to the
61substantive part, the report must indicate how the tasks are
62distributed among the members of the working group (this can be done
63in the conclusion or in the appendix).
64
65* Documentation
66:PROPERTIES:
67:CUSTOM_ID: documentation
68:END:
69The report has been lost to time, but I'm sure there was nothing
70interesting in it.
71
72* Showcase
73:PROPERTIES:
74:CUSTOM_ID: showcase
75:END:
76The CPU blocks allow you to issue commands: read, increment
77(read+write) or write (random byte), to a specific address. The whole
78timeline is being saved and you can scrub through it, go back in time
79and change the future. Bus access is animated through interpolation.
80
81#+caption: Initial state
82#+attr_html: :width 100%
83[[https://git.michalec.dev/uni/term-04/supercomp-arch/coursework/init.png][https://git.michalec.dev/uni/term-04/supercomp-arch/coursework/init.png]]
84
85#+caption: Increment (read+write) and read at the same time
86#+attr_html: :width 100%
87[[https://git.michalec.dev/uni/term-04/supercomp-arch/coursework/ir.png][https://git.michalec.dev/uni/term-04/supercomp-arch/coursework/ir.png]]
88
89#+caption: Write random byte
90#+attr_html: :width 100%
91[[https://git.michalec.dev/uni/term-04/supercomp-arch/coursework/w.png][https://git.michalec.dev/uni/term-04/supercomp-arch/coursework/w.png]]
92
93* Unlicense
94:PROPERTIES:
95:CUSTOM_ID: unlicense
96:END:
97#+include: UNLICENSE verse
98
99* Footnotes
100:PROPERTIES:
101:CUSTOM_ID: footnotes
102:END:
103[fn:1] Original text:
104#+HTML: <i>
105#+begin_quote
106Что нужно сделать? Реализовать модель, демонстрирующую работу
107подсистемы памяти в симметричной многопроцессорной системе. В качестве
108эталона можно использовать такой демонстратор:
109https://www.scss.tcd.ie/Jeremy.Jones/vivio/caches/MESIHelp.htm --
110здесь показана работа протокола MESI с кэшем прямого отображения и без
111политик замещения.
112
113Условия вашей работы более сложные:
1141) протокол кэш-когерентности и политика замещения определяются
115 выбранным вариантом;
1162) число процессоров в системе -- 4;
1173) объем основной памяти -- 16 адресуемых ячеек по 1 байт;
1184) размер строки памяти и кэша -- 1 байт;
1195) число строк кэша -- 4;
1206) ассоциативность кэша -- 2.
121
122Все необходимые атрибуты для фиксации и обновления времени последнего
123обращения к строке или частоты обращения к ней вы определяете
124самостоятельно, единицей времени во всех случаях является такт
125машинного времени.
126
127Модель обязательно должна отображать:
1281) содержимое и адрес каждой ячейки основной памяти;
1292) тэг, данные и состояние каждой строки кэша (возможные состояния
130 определяются протоколом из вашего варианта);
1313) счётчик метрики политики замещения для каждой строки кэша;
1324) запросы по шинам адреса, данных, состояний и ответы на них
133 (схематично, как в эталонной модели, без комментирования каждого
134 запроса и ответа);
1355) общий счётчик тактов машинного времени с момента запуска или
136 сброса.
137
138Команды управления, принимаемые от пользователя: для каждого
139процессора операции чтения и записи памяти по указанному (выбранному)
140адресу, общий сброс состояния модели, возможность «продвижения» по
141тактам вручную. Обратите внимание, что в эталонной модели реализована
142возможность выполнять операции на нескольких процессорах одновременно
143-- в вашей модели это тоже должно быть реализовано. Начальное
144состояние кэшей -- все строки пусты, начальное состояние памяти -- все
145ячейки содержат значение «0». По аналогии с эталонной моделью операция
146записи выполняет инкремент значения на «1».
147
148Языки программирования, фрэймворки, средства визуализации -- любые,
149лишь бы я мог запустить ваше приложение на своём рабочем ПК. Если для
150этого потребуется какое-то дополнительно ПО -- лучше будет собрать всё
151в виде образа виртуальной машины или контейнера. Красивая анимация,
152раскрашивание и другие декорации не требуются и не принимаются в
153расчёт при оценивании работы.
154
155Работа должна сопровождаться отчётом. В отчёте, помимо содержательной
156части, должно быть указано распределение задач по участникам рабочей
157группы (это можно сделать в заключении или в приложении).
158#+end_quote
159#+HTML: </i>