Commit 6dfcba6
authored
Merge pull request #1744 from HadrienRenaud/fix-ambiguous-po-regs
[herd,asl] Fix ambiguous PC writes
This PR cherry picks a commit from #1735 that introduces some checks on the coherence of writes, and fixes the problems highlighted from those checks.
## PC handling in ASL+herd
The aarch64 handwritten semantics in herd handle the program counter differently from the ASL code: the ASL code has an explicit PC register, whereas the handwritten semantics rely on po and BCC branching events.
We had introduced in #711 an AArch64 PC register in ASL to support the ASL code that uses it.
This implementation wrote 2 times to the PC:
1. First at the beginning of the instruction to correctly initialize the PC value
2. Secondly when the branching is committed and we actually increments the PC
This poses a few problems, mainly because the current herd algorithm does not handle multiple writes at the same register in a single instruction.
We thus remove the translation of the PC accesses, replaced here by a BCC commit event in case of a write. This leaves implicit the PC reads.
## Intra-Instruction Dependencies starting from a register write
The PC handling described above had a strange graph, where a `iico_data` was starting at a register write. This is because this register write was read-from in the same instruction.
(Precisely, the first write to PC was read from to query the current PC and then increment it, resulting in a graph like [the one](https://github.com/user-attachments/files/25799596/A.pdf) shown by Luc in [a comment](#1735 (comment)) on #1704).
We simply add guards on the Intra-Instruction Data dependencies to force them to start at a register read or at a memory read.4 files changed
+92
-54
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | 218 | | |
222 | 219 | | |
223 | 220 | | |
| |||
249 | 246 | | |
250 | 247 | | |
251 | 248 | | |
252 | | - | |
| 249 | + | |
253 | 250 | | |
254 | 251 | | |
255 | 252 | | |
| |||
266 | 263 | | |
267 | 264 | | |
268 | 265 | | |
269 | | - | |
270 | 266 | | |
271 | 267 | | |
272 | 268 | | |
| |||
277 | 273 | | |
278 | 274 | | |
279 | 275 | | |
280 | | - | |
281 | 276 | | |
282 | 277 | | |
283 | 278 | | |
| |||
296 | 291 | | |
297 | 292 | | |
298 | 293 | | |
299 | | - | |
300 | 294 | | |
301 | 295 | | |
302 | 296 | | |
| |||
1126 | 1120 | | |
1127 | 1121 | | |
1128 | 1122 | | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
1129 | 1126 | | |
1130 | 1127 | | |
1131 | 1128 | | |
| 1129 | + | |
1132 | 1130 | | |
1133 | 1131 | | |
1134 | 1132 | | |
| |||
1341 | 1339 | | |
1342 | 1340 | | |
1343 | 1341 | | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
1344 | 1351 | | |
1345 | 1352 | | |
1346 | 1353 | | |
| |||
1542 | 1549 | | |
1543 | 1550 | | |
1544 | 1551 | | |
1545 | | - | |
1546 | | - | |
1547 | | - | |
1548 | | - | |
1549 | | - | |
1550 | | - | |
1551 | | - | |
1552 | | - | |
1553 | | - | |
1554 | | - | |
1555 | | - | |
1556 | | - | |
1557 | | - | |
1558 | | - | |
1559 | | - | |
1560 | | - | |
1561 | | - | |
1562 | | - | |
1563 | | - | |
1564 | | - | |
1565 | | - | |
1566 | | - | |
1567 | | - | |
1568 | | - | |
1569 | | - | |
1570 | | - | |
1571 | | - | |
1572 | | - | |
1573 | | - | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
1574 | 1568 | | |
1575 | 1569 | | |
1576 | 1570 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
864 | 864 | | |
865 | 865 | | |
866 | 866 | | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
867 | 924 | | |
868 | 925 | | |
869 | 926 | | |
870 | 927 | | |
871 | 928 | | |
872 | 929 | | |
873 | | - | |
874 | | - | |
875 | | - | |
876 | | - | |
877 | | - | |
878 | | - | |
879 | | - | |
880 | | - | |
881 | | - | |
882 | | - | |
883 | | - | |
884 | | - | |
885 | | - | |
886 | | - | |
887 | | - | |
| 930 | + | |
| 931 | + | |
888 | 932 | | |
889 | 933 | | |
890 | 934 | | |
| |||
901 | 945 | | |
902 | 946 | | |
903 | 947 | | |
904 | | - | |
905 | 948 | | |
906 | | - | |
| 949 | + | |
907 | 950 | | |
908 | 951 | | |
909 | 952 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
| 396 | + | |
396 | 397 | | |
397 | 398 | | |
398 | 399 | | |
| |||
0 commit comments