diff options
| author | 2026-11-08 00:37:41 +0000 | |
|---|---|---|
| committer | 2026-11-08 00:37:41 +0000 | |
| commit | 1cf06615f97bc27f732a880e89e9366140095bf1 (patch) | |
| tree | a02c356c64b150c164fd72254da33d872f572957 /README.org | |
| download | coursework-1cf06615f97bc27f732a880e89e9366140095bf1.tar.gz | |
Diffstat (limited to 'README.org')
| -rw-r--r-- | README.org | 159 |
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 | ||
| 10 | This is a machine translation.[fn:1] | ||
| 11 | #+end_note | ||
| 12 | |||
| 13 | What needs to be done? Implement a model that demonstrates the | ||
| 14 | operation of the memory subsystem in a symmetric multiprocessor | ||
| 15 | system. As a reference, you can use the following demonstrator: | ||
| 16 | https://www.scss.tcd.ie/Jeremy.Jones/vivio/caches/MESIHelp.htm -- this | ||
| 17 | shows the operation of the MESI protocol with a direct‑mapped cache | ||
| 18 | and without replacement policies. | ||
| 19 | |||
| 20 | The conditions of your work are more complex: | ||
| 21 | 1) the cache coherence protocol and replacement policy are determined | ||
| 22 | 2) the number of processors in the system is 4; | ||
| 23 | 3) the amount of main memory is 16 addressable cells of 1 byte each; | ||
| 24 | 4) the size of the memory and cache line is 1 byte; | ||
| 25 | 5) the number of cache lines is 4; | ||
| 26 | 6) the cache associativity is 2. | ||
| 27 | |||
| 28 | You determine all the necessary attributes for fixing and updating the | ||
| 29 | time of the last access to a row or the frequency of access to it | ||
| 30 | yourself. In all cases, the time unit is the clock cycle. | ||
| 31 | |||
| 32 | The model must display: | ||
| 33 | 1) the contents and address of each main memory cell; | ||
| 34 | 2) tag, data, and state of each cache line (possible states determined | ||
| 35 | by the protocol from your option); | ||
| 36 | 3) Replacement policy metric counter for each cache line; | ||
| 37 | 4) 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); | ||
| 40 | 5) a common machine time clock counter from the moment of startup or | ||
| 41 | reset. | ||
| 42 | |||
| 43 | Control commands received from the user: for each processor, read and | ||
| 44 | write operations on memory at the specified (selected) address, a | ||
| 45 | general reset of the model’s state, the ability to “advance” manually | ||
| 46 | through the clock cycles. Please note that the reference model | ||
| 47 | implements the ability to perform operations on multiple processors | ||
| 48 | simultaneously -- your model should also implement this. The initial | ||
| 49 | state of the caches is that all lines are empty; the initial state of | ||
| 50 | the memory is that all cells contain the value "0". By analogy with | ||
| 51 | the reference model, the write operation increments the value by "1". | ||
| 52 | |||
| 53 | Programming languages, frameworks, visualization tools -- any, as long | ||
| 54 | as I can run your application on my work PC. If this requires any | ||
| 55 | additional software, it would be better to package everything in the | ||
| 56 | form of a virtual machine image or container. Beautiful animation, | ||
| 57 | coloring, and other decorations are not required and will not be taken | ||
| 58 | into account when evaluating the work. | ||
| 59 | |||
| 60 | The work must be accompanied by a report. In addition to the | ||
| 61 | substantive part, the report must indicate how the tasks are | ||
| 62 | distributed among the members of the working group (this can be done | ||
| 63 | in the conclusion or in the appendix). | ||
| 64 | |||
| 65 | * Documentation | ||
| 66 | :PROPERTIES: | ||
| 67 | :CUSTOM_ID: documentation | ||
| 68 | :END: | ||
| 69 | The report has been lost to time, but I'm sure there was nothing | ||
| 70 | interesting in it. | ||
| 71 | |||
| 72 | * Showcase | ||
| 73 | :PROPERTIES: | ||
| 74 | :CUSTOM_ID: showcase | ||
| 75 | :END: | ||
| 76 | The CPU blocks allow you to issue commands: read, increment | ||
| 77 | (read+write) or write (random byte), to a specific address. The whole | ||
| 78 | timeline is being saved and you can scrub through it, go back in time | ||
| 79 | and 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 | эталона можно использовать такой демонстратор: | ||
| 109 | https://www.scss.tcd.ie/Jeremy.Jones/vivio/caches/MESIHelp.htm -- | ||
| 110 | здесь показана работа протокола MESI с кэшем прямого отображения и без | ||
| 111 | политик замещения. | ||
| 112 | |||
| 113 | Условия вашей работы более сложные: | ||
| 114 | 1) протокол кэш-когерентности и политика замещения определяются | ||
| 115 | выбранным вариантом; | ||
| 116 | 2) число процессоров в системе -- 4; | ||
| 117 | 3) объем основной памяти -- 16 адресуемых ячеек по 1 байт; | ||
| 118 | 4) размер строки памяти и кэша -- 1 байт; | ||
| 119 | 5) число строк кэша -- 4; | ||
| 120 | 6) ассоциативность кэша -- 2. | ||
| 121 | |||
| 122 | Все необходимые атрибуты для фиксации и обновления времени последнего | ||
| 123 | обращения к строке или частоты обращения к ней вы определяете | ||
| 124 | самостоятельно, единицей времени во всех случаях является такт | ||
| 125 | машинного времени. | ||
| 126 | |||
| 127 | Модель обязательно должна отображать: | ||
| 128 | 1) содержимое и адрес каждой ячейки основной памяти; | ||
| 129 | 2) тэг, данные и состояние каждой строки кэша (возможные состояния | ||
| 130 | определяются протоколом из вашего варианта); | ||
| 131 | 3) счётчик метрики политики замещения для каждой строки кэша; | ||
| 132 | 4) запросы по шинам адреса, данных, состояний и ответы на них | ||
| 133 | (схематично, как в эталонной модели, без комментирования каждого | ||
| 134 | запроса и ответа); | ||
| 135 | 5) общий счётчик тактов машинного времени с момента запуска или | ||
| 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> | ||
