)]}'
{
  "commit": "46e11ba66e9c70ca08afd56ef829f2e7f535c053",
  "tree": "e7b0797e4662ef71fb9338f99f6b5c28b6e3eb78",
  "parents": [
    "e3e7610e2c87746c25b3c32dc968b7f4e1de2c37"
  ],
  "author": {
    "name": "Rupert Swarbrick",
    "email": "rswarbrick@lowrisc.org",
    "time": "Tue Jul 13 12:11:43 2021 +0100"
  },
  "committer": {
    "name": "Rupert Swarbrick",
    "email": "rswarbrick@gmail.com",
    "time": "Sat Jul 17 14:57:54 2021 +0100"
  },
  "message": "[otbn] Fix BN.LID when the destination WDR is read from x1\n\nThe problem comes up with an instruction like:\n\n      bn.lid x1, 0(x0)\n\nThe previous code read both input GPRs to BN.LID (x1 and x0) on the\nfirst cycle. This is good for the base address, but is the wrong thing\nfor the destination address, which is needed on the following cycle.\n\nNote that the behaviour was technically wrong for something like\n\n      bn.lid x2, 0(x0)\n\nas well, but didn\u0027t cause a bug because the base register file doesn\u0027t\nfactor the read-enable in unless we\u0027re reading from the call stack.\n\nTo see the bug, run the following example code:\n\n      addi x1, x0, 1\n      bn.lid x1, 0(x0)\n      ecall\n\n    .section .data\n    .word 0x00000000\n    .word 0x00000001\n    .word 0x00000002\n    .word 0x00000003\n    .word 0x00000004\n    .word 0x00000005\n    .word 0x00000006\n    .word 0x00000007\n\nIf that is saved as bug.s, assemble and link it with\n\n    hw/ip/otbn/util/otbn-as -o bug.o bug.s\n    hw/ip/otbn/util/otbn-ld -o bug bug.o\n\nNext, build a Verilator-based simulation with:\n\n    fusesoc --cores-root\u003d. run --target\u003dsim --setup --build lowrisc:ip:otbn_top_sim\n\nand then run it with:\n\n    build/lowrisc_ip_otbn_top_sim_0.1/sim-verilator/Votbn_top_sim -t --load-elf\u003dbug\n\nSigned-off-by: Rupert Swarbrick \u003crswarbrick@lowrisc.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "7b5d1d4bb833f98136eb063191efbfbef4713e0c",
      "old_mode": 33188,
      "old_path": "hw/ip/otbn/rtl/otbn_controller.sv",
      "new_id": "b0d268bb1256d2fdfc32ddd3e22e8908a5c91d8e",
      "new_mode": 33188,
      "new_path": "hw/ip/otbn/rtl/otbn_controller.sv"
    }
  ]
}
