{"id": "uart-t1-001", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/uart/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "### Transmission\n\nA write to [`WDATA`](registers.md#wdata) enqueues a data byte into the 32-byte write FIFO, which triggers the transmit module to start UART TX serial data transfer.\nThe TX module dequeues the byte from the FIFO and shifts it bit by bit out to the UART TX pin on positive edges of the baud clock.\n\nIf TX is not enabled, written DATA into FIFO will be stacked up and sent out when TX is enabled.\n\nWhen the FIFO becomes empty as part of transmission, a TX FIFO done interrupt will be raised when the final byte has finished transmitting.\nThis is separate from the TX FIFO water mark interrupt.", "rtl_excerpt": "", "question": "According to the Transmission section, how deep is the UART transmit (write) FIFO?", "answer_format": "exact_value", "gold_answer": "32-byte", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "gold answer appears verbatim in hw/ip/uart/doc/theory_of_operation.md, section Transmission", "difficulty": "easy"} {"id": "uart-t1-002", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/uart/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "### Reception\n\nThe RX module oversamples the RX input pin at 16x the requested baud clock.\nWhen the input is detected low the receiver will check half a bit-time later (i.e. 8 cycles of the oversample clock) that the line is still low before detecting the START bit.\nIf the line has returned high the glitch is ignored.\nAfter it detects the START bit, the RX module samples at the center of each bit-time and gathers incoming serial bits into a character buffer.\nIf the STOP bit is detected as high and the optional parity bit is correct the data byte is pushed into a 64-byte RX FIFO.\nThe data can be read out by reading the [`RDATA`](registers.md#rdata) register.", "rtl_excerpt": "", "question": "According to the Reception section, how deep is the UART receive FIFO?", "answer_format": "exact_value", "gold_answer": "64-byte", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "gold answer appears verbatim in hw/ip/uart/doc/theory_of_operation.md, section Reception", "difficulty": "easy"} {"id": "uart-t1-003", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/uart/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "### Reception\n\nThe RX module oversamples the RX input pin at 16x the requested baud clock.\nWhen the input is detected low the receiver will check half a bit-time later (i.e. 8 cycles of the oversample clock) that the line is still low before detecting the START bit.\nIf the line has returned high the glitch is ignored.", "rtl_excerpt": "", "question": "At what multiple of the requested baud clock does the RX module oversample the RX input pin?", "answer_format": "exact_value", "gold_answer": "16x", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "gold answer appears verbatim in hw/ip/uart/doc/theory_of_operation.md, section Reception", "difficulty": "easy"} {"id": "uart-t1-004", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/uart/doc/registers.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "### CTRL . RXBLVL\nTrigger level for RX break detection. Sets the number of character\ntimes the line must be low to detect a break.\n\n| Value | Name | Description |\n|:--------|:--------|:--------------|\n| 0x0 | break2 | 2 characters |\n| 0x1 | break4 | 4 characters |\n| 0x2 | break8 | 8 characters |\n| 0x3 | break16 | 16 characters |", "rtl_excerpt": "", "question": "What value must be written to the CTRL.RXBLVL field to select a break-detect threshold of 16 characters?", "answer_format": "exact_value", "gold_answer": "0x3", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "gold answer appears verbatim in hw/ip/uart/doc/registers.md, section CTRL . RXBLVL", "difficulty": "medium"} {"id": "uart-t1-005", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/uart/doc/registers.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "## INTR_STATE\nInterrupt State Register\n- Offset: `0x0`\n- Reset default: `0x101`\n- Reset mask: `0x1ff`\n\n### Fields\n\n\n| Bits | Type | Reset | Name | Description |\n|:------:|:------:|:-------:|:--------------|:---------------------------------------------------------------------------------------------------------------|\n| 31:9 | | | | Reserved |\n| 8 | ro | 0x1 | tx_empty | raised if the transmit FIFO is empty. |\n| 7 | rw1c | 0x0 | rx_parity_err | raised if the receiver has detected a parity error. |\n| 6 | rw1c | 0x0 | rx_timeout | raised if RX FIFO has characters remaining in the FIFO without being retrieved for the programmed time period. |\n| 5 | rw1c | 0x0 | rx_break_err | raised if break condition has been detected on receive. |\n| 4 | rw1c | 0x0 | rx_frame_err | raised if a framing error has been detected on receive. |\n| 3 | rw1c | 0x0 | rx_overflow | raised if the receive FIFO has overflowed. |\n| 2 | rw1c | 0x0 | tx_done | raised if the transmit FIFO has emptied and no transmit is ongoing. |\n| 1 | ro | 0x0 | rx_watermark | raised if the receive FIFO is past the high-water mark. |\n| 0 | ro | 0x1 | tx_watermark | raised if the transmit FIFO is past the high-water mark. |", "rtl_excerpt": "", "question": "What is the reset default value of the INTR_STATE register?", "answer_format": "exact_value", "gold_answer": "0x101", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "gold answer appears verbatim in hw/ip/uart/doc/registers.md, section INTR_STATE", "difficulty": "medium"} {"id": "uart-t2-001", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/uart/doc/theory_of_operation.md; hw/ip/uart/doc/registers.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "#### rx_break_err\n\nThe `rx_break_err` interrupt is triggered if a break condition has been detected.\nA break condition is defined as the RX pin being continuously low for more than a programmable number of character-times (via [`CTRL.RXBLVL`](registers.md#ctrl), either 2, 4, 8, or 16).\nA character time is 10 bit-times if parity is disabled (START + 8 data + STOP) or 11 bit-times if parity is enabled (START + 8 data + parity + STOP).\n\n### CTRL . RXBLVL\nTrigger level for RX break detection. Sets the number of character\ntimes the line must be low to detect a break.\n\n| Value | Name | Description |\n|:--------|:--------|:--------------|\n| 0x0 | break2 | 2 characters |\n| 0x1 | break4 | 4 characters |\n| 0x2 | break8 | 8 characters |\n| 0x3 | break16 | 16 characters |", "rtl_excerpt": "", "question": "CTRL.RXBLVL is programmed to 0x2 and parity is disabled. For a break condition to be detected, the RX pin must be continuously low for more than how many bit-times?", "answer_format": "exact_value", "gold_answer": "more than 80 bit-times", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "break definition (continuously low for more than a programmable number of character-times) appears verbatim in hw/ip/uart/doc/theory_of_operation.md, section Interrupts > rx_break_err; 0x2 = 8 characters appears verbatim in hw/ip/uart/doc/registers.md, section CTRL . RXBLVL; character time = 10 bit-times with parity disabled appears verbatim in hw/ip/uart/doc/theory_of_operation.md, section Interrupts > rx_break_err", "difficulty": "hard"} {"id": "uart-t2-002", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/uart/doc/theory_of_operation.md; hw/ip/uart/doc/registers.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "#### tx_watermark / tx_empty / rx_watermark\n\nIf the TX FIFO level becomes smaller than the TX water mark level (configurable via [`FIFO_CTRL.TXILVL`](registers.md#fifo_ctrl--txilvl)), the `tx_watermark` interrupt is raised to inform SW.\n\n### FIFO_CTRL . TXILVL\nTrigger level for TX interrupts. If the FIFO depth is less than the setting, it\nraises tx_watermark interrupt.\n\n| Value | Name | Description |\n|:--------|:--------|:--------------|\n| 0x0 | txlvl1 | 1 character |\n| 0x1 | txlvl2 | 2 characters |\n| 0x2 | txlvl4 | 4 characters |\n| 0x3 | txlvl8 | 8 characters |\n| 0x4 | txlvl16 | 16 characters |\n\nOther values are reserved.", "rtl_excerpt": "", "question": "FIFO_CTRL.TXILVL is programmed to 0x3. Under what FIFO-depth condition is the tx_watermark interrupt raised?", "answer_format": "exact_value", "gold_answer": "less than 8 characters", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "0x3 = txlvl8 = 8 characters appears verbatim in hw/ip/uart/doc/registers.md, section FIFO_CTRL . TXILVL; the trigger condition (FIFO depth less than the setting) appears verbatim in the same section, and the equivalent condition (TX FIFO level smaller than the TX water mark level) appears verbatim in hw/ip/uart/doc/theory_of_operation.md, section Interrupts", "difficulty": "medium"} {"id": "uart-t2-003", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/uart/doc/programmers_guide.md; hw/ip/uart/doc/registers.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "### Configuration\n\nTo program the baud rate of the UART, the clock rate of the Numerically Controlled Oscillator ([`CTRL.NCO`](registers.md#ctrl--nco)) can be configured.\nThe `NCO` is calculated using the following equation:\n\n$$ NCO = {{16 * 2^{bits(NCO)} * f\\_{baud}} \\over {f\\_{pclk}}} $$\n\nWhere `f_baud` is the desired baud rate in bits per second, and `f_pclk` is the fixed clock frequency of the UART's main clock input.\nThe [`CTRL.NCO`](registers.md#ctrl--nco) field is 16 bits, meaning that you can use a simplified calculation:\n\n$$ NCO = {{2^{20} * f\\_{baud}} \\over {f\\_{pclk}}} $$\n\nNote that the result of the above formulae can be some non-integer value, whilst the [`CTRL.NCO`](registers.md#ctrl--nco) field only accepts integer values.\n\n### CTRL . NCO\nBAUD clock rate control.\n\n| Bits | Type | Reset | Name |\n|:------:|:------:|:-------:|:------------------|\n| 31:16 | rw | 0x0 | [NCO](#ctrl--nco) |", "rtl_excerpt": "", "question": "Using the simplified NCO formula and rounding down to an integer (the CTRL.NCO field only accepts integer values), what decimal value must be written to CTRL.NCO to configure 9600 baud when the UART clock f_pclk is 24 MHz?", "answer_format": "exact_value", "gold_answer": "419", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "simplified formula NCO = 2^20 * f_baud / f_pclk appears verbatim in hw/ip/uart/doc/programmers_guide.md, section Configuration; CTRL.NCO is 16 bits (bits 31:16) and integer-only appears verbatim in hw/ip/uart/doc/programmers_guide.md and hw/ip/uart/doc/registers.md, sections Configuration and CTRL; 2^20 * 9600 / 24,000,000 = 419.43 -> 419", "difficulty": "hard"} {"id": "uart-t2-004", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/uart/doc/programmers_guide.md; hw/ip/uart/doc/registers.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "### Reset\n\nBefore utilizing the UART, it is recommended to reset the UART and clear any existing state.\nYou can do this by writing `0x0` to the [`CTRL`](registers.md#ctrl) register, and then writing `0x1` to [`FIFO_CTRL.RXRST`](registers.md#fifo_ctrl--rxrst) and [`FIFO_CTRL.TXRST`](registers.md#fifo_ctrl--txrst), which will clear the UART's FIFOs.\n\n### FIFO_CTRL\nUART FIFO control register\n- Offset: `0x20`\n\n| Bits | Type | Reset | Name |\n|:------:|:------:|:-------:|:-----------------------------|\n| 31:8 | | | Reserved |\n| 7:5 | rw | 0x0 | [TXILVL](#fifo_ctrl--txilvl) |\n| 4:2 | rw | 0x0 | [RXILVL](#fifo_ctrl--rxilvl) |\n| 1 | wo | 0x0 | [TXRST](#fifo_ctrl--txrst) |\n| 0 | wo | 0x0 | [RXRST](#fifo_ctrl--rxrst) |\n\n### FIFO_CTRL . TXRST\nTX fifo reset. Write 1 to the register resets TX_FIFO. Read returns 0\n\n### FIFO_CTRL . RXRST\nRX fifo reset. Write 1 to the register resets RX_FIFO. Read returns 0", "rtl_excerpt": "", "question": "A single write to FIFO_CTRL should clear both the TX and RX FIFOs. Given the bit positions of FIFO_CTRL.TXRST and FIFO_CTRL.RXRST, what value should be written to FIFO_CTRL?", "answer_format": "exact_value", "gold_answer": "0x3", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "write 0x1 to FIFO_CTRL.RXRST and FIFO_CTRL.TXRST clears the FIFOs appears verbatim in hw/ip/uart/doc/programmers_guide.md, section Initialization > Reset; TXRST is bit 1 and RXRST is bit 0 of FIFO_CTRL appears verbatim in hw/ip/uart/doc/registers.md, section FIFO_CTRL; bits 1 and 0 set -> 0x3", "difficulty": "medium"} {"id": "uart-t2-005", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/uart/doc/programmers_guide.md; hw/ip/uart/doc/registers.md; hw/ip/uart/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "One potential use of the [`INTR_STATE.RX_TIMEOUT`](registers.md#intr_state) interrupt is for when the [`FIFO_CTRL.RXILVL`](registers.md#fifo_ctrl--rxilvl) field is configured for some watermark value **greater than one**.\nIn this scenario, an interrupt will only be fired when the the FIFO is filled over a certain level.\nIf the remote device sends fewer characters than the configured watermark before it stops sending (e.g. it may be waiting for an acknowledgement) then the usual `rx_watermark` interrupt would not be raised.\nInstead, after some time an `rx_timeout` interrupt can be generated that would then allow the device to read these additional characters.\n\n### FIFO_CTRL . RXILVL\nTrigger level for RX interrupts. If the FIFO depth is greater than or equal to\nthe setting, it raises rx_watermark interrupt.\n\n| Value | Name | Description |\n|:--------|:--------|:--------------|\n| 0x0 | rxlvl1 | 1 character |\n| 0x1 | rxlvl2 | 2 characters |\n| 0x2 | rxlvl4 | 4 characters |\n| 0x3 | rxlvl8 | 8 characters |\n| 0x4 | rxlvl16 | 16 characters |\n| 0x5 | rxlvl32 | 32 characters |\n| 0x6 | rxlvl62 | 62 characters |", "rtl_excerpt": "", "question": "FIFO_CTRL.RXILVL is programmed to 0x2 and the RX timeout feature is enabled. The remote device sends exactly 3 characters and then stops. Which interrupt fires for these characters? A) rx_watermark immediately B) rx_timeout after the programmed timeout period C) rx_overflow D) tx_empty. Answer with the letter.", "answer_format": "multiple_choice", "gold_answer": "B", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "0x2 = 4 characters appears verbatim in hw/ip/uart/doc/registers.md, section FIFO_CTRL . RXILVL; rx_watermark requires FIFO depth >= setting (same section); the scenario of a remote device sending fewer characters than the watermark -> rx_watermark not raised, rx_timeout generated instead, appears verbatim in hw/ip/uart/doc/programmers_guide.md, section Interrupt Handling; 3 < 4 so rx_watermark is not raised and rx_timeout fires", "difficulty": "hard", "options": ["A) rx_watermark immediately", "B) rx_timeout after the programmed timeout period", "C) rx_overflow", "D) tx_empty"]} {"id": "uart-t3-001", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0", "file": "hw/ip/uart/doc/programmers_guide.md"}, "spec_excerpt": "### Setting the baud rate\n\nThe baud rate is set by writing to the [`CTRL.NCO`](registers.md#ctrl) register field.\nThis should be set using the equation below, where `f_pclk` is the system clock frequency provided to the UART, and `f_baud` is the desired baud rate (in bits per second).\n\n$$ NCO = 16 \\times {{2^{$bits(NCO)} \\times f\\_{baud}} \\over {f\\_{pclk}}} $$\n\nThe formula above depends on the NCO field width.\nThe logic creates a x16 tick when the NCO counter overflows.\nSo, the computed baud rate from NCO value is below.\n\n$$ f\\_{baud} = {{1 \\over 16} \\times {NCO \\over {2^{$bits(NCO)}}} \\times {f\\_{pclk}}} $$\n\nNote that the NCO result from the above formula can be a fraction but the NCO register only accepts an integer value.\nThis will create an error if the baud rate is not divisible by the fixed clock frequency.\nAs discussed in the previous section the error rate between the receiver and remote transmitter should be lower than `8 / 144` to latch a correct character value when parity is not used and lower than `8 / 160` when parity is used.\nIn the expectation that the device the other side of the line behaves similarly, this requires each side have a baud rate that is matched to within +/- 2.5% of the ideal baud rate.\nThe contribution to this error if NCO is rounded down to an integer (which will make the actual baud rate always lower or equal to the requested rate) can be computed from:\n\n$$ Error = {{(NCO - INT(NCO))} \\over {NCO}} percent $$\n\nIn this case if the resulting value of NCO is greater than $$ {1 \\over 0.025} = 40 $$ then this will always be less than the 2.5% error target.\n\nFor NCO less than 40 the error in baud rate may or may not be acceptable and should be carefully checked and rounding to the nearest integer may achieve better results.\nIf the computed value is close to an integer so that the error in the target range then the baud rate can be supported, however if it is too far off an integer then the baud rate cannot be supported.\nThis check is needed when\n\n$$ {{baud} < {{40 * f\\_{pclk}} \\over {2^{$bits(NCO)+4}}}} \\qquad OR \\qquad\n{{f\\_{pclk}} > {{{2^{$bits(NCO)+4}} * {baud}} \\over {40}}} $$\n\nUsing rounded frequencies and common baud rates, this implies that care is needed for 9600 baud and below if the system clock is over 250MHz, with 4800 baud and below if the system clock is over 125MHz, 2400 baud and below if the system clock is over 62MHz, and 1200 baud and below if the system clock is over 31MHz.\n\n\n\n---\n\n### Configuration\n\nTo program the baud rate of the UART, the clock rate of the Numerically Controlled Oscillator ([`CTRL.NCO`](registers.md#ctrl--nco)) can be configured.\nThe `NCO` is calculated using the following equation:\n\n$$ NCO = {{16 * 2^{bits(NCO)} * f\\_{baud}} \\over {f\\_{pclk}}} $$\n\nWhere `f_baud` is the desired baud rate in bits per second, and `f_pclk` is the fixed clock frequency of the UART's main clock input.\nFor example, in Earlgrey's design this is currently configured as the IO clock divided by 4.\nThe additional multiple of 16 arises from the 16x [oversampling](theory_of_operation.md#reception) applied by the UART.\n\nThe [`CTRL.NCO`](registers.md#ctrl--nco) field is 16 bits, meaning that you can use a simplified calculation:\n\n$$ NCO = {{2^{19} * f\\_{baud}} \\over {f\\_{pclk}}} $$\n\nNote that the result of the above formulae can be some non-integer value, whilst the [`CTRL.NCO`](registers.md#ctrl--nco) field only accepts integer values.\nSee the \"[Reception](theory_of_operation.md#reception)\" and \"[Setting the baud rate](theory_of_operation.md#setting-the-baud-rate)\" sections of the theory of operation documentation for more discussion of these calculations and targeting specific baud rate errors -- and clarifications on cases where extra care may be needed.\n\nAlso note that when calculating the baud rate, some care is needed not to overflow 32 bit integer types.\nAs the baud rate is multiplied by `2^20`, and baud rates can easily exceed 12 bits, you must be careful to use 64-bit arithmetic.\nThe following code snippet shows an example of handling this:\n\n```cpp\n#define CLK_FIXED_FREQ_HZ (24ULL * 1000 * 1000)\n\nvoid uart_init(unsigned int baud) {\n uint64_t nco = ((uint64_t)baud << 20) / CLK_FIXED_FREQ_HZ;\n // ...\n}\n```\n\nAnother recommendation is to compute the masked version of the final 16-bit `NCO` value, to be sure that it matches the calculated `NCO`.\nFor certain configurations (e.g. a UART baud rate of 1.6 Mbps, and a clock of 24 MHz) this may not be the case -- the requested baud rate may be too high for the clock frequency.\nIn these cases, you must determine if the error is tolerable and how such cases should be handled.\n\nThen, the following steps can be customized to configure the UART as desired:\n\n1. Write the [`CTRL`](registers.md#ctrl) register with the calculated [`CTRL.NCO`](registers.md#ctrl--nco) value, also writing `0x1` to [`CTRL.TX`](registers.md#ctrl--tx) and [`CTRL.RX`](registers.md#ctrl--rx) fields to enable UART transmission and reception respectively.\n Parity can be optionally enabled by writing `0x1` to the [`CTRL.PARITY_EN`](registers.md#ctrl--parity_en) field, whereas [`CTRL.PARITY_ODD`](registers.md#ctrl--parity_odd) configures the type of parity (`0x0` is even, `0x1` is odd).\n\n2. Optionally write FIFO watermark interrupt thresholds to the [`FIFO_CTRL.TXILVL`](registers.md#fifo_ctrl--txilvl) and [`FIFO_CTRL.RXILVL`](registers.md#fifo_ctrl--rxilvl) fields.\n See the register documentation for exact thresholds -- for example, you could write a TX level of `0x4` and an RX level of `0x0` to configure interrupts when there are 16 or less characters in the TX FIFO, and 1 or more characters in the RX FIFO.\n\n3. Optionally write `0x1` to the fields of the [`INTR_ENABLE`](registers.md#intr_enable) register to configure any interrupts that you would like to enable.\n A common configuration would be to enable the `tx_watermark` and `rx_watermark` interrupts, along with any break, error and/or overflow conditions (`rx_break_err`, `rx_frame_err`, `rx_parity_err` and `rx_overflow`).\n Note that these UART interrupts should also be enabled at the processor level via the PLIC.\n", "rtl_excerpt": "", "question": "The excerpt below was derived from the UART spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Configuration section: 'NCO = 2^19 * f_baud / f_pclk' vs the theory-of-operation equation 'NCO = 16 x 2^bits(NCO) x f_baud / f_pclk' with bits(NCO)=16 (hence 2^20), the example code '((uint64_t)baud << 20)', and the note 'the baud rate is multiplied by 2^20'\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The theory section derives NCO = 16 * 2^bits(NCO) * f_baud / f_pclk; with the documented 16-bit NCO field that is 2^20 * f_baud / f_pclk, confirmed by the '<< 20' example code and the 'multiplied by 2^20' overflow note. The mutated simplified equation uses 2^19, halving every computed NCO value.\"}", "mutation": {"type": "changed_number", "original": "2^{20} * f\\_{baud}", "mutated": "2^{19} * f\\_{baud}", "location": "Programmer's Guide 'Configuration' section, simplified NCO equation"}, "verification": "original text verified verbatim in uart_excerpt_1_txrx_timing_baud.md; mutation reverted restores consistency", "difficulty": "hard"} {"id": "uart-t3-002", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0", "file": "hw/ip/uart/doc/registers.md"}, "spec_excerpt": "#### tx_watermark / tx_empty / rx_watermark\n\nIf the TX FIFO level becomes smaller than the TX water mark level (configurable via [`FIFO_CTRL.TXILVL`](registers.md#fifo_ctrl--txilvl)), the `tx_watermark` interrupt is raised to inform SW.\nIf the TX FIFO is empty, the `tx_empty` interrupt is raised to inform SW.\nIf the RX FIFO level becomes greater than or equal to RX water mark level (configurable via [`FIFO_CTRL.RXILVL`](registers.md#fifo_ctrl--rxilvl)), the `rx_watermark` interrupt is raised to inform SW.\n\nNote that the watermark interrupts and the empty interrupt are level-based status interrupts.\nThey will stay asserted for as long as the FIFO levels are in violation of the configured level and cannot be cleared by writing to the status register.\nThis also means that `tx_watermark` and `tx_empty` start off in an asserted state (reset high).\n\n### FIFO_CTRL . TXILVL\nTrigger level for TX interrupts. If the FIFO depth is greater than or equal to the setting, it\nraises tx_watermark interrupt.\n\n| Value | Name | Description |\n|:--------|:--------|:--------------|\n| 0x0 | txlvl1 | 1 character |\n| 0x1 | txlvl2 | 2 characters |\n| 0x2 | txlvl4 | 4 characters |\n| 0x3 | txlvl8 | 8 characters |\n| 0x4 | txlvl16 | 16 characters |\n\nOther values are reserved.\n\n2. Optionally write FIFO watermark interrupt thresholds to the [`FIFO_CTRL.TXILVL`](registers.md#fifo_ctrl--txilvl) and [`FIFO_CTRL.RXILVL`](registers.md#fifo_ctrl--rxilvl) fields.\n See the register documentation for exact thresholds -- for example, you could write a TX level of `0x4` and an RX level of `0x0` to configure interrupts when there are 16 or less characters in the TX FIFO, and 1 or more characters in the RX FIFO.\n", "rtl_excerpt": "", "question": "The excerpt below was derived from the UART spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"FIFO_CTRL.TXILVL register text ('greater than or equal to the setting raises tx_watermark') vs the theory section ('If the TX FIFO level becomes smaller than the TX water mark level ... the tx_watermark interrupt is raised') and the programming example ('interrupts when there are 16 or less characters in the TX FIFO')\", \"category\": \"RULE_INVERSION\", \"explanation\": \"The theory and the worked example both define the TX watermark as firing when the TX FIFO level drops below the threshold; the mutated register description inverts this to firing when the level is at or above the threshold, which would make tx_watermark behave like rx_watermark.\"}", "mutation": {"type": "rule_inversion", "original": "If the FIFO depth is less than the setting, it\nraises tx_watermark interrupt.", "mutated": "If the FIFO depth is greater than or equal to the setting, it\nraises tx_watermark interrupt.", "location": "Register reference 'FIFO_CTRL . TXILVL' description"}, "verification": "original text verified verbatim in uart_excerpt_1/2/3 files; mutation reverted restores consistency", "difficulty": "medium"} {"id": "uart-t3-003", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0", "file": "hw/ip/uart/doc/theory_of_operation.md"}, "spec_excerpt": "#### rx_timeout\n\nThe `rx_timeout` interrupt is triggered when the RX FIFO has data sitting in it without software reading it for a programmable number of bit times (using the baud rate clock as reference, programmable via [`FIFO_CTRL`](registers.md#fifo_ctrl)).\nThis is used to alert software that it has data still waiting in the FIFO that has not been handled yet.\nThe timeout counter is reset whenever the FIFO depth is changed or an `rx_timeout` event occurs.\nIf the RX FIFO is full and new character is received, it won't reset the timeout value.\nThe software is responsible for keeping the RX FIFO in the level below the watermark.\nThe actual timeout time can vary based on the reset of the timeout timer and the start of the transaction.\nFor instance, if the software resets the timeout timer by reading a character from the RX FIFO and right after it there is a baud clock tick and the start of a new RX transaction from the host, the timeout time is reduced by 1 and half baud clock periods.\n\n## TIMEOUT_CTRL\nUART RX timeout control\n- Offset: `0x30`\n- Reset default: `0x0`\n- Reset mask: `0x80ffffff`\n\n### Fields\n\n\n| Bits | Type | Reset | Name | Description |\n|:------:|:------:|:-------:|:-------|:-----------------------------------|\n| 31 | rw | 0x0 | EN | Enable RX timeout feature |\n| 30:24 | | | | Reserved |\n| 23:0 | rw | 0x0 | VAL | RX timeout value in UART bit times |\n", "rtl_excerpt": "", "question": "The excerpt below was derived from the UART spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"rx_timeout theory ('programmable via FIFO_CTRL') vs the TIMEOUT_CTRL register documentation in the same excerpt (EN bit 31 enables the RX timeout feature; VAL bits 23:0 hold the timeout value in UART bit times), while FIFO_CTRL only documents TXILVL/RXILVL watermark levels and TXRST/RXRST FIFO resets\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The mutated reference sends the reader to FIFO_CTRL, which contains no timeout programming interface; the excerpt's own TIMEOUT_CTRL register block documents EN and VAL as the fields that actually program the rx_timeout period.\"}", "mutation": {"type": "crossref_conflict", "original": "programmable via [`TIMEOUT_CTRL`](registers.md#timeout_ctrl)", "mutated": "programmable via [`FIFO_CTRL`](registers.md#fifo_ctrl)", "location": "Theory 'rx_timeout' paragraph, register cross-reference"}, "verification": "original text verified verbatim in uart_excerpt_2/3 files; mutation reverted restores consistency", "difficulty": "medium"} {"id": "uart-t3-004", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0", "file": "hw/ip/uart/doc/theory_of_operation.md"}, "spec_excerpt": "#### rx_parity_err\n\nThe `rx_parity_err` interrupt is triggered if the RX parity bit does not match the expected polarity as programmed in [`CTRL.PARITY_ODD`](registers.md#ctrl--parity_odd).\n\n### Serial interface (both directions)\n\nThe TX/RX serial lines are high when idle.\nData starts with a START bit (high idle state deasserts, **1**-->**0**) followed by 8 data bits.\nThe least significant bit is sent first.\nIf the parity feature is turned on, then an odd or even parity bit follows after the data bits.\nFinally a STOP (**1**) bit completes one byte of data transfer.\n\n### CTRL . PARITY_ODD\nIf PARITY_EN is true, this determines the type, 1 for odd parity, 0 for even.\n\n### CTRL . PARITY_EN\nIf true, parity is enabled in both RX and TX directions.\n", "rtl_excerpt": "", "question": "The excerpt below was derived from the UART spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated rx_parity_err rule (fires whenever the RX parity bit mismatches) vs the serial-interface section ('If the parity feature is turned on, then an odd or even parity bit follows after the data bits') and CTRL.PARITY_EN ('If true, parity is enabled in both RX and TX directions'): with parity disabled there is no RX parity bit at all, so the condition-free rule can never be evaluated\", \"category\": \"MISSING_CONDITION\", \"explanation\": \"Deleting 'if parity is enabled' leaves a rule that compares a parity bit that the spec says only exists when the parity feature is turned on; the two statements are jointly contradictory because the trigger condition is only meaningful under the deleted condition.\"}", "mutation": {"type": "deleted_condition", "original": "The `rx_parity_err` interrupt is triggered if parity is enabled and the RX parity bit does not match the expected polarity as programmed in [`CTRL.PARITY_ODD`](registers.md#ctrl--parity_odd).", "mutated": "The `rx_parity_err` interrupt is triggered if the RX parity bit does not match the expected polarity as programmed in [`CTRL.PARITY_ODD`](registers.md#ctrl--parity_odd).", "location": "Theory 'rx_parity_err' paragraph (condition deleted)"}, "verification": "original text verified verbatim in uart_excerpt_1/2/3 files; mutation reverted restores consistency", "difficulty": "medium"} {"id": "uart-t3-005", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0", "file": "hw/ip/uart/doc/theory_of_operation.md"}, "spec_excerpt": "### Reception\n\nThe RX module oversamples the RX input pin at 16x the requested baud clock.\nWhen the input is detected low the receiver will check half a bit-time later (i.e. 4 cycles of the oversample clock) that the line is still low before detecting the START bit.\nIf the line has returned high the glitch is ignored.\nAfter it detects the START bit, the RX module samples at the center of each bit-time and gathers incoming serial bits into a character buffer.\nIf the STOP bit is detected as high and the optional parity bit is correct the data byte is pushed into a 64-byte RX FIFO.\nThe data can be read out by reading the [`RDATA`](registers.md#rdata) register.\n\nThis behavior of the receiver can be used to compute the approximate baud clock frequency error that can be tolerated between the transmitter at the other end of the cable and the receiver.\nThe initial sample point is aligned with the center of the START bit.\nThe receiver will then sample every 16 cycles of the oversampling clock, the diagram below shows the number of ticks after the centering that each bit is captured.\nBecause of the frequency difference between the transmitter and receiver the actual sample point will drift compared to the ideal center of the bit.\nIn order to correctly receive the STOP bit it must be sampled between the \"early\" and \"late\" points shown on the diagram, which are half a bit-time or 8 ticks of the 16x baud clock before or after the center.\nIf the transmitter is considered \"ideal\", then the local clock must thus differ by no more than plus or minus 8 ticks in 144, or approximately +/- 5.5%.\nIf parity is enabled the stop bit will be a bit time later, so this becomes 8/160, or about +/- 5%.\n\n\nIn practice, the transmitter and receiver will both differ from the ideal baud rate.\nSince the worst case difference for reception is 5%, the uart can be expected to work if both sides are within +/- 2.5% of the ideal baud rate.\n\n---\n", "rtl_excerpt": "", "question": "The excerpt below was derived from the UART spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Reception paragraph ('check half a bit-time later, i.e. 4 cycles of the oversample clock') vs the same section's later statements: 'half a bit-time or 8 ticks of the 16x baud clock', 'the receiver will then sample every 16 cycles of the oversampling clock', and the +/- 8-ticks-in-144 error budget\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"With 16x oversampling, half a bit-time is 8 oversample cycles (the excerpt later states exactly this: 'half a bit-time or 8 ticks of the 16x baud clock'). The mutated '4 cycles' contradicts that arithmetic and the 8/144 error calculation built on it.\"}", "mutation": {"type": "changed_number", "original": "(i.e. 8 cycles of the oversample clock)", "mutated": "(i.e. 4 cycles of the oversample clock)", "location": "Theory 'Reception' paragraph, START-bit check timing"}, "verification": "original text verified verbatim in uart_excerpt_1_txrx_timing_baud.md; mutation reverted restores consistency", "difficulty": "medium"} {"id": "uart-t3-006", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0", "file": "hw/ip/uart/doc/theory_of_operation.md"}, "spec_excerpt": "#### tx_watermark / tx_empty / rx_watermark\n\nIf the TX FIFO level becomes smaller than the TX water mark level (configurable via [`FIFO_CTRL.TXILVL`](registers.md#fifo_ctrl--txilvl)), the `tx_watermark` interrupt is raised to inform SW.\nIf the TX FIFO is empty, the `tx_empty` interrupt is raised to inform SW.\nIf the RX FIFO level becomes greater than or equal to RX water mark level (configurable via [`FIFO_CTRL.RXILVL`](registers.md#fifo_ctrl--rxilvl)), the `rx_watermark` interrupt is raised to inform SW.\n\nNote that the watermark interrupts and the empty interrupt are level-based status interrupts.\nThey will stay asserted for as long as the FIFO levels are in violation of the configured level and can be cleared by writing to the status register.\nThis also means that `tx_watermark` and `tx_empty` start off in an asserted state (reset high).\n\n*Register fields (from the register reference):*\n\n## INTR_STATE\nInterrupt State Register\n- Offset: `0x0`\n- Reset default: `0x101`\n- Reset mask: `0x1ff`\n\n### Fields\n\n\n| Bits | Type | Reset | Name | Description |\n|:------:|:------:|:-------:|:--------------|:---------------------------------------------------------------------------------------------------------------|\n| 31:9 | | | | Reserved |\n| 8 | ro | 0x1 | tx_empty | raised if the transmit FIFO is empty. |\n| 7 | rw1c | 0x0 | rx_parity_err | raised if the receiver has detected a parity error. |\n| 6 | rw1c | 0x0 | rx_timeout | raised if RX FIFO has characters remaining in the FIFO without being retrieved for the programmed time period. |\n| 5 | rw1c | 0x0 | rx_break_err | raised if break condition has been detected on receive. |\n| 4 | rw1c | 0x0 | rx_frame_err | raised if a framing error has been detected on receive. |\n| 3 | rw1c | 0x0 | rx_overflow | raised if the receive FIFO has overflowed. |\n| 2 | rw1c | 0x0 | tx_done | raised if the transmit FIFO has emptied and no transmit is ongoing. |\n| 1 | ro | 0x0 | rx_watermark | raised if the receive FIFO is past the high-water mark. |\n| 0 | ro | 0x1 | tx_watermark | raised if the transmit FIFO is past the high-water mark. |\n", "rtl_excerpt": "", "question": "The excerpt below was derived from the UART spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated note ('stay asserted ... and can be cleared by writing to the status register') vs (a) its own first clause ('stay asserted for as long as the FIFO levels are in violation') and (b) the INTR_STATE field table in the same excerpt, where tx_watermark, rx_watermark and tx_empty are all Type 'ro' (read-only), so a status-register write cannot change them\", \"category\": \"RULE_INVERSION\", \"explanation\": \"Flipping 'cannot' to 'can' contradicts both the sentence's own 'stay asserted while levels are in violation' clause and the register table: the three level-based bits are read-only, so writing the status register cannot clear them.\"}", "mutation": {"type": "rule_inversion", "original": "cannot be cleared by writing to the status register", "mutated": "can be cleared by writing to the status register", "location": "Theory 'Interrupts' note on level-based watermark/empty interrupts"}, "verification": "original text verified verbatim in uart_excerpt_2_interrupts.md; mutation reverted restores consistency", "difficulty": "hard"} {"id": "uart-t3-007", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0", "file": "hw/ip/uart/doc/registers.md"}, "spec_excerpt": "## STATUS\nUART live status register\n- Offset: `0x14`\n- Reset default: `0x1c`\n- Reset mask: `0x3f`\n\n### Fields\n\n\n| Bits | Type | Reset | Name | Description |\n|:------:|:------:|:-------:|:--------|:----------------------------------------------------|\n| 31:6 | | | | Reserved |\n| 5 | ro | 0x1 | RXEMPTY | RX FIFO is empty |\n| 4 | ro | 0x1 | RXIDLE | RX is idle |\n| 3 | ro | 0x1 | TXIDLE | TX FIFO is empty and all bits have been transmitted |\n| 2 | ro | 0x1 | TXEMPTY | TX FIFO is empty |\n| 1 | ro | x | RXFULL | RX buffer is full |\n| 0 | ro | x | TXFULL | TX buffer is full |\n", "rtl_excerpt": "", "question": "The excerpt below was derived from the UART spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"STATUS header ('Reset default: 0x1c') vs the STATUS field table in the same excerpt: bit 5 RXEMPTY resets to 0x1, but 0x1c = 0b0001_1100 has bit 5 clear (bits 4,3,2 set only), so the header value is incompatible with the documented per-field reset values\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The field table requires bits 5,4,3,2 (RXEMPTY, RXIDLE, TXIDLE, TXEMPTY) all reset to 1, i.e. 0x3c; the mutated 0x1c clears bit 5, directly contradicting RXEMPTY's documented reset value of 0x1.\"}", "mutation": {"type": "changed_number", "original": "- Reset default: `0x3c`", "mutated": "- Reset default: `0x1c`", "location": "Register reference 'STATUS' header, reset default"}, "verification": "original text verified verbatim in uart_excerpt_3_ctrl_fifo_registers.md; mutation reverted restores consistency", "difficulty": "medium"} {"id": "uart-t3-008", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0", "file": "hw/ip/uart/doc/programmers_guide.md"}, "spec_excerpt": "One potential use of the [`INTR_STATE.RX_TIMEOUT`](registers.md#intr_state) interrupt is for when the [`FIFO_CTRL.TXILVL`](registers.md#fifo_ctrl--txilvl) field is configured for some watermark value **greater than one**.\nIn this scenario, an interrupt will only be fired when the the FIFO is filled over a certain level.\nIf the remote device sends fewer characters than the configured watermark before it stops sending (e.g. it may be waiting for an acknowledgement) then the usual `rx_watermark` interrupt would not be raised.\nInstead, after some time an `rx_timeout` interrupt can be generated that would then allow the device to read these additional characters.\n\nThe [`TIMEOUT_CTRL`](registers.md#timeout_ctrl) register can be used to enable and configure this timeout value.\nThis timeout can therefore be selected based on the worst latency experienced by any individual character.\nIf characters happen to continue to arrive *just slower* than the configured timeout (the second character arrives just before the timeout for the first, the third just before the timeout for the second, etc.) then in this case the host will eventually receive an `rx_watermark` interrupt.\nThis will happen `((RXILVL - 1) * RX_TIMEOUT)` units after the first character was received, providing an upper bound on the possible latency.\n\n### FIFO_CTRL . TXILVL\nTrigger level for TX interrupts. If the FIFO depth is less than the setting, it\nraises tx_watermark interrupt.\n\n| Value | Name | Description |\n|:--------|:--------|:--------------|\n| 0x0 | txlvl1 | 1 character |\n| 0x1 | txlvl2 | 2 characters |\n| 0x2 | txlvl4 | 4 characters |\n| 0x3 | txlvl8 | 8 characters |\n| 0x4 | txlvl16 | 16 characters |\n\nOther values are reserved.\n\n### FIFO_CTRL . RXILVL\nTrigger level for RX interrupts. If the FIFO depth is greater than or equal to\nthe setting, it raises rx_watermark interrupt.\n\n| Value | Name | Description |\n|:--------|:--------|:--------------|\n| 0x0 | rxlvl1 | 1 character |\n| 0x1 | rxlvl2 | 2 characters |\n| 0x2 | rxlvl4 | 4 characters |\n| 0x3 | rxlvl8 | 8 characters |\n| 0x4 | rxlvl16 | 16 characters |\n| 0x5 | rxlvl32 | 32 characters |\n| 0x6 | rxlvl62 | 62 characters |\n\nOther values are reserved.\n", "rtl_excerpt": "", "question": "The excerpt below was derived from the UART spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated paragraph (RX_TIMEOUT useful when FIFO_CTRL.TXILVL is configured above one; 'an interrupt will only be fired when the FIFO is filled over a certain level'; 'the usual rx_watermark interrupt would not be raised') vs the FIFO_CTRL field documentation in the same excerpt: TXILVL raises tx_watermark when the TX FIFO depth is less than the setting, while RXILVL raises rx_watermark when the RX FIFO depth is greater than or equal to the setting\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The paragraph describes RX-side, fill-above-threshold watermark semantics (rx_watermark), but names TXILVL, which the same excerpt documents as the TX-side, drain-below-threshold trigger for tx_watermark. The reference points at the wrong register field for the behavior described.\"}", "mutation": {"type": "crossref_conflict", "original": "the [`FIFO_CTRL.RXILVL`](registers.md#fifo_ctrl--rxilvl) field is configured", "mutated": "the [`FIFO_CTRL.TXILVL`](registers.md#fifo_ctrl--txilvl) field is configured", "location": "Programmer's Guide 'Interrupt Handling' rx_timeout usage paragraph, register reference"}, "verification": "original text verified verbatim in uart_excerpt_3/4 files; mutation reverted restores consistency", "difficulty": "medium"} {"id": "uart-t3-009", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0", "file": "hw/ip/uart/doc/theory_of_operation.md"}, "spec_excerpt": "#### rx_overflow\n\nIf RX FIFO receives an additional write request, the interrupt `rx_overflow` is asserted and the character is dropped.\n\n\n---\n\nReception (theory of operation):\n\nIf the STOP bit is detected as high and the optional parity bit is correct the data byte is pushed into a 64-byte RX FIFO.\n\nSTATUS register:\n\n| 1 | ro | x | RXFULL | RX buffer is full |\n", "rtl_excerpt": "", "question": "The excerpt below was derived from the UART spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated rx_overflow rule (any additional write request asserts overflow and drops the character) vs the reception section ('the data byte is pushed into a 64-byte RX FIFO' as normal operation) and STATUS.RXFULL ('RX buffer is full'): every normal received byte would simultaneously be pushed and dropped with overflow asserted, and the documented fullness condition becomes meaningless\", \"category\": \"MISSING_CONDITION\", \"explanation\": \"Removing 'when its FIFO is full' turns a full-FIFO error case into the normal case: the spec's own reception flow pushes every received byte into the RX FIFO, which the mutated rule would classify as an overflow that drops the character. The two statements cannot both hold.\"}", "mutation": {"type": "deleted_condition", "original": "If RX FIFO receives an additional write request when its FIFO is full, the interrupt `rx_overflow` is asserted and the character is dropped.", "mutated": "If RX FIFO receives an additional write request, the interrupt `rx_overflow` is asserted and the character is dropped.", "location": "Theory 'rx_overflow' paragraph (condition deleted)"}, "verification": "original text verified verbatim in uart_excerpt_1/2/3 files; mutation reverted restores consistency", "difficulty": "hard"} {"id": "uart-t3-010", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0", "file": "hw/ip/uart/doc/theory_of_operation.md"}, "spec_excerpt": "#### rx_break_err\n\nThe `rx_break_err` interrupt is triggered if a break condition has been detected.\nA break condition is defined as the RX pin being continuously low for more than a programmable number of character-times (via [`CTRL.RXBLVL`](registers.md#ctrl), either 2, 4, 8, or 16).\nA character time is 10 bit-times if parity is disabled (START + 8 data + STOP) or 12 bit-times if parity is enabled (START + 8 data + parity + STOP).\nIf the UART is connected to an external connector this would typically indicate the cable has been disconnected (or there is a break in the wire).\nIf the UART is connected to another part on the same board it would typically indicate the other part has reset or rebooted (if the open connector or resetting peer part causes the RX input to not be actively driven, then a pulldown resistor is needed to ensure a break and a pullup resistor will ensure the line looks idle and no break is generated).\nNote that only one interrupt is generated per break -- the line must return high for at least half a bit-time before an additional break interrupt is generated.\nThe current break status can be read from the [`STATUS.BREAK`](registers.md#status) bit.\nIf STATUS.BREAK is set but [`INTR_STATE.BREAK`](registers.md#intr_state) is clear then the line break has already caused an interrupt that has been cleared but the line break is still going on.\nIf [`STATUS.BREAK`](registers.md#status) is clear but [`INTR_STATE.BREAK`](registers.md#intr_state) is set then there has been a line break for which software has not cleared the interrupt but the line is now back to normal.\n", "rtl_excerpt": "", "question": "The excerpt below was derived from the UART spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"rx_break_err paragraph ('A character time is ... 12 bit-times if parity is enabled (START + 8 data + parity + STOP)') vs the enumeration in the same sentence: START (1) + 8 data + parity (1) + STOP (1) = 11, not 12\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The sentence lists the frame components that sum to 11 bit-times with parity (1+8+1+1), contradicting its own headline figure of 12; this also breaks the break-detect timing ('RXBLVL character-times') computed from the character time.\"}", "mutation": {"type": "changed_number", "original": "or 11 bit-times if parity is enabled (START + 8 data + parity + STOP)", "mutated": "or 12 bit-times if parity is enabled (START + 8 data + parity + STOP)", "location": "Theory 'rx_break_err' paragraph, character-time definition"}, "verification": "original text verified verbatim in uart_excerpt_2_interrupts.md; mutation reverted restores consistency", "difficulty": "medium"} {"id": "uart-t4-001", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/uart/rtl/uart_tx.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The TX/RX serial lines are high when idle.", "rtl_excerpt": "44: \n45: always_ff @(posedge clk_i or negedge rst_ni) begin\n46: if (!rst_ni) begin\n47: bit_cnt_q <= 4'h0;\n48: sreg_q <= 11'h7ff;\n49: tx_q <= 1'b0; // <-- MUTATED\n50: end else begin\n51: bit_cnt_q <= bit_cnt_d;\n52: sreg_q <= sreg_d;\n[mutated line(s): 49]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"The TX/RX serial lines are high when idle.\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/uart/rtl/uart_tx.sv:49\", \"explanation\": \"The reset value of tx_q was changed from 1 to 0. Because tx_d feeds back tx_q while idle, the TX pin sits at 0 whenever the transmitter is idle, violating the rule that the TX/RX serial lines are high when idle.\"}", "mutation": {"type": "wrong_reset_value", "original": "tx_q <= 1'b1;", "mutated": "tx_q <= 1'b0;", "location": "hw/ip/uart/rtl/uart_tx.sv:49"}, "verification": "iverilog sim: export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd pilot/sim_t4/q001 && iverilog -g2012 -o sim.vvp orig.sv mut.sv tb.sv && vvp sim.vvp; original tx=1 vs mutated tx=0, both during reset and on the idle line after reset (tx_enable=1, no write); logs pilot/sim_t4/q001/q001.log", "difficulty": "medium"} {"id": "uart-t4-002", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/uart/rtl/uart_tx.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Finally a STOP (**1**) bit completes one byte of data transfer.", "rtl_excerpt": "63: bit_cnt_d = bit_cnt_q;\n64: sreg_d = sreg_q;\n65: tx_d = tx_q;\n66: if (wr) begin\n67: sreg_d = {1'b1, (parity_enable ? wr_parity : 1'b1), wr_data, 1'b0};\n68: bit_cnt_d = (parity_enable ? 4'd10 : 4'd9); // <-- MUTATED\n69: end else if (tick_baud_q && (bit_cnt_q != 4'h0)) begin\n70: sreg_d = {1'b1, sreg_q[10:1]};\n71: tx_d = sreg_q[0];\n[mutated line(s): 68]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"Finally a STOP (**1**) bit completes one byte of data transfer.\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/uart/rtl/uart_tx.sv:68\", \"explanation\": \"The bit counter is loaded one short, so only 10 shifts occur instead of 11. The final STOP (1) bit is never shifted out; the line instead holds the parity-bit value during the 11th bit time, so the byte transfer never completes with a STOP bit.\"}", "mutation": {"type": "counter_off_by_one", "original": "bit_cnt_d = (parity_enable ? 4'd11 : 4'd10);", "mutated": "bit_cnt_d = (parity_enable ? 4'd10 : 4'd9);", "location": "hw/ip/uart/rtl/uart_tx.sv:68"}, "verification": "iverilog sim: export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd pilot/sim_t4/q002 && iverilog -g2012 -o sim.vvp orig.sv mut.sv tb.sv && vvp sim.vvp; 11 captured line bits (parity on, wr_parity=0, data 0xA5): original ends ...par=0,STOP=1, mutated ends ...par=0,0 (STOP bit never transmitted); logs pilot/sim_t4/q002/q002.log", "difficulty": "hard"} {"id": "uart-t4-003", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/uart/rtl/uart_tx.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If TX is not enabled, written DATA into FIFO will be stacked up and sent out when TX is enabled.", "rtl_excerpt": "55: end\n56: \n57: always_comb begin\n58: if (tx_enable) begin // <-- MUTATED\n59: bit_cnt_d = 4'h0;\n60: sreg_d = 11'h7ff;\n61: tx_d = 1'b1;\n62: end else begin\n63: bit_cnt_d = bit_cnt_q;\n[mutated line(s): 58]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"If TX is not enabled, written DATA into FIFO will be stacked up and sent out when TX is enabled.\", \"category\": \"RULE_INVERSION\", \"rtl_location\": \"hw/ip/uart/rtl/uart_tx.sv:58\", \"explanation\": \"The enable polarity is inverted: with TX enabled the transmitter is forced to its idle/reset state and nothing is ever sent, while with TX disabled a written byte is transmitted immediately instead of being stacked up until TX is enabled.\"}", "mutation": {"type": "inverted_enable", "original": "if (!tx_enable) begin", "mutated": "if (tx_enable) begin", "location": "hw/ip/uart/rtl/uart_tx.sv:58"}, "verification": "iverilog sim: export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd pilot/sim_t4/q003 && iverilog -g2012 -o sim.vvp orig.sv mut.sv tb.sv && vvp sim.vvp; phase A (tx_enable=1): original transmits the 0xA5 frame, mutated holds idle-high; phase B (tx_enable=0): original holds idle-high, mutated transmits the frame; logs pilot/sim_t4/q003/q003.log", "difficulty": "medium"} {"id": "uart-t4-004", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/uart/rtl/uart_tx.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The TX module dequeues the byte from the FIFO and shifts it bit by bit out to the UART TX pin on positive edges of the baud clock.", "rtl_excerpt": "60: sreg_d = 11'h7ff;\n61: tx_d = 1'b1;\n62: end else begin\n63: bit_cnt_d = bit_cnt_q;\n64: sreg_d = sreg_q;\n65: tx_d = tx_q;\n66: if (wr) begin\n67: sreg_d = {1'b1, (parity_enable ? wr_parity : 1'b1), wr_data, 1'b0};\n68: bit_cnt_d = (parity_enable ? 4'd11 : 4'd10);\n69b: // <-- MUTATED: DELETED 'end else if (tick_baud_q && (bit_cnt_q != 4'h0)) begin' + shift-out body (sreg_d shift, tx_d = sreg_q[0], bit_cnt_d decrement)\n69: end\n70: end\n71: end\n[mutated line(s): 69 (deleted branch)]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"The TX module dequeues the byte from the FIFO and shifts it bit by bit out to the UART TX pin on positive edges of the baud clock.\", \"category\": \"MISSING_CONDITION\", \"rtl_location\": \"hw/ip/uart/rtl/uart_tx.sv:69-73 (removed)\", \"explanation\": \"The baud-tick shift transition was deleted, so once a byte is written the bit counter never decrements and sreg/tx never advance: the byte is never shifted out bit by bit and the transmitter never returns to idle.\"}", "mutation": {"type": "missing_fsm_transition", "original": "end else if (tick_baud_q && (bit_cnt_q != 4'h0)) begin ... end", "mutated": "branch removed: after if (wr) the shift-out transition is gone", "location": "hw/ip/uart/rtl/uart_tx.sv:69-73 (removed)"}, "verification": "iverilog sim: export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd pilot/sim_t4/q004 && iverilog -g2012 -o sim.vvp orig.sv mut.sv tb.sv && vvp sim.vvp; 12 line-bit slots: original shows the full 0xA5 frame then idle=1; mutated shows constant 1 with idle=0 forever (bit_cnt stuck at 10); logs pilot/sim_t4/q004/q004.log", "difficulty": "medium"} {"id": "uart-t4-005", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/uart/rtl/uart_tx.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If the parity feature is turned on, then an odd or even parity bit follows after the data bits.", "rtl_excerpt": "63: bit_cnt_d = bit_cnt_q;\n64: sreg_d = sreg_q;\n65: tx_d = tx_q;\n66: if (wr) begin\n67: sreg_d = {1'b1, wr_data, (parity_enable ? wr_parity : 1'b1), 1'b0}; // <-- MUTATED\n68: bit_cnt_d = (parity_enable ? 4'd11 : 4'd10);\n69: end else if (tick_baud_q && (bit_cnt_q != 4'h0)) begin\n70: sreg_d = {1'b1, sreg_q[10:1]};\n71: tx_d = sreg_q[0];\n[mutated line(s): 67]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"If the parity feature is turned on, then an odd or even parity bit follows after the data bits.\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/uart/rtl/uart_tx.sv:67\", \"explanation\": \"The parity bit was moved one field over in the shift-register load, so it is transmitted in the data-bit-0 slot instead of following after the 8 data bits.\"}", "mutation": {"type": "field_offset_error", "original": "sreg_d = {1'b1, (parity_enable ? wr_parity : 1'b1), wr_data, 1'b0};", "mutated": "sreg_d = {1'b1, wr_data, (parity_enable ? wr_parity : 1'b1), 1'b0};", "location": "hw/ip/uart/rtl/uart_tx.sv:67"}, "verification": "iverilog sim: export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd pilot/sim_t4/q005 && iverilog -g2012 -o sim.vvp orig.sv mut.sv tb.sv && vvp sim.vvp; 11 captured line bits (parity on, wr_parity=1, data 0xA5): original sends start,d0..d7,par,stop; mutated sends start,par,d0..d7,stop; logs pilot/sim_t4/q005/q005.log", "difficulty": "hard"} {"id": "uart-t4-006", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/uart/rtl/uart_rx.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "## STATUS\nUART live status register\n- Offset: `0x14`\n- Reset default: `0x3c`\n- Reset mask: `0x3f`\n\n| 4 | ro | 0x1 | RXIDLE | RX is idle |", "rtl_excerpt": "38: if (!rst_ni) begin\n39: sreg_q <= 11'h0;\n40: bit_cnt_q <= 4'h0;\n41: baud_div_q <= 4'h0;\n42: tick_baud_q <= 1'b0;\n43: idle_q <= 1'b0; // <-- MUTATED\n44: end else begin\n45: sreg_q <= sreg_d;\n46: bit_cnt_q <= bit_cnt_d;\n47: baud_div_q <= baud_div_d;\n48: tick_baud_q <= tick_baud_d;\n[mutated line(s): 43]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"## STATUS\\nUART live status register\\n- Offset: `0x14`\\n- Reset default: `0x3c`\\n- Reset mask: `0x3f`\\n\\n| 4 | ro | 0x1 | RXIDLE | RX is idle |\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/uart/rtl/uart_rx.sv:43\", \"explanation\": \"The receiver's idle flag resets to 0 instead of 1, so STATUS.RXIDLE reads not-idle after reset even though no reception is occurring; the phantom 'frame' then self-aborts at the glitch check and no byte is ever delivered.\"}", "mutation": {"type": "wrong_reset_value", "original": "idle_q <= 1'b1;", "mutated": "idle_q <= 1'b0;", "location": "hw/ip/uart/rtl/uart_rx.sv:43"}, "verification": "iverilog sim: export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd pilot/sim_t4/q006 && iverilog -g2012 -o sim.vvp orig.sv mut.sv tb.sv && vvp sim.vvp; original idle=1 vs mutated idle=0 during reset and ~3 bit-times after reset with the line idle-high (mutant self-aborts ~7 bit-times later); logs pilot/sim_t4/q006/q006.log", "difficulty": "medium"} {"id": "uart-t4-007", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/uart/rtl/uart_rx.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "When the input is detected low the receiver will check half a bit-time later (i.e. 8 cycles of the oversample clock) that the line is still low before detecting the START bit.\nIf the line has returned high the glitch is ignored.", "rtl_excerpt": "68: end\n69: \n70: if (idle_q && !rx) begin\n71: // start of char, sample in the middle of the bit time\n72: baud_div_d = 4'd8;\n73: tick_baud_d = 1'b0;\n74: bit_cnt_d = (parity_enable ? 4'd10 : 4'd9); // <-- MUTATED\n75: sreg_d = 11'h0;\n76: idle_d = 1'b0;\n77: end else if (!idle_q && tick_baud_q) begin\n78: if ((bit_cnt_q == (parity_enable ? 4'd11 : 4'd10)) && rx) begin\n[mutated line(s): 74]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"When the input is detected low the receiver will check half a bit-time later (i.e. 8 cycles of the oversample clock) that the line is still low before detecting the START bit.\\nIf the line has returned high the glitch is ignored.\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/uart/rtl/uart_rx.sv:74\", \"explanation\": \"With parity enabled the START-confirmation check compares bit_cnt_q against 11, but the counter now starts at 10, so the half-bit-time glitch check can never match: a glitch that has returned high is accepted as a START bit instead of being ignored.\"}", "mutation": {"type": "counter_off_by_one", "original": "bit_cnt_d = (parity_enable ? 4'd11 : 4'd10);", "mutated": "bit_cnt_d = (parity_enable ? 4'd10 : 4'd9);", "location": "hw/ip/uart/rtl/uart_rx.sv:74"}, "verification": "iverilog sim: export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd pilot/sim_t4/q007 && iverilog -g2012 -o sim.vvp orig.sv mut.sv tb.sv && vvp sim.vvp; 4-clock low glitch on idle line (parity on): original ignores it (no rx_valid), mutated treats it as START and delivers garbage byte 0xFF with rx_valid=1; logs pilot/sim_t4/q007/q007.log", "difficulty": "hard"} {"id": "uart-t4-008", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/uart/rtl/uart_rx.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "also writing `0x1` to [`CTRL.TX`](registers.md#ctrl--tx) and [`CTRL.RX`](registers.md#ctrl--rx) fields to enable UART transmission and reception respectively.", "rtl_excerpt": "50: end\n51: end\n52: \n53: always_comb begin\n54: if (rx_enable) begin // <-- MUTATED\n55: sreg_d = 11'h0;\n56: bit_cnt_d = 4'h0;\n57: baud_div_d = 4'h0;\n58: tick_baud_d = 1'b0;\n[mutated line(s): 54]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"also writing `0x1` to [`CTRL.TX`](registers.md#ctrl--tx) and [`CTRL.RX`](registers.md#ctrl--rx) fields to enable UART transmission and reception respectively.\", \"category\": \"RULE_INVERSION\", \"rtl_location\": \"hw/ip/uart/rtl/uart_rx.sv:54\", \"explanation\": \"The enable polarity is inverted: writing 1 to enable reception actually forces the receiver into its disabled/reset state, and the receiver only works when supposedly disabled.\"}", "mutation": {"type": "inverted_enable", "original": "if (!rx_enable) begin", "mutated": "if (rx_enable) begin", "location": "hw/ip/uart/rtl/uart_rx.sv:54"}, "verification": "iverilog sim: export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd pilot/sim_t4/q008 && iverilog -g2012 -o sim.vvp orig.sv mut.sv tb.sv && vvp sim.vvp; phase A (rx_enable=1): original receives byte 0x45, mutated ignores it; phase B (rx_enable=0): original ignores, mutated receives 0x45; logs pilot/sim_t4/q008/q008.log", "difficulty": "medium"} {"id": "uart-t4-009", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/uart/rtl/uart_rx.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "After it detects the START bit, the RX module samples at the center of each bit-time and gathers incoming serial bits into a character buffer.", "rtl_excerpt": "70: if (idle_q && !rx) begin\n71: // start of char, sample in the middle of the bit time\n72: baud_div_d = 4'd8;\n73: tick_baud_d = 1'b0;\n74: bit_cnt_d = (parity_enable ? 4'd11 : 4'd10);\n75: sreg_d = 11'h0;\n76: idle_d = 1'b0;\n77: end\n77b: // <-- MUTATED: DELETED 'end else if (!idle_q && tick_baud_q) begin' + sample/shift body (glitch-abort, sreg shift-in, bit_cnt decrement, idle update)\n78: end\n79: end\n80: \n[mutated line(s): 77 (deleted branch)]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"After it detects the START bit, the RX module samples at the center of each bit-time and gathers incoming serial bits into a character buffer.\", \"category\": \"MISSING_CONDITION\", \"rtl_location\": \"hw/ip/uart/rtl/uart_rx.sv:77-88 (removed)\", \"explanation\": \"The per-baud-tick sample/shift transition was deleted, so after START detection the receiver never samples the line or gathers bits: the byte is never assembled and rx_valid never fires.\"}", "mutation": {"type": "missing_fsm_transition", "original": "end else if (!idle_q && tick_baud_q) begin ... end", "mutated": "branch removed: after START detection the sample/shift transition is gone", "location": "hw/ip/uart/rtl/uart_rx.sv:77-88 (removed)"}, "verification": "iverilog sim: export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd pilot/sim_t4/q009 && iverilog -g2012 -o sim.vvp orig.sv mut.sv tb.sv && vvp sim.vvp; byte 0x45 driven on the line: original asserts rx_valid with data 0x45 and returns idle; mutated detects START then stalls (idle=0 forever, rx_valid never asserts); logs pilot/sim_t4/q009/q009.log", "difficulty": "medium"} {"id": "uart-t4-010", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/uart/rtl/uart_rx.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The least significant bit is sent first.", "rtl_excerpt": "95: \n96: end\n97: \n98: assign rx_valid = rx_valid_q;\n99: assign rx_data = parity_enable ? sreg_q[9:2] : sreg_q[10:3]; // <-- MUTATED\n100: // (rx_parity = sreg_q[9])\n101: assign frame_err = rx_valid_q & ~sreg_q[10];\n102: assign rx_parity_err = parity_enable & rx_valid_q &\n[mutated line(s): 99]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"The least significant bit is sent first.\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/uart/rtl/uart_rx.sv:99\", \"explanation\": \"The data-extraction window is shifted up by one bit, so the received byte's LSB is the transmitted second data bit instead of the first: the LSB-first reassembly is misaligned and the pushed byte is wrong.\"}", "mutation": {"type": "field_offset_error", "original": "assign rx_data = parity_enable ? sreg_q[8:1] : sreg_q[9:2];", "mutated": "assign rx_data = parity_enable ? sreg_q[9:2] : sreg_q[10:3];", "location": "hw/ip/uart/rtl/uart_rx.sv:99"}, "verification": "iverilog sim: export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd pilot/sim_t4/q010 && iverilog -g2012 -o sim.vvp orig.sv mut.sv tb.sv && vvp sim.vvp; byte 0x45 with odd parity driven on the line: original reports rx_data=0x45, mutated reports 0x22; logs pilot/sim_t4/q010/q010.log", "difficulty": "hard"} {"id": "aes-t1-001", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Then, the AES cipher core performs 9/11/13 rounds of encryption/decryption when using a 128/192/256-bit key, respectively.", "rtl_excerpt": "", "question": "How many cipher rounds does the AES unit perform for a 256-bit key?", "answer_format": "exact_value", "gold_answer": "13", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "easy"} {"id": "aes-t1-002", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/registers.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "CTRL_SHADOWED . MANUAL_OPERATION: Controls whether the AES unit is operated in normal/automatic mode (0) or fully manual mode (1). | Bits | Type | Reset | Name | | 15 | rw | 0x0 | MANUAL_OPERATION |", "rtl_excerpt": "", "question": "Which bit of CTRL_SHADOWED selects manual operation?", "answer_format": "exact_value", "gold_answer": "15", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "easy"} {"id": "aes-t1-003", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If running in CTR mode, the counter module iteratively updates the IV in parallel to the cipher core performing encryption/decryption. Internally, the counter module uses one 16-bit counter, meaning it requires 8 clock cycles to increment the 128-bit counter value stored in the IV register.", "rtl_excerpt": "", "question": "In CTR mode, how many clock cycles does the counter module need to increment the 128-bit counter value?", "answer_format": "exact_value", "gold_answer": "8", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "easy"} {"id": "aes-t1-004", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Since the counter value is used in the first round only, and since the encryption/decryption of a single block takes 12/14/16 cycles, the iterative counter implementation does not affect the throughput of the AES unit.", "rtl_excerpt": "", "question": "How many cycles does encryption/decryption of a single block take with a 128-bit key?", "answer_format": "exact_value", "gold_answer": "12", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "medium"} {"id": "aes-t1-005", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/registers.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "CTRL_SHADOWED . PRNG_RESEED_RATE: | 0x2 | PER_64 | 3'b010: Reseed the masking PRNG approximately once per every 64 blocks.", "rtl_excerpt": "", "question": "What PRNG_RESEED_RATE field value selects reseeding approximately once per every 64 blocks (PER_64)?", "answer_format": "exact_value", "gold_answer": "0x2", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "medium"} {"id": "aes-t1-006", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/registers.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "CTRL_SHADOWED . KEY_LEN: | 0x1 | AES_128 | 3'b001: 128-bit key length. | | 0x2 | AES_192 | 3'b010: 192-bit key length. | | 0x4 | AES_256 | 3'b100: 256-bit key length.", "rtl_excerpt": "", "question": "What KEY_LEN field value selects the 128-bit key length (AES_128)?", "answer_format": "exact_value", "gold_answer": "0x1", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "easy"} {"id": "aes-t1-007", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/registers.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "CTRL_SHADOWED . MODE: | 0x3f | AES_NONE | 6'b11_1111: Invalid input values, i.e., value with multiple bits set, value 6'b00_0000, and value 6'b10_0000 in case GCM is not supported (because disabled at compile time) are mapped to AES_NONE.", "rtl_excerpt": "", "question": "Invalid MODE field values are mapped to which mode?", "answer_format": "exact_value", "gold_answer": "AES_NONE", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "medium"} {"id": "aes-t2-001", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Note that all registers are little-endian. ... These registers are little-endian, but the increment of the IV in CTR mode is big-endian.", "rtl_excerpt": "", "question": "A testbench asserts that the CTR-mode IV increment uses the same endianness as the IV registers. Which statement is correct? A) The assertion holds: both are little-endian. B) The assertion fails: registers are little-endian but the CTR-mode IV increment is big-endian. C) The assertion fails: registers are big-endian but the CTR-mode IV increment is little-endian. D) The spec does not define the IV increment endianness.", "answer_format": "multiple_choice", "gold_answer": "B", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; rewritten 2026-09-25: original question telegraphed the answer (contrast given in question); neutral MC rewrite preserves cross-section reasoning without leaking", "difficulty": "medium", "options": ["A) The assertion holds: both are little-endian", "B) The assertion fails: registers are little-endian but the CTR-mode IV increment is big-endian", "C) The assertion fails: registers are big-endian but the CTR-mode IV increment is little-endian", "D) The spec does not define the IV increment endianness"]} {"id": "aes-t2-002", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Note, for the AES unit to automatically start in CBC, CFB, OFB or CTR mode, also the IV must be ready. The IV is ready if -- since the last IV update (either done by the processor or the AES unit itself) -- all IV registers have been written at least once or none of them. The AES unit will not automatically start the next encryption/decryption with a partially updated IV.", "rtl_excerpt": "", "question": "In CTR mode, software has written IV_0, IV_1 and IV_2 but not IV_3 since the last IV update, then writes all four input data registers. Does the AES unit automatically start encryption?", "answer_format": "exact_value", "gold_answer": "No, the IV is partially updated", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "medium"} {"id": "aes-t2-003", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "To this end, the processor has to set the SIDELOAD bit in CTRL_SHADOWED to 1. Any write operations of the processor to the Initial Key registers KEY_SHARE0_0 - KEY_SHARE1_7 are then ignored.", "rtl_excerpt": "", "question": "With CTRL_SHADOWED.SIDELOAD set to 1, do processor writes to KEY_SHARE0_0 take effect?", "answer_format": "exact_value", "gold_answer": "No, they are ignored", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "easy"} {"id": "aes-t2-004", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/registers.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "TRIGGER . START: Keep AES unit paused (0) or trigger the encryption/decryption of one data block (1). This trigger is cleared to 0 if MANUAL_OPERATION=0 or if MODE=AES_NONE (see Control Register).", "rtl_excerpt": "", "question": "In automatic mode (MANUAL_OPERATION=0), what happens to the TRIGGER.START bit?", "answer_format": "exact_value", "gold_answer": "cleared to 0", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "medium"} {"id": "aes-t2-005", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/registers.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "STATUS . OUTPUT_LOST: All previous output data has been fully read by the processor (0) or at least one previous output data block has been lost (1). It has been overwritten by the AES unit before the processor could fully read it. Once set to 1, this flag remains set until AES operation is restarted by re-writing the Control Register. The primary use of this flag is for design verification. This flag is not meaningful if MANUAL_OPERATION=0 (see Control Register).", "rtl_excerpt": "", "question": "In automatic mode (MANUAL_OPERATION=0), is STATUS.OUTPUT_LOST meaningful?", "answer_format": "exact_value", "gold_answer": "No", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "medium"} {"id": "aes-t2-006", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Software configures the CTRL_GCM_SHADOWED.PHASE to GCM_SAVE and the NUM_VALID_BYTES field to 16. Software should check the CTRL_GCM_SHADOWED.PHASE field. If it does not read as GCM_TAG, the previous write operation did not go through, e.g., because moving to this phase is only possible after having processed a first AAD or plaintext/ciphertext block.", "rtl_excerpt": "", "question": "During GCM context saving, software writes GCM_SAVE to CTRL_GCM_SHADOWED.PHASE but the field does not read back as GCM_TAG. What does this mean?", "answer_format": "exact_value", "gold_answer": "the write did not go through, e.g. no AAD or plaintext/ciphertext block has been processed yet", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "hard"} {"id": "aes-t2-007", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "After finishing operation, software must: 1. Disable the AES unit to no longer automatically start encryption/decryption by setting the MANUAL_OPERATION bit in CTRL_SHADOWED to 1. 2. Clear all key registers, IV registers as well as the Input Data and the Output Data registers with pseudo-random data by setting the KEY_IV_DATA_IN_CLEAR and DATA_OUT_CLEAR bits in TRIGGER to 1.", "rtl_excerpt": "", "question": "Which two TRIGGER bits must software set to clear the key, IV, input data and output data registers with pseudo-random data?", "answer_format": "exact_value", "gold_answer": "KEY_IV_DATA_IN_CLEAR and DATA_OUT_CLEAR", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "medium"} {"id": "aes-t3-001", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Then, the AES cipher core performs 9/11/12 rounds of encryption/decryption when using a 128/192/256-bit key, respectively. In every round, the cipher data path performs the four following transformations. Since the counter value is used in the first round only, and since the encryption/decryption of a single block takes 12/14/16 cycles, the iterative counter implementation does not affect the throughput of the AES unit.", "rtl_excerpt": "", "question": "The excerpt below was derived from the AES spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Datapath operation ('9/11/12 rounds ... 128/192/256-bit key') vs the block-latency figures in the same section ('12/14/16 cycles' for a single block): 12 rounds for a 256-bit key is inconsistent with 16 cycles per block when 9 rounds take 12 cycles and 11 rounds take 14 cycles (rounds + 3)\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The section's own cycle counts follow rounds+3 (9->12, 11->14); the mutated 12 rounds for 256-bit keys would give 15 cycles, contradicting the stated 16.\"}", "mutation": {"type": "changed_number", "original": "performs 9/11/13 rounds of encryption/decryption", "mutated": "performs 9/11/12 rounds of encryption/decryption", "location": "Theory 'Datapath Architecture and Operation' round count"}, "verification": "original text verified verbatim in sources/excerpts/aes/aes_excerpt_1_block_operation_theory.md; mutation reverted restores consistency", "difficulty": "medium"} {"id": "aes-t3-002", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If running in CTR mode, the counter module iteratively updates the IV in parallel to the cipher core performing encryption/decryption. Internally, the counter module uses one 16-bit counter, meaning it requires 4 clock cycles to increment the 128-bit counter value stored in the IV register.", "rtl_excerpt": "", "question": "The excerpt below was derived from the AES spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"CTR counter paragraph ('one 16-bit counter ... requires 4 clock cycles to increment the 128-bit counter value') vs its own arithmetic: 128 / 16 = 8, not 4\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"A single 16-bit counter needs 128/16 = 8 iterations to cover 128 bits; the mutated 4 contradicts the sentence's own numbers.\"}", "mutation": {"type": "changed_number", "original": "it requires 8 clock cycles to increment the 128-bit counter value", "mutated": "it requires 4 clock cycles to increment the 128-bit counter value", "location": "Theory 'Datapath Architecture and Operation' CTR counter paragraph"}, "verification": "original text verified verbatim in sources/excerpts/aes/aes_excerpt_1_block_operation_theory.md; mutation reverted restores consistency", "difficulty": "easy"} {"id": "aes-t3-003", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/registers.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "CTRL_SHADOWED . PRNG_RESEED_RATE: 3-bit one-hot field to control the reseeding rate of the internal pseudo-random number generator (PRNG) used for masking. Invalid input values, i.e., values with multiple bits set and value 3'b000 are mapped to the highest reseeding rate PER_1 (3'b001). | Value | Name | Description | | 0x3 | PER_64 | 3'b010: Reseed the masking PRNG approximately once per every 64 blocks.", "rtl_excerpt": "", "question": "The excerpt below was derived from the AES spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"PRNG_RESEED_RATE table ('0x3 | PER_64 | 3'b010') vs the field description ('Invalid input values, i.e., values with multiple bits set ... are mapped to PER_1 (3'b001)'): 0x3 = 3'b011 has multiple bits set, so it cannot select PER_64, and its one-hot code is given as 3'b010 which is 0x2\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The table assigns value 0x3 (two bits set) to PER_64 while the field text defines multi-bit values as invalid (mapped to PER_1) and gives PER_64's one-hot code as 3'b010 = 0x2.\"}", "mutation": {"type": "changed_number", "original": "| 0x2 | PER_64 | 3'b010:", "mutated": "| 0x3 | PER_64 | 3'b010:", "location": "Register reference 'CTRL_SHADOWED . PRNG_RESEED_RATE' table"}, "verification": "original text verified verbatim in sources/excerpts/aes/aes_excerpt_5a_ctrl_shadowed.md; mutation reverted restores consistency", "difficulty": "medium"} {"id": "aes-t3-004", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/registers.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "CTRL_SHADOWED: Control Register. - Offset: 0x74 - Reset default: 0x10fd - Reset mask: 0xffff. Fields table: | 14:12 | rw | 0x1 | PRNG_RESEED_RATE |", "rtl_excerpt": "", "question": "The excerpt below was derived from the AES spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"CTRL_SHADOWED header ('Reset default: 0x10fd') vs the field table (PRNG_RESEED_RATE bits 14:12 reset to 0x1): 0x10fd = 0b0001_0000_1111_1101 has bits 14:12 = 000, contradicting the documented per-field reset value 0x1\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The field table requires PRNG_RESEED_RATE (bits 14:12) to reset to 0x1; the mutated 0x10fd clears those bits, so the header value is incompatible with the documented reset values.\"}", "mutation": {"type": "changed_number", "original": "- Reset default: `0x11fd`", "mutated": "- Reset default: `0x10fd`", "location": "Register reference 'CTRL_SHADOWED' header"}, "verification": "original text verified verbatim in sources/excerpts/aes/aes_excerpt_5a_ctrl_shadowed.md; mutation reverted restores consistency", "difficulty": "hard"} {"id": "aes-t3-005", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/registers.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "TRIGGER: Trigger Register. - Offset: 0x80 - Reset default: 0xf - Reset mask: 0xf. Fields table: | 3 | wo | 0x1 | PRNG_RESEED | | 2 | wo | 0x1 | DATA_OUT_CLEAR | | 1 | wo | 0x1 | KEY_IV_DATA_IN_CLEAR | | 0 | wo | 0x0 | START |", "rtl_excerpt": "", "question": "The excerpt below was derived from the AES spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"TRIGGER header ('Reset default: 0xf') vs the field table (START bit 0 resets to 0x0): 0xf = 0b1111 has bit 0 set, contradicting START's documented reset value of 0\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The field table requires START (bit 0) to reset to 0 while the other three trigger bits reset to 1, i.e. 0xe; the mutated 0xf sets bit 0, contradicting START's reset value.\"}", "mutation": {"type": "changed_number", "original": "- Reset default: `0xe`", "mutated": "- Reset default: `0xf`", "location": "Register reference 'TRIGGER' header"}, "verification": "original text verified verbatim in sources/excerpts/aes/aes_excerpt_6_trigger_status.md; mutation reverted restores consistency", "difficulty": "medium"} {"id": "aes-t3-006", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/registers.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "CTRL_SHADOWED . KEY_LEN: 3-bit one-hot field to select AES key length. | Value | Name | Description | | 0x2 | AES_128 | 3'b001: 128-bit key length. | | 0x2 | AES_192 | 3'b010: 192-bit key length. In case support for 192-bit keys has been disabled at compile time, setting this value results in configuring AES_256 (3'b100). | | 0x4 | AES_256 | 3'b100: 256-bit key length.", "rtl_excerpt": "", "question": "The excerpt below was derived from the AES spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"KEY_LEN table (both AES_128 and AES_192 list value 0x2) vs the one-hot codes in the same table (AES_128 is 3'b001 = 0x1, AES_192 is 3'b010 = 0x2): two different key lengths cannot share the value 0x2\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The table assigns 0x2 to both AES_128 and AES_192, contradicting its own one-hot codes, where 3'b001 (0x1) is AES_128.\"}", "mutation": {"type": "changed_number", "original": "| 0x1 | AES_128 | 3'b001: 128-bit key length.", "mutated": "| 0x2 | AES_128 | 3'b001: 128-bit key length.", "location": "Register reference 'CTRL_SHADOWED . KEY_LEN' table"}, "verification": "original text verified verbatim in sources/excerpts/aes/aes_excerpt_5a_ctrl_shadowed.md; mutation reverted restores consistency", "difficulty": "easy"} {"id": "aes-t3-007", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Alternatively, the processor can configure the AES unit to use an initial key provided by the key manager via key sideload interface without exposing the key to the processor or other hosts attached to the system bus interconnect. To this end, the processor has to set the SIDELOAD bit in CTRL_SHADOWED to 1. Any write operations of the processor to the Initial Key registers KEY_SHARE0_0 - KEY_SHARE1_7 are then honored.", "rtl_excerpt": "", "question": "The excerpt below was derived from the AES spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"System Key-Manager Interface ('Any write operations of the processor to the Initial Key registers ... are then honored') vs the feature's stated purpose ('use an initial key provided by the key manager ... without exposing the key to the processor or other hosts')\", \"category\": \"RULE_INVERSION\", \"explanation\": \"Honoring processor writes to the key registers under SIDELOAD=1 defeats the interface's purpose of keeping the key hidden from the processor; the spec requires those writes to be ignored.\"}", "mutation": {"type": "rule_inversion", "original": "Any write operations of the processor to the Initial Key registers [`KEY_SHARE0_0`](registers.md#key_share0) - [`KEY_SHARE1_7`](registers.md#key_share1) are then ignored.", "mutated": "Any write operations of the processor to the Initial Key registers KEY_SHARE0_0 - KEY_SHARE1_7 are then honored.", "location": "Theory 'System Key-Manager Interface' paragraph"}, "verification": "original text verified verbatim in sources/excerpts/aes/aes_excerpt_2_init_key_sideload.md; mutation reverted restores consistency", "difficulty": "medium"} {"id": "aes-t3-008", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Note, for the AES unit to automatically start in CBC, CFB, OFB or CTR mode, also the IV must be ready. The IV is ready if -- since the last IV update (either done by the processor or the AES unit itself) -- all IV registers have been written at least once or none of them. The AES unit will automatically start the next encryption/decryption with a partially updated IV.", "rtl_excerpt": "", "question": "The excerpt below was derived from the AES spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Automatic start ('The AES unit will automatically start the next encryption/decryption with a partially updated IV') vs the preceding sentence ('The IV is ready if ... all IV registers have been written at least once or none of them')\", \"category\": \"RULE_INVERSION\", \"explanation\": \"The IV-ready rule requires all-or-none IV register writes; the mutated sentence inverts the guard so the unit starts with a partially updated IV, the exact case the rule forbids.\"}", "mutation": {"type": "rule_inversion", "original": "The AES unit will not automatically start the next encryption/decryption with a partially updated IV.", "mutated": "The AES unit will automatically start the next encryption/decryption with a partially updated IV.", "location": "Theory 'Datapath Architecture and Operation' auto-start note"}, "verification": "original text verified verbatim in sources/excerpts/aes/aes_excerpt_1_block_operation_theory.md; mutation reverted restores consistency", "difficulty": "easy"} {"id": "aes-t3-009", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "CTRL_SHADOWED . MANUAL_OPERATION: In automatic mode (0), the AES unit automatically i) starts to encrypt/decrypt when it receives new input data, and ii) stalls during the last encryption/decryption cycle if the previous output data has not yet been read. If the AES unit wants to finish the encryption/decryption of an output data block but the previous one has not yet been read by the processor, the AES unit is stalled. It hangs and drops the pending output data, then continues with the next block.", "rtl_excerpt": "", "question": "The excerpt below was derived from the AES spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Stall behavior ('It hangs and drops the pending output data, then continues') vs CTRL_SHADOWED.MANUAL_OPERATION in the same excerpt ('In automatic mode (0), the AES unit ... ii) stalls during the last encryption/decryption cycle if the previous output data has not yet been read')\", \"category\": \"RULE_INVERSION\", \"explanation\": \"Automatic mode stalls (waits) when previous output is unread rather than overwriting it; the mutated sentence inverts this into dropping the pending output and continuing.\"}", "mutation": {"type": "rule_inversion", "original": "It hangs and does not drop data.", "mutated": "It hangs and drops the pending output data, then continues with the next block.", "location": "Theory 'Datapath Architecture and Operation' stall paragraph"}, "verification": "original text verified verbatim in sources/excerpts/aes/aes_excerpt_1_block_operation_theory.md; mutation reverted restores consistency", "difficulty": "medium"} {"id": "aes-t3-010", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "In ECB mode, no IV needs to be provided. The content of the IV registers is used in ECB mode.", "rtl_excerpt": "", "question": "The excerpt below was derived from the AES spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"ECB IV handling ('The content of the IV registers is used in ECB mode') vs the preceding sentence ('In ECB mode, no IV needs to be provided')\", \"category\": \"RULE_INVERSION\", \"explanation\": \"If the IV register content were used in ECB mode, an IV would need to be provided; the mutated sentence inverts the documented 'ignored' behavior.\"}", "mutation": {"type": "rule_inversion", "original": "The content of the IV registers is ignored in ECB mode.", "mutated": "The content of the IV registers is used in ECB mode.", "location": "Theory 'Datapath Architecture and Operation' ECB note"}, "verification": "original text verified verbatim in sources/excerpts/aes/aes_excerpt_1_block_operation_theory.md; mutation reverted restores consistency", "difficulty": "easy"} {"id": "aes-t3-011", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/registers.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "CTRL_SHADOWED: Control Register. This register is shadowed, meaning two subsequent write operations are required to change its content. If the two write operations try to set the same value, a recoverable alert is triggered (See Status Register).", "rtl_excerpt": "", "question": "The excerpt below was derived from the AES spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"CTRL_SHADOWED ('If the two write operations try to set the same value, a recoverable alert is triggered') vs the preceding sentence ('two subsequent write operations are required to change its content': the normal update is two writes of the same value)\", \"category\": \"RULE_INVERSION\", \"explanation\": \"A shadow-register update is performed by writing the same value twice; the mutated condition would raise a recoverable alert on every legitimate update, inverting the same/different distinction.\"}", "mutation": {"type": "rule_inversion", "original": "If the two write operations try to set a different value, a recoverable alert is triggered (See Status Register).", "mutated": "If the two write operations try to set the same value, a recoverable alert is triggered (See Status Register).", "location": "Register reference 'CTRL_SHADOWED' description"}, "verification": "original text verified verbatim in sources/excerpts/aes/aes_excerpt_5a_ctrl_shadowed.md; mutation reverted restores consistency", "difficulty": "hard"} {"id": "aes-t3-012", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "CTRL_SHADOWED fields: OPERATION (bits 1:0), MODE (bits 7:2), KEY_LEN (bits 10:8), SIDELOAD (bit 11), PRNG_RESEED_RATE (bits 14:12), MANUAL_OPERATION (bit 15). TRIGGER . KEY_IV_DATA_IN_CLEAR: Keep current values in Initial Key, internal Full Key and Decryption Key registers, IV registers and Input Data registers (0) or clear all those registers with pseudo-random data (1). TRIGGER . DATA_OUT_CLEAR: Keep current values in Output Data registers (0) or clear those registers with pseudo-random data (1). After finishing operation, software must: 1. Disable the AES unit to no longer automatically start encryption/decryption by setting the MANUAL_OPERATION bit in CTRL_SHADOWED to 1. 2. Clear all key registers, IV registers as well as the Input Data and the Output Data registers with pseudo-random data by setting the KEY_IV_DATA_IN_CLEAR and DATA_OUT_CLEAR bits in CTRL_SHADOWED to 1.", "rtl_excerpt": "", "question": "The excerpt below was derived from the AES spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"De-Initialization ('by setting the KEY_IV_DATA_IN_CLEAR and DATA_OUT_CLEAR bits in CTRL_SHADOWED to 1') vs the CTRL_SHADOWED field list (OPERATION, MODE, KEY_LEN, SIDELOAD, PRNG_RESEED_RATE, MANUAL_OPERATION: no such bits) and the TRIGGER register, which documents KEY_IV_DATA_IN_CLEAR and DATA_OUT_CLEAR\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The clear bits are documented in the TRIGGER register; CTRL_SHADOWED has no such fields, so the mutated reference points at the wrong register.\"}", "mutation": {"type": "crossref_conflict", "original": "by setting the KEY_IV_DATA_IN_CLEAR and DATA_OUT_CLEAR bits in [`TRIGGER`](registers.md#trigger) to `1`.", "mutated": "by setting the KEY_IV_DATA_IN_CLEAR and DATA_OUT_CLEAR bits in CTRL_SHADOWED to 1.", "location": "Programmer's Guide 'De-Initialization' step 2"}, "verification": "original text verified verbatim in sources/excerpts/aes/aes_excerpt_4_deinit_fi_control.md; mutation reverted restores consistency", "difficulty": "medium"} {"id": "aes-t3-013", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "CTRL_SHADOWED fields: OPERATION (bits 1:0), MODE (bits 7:2), KEY_LEN (bits 10:8), SIDELOAD (bit 11), PRNG_RESEED_RATE (bits 14:12), MANUAL_OPERATION (bit 15). STATUS . IDLE: The AES unit is idle (1) or busy (0). Before initialization, software must ensure that the AES unit is idle by checking CTRL_SHADOWED.IDLE. If the AES unit is not idle, write operations to CTRL_SHADOWED, the Initial Key registers KEY_SHARE0_0 - KEY_SHARE1_7 and initialization vector (IV) registers IV_0 - IV_3 are ignored.", "rtl_excerpt": "", "question": "The excerpt below was derived from the AES spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Initialization ('by checking CTRL_SHADOWED.IDLE') vs the CTRL_SHADOWED field list (OPERATION, MODE, KEY_LEN, SIDELOAD, PRNG_RESEED_RATE, MANUAL_OPERATION: no IDLE field) and the STATUS register, which documents the IDLE bit\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The idle flag is documented in the STATUS register; CTRL_SHADOWED has no IDLE field, so the mutated reference points at the wrong register.\"}", "mutation": {"type": "crossref_conflict", "original": "software must ensure that the AES unit is idle by checking [`STATUS.IDLE`](registers.md#status).", "mutated": "software must ensure that the AES unit is idle by checking CTRL_SHADOWED.IDLE.", "location": "Programmer's Guide 'Initialization' paragraph"}, "verification": "original text verified verbatim in sources/excerpts/aes/aes_excerpt_2_init_key_sideload.md; mutation reverted restores consistency", "difficulty": "easy"} {"id": "aes-t3-014", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Software configures the CTRL_GCM_SHADOWED.PHASE to GCM_SAVE and the NUM_VALID_BYTES field to 16. Software should check the CTRL_GCM_SHADOWED.PHASE field. If it does not read as GCM_TAG, the previous write operation did not go through, e.g., because moving to this phase is only possible after having processed a first AAD or plaintext/ciphertext block. If it reads as GCM_TAG, this means the AES unit outputs the current state of the GHASH module via Output Data registers DATA_OUT_0 - DATA_OUT_3 where software can read it. Software reads the current content of the Input Data registers DATA_IN_0 - DATA_IN_3.", "rtl_excerpt": "", "question": "The excerpt below was derived from the AES spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"GCM Context Saving (mutated final step: 'Software reads the current content of the Input Data registers DATA_IN_0 - DATA_IN_3') vs the GCM Context Restoring section ('Software writes the previously saved IV into the IV registers IV_0 - IV_3. Note that even though just the content of IV_3 is really different from the value after the initialization, software must write all four IV registers'): the restore step needs the saved IV, which was never read\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The mutated step reads the Input Data registers instead of the IV registers, so the 'previously saved IV' that the restore procedure writes back was never captured.\"}", "mutation": {"type": "crossref_conflict", "original": "Software reads the current content of the IV registers [`IV_0`](registers.md#iv) - [`IV_3`](registers.md#iv).", "mutated": "Software reads the current content of the Input Data registers DATA_IN_0 - DATA_IN_3.", "location": "Programmer's Guide 'GCM Context Saving' step 3"}, "verification": "original text verified verbatim in sources/excerpts/aes/aes_excerpt_3_gcm_save_restore.md; mutation reverted restores consistency", "difficulty": "hard"} {"id": "aes-t3-015", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The key is provided in two shares: The first share is written to KEY_SHARE0_0 - KEY_SHARE0_7 and the second share is written to KEY_SHARE1_0 - KEY_SHARE1_7. The actual initial key used for encryption corresponds to the value obtained by XORing KEY_SHARE0_0 - KEY_SHARE0_7 with KEY_SHARE0_0 - KEY_SHARE0_7.", "rtl_excerpt": "", "question": "The excerpt below was derived from the AES spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Initialization ('XORing KEY_SHARE0_0 - KEY_SHARE0_7 with KEY_SHARE0_0 - KEY_SHARE0_7') vs the preceding sentence ('The first share is written to KEY_SHARE0_0 - KEY_SHARE0_7 and the second share is written to KEY_SHARE1_0 - KEY_SHARE1_7'): XORing a share with itself always yields zero\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The mutated sentence XORs the first share with itself (always zero) instead of with the second share KEY_SHARE1, contradicting the two-share provisioning described just before.\"}", "mutation": {"type": "crossref_conflict", "original": "The actual initial key used for encryption corresponds to the value obtained by XORing [`KEY_SHARE0_0`](registers.md#key_share0) - [`KEY_SHARE0_7`](registers.md#key_share0) with [`KEY_SHARE1_0`](registers.md#key_share1) - [`KEY_SHARE1_7`](registers.md#key_share1).", "mutated": "The actual initial key used for encryption corresponds to the value obtained by XORing KEY_SHARE0_0 - KEY_SHARE0_7 with KEY_SHARE0_0 - KEY_SHARE0_7.", "location": "Programmer's Guide 'Initialization' key-share paragraph"}, "verification": "original text verified verbatim in sources/excerpts/aes/aes_excerpt_2_init_key_sideload.md; mutation reverted restores consistency", "difficulty": "medium"} {"id": "aes-t3-016", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Note, for the AES unit to automatically start in CBC, CFB, OFB or CTR mode, also the IV must be ready. The IV is ready if -- since the last IV update (either done by the processor or the AES unit itself) -- all IV registers have been written at least once. Note that while operating, the AES unit automatically updates the IV registers after having consumed the current IV value.", "rtl_excerpt": "", "question": "The excerpt below was derived from the AES spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Automatic start (mutated: 'The IV is ready if ... all IV registers have been written at least once') vs 'the AES unit automatically updates the IV registers after having consumed the current IV value': after the unit's own update the processor has written none of the IV registers, so the IV would never become ready and automatic multi-block operation could never continue\", \"category\": \"MISSING_CONDITION\", \"explanation\": \"Deleting 'or none of them' removes the case covering the unit's own automatic IV update; the two remaining statements then imply the IV is never ready after the first block.\"}", "mutation": {"type": "deleted_condition", "original": "The IV is ready if -- since the last IV update (either done by the processor or the AES unit itself) -- all IV registers have been written at least once or none of them.", "mutated": "The IV is ready if -- since the last IV update (either done by the processor or the AES unit itself) -- all IV registers have been written at least once.", "location": "Theory 'Datapath Architecture and Operation' IV-ready note"}, "verification": "original text verified verbatim in sources/excerpts/aes/aes_excerpt_1_block_operation_theory.md; mutation reverted restores consistency", "difficulty": "medium"} {"id": "aes-t3-017", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Similarly, the initialization vector (IV) register can only be updated by the processor if the AES unit is idle. If the AES unit is busy, the AES unit itself updates the IV register.", "rtl_excerpt": "", "question": "The excerpt below was derived from the AES spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"IV update rule (mutated: 'If the AES unit is busy, the AES unit itself updates the IV register') vs 'In ECB mode, no IV needs to be provided. The content of the IV registers is ignored in ECB mode': the unit would pointlessly update an ignored register in ECB mode\", \"category\": \"MISSING_CONDITION\", \"explanation\": \"Deleting 'and running in CBC or CTR mode' extends the unit-driven IV update to every busy mode, contradicting the ECB rule that the IV registers are ignored.\"}", "mutation": {"type": "deleted_condition", "original": "If the AES unit is busy and running in CBC or CTR mode, the AES unit itself updates the IV register.", "mutated": "If the AES unit is busy, the AES unit itself updates the IV register.", "location": "Theory 'Datapath Architecture and Operation' IV update paragraph"}, "verification": "original text verified verbatim in sources/excerpts/aes/aes_excerpt_1_block_operation_theory.md; mutation reverted restores consistency", "difficulty": "easy"} {"id": "aes-t3-018", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "By setting the MANUAL_OPERATION bit in CTRL_SHADOWED to 1, the AES unit can be operated in manual mode. In manual mode, the AES unit starts encryption/decryption irrespective of the status of the IV and input data registers. In manual mode (1), the AES unit i) only starts to encrypt/decrypt after receiving a start trigger (see Trigger Register), and ii) overwrites previous output data irrespective of whether it has been read out or not.", "rtl_excerpt": "", "question": "The excerpt below was derived from the AES spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Manual mode (mutated: 'the AES unit starts encryption/decryption irrespective of the status of the IV and input data registers', with the start condition deleted) vs CTRL_SHADOWED.MANUAL_OPERATION ('In manual mode (1), the AES unit i) only starts to encrypt/decrypt after receiving a start trigger (see Trigger Register)'): the deleted 'whenever the START bit in TRIGGER is set to 1' leaves no defined start condition\", \"category\": \"MISSING_CONDITION\", \"explanation\": \"Deleting the START-trigger condition leaves manual-mode start undefined; the field description requires a start trigger before encryption/decryption begins.\"}", "mutation": {"type": "deleted_condition", "original": "the AES unit starts encryption/decryption whenever the START bit in [`TRIGGER`](registers.md#trigger) is set to `1`, irrespective of the status of the IV and input data registers.", "mutated": "the AES unit starts encryption/decryption irrespective of the status of the IV and input data registers.", "location": "Theory 'Datapath Architecture and Operation' manual-mode note"}, "verification": "original text verified verbatim in sources/excerpts/aes/aes_excerpt_1_block_operation_theory.md; mutation reverted restores consistency", "difficulty": "medium"} {"id": "aes-t4-001", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/rtl/aes_shift_rows.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. (For the exact offsets the OpenTitan documentation refers to the AES specification, FIPS-197 section 5.1.2: during encryption row r is cyclically shifted left by r bytes -- row 0 by 0, row 1 by 1, row 2 by 2, row 3 by 3 -- and during decryption row r is shifted right by r bytes. The original RTL implements exactly this: it was verified against a corrected FIPS-197 reference model with ORIG_MODEL_ERRORS=0.)", "rtl_excerpt": "19: assign data_o[2] = aes_circ_byte_shift(data_i[2], 2'h2);\n20: \n21: // Row 1\n22: assign data_o[1] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[1], 2'h2) : // <-- MUTATED\n23: (op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[1], 2'h1) :\n24: aes_circ_byte_shift(data_i[1], 2'h3);\n25: \n[mutated line(s): 22]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. (For the exact offsets the OpenTitan documentation refers to the AES specification, FIPS-197 section 5.1.2: during encryption row r is cyclically shifted left by r bytes -- row 0 by 0, row 1 by 1, row 2 by 2, row 3 by 3 -- and during decryption row r is shifted right by r bytes. The original RTL implements exactly this: it was verified against a corrected FIPS-197 reference model with ORIG_MODEL_ERRORS=0.)\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/aes/rtl/aes_shift_rows.sv:22\", \"explanation\": \"Row 1 forward shift amount changed from 3 to 2. Per FIPS-197, encryption shifts row 1 left by 1 byte (coded as amount 3 in this module's circular-shift function); the mutant shifts by a different amount, so 8 output bytes differ from the FIPS reference.\"}", "mutation": {"type": "off_by_one", "original": "assign data_o[1] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[1], 2'h3) :", "mutated": "assign data_o[1] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[1], 2'h2) :", "location": "hw/ip/aes/rtl/aes_shift_rows.sv:22"}, "verification": "iverilog sim: iverilog -g2012 -o sim.vvp /home/hatch/workspace/specbench/sources/sim_scout/stubs/aes_pkg_min.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/aes-001/aes-001.log shows `RESULT: DIFFER (8 byte mismatches between orig and mut)`", "difficulty": "medium"} {"id": "aes-t4-002", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/rtl/aes_shift_rows.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. (For the exact offsets the OpenTitan documentation refers to the AES specification, FIPS-197 section 5.1.2: during encryption row r is cyclically shifted left by r bytes -- row 0 by 0, row 1 by 1, row 2 by 2, row 3 by 3 -- and during decryption row r is shifted right by r bytes. The original RTL implements exactly this: it was verified against a corrected FIPS-197 reference model with ORIG_MODEL_ERRORS=0.)", "rtl_excerpt": "20: \n21: // Row 1\n22: assign data_o[1] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[1], 2'h3) :\n23: (op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[1], 2'h2) : // <-- MUTATED\n24: aes_circ_byte_shift(data_i[1], 2'h3);\n25: \n26: // Row 3\n[mutated line(s): 23]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. (For the exact offsets the OpenTitan documentation refers to the AES specification, FIPS-197 section 5.1.2: during encryption row r is cyclically shifted left by r bytes -- row 0 by 0, row 1 by 1, row 2 by 2, row 3 by 3 -- and during decryption row r is shifted right by r bytes. The original RTL implements exactly this: it was verified against a corrected FIPS-197 reference model with ORIG_MODEL_ERRORS=0.)\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/aes/rtl/aes_shift_rows.sv:23\", \"explanation\": \"Row 1 inverse shift amount changed from 1 to 2. Per FIPS-197, decryption shifts row 1 right by 1 byte (coded as amount 1); the mutant shifts by a different amount, so 8 output bytes differ from the FIPS reference.\"}", "mutation": {"type": "off_by_one", "original": "(op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[1], 2'h1) :", "mutated": "(op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[1], 2'h2) :", "location": "hw/ip/aes/rtl/aes_shift_rows.sv:23"}, "verification": "iverilog sim: iverilog -g2012 -o sim.vvp /home/hatch/workspace/specbench/sources/sim_scout/stubs/aes_pkg_min.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/aes-002/aes-002.log shows `RESULT: DIFFER (8 byte mismatches between orig and mut)`", "difficulty": "medium"} {"id": "aes-t4-003", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/rtl/aes_shift_rows.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. (For the exact offsets the OpenTitan documentation refers to the AES specification, FIPS-197 section 5.1.2: during encryption row r is cyclically shifted left by r bytes -- row 0 by 0, row 1 by 1, row 2 by 2, row 3 by 3 -- and during decryption row r is shifted right by r bytes. The original RTL implements exactly this: it was verified against a corrected FIPS-197 reference model with ORIG_MODEL_ERRORS=0.)", "rtl_excerpt": "24: aes_circ_byte_shift(data_i[1], 2'h3);\n25: \n26: // Row 3\n27: assign data_o[3] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[3], 2'h2) : // <-- MUTATED\n28: (op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[3], 2'h3) :\n29: aes_circ_byte_shift(data_i[3], 2'h1);\n30: \n[mutated line(s): 27]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. (For the exact offsets the OpenTitan documentation refers to the AES specification, FIPS-197 section 5.1.2: during encryption row r is cyclically shifted left by r bytes -- row 0 by 0, row 1 by 1, row 2 by 2, row 3 by 3 -- and during decryption row r is shifted right by r bytes. The original RTL implements exactly this: it was verified against a corrected FIPS-197 reference model with ORIG_MODEL_ERRORS=0.)\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/aes/rtl/aes_shift_rows.sv:27\", \"explanation\": \"Row 3 forward shift amount changed from 1 to 2. Per FIPS-197, encryption shifts row 3 left by 3 bytes (coded as amount 1); the mutant shifts by a different amount, so 8 output bytes differ from the FIPS reference.\"}", "mutation": {"type": "off_by_one", "original": "assign data_o[3] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[3], 2'h1) :", "mutated": "assign data_o[3] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[3], 2'h2) :", "location": "hw/ip/aes/rtl/aes_shift_rows.sv:27"}, "verification": "iverilog sim: iverilog -g2012 -o sim.vvp /home/hatch/workspace/specbench/sources/sim_scout/stubs/aes_pkg_min.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/aes-003/aes-003.log shows `RESULT: DIFFER (8 byte mismatches between orig and mut)`", "difficulty": "medium"} {"id": "aes-t4-004", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/rtl/aes_shift_rows.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. (For the exact offsets the OpenTitan documentation refers to the AES specification, FIPS-197 section 5.1.2: during encryption row r is cyclically shifted left by r bytes -- row 0 by 0, row 1 by 1, row 2 by 2, row 3 by 3 -- and during decryption row r is shifted right by r bytes. The original RTL implements exactly this: it was verified against a corrected FIPS-197 reference model with ORIG_MODEL_ERRORS=0.)", "rtl_excerpt": "25: \n26: // Row 3\n27: assign data_o[3] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[3], 2'h1) :\n28: (op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[3], 2'h2) : // <-- MUTATED\n29: aes_circ_byte_shift(data_i[3], 2'h1);\n30: \n31: endmodule\n[mutated line(s): 28]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. (For the exact offsets the OpenTitan documentation refers to the AES specification, FIPS-197 section 5.1.2: during encryption row r is cyclically shifted left by r bytes -- row 0 by 0, row 1 by 1, row 2 by 2, row 3 by 3 -- and during decryption row r is shifted right by r bytes. The original RTL implements exactly this: it was verified against a corrected FIPS-197 reference model with ORIG_MODEL_ERRORS=0.)\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/aes/rtl/aes_shift_rows.sv:28\", \"explanation\": \"Row 3 inverse shift amount changed from 3 to 2. Per FIPS-197, decryption shifts row 3 right by 3 bytes (coded as amount 3); the mutant shifts by a different amount, so 8 output bytes differ from the FIPS reference.\"}", "mutation": {"type": "off_by_one", "original": "(op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[3], 2'h3) :", "mutated": "(op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[3], 2'h2) :", "location": "hw/ip/aes/rtl/aes_shift_rows.sv:28"}, "verification": "iverilog sim: iverilog -g2012 -o sim.vvp /home/hatch/workspace/specbench/sources/sim_scout/stubs/aes_pkg_min.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/aes-004/aes-004.log shows `RESULT: DIFFER (8 byte mismatches between orig and mut)`", "difficulty": "medium"} {"id": "aes-t4-005", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/rtl/aes_shift_rows.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. (For the exact offsets the OpenTitan documentation refers to the AES specification, FIPS-197 section 5.1.2: during encryption row r is cyclically shifted left by r bytes -- row 0 by 0, row 1 by 1, row 2 by 2, row 3 by 3 -- and during decryption row r is shifted right by r bytes. The original RTL implements exactly this: it was verified against a corrected FIPS-197 reference model with ORIG_MODEL_ERRORS=0.)", "rtl_excerpt": "16: assign data_o[0] = data_i[0];\n17: \n18: // Row 2 does not depend on op_i\n19: assign data_o[2] = aes_circ_byte_shift(data_i[2], 2'h3); // <-- MUTATED\n20: \n21: // Row 1\n22: assign data_o[1] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[1], 2'h3) :\n[mutated line(s): 19]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. (For the exact offsets the OpenTitan documentation refers to the AES specification, FIPS-197 section 5.1.2: during encryption row r is cyclically shifted left by r bytes -- row 0 by 0, row 1 by 1, row 2 by 2, row 3 by 3 -- and during decryption row r is shifted right by r bytes. The original RTL implements exactly this: it was verified against a corrected FIPS-197 reference model with ORIG_MODEL_ERRORS=0.)\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/aes/rtl/aes_shift_rows.sv:19\", \"explanation\": \"Row 2 shift amount changed from 2 to 3. Per FIPS-197, row 2 is shifted by 2 bytes in both directions (coded as amount 2); the mutant uses a different amount, so 20 output bytes differ from the FIPS reference.\"}", "mutation": {"type": "off_by_one", "original": "assign data_o[2] = aes_circ_byte_shift(data_i[2], 2'h2);", "mutated": "assign data_o[2] = aes_circ_byte_shift(data_i[2], 2'h3);", "location": "hw/ip/aes/rtl/aes_shift_rows.sv:19"}, "verification": "iverilog sim: iverilog -g2012 -o sim.vvp /home/hatch/workspace/specbench/sources/sim_scout/stubs/aes_pkg_min.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/aes-005/aes-005.log shows `RESULT: DIFFER (20 byte mismatches between orig and mut)`", "difficulty": "medium"} {"id": "aes-t4-006", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/rtl/aes_shift_rows.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. (For the exact offsets the OpenTitan documentation refers to the AES specification, FIPS-197 section 5.1.2: during encryption row r is cyclically shifted left by r bytes -- row 0 by 0, row 1 by 1, row 2 by 2, row 3 by 3 -- and during decryption row r is shifted right by r bytes. The original RTL implements exactly this: it was verified against a corrected FIPS-197 reference model with ORIG_MODEL_ERRORS=0.)", "rtl_excerpt": "21: // Row 1\n22: assign data_o[1] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[1], 2'h3) :\n23: (op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[1], 2'h1) :\n24: aes_circ_byte_shift(data_i[1], 2'h2); // <-- MUTATED\n25: \n26: // Row 3\n27: assign data_o[3] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[3], 2'h1) :\n[mutated line(s): 24]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. (For the exact offsets the OpenTitan documentation refers to the AES specification, FIPS-197 section 5.1.2: during encryption row r is cyclically shifted left by r bytes -- row 0 by 0, row 1 by 1, row 2 by 2, row 3 by 3 -- and during decryption row r is shifted right by r bytes. The original RTL implements exactly this: it was verified against a corrected FIPS-197 reference model with ORIG_MODEL_ERRORS=0.)\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/aes/rtl/aes_shift_rows.sv:24\", \"explanation\": \"Row 1 fallback shift amount (used when op_i is neither CIPH_FWD nor CIPH_INV) changed from 3 to 2. The fallback must equal the forward amount; the mutant shifts by a different amount, so 4 output bytes differ from the FIPS reference.\"}", "mutation": {"type": "off_by_one", "original": "aes_circ_byte_shift(data_i[1], 2'h3);", "mutated": "aes_circ_byte_shift(data_i[1], 2'h2);", "location": "hw/ip/aes/rtl/aes_shift_rows.sv:24"}, "verification": "iverilog sim: iverilog -g2012 -o sim.vvp /home/hatch/workspace/specbench/sources/sim_scout/stubs/aes_pkg_min.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/aes-006/aes-006.log shows `RESULT: DIFFER (4 byte mismatches between orig and mut)`", "difficulty": "hard"} {"id": "aes-t4-007", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/rtl/aes_shift_rows.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. (For the exact offsets the OpenTitan documentation refers to the AES specification, FIPS-197 section 5.1.2: during encryption row r is cyclically shifted left by r bytes -- row 0 by 0, row 1 by 1, row 2 by 2, row 3 by 3 -- and during decryption row r is shifted right by r bytes. The original RTL implements exactly this: it was verified against a corrected FIPS-197 reference model with ORIG_MODEL_ERRORS=0.)", "rtl_excerpt": "19: assign data_o[2] = aes_circ_byte_shift(data_i[2], 2'h2);\n20: \n21: // Row 1\n22: assign data_o[1] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[1], 2'h1) : // <-- MUTATED\n23: (op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[1], 2'h3) : // <-- MUTATED\n24: aes_circ_byte_shift(data_i[1], 2'h3);\n25: \n26: // Row 3\n[mutated line(s): 22, 23]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. (For the exact offsets the OpenTitan documentation refers to the AES specification, FIPS-197 section 5.1.2: during encryption row r is cyclically shifted left by r bytes -- row 0 by 0, row 1 by 1, row 2 by 2, row 3 by 3 -- and during decryption row r is shifted right by r bytes. The original RTL implements exactly this: it was verified against a corrected FIPS-197 reference model with ORIG_MODEL_ERRORS=0.)\", \"category\": \"RULE_INVERSION\", \"rtl_location\": \"hw/ip/aes/rtl/aes_shift_rows.sv:22-23\", \"explanation\": \"Row 1 forward and inverse shift amounts swapped (forward now 1, inverse now 3). Encryption uses the decryption offset and vice versa, so 16 output bytes differ from the FIPS reference.\"}", "mutation": {"type": "inverted_enable", "original": "assign data_o[1] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[1], 2'h3) :\n(op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[1], 2'h1) :", "mutated": "assign data_o[1] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[1], 2'h1) :\n(op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[1], 2'h3) :", "location": "hw/ip/aes/rtl/aes_shift_rows.sv:22-23"}, "verification": "iverilog sim: iverilog -g2012 -o sim.vvp /home/hatch/workspace/specbench/sources/sim_scout/stubs/aes_pkg_min.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/aes-007/aes-007.log shows `RESULT: DIFFER (16 byte mismatches between orig and mut)`", "difficulty": "hard"} {"id": "aes-t4-008", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/rtl/aes_shift_rows.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. (For the exact offsets the OpenTitan documentation refers to the AES specification, FIPS-197 section 5.1.2: during encryption row r is cyclically shifted left by r bytes -- row 0 by 0, row 1 by 1, row 2 by 2, row 3 by 3 -- and during decryption row r is shifted right by r bytes. The original RTL implements exactly this: it was verified against a corrected FIPS-197 reference model with ORIG_MODEL_ERRORS=0.)", "rtl_excerpt": "24: aes_circ_byte_shift(data_i[1], 2'h3);\n25: \n26: // Row 3\n27: assign data_o[3] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[3], 2'h3) : // <-- MUTATED\n28: (op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[3], 2'h1) : // <-- MUTATED\n29: aes_circ_byte_shift(data_i[3], 2'h1);\n30: \n31: endmodule\n[mutated line(s): 27, 28]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. (For the exact offsets the OpenTitan documentation refers to the AES specification, FIPS-197 section 5.1.2: during encryption row r is cyclically shifted left by r bytes -- row 0 by 0, row 1 by 1, row 2 by 2, row 3 by 3 -- and during decryption row r is shifted right by r bytes. The original RTL implements exactly this: it was verified against a corrected FIPS-197 reference model with ORIG_MODEL_ERRORS=0.)\", \"category\": \"RULE_INVERSION\", \"rtl_location\": \"hw/ip/aes/rtl/aes_shift_rows.sv:27-28\", \"explanation\": \"Row 3 forward and inverse shift amounts swapped (forward now 3, inverse now 1). Encryption uses the decryption offset and vice versa, so 16 output bytes differ from the FIPS reference.\"}", "mutation": {"type": "inverted_enable", "original": "assign data_o[3] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[3], 2'h1) :\n(op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[3], 2'h3) :", "mutated": "assign data_o[3] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[3], 2'h3) :\n(op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[3], 2'h1) :", "location": "hw/ip/aes/rtl/aes_shift_rows.sv:27-28"}, "verification": "iverilog sim: iverilog -g2012 -o sim.vvp /home/hatch/workspace/specbench/sources/sim_scout/stubs/aes_pkg_min.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/aes-008/aes-008.log shows `RESULT: DIFFER (16 byte mismatches between orig and mut)`", "difficulty": "hard"} {"id": "aes-t4-010", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/rtl/aes_shift_rows.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. (For the exact offsets the OpenTitan documentation refers to the AES specification, FIPS-197 section 5.1.2: during encryption row r is cyclically shifted left by r bytes -- row 0 by 0, row 1 by 1, row 2 by 2, row 3 by 3 -- and during decryption row r is shifted right by r bytes. The original RTL implements exactly this: it was verified against a corrected FIPS-197 reference model with ORIG_MODEL_ERRORS=0.)", "rtl_excerpt": "24: aes_circ_byte_shift(data_i[1], 2'h3);\n25: \n26: // Row 3\n27: assign data_o[3] = (op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[3], 2'h1) : // <-- MUTATED\n28: (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[3], 2'h3) : // <-- MUTATED\n29: aes_circ_byte_shift(data_i[3], 2'h1);\n30: \n31: endmodule\n[mutated line(s): 27, 28]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. (For the exact offsets the OpenTitan documentation refers to the AES specification, FIPS-197 section 5.1.2: during encryption row r is cyclically shifted left by r bytes -- row 0 by 0, row 1 by 1, row 2 by 2, row 3 by 3 -- and during decryption row r is shifted right by r bytes. The original RTL implements exactly this: it was verified against a corrected FIPS-197 reference model with ORIG_MODEL_ERRORS=0.)\", \"category\": \"RULE_INVERSION\", \"rtl_location\": \"hw/ip/aes/rtl/aes_shift_rows.sv:27-28\", \"explanation\": \"Row 3 operation comparisons swapped: the CIPH_INV comparison now selects the forward amount and vice versa. Encryption uses the decryption offset and vice versa, so 16 output bytes differ from the FIPS reference.\"}", "mutation": {"type": "inverted_enable", "original": "assign data_o[3] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[3], 2'h1) :\n(op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[3], 2'h3) :", "mutated": "assign data_o[3] = (op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[3], 2'h1) :\n(op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[3], 2'h3) :", "location": "hw/ip/aes/rtl/aes_shift_rows.sv:27-28"}, "verification": "iverilog sim: iverilog -g2012 -o sim.vvp /home/hatch/workspace/specbench/sources/sim_scout/stubs/aes_pkg_min.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/aes-010/aes-010.log shows `RESULT: DIFFER (16 byte mismatches between orig and mut)`", "difficulty": "hard"} {"id": "aes-t4-011", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/rtl/aes_shift_rows.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. (For the exact offsets the OpenTitan documentation refers to the AES specification, FIPS-197 section 5.1.2: during encryption row r is cyclically shifted left by r bytes -- row 0 by 0, row 1 by 1, row 2 by 2, row 3 by 3 -- and during decryption row r is shifted right by r bytes. The original RTL implements exactly this: it was verified against a corrected FIPS-197 reference model with ORIG_MODEL_ERRORS=0.)", "rtl_excerpt": "19: assign data_o[2] = aes_circ_byte_shift(data_i[2], 2'h2);\n20: \n21: // Row 1\n22: assign data_o[1] = (op_i != CIPH_FWD) ? aes_circ_byte_shift(data_i[1], 2'h3) : // <-- MUTATED\n23: (op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[1], 2'h1) :\n24: aes_circ_byte_shift(data_i[1], 2'h3);\n25: \n[mutated line(s): 22]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. (For the exact offsets the OpenTitan documentation refers to the AES specification, FIPS-197 section 5.1.2: during encryption row r is cyclically shifted left by r bytes -- row 0 by 0, row 1 by 1, row 2 by 2, row 3 by 3 -- and during decryption row r is shifted right by r bytes. The original RTL implements exactly this: it was verified against a corrected FIPS-197 reference model with ORIG_MODEL_ERRORS=0.)\", \"category\": \"RULE_INVERSION\", \"rtl_location\": \"hw/ip/aes/rtl/aes_shift_rows.sv:22\", \"explanation\": \"Row 1 forward comparison inverted from == to !=. The forward amount is now applied to every operation except forward encryption, so 8 output bytes differ from the FIPS reference.\"}", "mutation": {"type": "inverted_enable", "original": "assign data_o[1] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[1], 2'h3) :", "mutated": "assign data_o[1] = (op_i != CIPH_FWD) ? aes_circ_byte_shift(data_i[1], 2'h3) :", "location": "hw/ip/aes/rtl/aes_shift_rows.sv:22"}, "verification": "iverilog sim: iverilog -g2012 -o sim.vvp /home/hatch/workspace/specbench/sources/sim_scout/stubs/aes_pkg_min.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/aes-011/aes-011.log shows `RESULT: DIFFER (8 byte mismatches between orig and mut)`", "difficulty": "medium"} {"id": "aes-t4-012", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/rtl/aes_shift_rows.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. (For the exact offsets the OpenTitan documentation refers to the AES specification, FIPS-197 section 5.1.2: during encryption row r is cyclically shifted left by r bytes -- row 0 by 0, row 1 by 1, row 2 by 2, row 3 by 3 -- and during decryption row r is shifted right by r bytes. The original RTL implements exactly this: it was verified against a corrected FIPS-197 reference model with ORIG_MODEL_ERRORS=0.)", "rtl_excerpt": "24: aes_circ_byte_shift(data_i[1], 2'h3);\n25: \n26: // Row 3\n27: assign data_o[3] = (op_i != CIPH_FWD) ? aes_circ_byte_shift(data_i[3], 2'h1) : // <-- MUTATED\n28: (op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[3], 2'h3) :\n29: aes_circ_byte_shift(data_i[3], 2'h1);\n30: \n[mutated line(s): 27]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. (For the exact offsets the OpenTitan documentation refers to the AES specification, FIPS-197 section 5.1.2: during encryption row r is cyclically shifted left by r bytes -- row 0 by 0, row 1 by 1, row 2 by 2, row 3 by 3 -- and during decryption row r is shifted right by r bytes. The original RTL implements exactly this: it was verified against a corrected FIPS-197 reference model with ORIG_MODEL_ERRORS=0.)\", \"category\": \"RULE_INVERSION\", \"rtl_location\": \"hw/ip/aes/rtl/aes_shift_rows.sv:27\", \"explanation\": \"Row 3 forward comparison inverted from == to !=. The forward amount is now applied to every operation except forward encryption, so 8 output bytes differ from the FIPS reference.\"}", "mutation": {"type": "inverted_enable", "original": "assign data_o[3] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[3], 2'h1) :", "mutated": "assign data_o[3] = (op_i != CIPH_FWD) ? aes_circ_byte_shift(data_i[3], 2'h1) :", "location": "hw/ip/aes/rtl/aes_shift_rows.sv:27"}, "verification": "iverilog sim: iverilog -g2012 -o sim.vvp /home/hatch/workspace/specbench/sources/sim_scout/stubs/aes_pkg_min.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/aes-012/aes-012.log shows `RESULT: DIFFER (8 byte mismatches between orig and mut)`", "difficulty": "medium"} {"id": "aes-t4-013", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/rtl/aes_shift_rows.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. Each output row is therefore computed from the same input row (rows are shifted, never permuted), and row 0 is left untouched.", "rtl_excerpt": "19: assign data_o[2] = aes_circ_byte_shift(data_i[2], 2'h2);\n20: \n21: // Row 1\n22: assign data_o[1] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[0], 2'h3) : // <-- MUTATED\n23: (op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[0], 2'h1) : // <-- MUTATED\n24: aes_circ_byte_shift(data_i[0], 2'h3); // <-- MUTATED\n25: \n26: // Row 3\n27: assign data_o[3] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[3], 2'h1) :\n[mutated line(s): 22, 23, 24]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. Each output row is therefore computed from the same input row (rows are shifted, never permuted), and row 0 is left untouched.\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/aes/rtl/aes_shift_rows.sv:22-24\", \"explanation\": \"Row 1 output is computed from data_i[0] instead of data_i[1]. ShiftRows shifts each row's own bytes; the mutant permutes rows, so 20 output bytes differ from the FIPS reference.\"}", "mutation": {"type": "field_offset_error", "original": "assign data_o[1] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[1], 2'h3) :\n(op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[1], 2'h1) :\naes_circ_byte_shift(data_i[1], 2'h3);", "mutated": "assign data_o[1] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[0], 2'h3) :\n(op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[0], 2'h1) :\naes_circ_byte_shift(data_i[0], 2'h3);", "location": "hw/ip/aes/rtl/aes_shift_rows.sv:22-24"}, "verification": "iverilog sim: iverilog -g2012 -o sim.vvp /home/hatch/workspace/specbench/sources/sim_scout/stubs/aes_pkg_min.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/aes-013/aes-013.log shows `RESULT: DIFFER (20 byte mismatches between orig and mut)`", "difficulty": "medium"} {"id": "aes-t4-014", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/rtl/aes_shift_rows.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. Each output row is therefore computed from the same input row (rows are shifted, never permuted), and row 0 is left untouched.", "rtl_excerpt": "19: assign data_o[2] = aes_circ_byte_shift(data_i[2], 2'h2);\n20: \n21: // Row 1\n22: assign data_o[1] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[2], 2'h3) : // <-- MUTATED\n23: (op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[2], 2'h1) : // <-- MUTATED\n24: aes_circ_byte_shift(data_i[2], 2'h3); // <-- MUTATED\n25: \n26: // Row 3\n27: assign data_o[3] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[3], 2'h1) :\n[mutated line(s): 22, 23, 24]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. Each output row is therefore computed from the same input row (rows are shifted, never permuted), and row 0 is left untouched.\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/aes/rtl/aes_shift_rows.sv:22-24\", \"explanation\": \"Row 1 output is computed from data_i[2] instead of data_i[1]. ShiftRows shifts each row's own bytes; the mutant permutes rows, so 20 output bytes differ from the FIPS reference.\"}", "mutation": {"type": "field_offset_error", "original": "assign data_o[1] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[1], 2'h3) :\n(op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[1], 2'h1) :\naes_circ_byte_shift(data_i[1], 2'h3);", "mutated": "assign data_o[1] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[2], 2'h3) :\n(op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[2], 2'h1) :\naes_circ_byte_shift(data_i[2], 2'h3);", "location": "hw/ip/aes/rtl/aes_shift_rows.sv:22-24"}, "verification": "iverilog sim: iverilog -g2012 -o sim.vvp /home/hatch/workspace/specbench/sources/sim_scout/stubs/aes_pkg_min.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/aes-014/aes-014.log shows `RESULT: DIFFER (20 byte mismatches between orig and mut)`", "difficulty": "medium"} {"id": "aes-t4-015", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/rtl/aes_shift_rows.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. Each output row is therefore computed from the same input row (rows are shifted, never permuted), and row 0 is left untouched.", "rtl_excerpt": "16: assign data_o[0] = data_i[0];\n17: \n18: // Row 2 does not depend on op_i\n19: assign data_o[2] = aes_circ_byte_shift(data_i[3], 2'h2); // <-- MUTATED\n20: \n21: // Row 1\n22: assign data_o[1] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[1], 2'h3) :\n[mutated line(s): 19]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. Each output row is therefore computed from the same input row (rows are shifted, never permuted), and row 0 is left untouched.\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/aes/rtl/aes_shift_rows.sv:19\", \"explanation\": \"Row 2 output is computed from data_i[3] instead of data_i[2]. ShiftRows shifts each row's own bytes; the mutant permutes rows, so 20 output bytes differ from the FIPS reference.\"}", "mutation": {"type": "field_offset_error", "original": "assign data_o[2] = aes_circ_byte_shift(data_i[2], 2'h2);", "mutated": "assign data_o[2] = aes_circ_byte_shift(data_i[3], 2'h2);", "location": "hw/ip/aes/rtl/aes_shift_rows.sv:19"}, "verification": "iverilog sim: iverilog -g2012 -o sim.vvp /home/hatch/workspace/specbench/sources/sim_scout/stubs/aes_pkg_min.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/aes-015/aes-015.log shows `RESULT: DIFFER (20 byte mismatches between orig and mut)`", "difficulty": "medium"} {"id": "aes-t4-016", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/rtl/aes_shift_rows.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. Each output row is therefore computed from the same input row (rows are shifted, never permuted), and row 0 is left untouched.", "rtl_excerpt": "24: aes_circ_byte_shift(data_i[1], 2'h3);\n25: \n26: // Row 3\n27: assign data_o[3] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[2], 2'h1) : // <-- MUTATED\n28: (op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[2], 2'h3) : // <-- MUTATED\n29: aes_circ_byte_shift(data_i[2], 2'h1); // <-- MUTATED\n30: \n31: endmodule\n[mutated line(s): 27, 28, 29]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. Each output row is therefore computed from the same input row (rows are shifted, never permuted), and row 0 is left untouched.\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/aes/rtl/aes_shift_rows.sv:27-29\", \"explanation\": \"Row 3 output is computed from data_i[2] instead of data_i[3]. ShiftRows shifts each row's own bytes; the mutant permutes rows, so 20 output bytes differ from the FIPS reference.\"}", "mutation": {"type": "field_offset_error", "original": "assign data_o[3] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[3], 2'h1) :\n(op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[3], 2'h3) :\naes_circ_byte_shift(data_i[3], 2'h1);", "mutated": "assign data_o[3] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[2], 2'h1) :\n(op_i == CIPH_INV) ? aes_circ_byte_shift(data_i[2], 2'h3) :\naes_circ_byte_shift(data_i[2], 2'h1);", "location": "hw/ip/aes/rtl/aes_shift_rows.sv:27-29"}, "verification": "iverilog sim: iverilog -g2012 -o sim.vvp /home/hatch/workspace/specbench/sources/sim_scout/stubs/aes_pkg_min.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/aes-016/aes-016.log shows `RESULT: DIFFER (20 byte mismatches between orig and mut)`", "difficulty": "medium"} {"id": "aes-t4-017", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/rtl/aes_shift_rows.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. Each output row is therefore computed from the same input row (rows are shifted, never permuted), and row 0 is left untouched.", "rtl_excerpt": "13: import aes_pkg::*;\n14: \n15: // Row 0 is left untouched\n16: assign data_o[0] = data_i[1]; // <-- MUTATED\n17: \n18: // Row 2 does not depend on op_i\n19: assign data_o[2] = aes_circ_byte_shift(data_i[2], 2'h2);\n[mutated line(s): 16]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. Each output row is therefore computed from the same input row (rows are shifted, never permuted), and row 0 is left untouched.\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/aes/rtl/aes_shift_rows.sv:16\", \"explanation\": \"Row 0 output reads data_i[1] instead of data_i[0]. Row 0 must be left untouched; the mutant copies row 1's bytes into row 0, so 20 output bytes differ from the FIPS reference.\"}", "mutation": {"type": "field_offset_error", "original": "assign data_o[0] = data_i[0];", "mutated": "assign data_o[0] = data_i[1];", "location": "hw/ip/aes/rtl/aes_shift_rows.sv:16"}, "verification": "iverilog sim: iverilog -g2012 -o sim.vvp /home/hatch/workspace/specbench/sources/sim_scout/stubs/aes_pkg_min.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/aes-017/aes-017.log shows `RESULT: DIFFER (20 byte mismatches between orig and mut)`", "difficulty": "easy"} {"id": "aes-t4-018", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aes/rtl/aes_shift_rows.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. Each output row is therefore computed from the same input row (rows are shifted, never permuted), and row 0 is left untouched.", "rtl_excerpt": "16: assign data_o[0] = data_i[0];\n17: \n18: // Row 2 does not depend on op_i\n19: assign data_o[2] = aes_circ_byte_shift(data_i[0], 2'h2); // <-- MUTATED\n20: \n21: // Row 1\n22: assign data_o[1] = (op_i == CIPH_FWD) ? aes_circ_byte_shift(data_i[1], 2'h3) :\n[mutated line(s): 19]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"ShiftRows Transformation: The bytes of the last three rows of the state are cyclically shifted over different offsets. Each output row is therefore computed from the same input row (rows are shifted, never permuted), and row 0 is left untouched.\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/aes/rtl/aes_shift_rows.sv:19\", \"explanation\": \"Row 2 output is computed from data_i[0] instead of data_i[2]. ShiftRows shifts each row's own bytes; the mutant permutes rows, so 20 output bytes differ from the FIPS reference.\"}", "mutation": {"type": "field_offset_error", "original": "assign data_o[2] = aes_circ_byte_shift(data_i[2], 2'h2);", "mutated": "assign data_o[2] = aes_circ_byte_shift(data_i[0], 2'h2);", "location": "hw/ip/aes/rtl/aes_shift_rows.sv:19"}, "verification": "iverilog sim: iverilog -g2012 -o sim.vvp /home/hatch/workspace/specbench/sources/sim_scout/stubs/aes_pkg_min.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/aes-018/aes-018.log shows `RESULT: DIFFER (20 byte mismatches between orig and mut)`", "difficulty": "medium"} {"id": "aon_timer-t1-001", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aon_timer/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The always-on timer will run on a ~200KHz clock.", "rtl_excerpt": "", "question": "According to the Theory of Operation, on what clock does the always-on timer run?", "answer_format": "exact_value", "gold_answer": "~200KHz", "mutation": {"type": "none", "original": "", "mutated": "", "location": "n/a"}, "verification": "quoted verbatim from sources/excerpts/aon_timer/aon_timer_excerpt_1_theory.md (Design Details)", "difficulty": "easy"} {"id": "aon_timer-t1-002", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aon_timer/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The wakeup timer is 64 bits wide and the watchdog timer is 32 bits wide.\nThis gives a maximum timeout window of roughly ~6 hours for the watchdog and almost 3 million years for the wakeup timer.", "rtl_excerpt": "", "question": "According to the Theory of Operation, how wide is the wakeup timer?", "answer_format": "exact_value", "gold_answer": "64 bits", "mutation": {"type": "none", "original": "", "mutated": "", "location": "n/a"}, "verification": "quoted verbatim from sources/excerpts/aon_timer/aon_timer_excerpt_1_theory.md (Design Details)", "difficulty": "easy"} {"id": "aon_timer-t1-003", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aon_timer/doc/registers.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "## WDOG_REGWEN\nWatchdog Timer Write Enable Register\n- Offset: `0x18`\n- Reset default: `0x1`\n- Reset mask: `0x1`\n\n| 31:1 | | | | Reserved |\n| 0 | rw0c | 0x1 | regwen | Once cleared, the watchdog configuration will be locked until the next reset. |", "rtl_excerpt": "", "question": "According to the register reference, what is the reset default of WDOG_REGWEN?", "answer_format": "exact_value", "gold_answer": "0x1", "mutation": {"type": "none", "original": "", "mutated": "", "location": "n/a"}, "verification": "quoted verbatim from sources/excerpts/aon_timer/aon_timer_excerpt_4_registers_wdog_intr.md (WDOG_REGWEN)", "difficulty": "medium"} {"id": "aon_timer-t1-004", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aon_timer/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "When integrating the AON timer into a bigger design, you must start the always-on clock (`clk_aon_i`) before you start the main clock (`clk_i`).", "rtl_excerpt": "", "question": "According to the Theory of Operation, which clock must be started first when integrating the AON timer?", "answer_format": "exact_value", "gold_answer": "the always-on clock (clk_aon_i), before the main clock (clk_i)", "mutation": {"type": "none", "original": "", "mutated": "", "location": "n/a"}, "verification": "quoted verbatim from sources/excerpts/aon_timer/aon_timer_excerpt_1_theory.md (integration note)", "difficulty": "medium"} {"id": "aon_timer-t2-001", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aon_timer/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If the timer has caused a wakeup event ([`WKUP_CAUSE`](registers.md#wkup_cause) is set) then clear the wakeup request by writing 0 to [`WKUP_CAUSE`](registers.md#wkup_cause).\nClear the interrupt by writing 1 into the Interrupt Status Register [`INTR_STATE`](registers.md#intr_state).", "rtl_excerpt": "", "question": "A wakeup event has set WKUP_CAUSE and raised the wkup_timer_expired interrupt. What value must be written to WKUP_CAUSE to clear the wakeup request, and how does that compare to clearing INTR_STATE?", "answer_format": "exact_value", "gold_answer": "write 0 to WKUP_CAUSE; INTR_STATE is cleared by writing 1 (opposite polarity)", "mutation": {"type": "none", "original": "", "mutated": "", "location": "n/a"}, "verification": "quoted verbatim from sources/excerpts/aon_timer/aon_timer_excerpt_1_theory.md (Interrupt Handling)", "difficulty": "medium"} {"id": "aon_timer-t2-002", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aon_timer/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Consider the scenario where the 64-bit counter value is `0x1_ffff_ffff`.\nA read of the [`WKUP_COUNT_HI`](registers.md#wkup_count_hi) value gives `0x1`.\nIf the counter then increments to `0x2_0000_0000` then a read of [`WKUP_COUNT_LO`](registers.md#wkup_count_lo) gives `0x0000_00000`.\nThe final 64-bit value of `0x1_0000_0000` is incorrect.", "rtl_excerpt": "", "question": "In the documented counter read-race scenario, what incorrect 64-bit value does software compute?", "answer_format": "exact_value", "gold_answer": "0x1_0000_0000", "mutation": {"type": "none", "original": "", "mutated": "", "location": "n/a"}, "verification": "quoted verbatim from sources/excerpts/aon_timer/aon_timer_excerpt_2_64bit_access.md (Reading the counter)", "difficulty": "medium"} {"id": "aon_timer-t2-003", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aon_timer/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The threshold is written by setting two registers ([`WKUP_THOLD_LO`](registers.md#wkup_thold_lo) and [`WKUP_THOLD_HI`](registers.md#wkup_thold_hi)).\nAs such, there will be an interim value of the threshold after the first register has been written.\nTo avoid this triggering a spurious wakeup, use the method below:\n```\ndisable_wakeup_interrupt();\n\n// Set the lower word to its maximum value. The resulting threshold will definitely be at least as\n// big as the previous value.\nREG_WRITE(WKUP_THOLD_LO, UINT32_MAX);\n\n// Set the upper word to its desired value. The resulting threshold will still be at least as big\n// as the desired threshold, so there cannot be any spurious trigger event.\nREG_WRITE(WKUP_THOLD_HI, new_thold >> 32);\n\n// Set the lower word to its desired value.\nREG_WRITE(WKUP_THOLD_LO, new_thold & 0xffff_ffff);\n\nenable_wakeup_interrupt();\n```", "rtl_excerpt": "", "question": "According to the Programmer's Guide, what is the recommended register-write sequence for updating the 64-bit wakeup threshold without triggering a spurious wakeup?", "answer_format": "exact_value", "gold_answer": "disable the wakeup interrupt; write UINT32_MAX to WKUP_THOLD_LO; write new_thold >> 32 to WKUP_THOLD_HI; write new_thold & 0xffffffff to WKUP_THOLD_LO; re-enable the wakeup interrupt", "mutation": {"type": "none", "original": "", "mutated": "", "location": "n/a"}, "verification": "quoted verbatim from sources/excerpts/aon_timer/aon_timer_excerpt_2_64bit_access.md (Writing the threshold)", "difficulty": "hard"} {"id": "aon_timer-t2-004", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aon_timer/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If {[`WKUP_COUNT_HI`](registers.md#wkup_count_hi), [`WKUP_COUNT_LO`](registers.md#wkup_count_lo)} remains above the threshold after clearing the interrupt or wakeup event and the timer remains enabled, the interrupt and wakeup event will trigger again at the next clock tick.", "rtl_excerpt": "", "question": "After software clears the wakeup interrupt, the 64-bit wakeup count is still above the threshold and the timer remains enabled. When will the interrupt trigger again?", "answer_format": "exact_value", "gold_answer": "at the next clock tick", "mutation": {"type": "none", "original": "", "mutated": "", "location": "n/a"}, "verification": "quoted verbatim from sources/excerpts/aon_timer/aon_timer_excerpt_1_theory.md (Interrupt Handling)", "difficulty": "medium"} {"id": "aon_timer-t3-001", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aon_timer/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The wakeup timer is 32 bits wide and the watchdog timer is 64 bits wide.\nThis gives a maximum timeout window of roughly ~6 hours for the watchdog and almost 3 million years for the wakeup timer.\n\n*Register reference:*\n\n## WKUP_THOLD_HI\nWakeup Timer Threshold Register (bits 63 - 32)\n## WKUP_THOLD_LO\nWakeup Timer Threshold Register (bits 31 - 0)\n## WKUP_COUNT_HI\nWakeup Timer Count Register (bits 63 - 32)\n## WKUP_COUNT_LO\nWakeup Timer Count Register (bits 31 - 0)\n\n## WDOG_COUNT\nWatchdog Timer Count Register\n| 31:0 | rw | 0x0 | count | The current watchdog counter value. |", "rtl_excerpt": "", "question": "The excerpt below was derived from the aon_timer spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated Design Details sentence ('The wakeup timer is 32 bits wide and the watchdog timer is 64 bits wide') vs the register reference in the same excerpt: the wakeup timer needs two 32-bit registers for each of its count and threshold (HI for bits 63-32, LO for bits 31-0, i.e. 64 bits total), while the watchdog has a single 32-bit WDOG_COUNT register\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The register map proves the wakeup timer is 64 bits (HI+LO halves) and the watchdog is 32 bits; the mutated sentence swaps the widths, which would also swap the stated ~6-hour / ~3-million-year timeout windows.\"}", "mutation": {"type": "changed_number", "original": "The wakeup timer is 64 bits wide and the watchdog timer is 32 bits wide.", "mutated": "The wakeup timer is 32 bits wide and the watchdog timer is 64 bits wide.", "location": "Theory of Operation Design Details (timer widths)"}, "verification": "excerpt derived verbatim from sources/excerpts/aon_timer/aon_timer_excerpt_1_theory.md, _3_registers_wkup.md and _4_registers_wdog_intr.md with the single numeric change noted in mutation", "difficulty": "medium"} {"id": "aon_timer-t3-002", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aon_timer/doc/registers.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "## WDOG_CTRL\nWatchdog Timer Control register\n\n| 31:2 | | | | Reserved |\n| 1 | rw | 0x0 | pause_in_sleep | When set to 1, the watchdog timer will count during sleep. |\n| 0 | rw | 0x0 | enable | When set to 1, the watchdog timer will count. |", "rtl_excerpt": "", "question": "The excerpt below was derived from the aon_timer spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated WDOG_CTRL.pause_in_sleep description ('When set to 1, the watchdog timer will count during sleep') vs the field's own name, pause_in_sleep\", \"category\": \"RULE_INVERSION\", \"explanation\": \"A bit named pause_in_sleep that, when set, makes the timer count during sleep is self-contradictory; the original rule is that setting it pauses (stops) the watchdog during sleep.\"}", "mutation": {"type": "rule_inversion", "original": "When set to 1, the watchdog timer will not count during sleep.", "mutated": "When set to 1, the watchdog timer will count during sleep.", "location": "Register reference WDOG_CTRL.pause_in_sleep description"}, "verification": "excerpt derived verbatim from sources/excerpts/aon_timer/aon_timer_excerpt_4_registers_wdog_intr.md with the single rule inversion noted in mutation", "difficulty": "medium"} {"id": "aon_timer-t3-003", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aon_timer/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "## Initialization\n\n1. Set the timer values [`WKUP_COUNT_LO`](registers.md#wkup_count_lo), [`WKUP_COUNT_HI`](registers.md#wkup_count_hi) and [`WDOG_COUNT`](registers.md#wdog_count) to zero.\n2. Program the desired wakeup pre-scaler value in [`WDOG_CTRL`](registers.md#wdog_ctrl).\n\n*Register reference:*\n\n## WKUP_CTRL\nWakeup Timer Control register.\nEach write to the register resets the internal prescaler count.\n| 12:1 | rw | 0x0 | prescaler | Pre-scaler value for wakeup timer count |\n| 0 | rw | 0x0 | enable | When set to 1, the wakeup timer will count |\n\n## WDOG_CTRL\nWatchdog Timer Control register\n| 1 | rw | 0x0 | pause_in_sleep | When set to 1, the watchdog timer will not count during sleep. |\n| 0 | rw | 0x0 | enable | When set to 1, the watchdog timer will count. |", "rtl_excerpt": "", "question": "The excerpt below was derived from the aon_timer spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated Initialization step 2 ('Program the desired wakeup pre-scaler value in WDOG_CTRL') vs the register reference in the same excerpt: the 12-bit prescaler field lives in WKUP_CTRL, while WDOG_CTRL documents only enable and pause_in_sleep and has no prescaler field\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The mutated cross-reference sends software to a register that cannot hold the prescaler value; the WKUP_CTRL documentation (including 'Each write to the register resets the internal prescaler count') confirms the prescaler belongs to WKUP_CTRL.\"}", "mutation": {"type": "crossref_conflict", "original": "Program the desired wakeup pre-scaler value in [`WKUP_CTRL`](registers.md#wkup_ctrl).", "mutated": "Program the desired wakeup pre-scaler value in [`WDOG_CTRL`](registers.md#wdog_ctrl).", "location": "Programmer's Guide Initialization step 2 (pre-scaler register reference)"}, "verification": "excerpt derived verbatim from sources/excerpts/aon_timer/aon_timer_excerpt_1_theory.md with the single cross-reference change noted in mutation", "difficulty": "medium"} {"id": "aon_timer-t3-004", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aon_timer/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The threshold is written by setting two registers ([`WKUP_THOLD_LO`](registers.md#wkup_thold_lo) and [`WKUP_THOLD_HI`](registers.md#wkup_thold_hi)).\nAs such, there will be an interim value of the threshold after the first register has been written.\nTo avoid this triggering a spurious wakeup, use the method below:\n```\ndisable_wakeup_interrupt();\n\n// Set the lower word. The resulting threshold will definitely be at least as\n// big as the previous value.\nREG_WRITE(WKUP_THOLD_LO, UINT32_MAX);\n\n// Set the upper word to its desired value. The resulting threshold will still be at least as big\n// as the desired threshold, so there cannot be any spurious trigger event.\nREG_WRITE(WKUP_THOLD_HI, new_thold >> 32);\n\n// Set the lower word to its desired value.\nREG_WRITE(WKUP_THOLD_LO, new_thold & 0xffff_ffff);\n\nenable_wakeup_interrupt();\n```", "rtl_excerpt": "", "question": "The excerpt below was derived from the aon_timer spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated comment ('Set the lower word. The resulting threshold will definitely be at least as big as the previous value') vs the actual write on the next line (REG_WRITE(WKUP_THOLD_LO, UINT32_MAX)): the guarantee only holds because the lower word is set to its maximum value\", \"category\": \"MISSING_CONDITION\", \"explanation\": \"The deleted condition 'to its maximum value' is what makes the interim threshold at least as big as the previous value; without it the comment's guarantee is unfounded and a spurious wakeup could occur, contradicting the stated purpose of the sequence.\"}", "mutation": {"type": "deleted_condition", "original": "// Set the lower word to its maximum value. The resulting threshold will definitely be at least as", "mutated": "// Set the lower word. The resulting threshold will definitely be at least as", "location": "Programmer's Guide threshold-write pseudo-code (first comment)"}, "verification": "excerpt derived verbatim from sources/excerpts/aon_timer/aon_timer_excerpt_2_64bit_access.md with the single condition deletion noted in mutation", "difficulty": "hard"} {"id": "aon_timer-t3-005", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aon_timer/doc/registers.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "## INTR_STATE\nInterrupt State Register\n- Offset: `0x2c`\n- Reset default: `0x1`\n- Reset mask: `0x3`\n\n| 31:2 | | | | Reserved |\n| 1 | rw1c | 0x0 | wdog_timer_bark | Raised if the watchdog timer has hit the bark threshold. |\n| 0 | rw1c | 0x0 | wkup_timer_expired | Raised if the wakeup timer has hit the specified threshold. |", "rtl_excerpt": "", "question": "The excerpt below was derived from the aon_timer spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"INTR_STATE header ('Reset default: 0x1') vs the field table in the same excerpt: both wdog_timer_bark (bit 1) and wkup_timer_expired (bit 0) reset to 0x0, so the register must reset to 0x0, not 0x1\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"A reset default of 0x1 would mean wkup_timer_expired is asserted at reset, contradicting the per-field reset values that both read 0x0.\"}", "mutation": {"type": "changed_number", "original": "- Reset default: `0x0`", "mutated": "- Reset default: `0x1`", "location": "Register reference INTR_STATE header (reset default)"}, "verification": "excerpt derived verbatim from sources/excerpts/aon_timer/aon_timer_excerpt_4_registers_wdog_intr.md with the single numeric change noted in mutation", "difficulty": "medium"} {"id": "aon_timer-t3-006", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aon_timer/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Register reads via the TL-UL interface (SYS domain) are synchronized to the slow clock (AON domain) using the \"async\" register generation feature.\nThis means that writes cannot complete before the data has reached its underlying register in the slow clock domain.\nIf software needs to guarantee completion of a register write then it can read back the register value.\nThis will guarantee the completion of all previous writes to the peripheral.", "rtl_excerpt": "", "question": "The excerpt below was derived from the aon_timer spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated async-register sentence ('writes cannot complete before the data has reached its underlying register in the slow clock domain') vs the following sentences: if writes could not complete early, software would never need the readback trick to 'guarantee the completion of all previous writes'\", \"category\": \"RULE_INVERSION\", \"explanation\": \"The original rule is that writes CAN complete before the data reaches the slow domain (that is why the readback guarantee is documented); the mutated 'cannot' inverts it and makes the readback recommendation pointless.\"}", "mutation": {"type": "rule_inversion", "original": "This means that writes can complete before the data has reached its underlying register in the slow clock domain.", "mutated": "This means that writes cannot complete before the data has reached its underlying register in the slow clock domain.", "location": "Theory of Operation async register generation paragraph"}, "verification": "excerpt derived verbatim from sources/excerpts/aon_timer/aon_timer_excerpt_1_theory.md with the single rule inversion noted in mutation", "difficulty": "hard"} {"id": "aon_timer-t3-007", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aon_timer/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The counter might increment between the read of [`WKUP_COUNT_HI`](registers.md#wkup_count_hi) and the read of [`WKUP_COUNT_LO`](registers.md#wkup_count_lo).\nIf the [`WKUP_COUNT_LO`](registers.md#wkup_count_lo) value overflows between the two register reads the combined 64-bit value may be incorrect.\nThe pseudo code below provides a method to avoid this issue:\n```\ncounter_hi = REG_READ(WKUP_COUNT_HI);\ncounter_lo = REG_READ(WKUP_COUNT_LO);\n\ncounter_full = counter_hi << 32 | counter_lo;\n```", "rtl_excerpt": "", "question": "The excerpt below was derived from the aon_timer spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated pseudo-code (two reads, no recheck) vs the paragraph above it: 'The pseudo code below provides a method to avoid this issue' where the issue is the LO overflowing between the HI and LO reads\", \"category\": \"MISSING_CONDITION\", \"explanation\": \"The deleted third read of WKUP_COUNT_HI and the counter_hi != counter_hi_2 recheck are the entire race-avoidance mechanism; without them the pseudo-code is exactly the naive racy sequence and cannot 'avoid this issue' as claimed.\"}", "mutation": {"type": "deleted_condition", "original": "counter_hi = REG_READ(WKUP_COUNT_HI);\ncounter_lo = REG_READ(WKUP_COUNT_LO);\ncounter_hi_2 = REG_READ(WKUP_COUNT_HI);\n\n// If WKUP_COUNT_LO overflowed between first and second read WKUP_COUNT_HI will\n// have changed\nif counter_hi != counter_hi_2 {", "mutated": "counter_hi = REG_READ(WKUP_COUNT_HI);\ncounter_lo = REG_READ(WKUP_COUNT_LO);", "location": "Programmer's Guide counter-read pseudo-code (third read and recheck)"}, "verification": "excerpt derived verbatim from sources/excerpts/aon_timer/aon_timer_excerpt_2_64bit_access.md with the single condition deletion noted in mutation", "difficulty": "medium"} {"id": "aon_timer-t3-008", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aon_timer/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If either timer reaches the programmed threshold, interrupts are generated from the AON_TIMER module.\nClear the interrupt by writing 1 into [`WKUP_CAUSE`](registers.md#wkup_cause).\n\n*Register reference:*\n\n## WKUP_CAUSE\nWakeup request status\n| 0 | rw0c | 0x0 | cause | AON timer requested wakeup, write 0 to clear. |\n\nIf the timer has caused a wakeup event ([`WKUP_CAUSE`](registers.md#wkup_cause) is set) then clear the wakeup request by writing 0 to [`WKUP_CAUSE`](registers.md#wkup_cause).", "rtl_excerpt": "", "question": "The excerpt below was derived from the aon_timer spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated interrupt-handling sentence ('Clear the interrupt by writing 1 into WKUP_CAUSE') vs the WKUP_CAUSE register reference in the same excerpt (Type rw0c, 'write 0 to clear') and the wakeup-handling sentence ('clear the wakeup request by writing 0 to WKUP_CAUSE')\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"WKUP_CAUSE is the wakeup-request status cleared by writing 0, not the interrupt status register (INTR_STATE, cleared by writing 1); the mutated sentence points at the wrong register with the wrong clear polarity.\"}", "mutation": {"type": "crossref_conflict", "original": "Clear the interrupt by writing 1 into the Interrupt Status Register [`INTR_STATE`](registers.md#intr_state).", "mutated": "Clear the interrupt by writing 1 into [`WKUP_CAUSE`](registers.md#wkup_cause).", "location": "Programmer's Guide Interrupt Handling (interrupt-clear register reference)"}, "verification": "excerpt derived verbatim from sources/excerpts/aon_timer/aon_timer_excerpt_1_theory.md and _3_registers_wkup.md with the single cross-reference change noted in mutation", "difficulty": "medium"} {"id": "aon_timer-t3-009", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aon_timer/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The always-on timer will run on a ~200MHz clock.\nThe wakeup timer is 64 bits wide and the watchdog timer is 32 bits wide.\nThis gives a maximum timeout window of roughly ~6 hours for the watchdog and almost 3 million years for the wakeup timer.", "rtl_excerpt": "", "question": "The excerpt below was derived from the aon_timer spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated clock rate ('~200MHz clock') vs the maximum-timeout-window sentence in the same excerpt: a 32-bit watchdog at 200MHz wraps in about 21 seconds (2^32/200MHz), not roughly 6 hours (2^32/200kHz ~= 5.96 hours)\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The stated ~6-hour watchdog window is only consistent with a ~200KHz clock; the mutated 200MHz rate is off by a factor of 1000 and contradicts the documented timeout window.\"}", "mutation": {"type": "changed_number", "original": "The always-on timer will run on a ~200KHz clock.", "mutated": "The always-on timer will run on a ~200MHz clock.", "location": "Theory of Operation Design Details (AON clock rate)"}, "verification": "excerpt derived verbatim from sources/excerpts/aon_timer/aon_timer_excerpt_1_theory.md with the single numeric change noted in mutation", "difficulty": "hard"} {"id": "aon_timer-t4-001", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aon_timer/rtl/aon_timer_core.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "## WKUP_CTRL\nWakeup Timer Control register.\nEach write to the register resets the internal prescaler count.", "rtl_excerpt": "47: if (!rst_aon_ni) begin\n48: prescale_count_q <= 12'h000;\n49: end else if (reg2hw_i.wkup_ctrl.prescaler.qe) begin\n50: prescale_count_q <= 12'h001; // <-- MUTATED\n51: end else if (prescale_en) begin\n52: prescale_count_q <= prescale_count_d;\n53: end\n[mutated line(s): 50]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"Each write to the WKUP_CTRL register resets the internal prescaler count.\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/aon_timer/rtl/aon_timer_core.sv:51\", \"explanation\": \"On a WKUP_CTRL prescaler write the RTL resets prescale_count_q to 12'h001 instead of 12'h000, so the prescaler starts one count ahead; simulation confirms the wakeup interrupt arrives one cycle earlier (18 vs 19 cycles from the reset).\"}", "mutation": {"type": "wrong_reset_value", "original": "prescale_count_q <= 12'h000;", "mutated": "prescale_count_q <= 12'h001;", "location": "hw/ip/aon_timer/rtl/aon_timer_core.sv:51"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd build/sim_t4/aon_timer-001 && iverilog -g2012 -o sim.vvp ../../../sources/sim_scout/stubs/lc_ctrl_pkg.sv ../../../sources/sim_scout/work/aon_timer_reg_pkg_sim.sv orig.sv mut.sv tb.sv && vvp sim.vvp # run.log shows RESULT: DIFFER", "difficulty": "medium"} {"id": "aon_timer-t4-002", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aon_timer/rtl/aon_timer_core.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If either timer reaches the programmed threshold, interrupts are generated from the AON_TIMER module.\n## WKUP_THOLD_LO\nWakeup Timer Threshold Register (bits 31 - 0)\n| 31:0 | rw | 0x0 | threshold_lo | The count at which a wakeup interrupt should be generated, bottom 32 bits. |", "rtl_excerpt": "65: assign wkup_count_wr_data_o = wkup_count + 64'd1;\n66: \n67: // Timer interrupt\n68: assign wkup_intr_o = wkup_incr & (wkup_count > wkup_thold); // <-- MUTATED\n69: \n70: ////////////////////\n71: // Watchdog Timer //\n[mutated line(s): 68]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"If either timer reaches the programmed threshold, interrupts are generated.\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/aon_timer/rtl/aon_timer_core.sv:68\", \"explanation\": \"'Reaches the threshold' includes equality, so the interrupt must fire when the count equals the threshold; the mutated RTL uses strict > and fires one count late. Simulation confirms at count==threshold(10): orig fires, mutated does not.\"}", "mutation": {"type": "off_by_one", "original": "assign wkup_intr_o = wkup_incr & (wkup_count >= wkup_thold);", "mutated": "assign wkup_intr_o = wkup_incr & (wkup_count > wkup_thold);", "location": "hw/ip/aon_timer/rtl/aon_timer_core.sv:68"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd build/sim_t4/aon_timer-002 && iverilog -g2012 -o sim.vvp ../../../sources/sim_scout/stubs/lc_ctrl_pkg.sv ../../../sources/sim_scout/work/aon_timer_reg_pkg_sim.sv orig.sv mut.sv tb.sv && vvp sim.vvp # run.log shows RESULT: DIFFER", "difficulty": "medium"} {"id": "aon_timer-t4-003", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aon_timer/rtl/aon_timer_core.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If either timer reaches the programmed threshold, interrupts are generated from the AON_TIMER module.\n## WDOG_BARK_THOLD\nWatchdog Timer Bark Threshold Register\n| 31:0 | rw | 0x0 | threshold | The count at which a watchdog bark interrupt should be generated. |", "rtl_excerpt": "80: assign wdog_count_wr_data_o = (reg2hw_i.wdog_count.q + 32'd1);\n81: \n82: // Timer interrupt\n83: assign wdog_intr_o = wdog_incr & (reg2hw_i.wdog_count.q > reg2hw_i.wdog_bark_thold.q); // <-- MUTATED\n84: // Timer reset\n85: assign wdog_reset_req_o = wdog_incr & (reg2hw_i.wdog_count.q >= reg2hw_i.wdog_bite_thold.q);\n86: \n[mutated line(s): 83]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"If either timer reaches the programmed threshold, interrupts are generated; the bark interrupt is generated at the count in WDOG_BARK_THOLD.\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/aon_timer/rtl/aon_timer_core.sv:83\", \"explanation\": \"'Reaches the threshold' includes equality; the mutated RTL uses strict > so the bark fires one count late. Simulation confirms at count==bark(5): orig barks, mutated does not.\"}", "mutation": {"type": "off_by_one", "original": "assign wdog_intr_o = wdog_incr & (reg2hw_i.wdog_count.q >= reg2hw_i.wdog_bark_thold.q);", "mutated": "assign wdog_intr_o = wdog_incr & (reg2hw_i.wdog_count.q > reg2hw_i.wdog_bark_thold.q);", "location": "hw/ip/aon_timer/rtl/aon_timer_core.sv:83"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd build/sim_t4/aon_timer-003 && iverilog -g2012 -o sim.vvp ../../../sources/sim_scout/stubs/lc_ctrl_pkg.sv ../../../sources/sim_scout/work/aon_timer_reg_pkg_sim.sv orig.sv mut.sv tb.sv && vvp sim.vvp # run.log shows RESULT: DIFFER", "difficulty": "medium"} {"id": "aon_timer-t4-004", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aon_timer/rtl/aon_timer_core.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Each timer increases its count as long as its enable signal (`wdog_ctrl.enable` for WDOG and `wkup_ctrl.enable` for WKUP) is set.\n## WKUP_CTRL\nWakeup Timer Control register.\n| 0 | rw | 0x0 | enable | When set to 1, the wakeup timer will count |", "rtl_excerpt": "58: \n59: // Wakeup timer count\n60: assign wkup_incr = lc_ctrl_pkg::lc_tx_test_false_strict(lc_escalate_en_i[1]) &\n61: ~reg2hw_i.wkup_ctrl.enable.q & // <-- MUTATED\n62: (prescale_count_q == reg2hw_i.wkup_ctrl.prescaler.q);\n63: \n64: assign wkup_count_reg_wr_o = wkup_incr;\n[mutated line(s): 61]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"Each timer increases its count as long as its enable signal is set (WKUP: wkup_ctrl.enable).\", \"category\": \"RULE_INVERSION\", \"rtl_location\": \"hw/ip/aon_timer/rtl/aon_timer_core.sv:61\", \"explanation\": \"The enable term in wkup_incr was negated, so the wakeup timer counts only when disabled and halts when enabled, exactly backwards from the spec. Simulation confirms: enable=0 gives orig intr=0/mut intr=1; enable=1 gives orig intr=1/mut intr=0.\"}", "mutation": {"type": "inverted_enable", "original": "reg2hw_i.wkup_ctrl.enable.q &", "mutated": "~reg2hw_i.wkup_ctrl.enable.q &", "location": "hw/ip/aon_timer/rtl/aon_timer_core.sv:61"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd build/sim_t4/aon_timer-004 && iverilog -g2012 -o sim.vvp ../../../sources/sim_scout/stubs/lc_ctrl_pkg.sv ../../../sources/sim_scout/work/aon_timer_reg_pkg_sim.sv orig.sv mut.sv tb.sv && vvp sim.vvp # run.log shows RESULT: DIFFER", "difficulty": "medium"} {"id": "aon_timer-t4-005", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aon_timer/rtl/aon_timer_core.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "## WDOG_CTRL\nWatchdog Timer Control register\n| 1 | rw | 0x0 | pause_in_sleep | When set to 1, the watchdog timer will not count during sleep. |\n| 0 | rw | 0x0 | enable | When set to 1, the watchdog timer will count. |", "rtl_excerpt": "74: // Watchdog timer count\n75: assign wdog_incr = reg2hw_i.wdog_ctrl.enable.q &\n76: lc_ctrl_pkg::lc_tx_test_false_strict(lc_escalate_en_i[2]) &\n77: (sleep_mode_i & reg2hw_i.wdog_ctrl.pause_in_sleep.q); // <-- MUTATED\n78: \n79: assign wdog_count_reg_wr_o = wdog_incr;\n80: assign wdog_count_wr_data_o = (reg2hw_i.wdog_count.q + 32'd1);\n[mutated line(s): 77]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"When WDOG_CTRL.pause_in_sleep is set to 1, the watchdog timer will not count during sleep.\", \"category\": \"RULE_INVERSION\", \"rtl_location\": \"hw/ip/aon_timer/rtl/aon_timer_core.sv:77\", \"explanation\": \"The sleep-pause term was changed from ~(sleep & pause_in_sleep) to (sleep & pause_in_sleep), so the watchdog counts during sleep when asked to pause and halts when awake. Simulation confirms: sleep=1,pause=1 gives orig intr=0/mut intr=1; awake gives orig intr=1/mut intr=0.\"}", "mutation": {"type": "inverted_enable", "original": "~(sleep_mode_i & reg2hw_i.wdog_ctrl.pause_in_sleep.q);", "mutated": "(sleep_mode_i & reg2hw_i.wdog_ctrl.pause_in_sleep.q);", "location": "hw/ip/aon_timer/rtl/aon_timer_core.sv:77"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd build/sim_t4/aon_timer-005 && iverilog -g2012 -o sim.vvp ../../../sources/sim_scout/stubs/lc_ctrl_pkg.sv ../../../sources/sim_scout/work/aon_timer_reg_pkg_sim.sv orig.sv mut.sv tb.sv && vvp sim.vvp # run.log shows RESULT: DIFFER", "difficulty": "medium"} {"id": "aon_timer-t4-006", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aon_timer/rtl/aon_timer_core.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Both timers halt the counting if the signal `lc_escalate_en_i` is set, which tells the alert handler is the system is in a \"killed\" state.", "rtl_excerpt": "57: assign wkup_thold = {reg2hw_i.wkup_thold_hi.q, reg2hw_i.wkup_thold_lo.q};\n58: \n59: // Wakeup timer count\n60: assign wkup_incr = !lc_ctrl_pkg::lc_tx_test_false_strict(lc_escalate_en_i[1]) & // <-- MUTATED\n61: reg2hw_i.wkup_ctrl.enable.q &\n62: (prescale_count_q == reg2hw_i.wkup_ctrl.prescaler.q);\n63: \n[mutated line(s): 60]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"Both timers halt the counting if the signal lc_escalate_en_i is set.\", \"category\": \"RULE_INVERSION\", \"rtl_location\": \"hw/ip/aon_timer/rtl/aon_timer_core.sv:60\", \"explanation\": \"The escalation gate in wkup_incr was negated (lc_tx_test_false_strict -> !lc_tx_test_false_strict), so the wakeup timer halts when the system is NOT escalated and counts while escalated, exactly backwards. Simulation confirms: escalate=Off gives orig intr=1/mut intr=0; escalate=On gives orig intr=0/mut intr=1.\"}", "mutation": {"type": "inverted_enable", "original": "assign wkup_incr = lc_ctrl_pkg::lc_tx_test_false_strict(lc_escalate_en_i[1]) &", "mutated": "assign wkup_incr = !lc_ctrl_pkg::lc_tx_test_false_strict(lc_escalate_en_i[1]) &", "location": "hw/ip/aon_timer/rtl/aon_timer_core.sv:60"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd build/sim_t4/aon_timer-006 && iverilog -g2012 -o sim.vvp ../../../sources/sim_scout/stubs/lc_ctrl_pkg.sv ../../../sources/sim_scout/work/aon_timer_reg_pkg_sim.sv orig.sv mut.sv tb.sv && vvp sim.vvp # run.log shows RESULT: DIFFER", "difficulty": "medium"} {"id": "aon_timer-t4-007", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aon_timer/rtl/aon_timer_core.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "## WDOG_BARK_THOLD\nWatchdog Timer Bark Threshold Register\n| 31:0 | rw | 0x0 | threshold | The count at which a watchdog bark interrupt should be generated. |\n\n## WDOG_BITE_THOLD\nWatchdog Timer Bite Threshold Register\n| 31:0 | rw | 0x0 | threshold | The count at which a watchdog bite reset should be generated. |", "rtl_excerpt": "80: assign wdog_count_wr_data_o = (reg2hw_i.wdog_count.q + 32'd1);\n81: \n82: // Timer interrupt\n83: assign wdog_intr_o = wdog_incr & (reg2hw_i.wdog_count.q >= reg2hw_i.wdog_bite_thold.q); // <-- MUTATED\n84: // Timer reset\n85: assign wdog_reset_req_o = wdog_incr & (reg2hw_i.wdog_count.q >= reg2hw_i.wdog_bite_thold.q);\n86: \n[mutated line(s): 83]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"The watchdog bark interrupt is generated at the count in WDOG_BARK_THOLD; the bite reset is generated at the count in WDOG_BITE_THOLD.\", \"category\": \"CROSSREF_CONFLICT\", \"rtl_location\": \"hw/ip/aon_timer/rtl/aon_timer_core.sv:83\", \"explanation\": \"The bark-interrupt comparison was changed to use wdog_bite_thold instead of wdog_bark_thold (a copy-paste between the two similarly-named threshold registers), so the bark fires at the bite threshold. Simulation confirms at count==bark(5) with bite=100: orig barks, mutated does not.\"}", "mutation": {"type": "field_offset_error", "original": "assign wdog_intr_o = wdog_incr & (reg2hw_i.wdog_count.q >= reg2hw_i.wdog_bark_thold.q);", "mutated": "assign wdog_intr_o = wdog_incr & (reg2hw_i.wdog_count.q >= reg2hw_i.wdog_bite_thold.q);", "location": "hw/ip/aon_timer/rtl/aon_timer_core.sv:83"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd build/sim_t4/aon_timer-007 && iverilog -g2012 -o sim.vvp ../../../sources/sim_scout/stubs/lc_ctrl_pkg.sv ../../../sources/sim_scout/work/aon_timer_reg_pkg_sim.sv orig.sv mut.sv tb.sv && vvp sim.vvp # run.log shows RESULT: DIFFER", "difficulty": "medium"} {"id": "aon_timer-t4-008", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/aon_timer/rtl/aon_timer_core.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If either timer reaches the programmed threshold, interrupts are generated from the AON_TIMER module.\n## WDOG_BITE_THOLD\nWatchdog Timer Bite Threshold Register\n| 31:0 | rw | 0x0 | threshold | The count at which a watchdog bite reset should be generated. |", "rtl_excerpt": "82: // Timer interrupt\n83: assign wdog_intr_o = wdog_incr & (reg2hw_i.wdog_count.q >= reg2hw_i.wdog_bark_thold.q);\n84: // Timer reset\n85: assign wdog_reset_req_o = wdog_incr & (reg2hw_i.wdog_count.q > reg2hw_i.wdog_bite_thold.q); // <-- MUTATED\n86: \n87: assign unused_reg2hw = |{reg2hw_i.intr_state, reg2hw_i.intr_test, reg2hw_i.wkup_cause,\n88: reg2hw_i.alert_test};\n[mutated line(s): 85]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"If either timer reaches the programmed threshold, the event is generated; the watchdog bite reset is generated at the count in WDOG_BITE_THOLD.\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/aon_timer/rtl/aon_timer_core.sv:85\", \"explanation\": \"'Reaches the threshold' includes equality; the mutated RTL uses strict > so the bite reset is requested one count late. Simulation confirms at count==bite(5): orig requests reset, mutated does not.\"}", "mutation": {"type": "off_by_one", "original": "assign wdog_reset_req_o = wdog_incr & (reg2hw_i.wdog_count.q >= reg2hw_i.wdog_bite_thold.q);", "mutated": "assign wdog_reset_req_o = wdog_incr & (reg2hw_i.wdog_count.q > reg2hw_i.wdog_bite_thold.q);", "location": "hw/ip/aon_timer/rtl/aon_timer_core.sv:85"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd build/sim_t4/aon_timer-008 && iverilog -g2012 -o sim.vvp ../../../sources/sim_scout/stubs/lc_ctrl_pkg.sv ../../../sources/sim_scout/work/aon_timer_reg_pkg_sim.sv orig.sv mut.sv tb.sv && vvp sim.vvp # run.log shows RESULT: DIFFER", "difficulty": "medium"} {"id": "hmac-t1-001", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The logic assumes the input message is little-endian.\nIt converts the byte order of the word right before writing to SHA-2 storage as SHA-2 treats the incoming message as big-endian.\nIf SW wants to convert the message byte order, SW should set [`CFG.endian_swap`](registers.md#cfg) to **1**.", "rtl_excerpt": "", "question": "To what value must software set CFG.endian_swap to byte-swap the input message words?", "answer_format": "exact_value", "gold_answer": "1", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "quoted verbatim from hw/ip/hmac/doc/theory_of_operation.md, section 'SHA-2 message feed and pad'", "difficulty": "easy"} {"id": "hmac-t1-002", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "For SHA-2 256, only `DIGEST_0`..`7` should be read out, the remaining digest registers are redundant and would hold irrelevant values.\nFor SHA-2 384, only `DIGEST_0`..`11` should be read out, the rest should be truncated out by not being read by the SW.\nFor SHA-2 512, all `DIGEST_0`..`15` should be read out.", "rtl_excerpt": "", "question": "For SHA-2 384, which DIGEST registers should software read out?", "answer_format": "exact_value", "gold_answer": "DIGEST_0..11", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "quoted verbatim from hw/ip/hmac/doc/programmers_guide.md, section 'Triggering HMAC/SHA-2 engine'", "difficulty": "easy"} {"id": "hmac-t1-003", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The HMAC IP prevents [`CFG`](registers.md#cfg) and [`KEY`](registers.md#key) registers from getting updating while the engine is processing messages.\nSuch attempts are discarded.\nThe [`KEY`](registers.md#key) register ignores any attempt to access the secret key in the middle of the process.\nIf the software tries to update the KEY, the IP reports an error through the [`ERR_CODE`](registers.md#err_code) register.\nThe error code is `SwUpdateSecretKeyInProcess`, `0x0003`.", "rtl_excerpt": "", "question": "What error code is reported when software tries to update the KEY registers while the engine is processing messages?", "answer_format": "exact_value", "gold_answer": "0x0003", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "quoted verbatim from hw/ip/hmac/doc/programmers_guide.md, section 'Updating the configurations'", "difficulty": "easy"} {"id": "hmac-t1-004", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The second round computes the hash of the outer secret key concatenated with the first round digest.\nIn the second round, the message length is a fixed 768 bits (512-bit size of outer secret key + 256-bit first round digest size).", "rtl_excerpt": "", "question": "For HMAC with SHA-2 256 and a 256-bit key, the second-round message length is a fixed 768 bits. How is that 768-bit length composed?", "answer_format": "exact_value", "gold_answer": "512-bit outer secret key + 256-bit first round digest", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "quoted verbatim from hw/ip/hmac/doc/theory_of_operation.md, section 'HMAC computation'", "difficulty": "medium"} {"id": "hmac-t1-005", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If the FIFO is full, the HMAC block will block any writes leading to back-pressure on the interconnect (as opposed to dropping those writes or overwriting existing FIFO contents).", "rtl_excerpt": "", "question": "When the message FIFO is full, what does the HMAC block do with further writes?", "answer_format": "exact_value", "gold_answer": "blocks the writes, causing back-pressure on the interconnect", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "quoted verbatim from hw/ip/hmac/doc/theory_of_operation.md, section 'SHA-2 message feed and pad'", "difficulty": "easy"} {"id": "hmac-t2-001", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "```\nInput Msg #0: 010203h\nInput Msg #1: 0405h\n```\n\nendian_swap | 0 | 1\n----------------|-----------|-----------\nPush to SHA2 #0 | 03020105h | 01020304h\nPush to SHA2 #1 | 00000004h | 00000005h", "rtl_excerpt": "", "question": "With CFG.endian_swap set to 1, what 32-bit value is pushed to the SHA-2 module first for the two input messages shown in the table?", "answer_format": "exact_value", "gold_answer": "01020304h", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "table cell 'Push to SHA2 #0' under the endian_swap=1 column, hw/ip/hmac/doc/theory_of_operation.md", "difficulty": "medium"} {"id": "hmac-t2-002", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "To support any arbitrary key length, the software should configure the HMAC to the next largest supported key length and concatenate zeros to reach the programmed key size.\nFor example, for an 80-bit key, HMAC should be configured with an 128-bit key length, fed with the 80-bit key and with 48 zero-bits.", "rtl_excerpt": "", "question": "Software must use an 80-bit secret key with HMAC. How should it configure and feed the key? Choose the correct option.\nA) Configure a 128-bit key length; feed the 80-bit key with 48 zero-bits.\nB) Configure an 80-bit key length directly.\nC) Configure a 256-bit key length; feed the 80-bit key with 176 zero-bits.\nD) Hash the 80-bit key first, then configure a 128-bit key length.", "answer_format": "multiple_choice", "gold_answer": "A", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "quoted verbatim from hw/ip/hmac/doc/theory_of_operation.md, section 'HMAC computation' (next-largest-supported-key-length rule + 80-bit example)", "difficulty": "medium", "options": ["A) Configure a 128-bit key length; feed the 80-bit key with 48 zero-bits", "B) Configure an 80-bit key length directly", "C) Configure a 256-bit key length; feed the 80-bit key with 176 zero-bits", "D) Hash the 80-bit key first, then configure a 128-bit key length"]} {"id": "hmac-t2-003", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Each new message stream needs to be started *once* by setting the `CMD.hash_start` bit and finalized *once* by setting the `CMD.hash_process` bit.\nTo switch from one message stream to another, set the `CMD.hash_stop` bit, wait for the `hmac_done` interrupt (or status bit), save one context and restore the other, and then set the `CMD.hash_continue` bit.", "rtl_excerpt": "", "question": "To pause message stream A and later resume it, which two CMD bits does software set, in order?", "answer_format": "exact_value", "gold_answer": "hash_stop, then hash_continue", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "quoted verbatim from hw/ip/hmac/doc/programmers_guide.md, section 'Saving and restoring the context'", "difficulty": "medium"} {"id": "hmac-t2-004", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Error | Value | Description\n-----------------------------|-------|---------------\n`SwPushMsgWhenShaDisabled` | `0x1` | The error is reported when SW writes data into MSG_FIFO when SHA is disabled. It may be due to SW routine error, or FI attacks. This error code is not used in the current version of the IP. Instead `SwPushMsgWhenDisallowed` is reported.\n`SwPushMsgWhenDisallowed` | `0x5` | The error is reported when MSG_FIFO is being updated by SW with more message words when it is disallowed: either when the SHA-2 engine is disabled or the engine has not been triggered to start yet or it has been already triggered to finalize computation.", "rtl_excerpt": "", "question": "Software writes data into MSG_FIFO while the SHA-2 engine is disabled. Which error code does the IP report? Choose the correct option.\nA) 0x1 (SwPushMsgWhenShaDisabled)\nB) 0x5 (SwPushMsgWhenDisallowed)\nC) 0x3 (SwUpdateSecretKeyInProcess)\nD) 0x6 (SwInvalidConfig)", "answer_format": "multiple_choice", "gold_answer": "B", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "error table in hw/ip/hmac/doc/programmers_guide.md: the 0x1 row states it is not used in the current IP and SwPushMsgWhenDisallowed is reported instead; the 0x5 row covers writes when the SHA-2 engine is disabled", "difficulty": "hard", "options": ["A) 0x1 (SwPushMsgWhenShaDisabled)", "B) 0x5 (SwPushMsgWhenDisallowed)", "C) 0x3 (SwUpdateSecretKeyInProcess)", "D) 0x6 (SwInvalidConfig)"]} {"id": "hmac-t2-005", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "HMAC supports a secret key of length 128/256/384/512/1024-bit, so long as the key length does not exceed the block size of the configured digest, i.e., for SHA-2 256 a maximum length of 512-bit key is supported.", "rtl_excerpt": "", "question": "Which statement is correct about configuring a 1024-bit key length with SHA-2 256? Choose the correct option.\nA) Valid: 1024-bit appears in the supported key-length list.\nB) Invalid: with SHA-2 256 the key length may not exceed the 512-bit block size.\nC) Valid: the IP automatically hashes longer keys down to a supported length.", "answer_format": "multiple_choice", "gold_answer": "B", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "quoted verbatim from hw/ip/hmac/doc/theory_of_operation.md, section 'HMAC computation' (key length must not exceed the block size of the configured digest; max 512-bit for SHA-2 256)", "difficulty": "hard", "options": ["A) Valid: 1024-bit appears in the supported key-length list", "B) Invalid: with SHA-2 256 the key length may not exceed the 512-bit block size", "C) Valid: the IP automatically hashes longer keys down to a supported length"]} {"id": "hmac-t3-001", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "For example, for SHA-2 256, if the message is empty, the message length is 64-bit 0.\nIn this case, the padding logic gives `0x80000000` into the SHA-2 module first.\nThen it sends (512 - 32 - 64)/32, 12 times of `0x00000000` for Padding `0x00`.\nLastly, it returns the message length which is 64-bit `0x00000000_00000000`.", "rtl_excerpt": "", "question": "The excerpt below was derived from the HMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated padding example ('12 times of 0x00000000') vs the formula in the same sentence ('(512 - 32 - 64)/32', which equals 13)\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The sentence derives the repetition count as (512-32-64)/32 = 13; the mutated count of 12 contradicts its own formula.\"}", "mutation": {"type": "changed_number", "original": "13 times of `0x00000000`", "mutated": "12 times of `0x00000000`", "location": "Theory 'SHA-2 message feed and pad', empty-message padding example"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "hmac-t3-002", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "This inner secret key is created with the 128/256/384/512/1024-bit (hashed) secret key (depending on the configured key length) and `0x36` padding to complete the corresponding block size of the configured digest size.\nFor example, for SHA-2 256 with 256-bit key, 512-bit inner secret key is created with the 256-bit secret key with 256-bit zero padding, XORed with 64{`0x36`}.\n\n```verilog\n inner_pad_key = {key[255:0], 256'h0} ^ {64{8'h5c}} // big-endian\n```", "rtl_excerpt": "", "question": "The excerpt below was derived from the HMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated inner_pad_key line (XOR with 64{8'h5c}) vs the prose ('0x36 padding' and 'XORed with 64{0x36}') and the outer_pad_key line which legitimately uses 0x5c\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The mutation copies the outer pad constant into the inner pad line; the prose still specifies 0x36 for the inner key.\"}", "mutation": {"type": "changed_number", "original": "{64{8'h36}}", "mutated": "{64{8'h5c}}", "location": "Theory 'HMAC computation', inner_pad_key Verilog line"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "hmac-t3-003", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The second round computes the hash of the outer secret key concatenated with the first round digest.\n\n```verilog\n outer_pad_key = {key[255:0], 256'h0} ^ {64{8'h5c}} // big-endian\n```\n\nIn the second round, the message length is a fixed 1024 bits (512-bit size of outer secret key + 256-bit first round digest size).", "rtl_excerpt": "", "question": "The excerpt below was derived from the HMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated second-round length ('fixed 1024 bits') vs the parenthetical derivation in the same sentence ('512-bit size of outer secret key + 256-bit first round digest size' = 768)\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The mutated total contradicts the sentence's own arithmetic: 512 + 256 = 768, not 1024.\"}", "mutation": {"type": "changed_number", "original": "a fixed 768 bits", "mutated": "a fixed 1024 bits", "location": "Theory 'HMAC computation', second-round message length"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "hard"} {"id": "hmac-t3-004", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "## Updating the configurations\n\nThe HMAC IP prevents [`CFG`](registers.md#cfg) and [`KEY`](registers.md#key) registers from getting updating while the engine is processing messages.\nSuch attempts are discarded.\nThe [`KEY`](registers.md#key) register ignores any attempt to access the secret key in the middle of the process.\nIf the software tries to update the KEY, the IP reports an error through the [`ERR_CODE`](registers.md#err_code) register.\nThe error code is `SwUpdateSecretKeyInProcess`, `0x0004`.\n\n## Errors\n\nWhen HMAC errors are triggered, the IP reports the error via [`INTR_STATE.hmac_err`](registers.md#intr_state).\nThe details of the error type is stored in [`ERR_CODE`](registers.md#err_code).\n\nError | Value | Description\n-----------------------------|-------|---------------\n`SwUpdateSecretKeyInProcess` | `0x3` | Secret Key CSRs should not be modified during the hashing. This error is reported when those CSRs are revised during hashing.\n`SwHashStartWhenActive` | `0x4` | The error is reported when CMD.start is received while HMAC is running.", "rtl_excerpt": "", "question": "The excerpt below was derived from the HMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated error code (SwUpdateSecretKeyInProcess = 0x0004) vs the error table in the same excerpt, where 0x4 is assigned to SwHashStartWhenActive and SwUpdateSecretKeyInProcess is 0x3\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The mutated value collides with a different error code's value and contradicts the table's own 0x3 row.\"}", "mutation": {"type": "changed_number", "original": "The error code is `SwUpdateSecretKeyInProcess`, `0x0003`.", "mutated": "The error code is `SwUpdateSecretKeyInProcess`, `0x0004`.", "location": "Programmers guide 'Updating the configurations', key-update error code"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "hmac-t3-005", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "For SHA-2 256, only `DIGEST_0`..`8` should be read out, the remaining digest registers are redundant and would hold irrelevant values.\nFor SHA-2 384, only `DIGEST_0`..`11` should be read out, the rest should be truncated out by not being read by the SW.\nFor SHA-2 512, all `DIGEST_0`..`15` should be read out.\n\n```c\n // Read the digest\n for (int i = 0 ; i < 8 ; i++) {\n *(hash + i) = REG32(HMAC_DIGEST_0(0) + (i << 2));\n }\n```", "rtl_excerpt": "", "question": "The excerpt below was derived from the HMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated readout range ('DIGEST_0..8', i.e. 9 registers) vs the run_hmac code in the same excerpt, which reads 8 registers (loop 'i < 8' from HMAC_DIGEST_0)\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The mutated text demands 9 digest registers while the reference code reads exactly 8.\"}", "mutation": {"type": "changed_number", "original": "only `DIGEST_0`..`7` should be read out", "mutated": "only `DIGEST_0`..`8` should be read out", "location": "Programmers guide 'Triggering HMAC/SHA-2 engine', SHA-2 256 digest readout"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "hmac-t3-006", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "This is done with an initial **1** bit after the actual message bits, followed by enough **0** padding bits, and then the 32/64-bit message length at the end of the block.\nFor example, for SHA-2 256, if the message is empty, the message length is 64-bit 0.\nIn this case, the padding logic gives `0x80000000` into the SHA-2 module first.\nThen it sends (512 - 32 - 64)/32, 13 times of `0x00000000` for Padding `0x00`.\nLastly, it returns the message length which is 64-bit `0x00000000_00000000`.\nThis similarly occurs for SHA-2 384/512 but with a 128-bit message length and block size of 1024 bits.", "rtl_excerpt": "", "question": "The excerpt below was derived from the HMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated padding rule ('32/64-bit message length') vs the two examples in the same excerpt: 64-bit length for SHA-2 256 and 128-bit length for SHA-2 384/512\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The general rule contradicts both worked examples that follow it.\"}", "mutation": {"type": "changed_number", "original": "the 64/128-bit message length", "mutated": "the 32/64-bit message length", "location": "Theory 'SHA-2 message feed and pad', padding length field"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "hmac-t3-007", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "HMAC supports a secret key of length 128/256/384/512/1024-bit, so long as the key length does not exceed the block size of the configured digest, i.e., for SHA-2 256 a maximum length of 512-bit key is supported.\nIt is also up to the software to shrink the key to the supported key length (up to 1024-bit for SHA-2 256 and up to 1024-bit for SHA-2 384/512) using a hash function when setting up the HMAC.", "rtl_excerpt": "", "question": "The excerpt below was derived from the HMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated shrink bound ('up to 1024-bit for SHA-2 256') vs the key-length rule in the same excerpt ('for SHA-2 256 a maximum length of 512-bit key is supported')\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The mutated sentence allows 1024-bit keys for SHA-2 256 while the spec caps them at the 512-bit block size.\"}", "mutation": {"type": "changed_number", "original": "(up to 512-bit for SHA-2 256 and up to 1024-bit for SHA-2 384/512)", "mutated": "(up to 1024-bit for SHA-2 256 and up to 1024-bit for SHA-2 384/512)", "location": "Theory 'HMAC computation', software key-shrinking guidance"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "hmac-t3-008", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/theory_of_operation.md; hw/ip/hmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If the FIFO is full, the HMAC block will overwrite the oldest FIFO contents with the new writes, avoiding any back-pressure on the interconnect (as opposed to blocking those writes or dropping them).\n\nIf the FIFO runs full, software should not continue to write data into [`MSG_FIFO`](registers.md#msg_fifo) and first wait the status flag [`STATUS.fifo_full`](registers.md#status) to lower.\nWhilst the FIFO is full, the HMAC will block writes until the FIFO has space which will cause back-pressure on the interconnect.", "rtl_excerpt": "", "question": "The excerpt below was derived from the HMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated FIFO-full rule ('overwrite the oldest FIFO contents ... avoiding any back-pressure') vs the FIFO-depth guidance in the same excerpt ('the HMAC will block writes until the FIFO has space which will cause back-pressure on the interconnect')\", \"category\": \"RULE_INVERSION\", \"explanation\": \"The mutation flips blocking into overwriting; the unmutated guidance still documents blocking with back-pressure.\"}", "mutation": {"type": "rule_inversion", "original": "If the FIFO is full, the HMAC block will block any writes leading to back-pressure on the interconnect (as opposed to dropping those writes or overwriting existing FIFO contents).", "mutated": "If the FIFO is full, the HMAC block will overwrite the oldest FIFO contents with the new writes, avoiding any back-pressure on the interconnect (as opposed to blocking those writes or dropping them).", "location": "Theory 'SHA-2 message feed and pad', FIFO-full write behavior"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "hmac-t3-009", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "```verilog\n inner_pad_key = {key[255:0], 256'h0} ^ {64{8'h36}} // big-endian\n```\n\n```verilog\n outer_pad_key = {key[255:0], 256'h0} ^ {64{8'h5c}} // big-endian\n```\n\nThe byte order of the key registers is little-endian by default, can be swapped to big-endian by setting [`CFG.key_swap`](registers.md#cfg--key_swap) to 1.", "rtl_excerpt": "", "question": "The excerpt below was derived from the HMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated default ('little-endian by default') vs the pad-key Verilog lines in the same excerpt, both commented '// big-endian'\", \"category\": \"RULE_INVERSION\", \"explanation\": \"The mutated default contradicts the documented big-endian key construction shown in both code snippets.\"}", "mutation": {"type": "rule_inversion", "original": "The byte order of the key registers is big-endian by default, can be swapped to little endian by setting [`CFG.key_swap`](registers.md#cfg--key_swap) to 1.", "mutated": "The byte order of the key registers is little-endian by default, can be swapped to big-endian by setting [`CFG.key_swap`](registers.md#cfg--key_swap) to 1.", "location": "Theory 'HMAC computation', key register byte order"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "hmac-t3-010", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The HMAC IP prevents [`CFG`](registers.md#cfg) and [`KEY`](registers.md#key) registers from getting updating while the engine is processing messages.\nSuch attempts are applied immediately and take effect for the ongoing computation.\nThe [`KEY`](registers.md#key) register ignores any attempt to access the secret key in the middle of the process.\nIf the software tries to update the KEY, the IP reports an error through the [`ERR_CODE`](registers.md#err_code) register.\nThe error code is `SwUpdateSecretKeyInProcess`, `0x0003`.", "rtl_excerpt": "", "question": "The excerpt below was derived from the HMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated rule ('attempts are applied immediately') vs the same paragraph's 'prevents CFG and KEY registers from getting updating while the engine is processing' and its key-update error reporting (SwUpdateSecretKeyInProcess)\", \"category\": \"RULE_INVERSION\", \"explanation\": \"The mutation inverts the lockout: updates can neither be applied immediately nor reported as errors at the same time.\"}", "mutation": {"type": "rule_inversion", "original": "Such attempts are discarded.", "mutated": "Such attempts are applied immediately and take effect for the ongoing computation.", "location": "Programmers guide 'Updating the configurations', CFG/KEY update rule"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "hmac-t3-011", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/theory_of_operation.md; hw/ip/hmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "It is recommended to keep writing to the memory-mapped message FIFO even when it is full, since sustained writes improve throughput.\nTo avoid doing so, software can read the [`STATUS.fifo_full`](registers.md#status) register.\n\nIf the FIFO runs full, software should not continue to write data into [`MSG_FIFO`](registers.md#msg_fifo) and first wait the status flag [`STATUS.fifo_full`](registers.md#status) to lower.\nWhilst the FIFO is full, the HMAC will block writes until the FIFO has space which will cause back-pressure on the interconnect.", "rtl_excerpt": "", "question": "The excerpt below was derived from the HMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated recommendation ('keep writing ... even when it is full') vs the FIFO-depth guidance in the same excerpt ('software should not continue to write data into MSG_FIFO and first wait the status flag STATUS.fifo_full to lower')\", \"category\": \"RULE_INVERSION\", \"explanation\": \"The mutation inverts the documented guidance; the unmutated procedure still tells software to stop and wait.\"}", "mutation": {"type": "rule_inversion", "original": "It is recommended to avoid this back-pressure by not writing to the memory-mapped message FIFO when it is full.", "mutated": "It is recommended to keep writing to the memory-mapped message FIFO even when it is full, since sustained writes improve throughput.", "location": "Theory 'SHA-2 message feed and pad', back-pressure recommendation"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "hmac-t3-012", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The first phase of HMAC calculates the SHA-2 hash of the actual message concatenated with the inner secret key (the key block is appended after the message).\nThe message length used in the SHA-2 module is calculated by the HMAC core by adding the block size to the original message length (to account for the length of `inner_pad_key`, which has been prepended to the message).", "rtl_excerpt": "", "question": "The excerpt below was derived from the HMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated first-phase order ('key block is appended after the message') vs the same excerpt's 'inner_pad_key, which has been prepended to the message'\", \"category\": \"RULE_INVERSION\", \"explanation\": \"The mutation flips prepend to append; the length-accounting sentence still documents prepending.\"}", "mutation": {"type": "rule_inversion", "original": "The first phase of HMAC calculates the SHA-2 hash of the inner secret key concatenated with the actual message to be authenticated.", "mutated": "The first phase of HMAC calculates the SHA-2 hash of the actual message concatenated with the inner secret key (the key block is appended after the message).", "location": "Theory 'HMAC computation', first-phase message construction"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "hard"} {"id": "hmac-t3-013", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "To support any arbitrary key length, the software should configure the HMAC to the next smallest supported key length and concatenate zeros to reach the programmed key size.\nFor example, for an 80-bit key, HMAC should be configured with an 128-bit key length, fed with the 80-bit key and with 48 zero-bits.", "rtl_excerpt": "", "question": "The excerpt below was derived from the HMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated rule ('next smallest supported key length') vs the 80-bit example in the same excerpt (an 80-bit key is configured as 128-bit, which is the next largest, not the next smallest)\", \"category\": \"RULE_INVERSION\", \"explanation\": \"The mutation inverts the sizing rule; the worked example still follows the original rule.\"}", "mutation": {"type": "rule_inversion", "original": "the software should configure the HMAC to the next largest supported key length", "mutated": "the software should configure the HMAC to the next smallest supported key length", "location": "Theory 'HMAC computation', arbitrary key length rule"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "hmac-t3-014", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The byte order of the key registers is big-endian by default, can be swapped to little endian by setting [`CFG.key_swap`](registers.md#cfg--endian_swap) to 1.\n\nIf SW wants to convert the message byte order, SW should set [`CFG.endian_swap`](registers.md#cfg) to **1**.", "rtl_excerpt": "", "question": "The excerpt below was derived from the HMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated link (text 'CFG.key_swap' resolving to the #cfg--endian_swap anchor) vs the same excerpt, where CFG.endian_swap is documented as the message byte-order field, distinct from the key byte-order field\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The link text names the key-swap field but the anchor sends the reader to the message endianness field.\"}", "mutation": {"type": "crossref_conflict", "original": "[`CFG.key_swap`](registers.md#cfg--key_swap)", "mutated": "[`CFG.key_swap`](registers.md#cfg--endian_swap)", "location": "Theory 'HMAC computation', CFG.key_swap cross-reference"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "hmac-t3-015", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "the procedure is the same whether a full HMAC or just a SHA-2 computation is required (choose between them using [`CFG.hmac_en`](registers.md#cmd)).\nIn both cases the SHA-2 engine must be enabled using [`CFG.sha_en`](registers.md#cfg) (once all other configuration inputs have been properly set).\n\n```c\n // Initiate hash: hash_start\n REG32(HMAC_CMD(0)) = (1 << HMAC_CMD_HASH_START);\n```", "rtl_excerpt": "", "question": "The excerpt below was derived from the HMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated link (text 'CFG.hmac_en' resolving to the #cmd anchor) vs the same excerpt, where CMD is the command register receiving hash_start/hash_process while hmac_en is described as the CFG mode-select bit\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The anchor points at the command register, but hmac_en is a configuration bit, not a command.\"}", "mutation": {"type": "crossref_conflict", "original": "[`CFG.hmac_en`](registers.md#cfg)", "mutated": "[`CFG.hmac_en`](registers.md#cmd)", "location": "Programmers guide 'Triggering HMAC/SHA-2 engine', CFG.hmac_en cross-reference"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "hmac-t3-016", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/theory_of_operation.md; hw/ip/hmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "To avoid doing so, software can read the [`STATUS.fifo_full`](registers.md#cfg) register.\n\n[`CFG.endian_swap`](registers.md#cfg) reverses the byte-order of input words when software writes into the message FIFO.\n[`CFG.digest_swap`](registers.md#cfg) reverses the byte-order in the final HMAC or SHA hash.", "rtl_excerpt": "", "question": "The excerpt below was derived from the HMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated link (text 'STATUS.fifo_full' resolving to the #cfg anchor) vs the same excerpt, where CFG is documented as holding configuration fields (endian_swap, digest_swap) while fifo_full is named as a STATUS bit\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The anchor sends the reader to the configuration register, but fifo_full is a status bit.\"}", "mutation": {"type": "crossref_conflict", "original": "[`STATUS.fifo_full`](registers.md#status)", "mutated": "[`STATUS.fifo_full`](registers.md#cfg)", "location": "Theory 'SHA-2 message feed and pad', STATUS.fifo_full cross-reference"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "hmac-t3-017", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The context that needs to be saved and restored is in the following registers: [`CFG`](registers.md#cfg), [`DIGEST_*`](registers.md#msg_length_lower), and [`MSG_LENGTH_*`](registers.md#msg_length_lower).", "rtl_excerpt": "", "question": "The excerpt below was derived from the HMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated link (text 'DIGEST_*' resolving to #msg_length_lower) vs the same sentence, which lists MSG_LENGTH_* separately with the identical anchor: two distinct register groups now resolve to the same anchor\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The sentence names DIGEST_* and MSG_LENGTH_* as separate groups, but both links point at the message-length anchor.\"}", "mutation": {"type": "crossref_conflict", "original": "[`DIGEST_*`](registers.md#digest)", "mutated": "[`DIGEST_*`](registers.md#msg_length_lower)", "location": "Programmers guide 'Saving and restoring the context', context register list"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "hmac-t3-018", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If the FIFO runs full, software should not continue to write data into [`MSG_FIFO`](registers.md#status) and first wait the status flag [`STATUS.fifo_full`](registers.md#status) to lower.\nWhilst the FIFO is full, the HMAC will block writes until the FIFO has space which will cause back-pressure on the interconnect.", "rtl_excerpt": "", "question": "The excerpt below was derived from the HMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated link (text 'MSG_FIFO' resolving to the #status anchor) vs the same sentence, which treats STATUS.fifo_full as the status flag and MSG_FIFO as the write target\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The anchor points at the status register while the text names the message FIFO write window.\"}", "mutation": {"type": "crossref_conflict", "original": "[`MSG_FIFO`](registers.md#msg_fifo)", "mutated": "[`MSG_FIFO`](registers.md#status)", "location": "Programmers guide 'FIFO Depth and Empty status', MSG_FIFO cross-reference"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "hmac-t3-019", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If the software tries to update the KEY, the IP reports an error through the [`ERR_CODE`](registers.md#intr_state) register.\n\n## Errors\n\nWhen HMAC errors are triggered, the IP reports the error via [`INTR_STATE.hmac_err`](registers.md#intr_state).\nThe details of the error type is stored in [`ERR_CODE`](registers.md#err_code).", "rtl_excerpt": "", "question": "The excerpt below was derived from the HMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated link (text 'ERR_CODE' resolving to the #intr_state anchor) vs the Errors section in the same excerpt, which separates the two: the error is signaled via INTR_STATE.hmac_err while the error details are stored in ERR_CODE\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The anchor conflates the interrupt status register with the error-code register the Errors section keeps distinct.\"}", "mutation": {"type": "crossref_conflict", "original": "the IP reports an error through the [`ERR_CODE`](registers.md#err_code) register.", "mutated": "the IP reports an error through the [`ERR_CODE`](registers.md#intr_state) register.", "location": "Programmers guide 'Updating the configurations', ERR_CODE cross-reference"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "hard"} {"id": "hmac-t3-020", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/theory_of_operation.md; hw/ip/hmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "It is recommended to avoid this back-pressure by not writing to the memory-mapped message FIFO.\n\n```c\n // write the message: below example assumes word-aligned access\n for (uint32_t written = 0 ; written < (msg_len >> 3) ; written += 4) {\n while((REG32(HMAC_STATUS(0)) >> HMAC_STATUS_FIFO_FULL) & 0x1) ;\n // Any write data from HMAC_MSG_FIFO_OFFSET to HMAC_MSG_FIFO_SIZE\n // is written to the message FIFO\n REG32(HMAC_MSG_FIFO(0)) = *(msg+(written/4));\n }\n```", "rtl_excerpt": "", "question": "The excerpt below was derived from the HMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated recommendation ('not writing to the message FIFO', unconditionally) vs the run_hmac reference code in the same excerpt, which writes the whole message via REG32(HMAC_MSG_FIFO(0))\", \"category\": \"MISSING_CONDITION\", \"explanation\": \"Deleting 'when it is full' turns a full-FIFO caution into a blanket ban that the reference driver violates on every hash.\"}", "mutation": {"type": "deleted_condition", "original": "It is recommended to avoid this back-pressure by not writing to the memory-mapped message FIFO when it is full.", "mutated": "It is recommended to avoid this back-pressure by not writing to the memory-mapped message FIFO.", "location": "Theory 'SHA-2 message feed and pad', back-pressure recommendation (condition deleted)"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "hmac-t3-021", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "```c\n // Initiate hash: hash_start\n REG32(HMAC_CMD(0)) = (1 << HMAC_CMD_HASH_START);\n```\n\nError | Value | Description\n-----------------------------|-------|---------------\n`SwHashStartWhenActive` | `0x4` | The error is reported when CMD.start is received.", "rtl_excerpt": "", "question": "The excerpt below was derived from the HMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated error rule ('reported when CMD.start is received', unconditionally) vs the run_hmac reference code in the same excerpt, which initiates every hash by writing hash_start to HMAC_CMD\", \"category\": \"MISSING_CONDITION\", \"explanation\": \"Deleting 'while HMAC is running' makes the normal start command an error, so no hash could ever be initiated.\"}", "mutation": {"type": "deleted_condition", "original": "The error is reported when CMD.start is received while HMAC is running.", "mutated": "The error is reported when CMD.start is received.", "location": "Programmers guide error table, SwHashStartWhenActive (condition deleted)"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "hmac-t3-022", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Resolving this conditions may take several dozens of cycles.\nThe Message FIFO will eventually run empty again and the `fifo_empty` status interrupt will fire.\nNote that the `fifo_empty` status interrupt will not fire if i) the Message FIFO is not writable by software, or ii) after software has written either the `Process` or `Stop` command.", "rtl_excerpt": "", "question": "The excerpt below was derived from the HMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated firing rule ('will fire' whenever the FIFO runs empty) vs the note in the same paragraph ('will not fire ... after software has written either the Process or Stop command'), since the FIFO still drains empty after those commands\", \"category\": \"MISSING_CONDITION\", \"explanation\": \"Deleting the 'after the engine starts popping' condition makes the unconditional fire rule collide with the documented no-fire exceptions.\"}", "mutation": {"type": "deleted_condition", "original": "After the SHA-2 engine starts popping the data again, the Message FIFO will eventually run empty again and the `fifo_empty` status interrupt will fire.", "mutated": "The Message FIFO will eventually run empty again and the `fifo_empty` status interrupt will fire.", "location": "Programmers guide 'FIFO Depth and Empty status', fifo_empty firing rule (condition deleted)"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "hmac-t3-023", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "1. Disable `sha_en` by updating `CFG` register, in order to clear the digest from stream A.\nThis is necessary to also prevent leakage of intermediate context of one SW thread to another.\n1. Repeat steps 1-5 for message stream B.\n1. Restore the context of message stream A by writing the `CFG`, `DIGEST_0`..`15`, and `MSG_LENGTH_`{`LOWER`,`UPPER`} registers.\nIn the case of keyed HMAC, `KEY_0`..`X` registers also need to be restored.\n1. Enable `sha_en` of `CFG`, which enables HMAC again and locks down writing to the `DIGEST_0`..`15` registers from SW.\n1. Continue processing message stream A by setting the `CMD.hash_continue` bit.", "rtl_excerpt": "", "question": "The excerpt below was derived from the HMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated sequence (restore step with the sha_en-disabled precondition dropped) vs the later step in the same sequence ('Enable sha_en of CFG, which ... locks down writing to the DIGEST_0..15 registers from SW'): restoring writes DIGEST_0..15, which is only possible while sha_en is disabled\", \"category\": \"MISSING_CONDITION\", \"explanation\": \"Without the dropped precondition the restore could run with sha_en enabled, when DIGEST writes are locked down.\"}", "mutation": {"type": "deleted_condition", "original": "1. Before restoring context, make sure that `sha_en` in `CFG` remains disabled.\n", "mutated": "", "location": "Programmers guide 'Saving and restoring the context', restore precondition (dropped)"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "hmac-t3-024", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Error | Value | Description\n-----------------------------|-------|---------------\n`SwPushMsgWhenDisallowed` | `0x5` | The MSG_FIFO should not by updated by SW. This error is reported in that case.\n`SwInvalidConfig` | `0x6` | SW has configured HMAC incorrectly.\n`SwPushMsgWhenDisallowed` | `0x5` | The error is reported when MSG_FIFO is being updated by SW with more message words when it is disallowed: either when the SHA-2 engine is disabled or the engine has not been triggered to start yet or it has been already triggered to finalize computation.\n\n```c\n // write the message: below example assumes word-aligned access\n for (uint32_t written = 0 ; written < (msg_len >> 3) ; written += 4) {\n while((REG32(HMAC_STATUS(0)) >> HMAC_STATUS_FIFO_FULL) & 0x1) ;\n // Any write data from HMAC_MSG_FIFO_OFFSET to HMAC_MSG_FIFO_SIZE\n // is written to the message FIFO\n REG32(HMAC_MSG_FIFO(0)) = *(msg+(written/4));\n }\n```", "rtl_excerpt": "", "question": "The excerpt below was derived from the HMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated rule ('the MSG_FIFO should not be updated by SW', unconditionally) vs the detailed 0x5 row in the same table (updates are disallowed only in specific states, implying they are allowed otherwise) and the run_hmac code, which feeds the message through MSG_FIFO\", \"category\": \"MISSING_CONDITION\", \"explanation\": \"Deleting 'After CMD.process is received' bans all software writes, contradicting both the detailed row and the reference driver.\"}", "mutation": {"type": "deleted_condition", "original": "After CMD.process is received, the MSG_FIFO should not by updated by SW. This error is reported in that case.", "mutated": "The MSG_FIFO should not by updated by SW. This error is reported in that case.", "location": "Programmers guide error table, SwPushMsgWhenDisallowed (condition deleted)"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "hmac-t3-025", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/hmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The [`KEY`](registers.md#key) register ignores any attempt to access the secret key.\nIf the software tries to update the KEY, the IP reports an error through the [`ERR_CODE`](registers.md#err_code) register.\nThe error code is `SwUpdateSecretKeyInProcess`, `0x0003`.\n\n```c\n // If secret key is static, you can put the key here\n HMAC_KEY_0 = SECRET_KEY_0;\n HMAC_KEY_1 = SECRET_KEY_1;\n HMAC_KEY_2 = SECRET_KEY_2;\n HMAC_KEY_3 = SECRET_KEY_3;\n HMAC_KEY_4 = SECRET_KEY_4;\n HMAC_KEY_5 = SECRET_KEY_5;\n HMAC_KEY_6 = SECRET_KEY_6;\n HMAC_KEY_7 = SECRET_KEY_7;\n```", "rtl_excerpt": "", "question": "The excerpt below was derived from the HMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated rule ('ignores any attempt to access the secret key', unconditionally) vs the hmac_init reference code in the same excerpt, which programs HMAC_KEY_0..7 during initialization\", \"category\": \"MISSING_CONDITION\", \"explanation\": \"Deleting 'in the middle of the process' makes even the documented key-programming sequence impossible.\"}", "mutation": {"type": "deleted_condition", "original": "The [`KEY`](registers.md#key) register ignores any attempt to access the secret key in the middle of the process.", "mutated": "The [`KEY`](registers.md#key) register ignores any attempt to access the secret key.", "location": "Programmers guide 'Updating the configurations', KEY access rule (condition deleted)"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "i2c-t1-001", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The I2C Target Module supports up to two 7-bit address and 7-bit mask pairs.", "rtl_excerpt": "", "question": "How many 7-bit address/mask pairs does the I2C Target Module support?", "answer_format": "exact_value", "gold_answer": "2", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "easy"} {"id": "i2c-t1-002", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The ACK/NACK signal is represented in the MSB of ACQDATA.SIGNAL, in the same entry as the STOP or repeated START signal. For ACK signals, the value of the MSB is 0; for NACK signals, the value is 1.", "rtl_excerpt": "", "question": "In ACQDATA.SIGNAL, what value of the MSB represents a NACK signal?", "answer_format": "exact_value", "gold_answer": "1", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "easy"} {"id": "i2c-t1-003", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "THD_DAT must be at least 1, and to disambiguate START conditions from early SDA arrival, THD_STA must be at least 2 cycles longer than THD_DAT.", "rtl_excerpt": "", "question": "At minimum, how much longer than THD_DAT must THD_STA be?", "answer_format": "exact_value", "gold_answer": "2 cycles", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "easy"} {"id": "i2c-t1-004", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "THIGH must be at least 4 cycles + InputDelayCycles.", "rtl_excerpt": "", "question": "What is the minimum allowed value of TIMING0.THIGH?", "answer_format": "exact_value", "gold_answer": "4 cycles + InputDelayCycles", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "medium"} {"id": "i2c-t1-005", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "As there is an output flop, a 2-flop synchronizer, a rise time, and a pad input delay all on the path, TLOW must be at least 3 cycles + T_R + InputDelayCycles.", "rtl_excerpt": "", "question": "What is the minimum allowed value of TIMING0.TLOW?", "answer_format": "exact_value", "gold_answer": "3 cycles + T_R + InputDelayCycles", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "medium"} {"id": "i2c-t1-006", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "As described in the I2C specification, a target device can pause a transaction by holding SCL low. There are 3 cases in which this design stretches the clock.", "rtl_excerpt": "", "question": "In how many cases does this I2C target design stretch the clock?", "answer_format": "exact_value", "gold_answer": "3", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "easy"} {"id": "i2c-t1-007", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "It is important that the internal clock is at least 50x the bus clock so that the proportions of the timings can be accurately captured.", "rtl_excerpt": "", "question": "How much faster than the bus clock must the internal clock be, at minimum, for the timing proportions to be accurately captured?", "answer_format": "exact_value", "gold_answer": "50x", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "easy"} {"id": "i2c-t1-008", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "READB (corresponds to FDATA.READB): Signifies the format byte (FDATA.FBYTE) should be treated as an unsigned number, R, and prompts the state machine to read R bytes from the target device. A value of 0 is treated as a read of 256 bytes.", "rtl_excerpt": "", "question": "With FDATA.READB set, what does a format byte value of 0 mean?", "answer_format": "exact_value", "gold_answer": "read of 256 bytes", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "medium"} {"id": "i2c-t2-001", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The I2C Target Module supports up to two 7-bit address and 7-bit mask pairs. The Target Module accepts a transaction if the result of the bitwise AND operation performed on the transaction address sent by the controller and a mask matches the assigned address corresponding to the mask. In other words, address matching is performed only for bits where the mask is \"1\". Thus, with the masks set to all ones (0x7F), the target device will respond to either of the two assigned unique addresses and no other.", "rtl_excerpt": "", "question": "TARGET_ID.MASK0 is 0x7F and TARGET_ID.ADDRESS0 is 0x50. Which transaction addresses match entry 0?", "answer_format": "exact_value", "gold_answer": "0x50 only", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "medium"} {"id": "i2c-t2-002", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Finally, in the special case where the mask is all zeroes (0x00), then that corresponding entry is ignored and will not match.", "rtl_excerpt": "", "question": "TARGET_ID.MASK0 is 0x00 and TARGET_ID.ADDRESS0 is 0x20. Can any transaction address match entry 0?", "answer_format": "exact_value", "gold_answer": "No, the entry is ignored and will not match", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "easy"} {"id": "i2c-t2-003", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Note that if, in any bit position, the mask has zero and the assigned address has one, no transaction can match and such mask/address pair is effectively disabled.", "rtl_excerpt": "", "question": "TARGET_ID.MASK0 is 0x7E (bit 0 is 0) and TARGET_ID.ADDRESS0 is 0x01 (bit 0 is 1). Can entry 0 match any transaction address?", "answer_format": "exact_value", "gold_answer": "No, the pair is effectively disabled", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "medium"} {"id": "i2c-t2-004", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "THD_DAT must be at least 1, and to disambiguate START conditions from early SDA arrival, THD_STA must be at least 2 cycles longer than THD_DAT.", "rtl_excerpt": "", "question": "TIMING3.THD_DAT is programmed to 5. What is the minimum legal value of TIMING2.THD_STA?", "answer_format": "exact_value", "gold_answer": "7", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "medium"} {"id": "i2c-t2-005", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Enabling a timeout at all requires setting TIMEOUT_CTRL.EN and configuring TIMEOUT_CTRL.VAL with the desired number of cycles to count before timing out. With the configuration of TIMEOUT_CTRL.MODE, one of two types of timeouts can be selected. If a STRETCH_TIMEOUT is selected, the Controller Module detects when some other device holds SCL low for more cycles than TIMEOUT_CTRL.VAL clock ticks. If the counter expires, the stretch_timeout interrupt will be asserted.", "rtl_excerpt": "", "question": "TIMEOUT_CTRL.EN is 1, TIMEOUT_CTRL.MODE selects STRETCH_TIMEOUT, and another device holds SCL low for more than TIMEOUT_CTRL.VAL clock ticks. Which interrupt is asserted?", "answer_format": "exact_value", "gold_answer": "stretch_timeout", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "medium"} {"id": "i2c-t2-006", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "When a target device receives a start and read command, it may stretch the clock for any of the following reasons: If there is no data available to be sent back (TX FIFO empty case), the target stretches the clock until data is made available by software. [...] The tx_stretch interrupt is generated to alert software to such a situation.", "rtl_excerpt": "", "question": "The target receives a read command with the TX FIFO empty and stretches the clock. Which interrupt alerts software?", "answer_format": "exact_value", "gold_answer": "tx_stretch", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "easy"} {"id": "i2c-t2-007", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "In ACK Control Mode, an Auto ACK Counter influences whether the Target module automatically ACKs a data byte when there is space in the ACQ FIFO. The counter begins at 0 for every transfer, and it decrements for every data byte that is ACK'd. [...] Note that because the Auto ACK Counter begins every transfer at 0, the first data byte will always stretch the clock.", "rtl_excerpt": "", "question": "ACK Control Mode is enabled (CTRL.ACK_CTRL_EN = 1). Will the first data byte of a write transfer be automatically ACK'd?", "answer_format": "exact_value", "gold_answer": "No, the first data byte always stretches the clock", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "medium"} {"id": "i2c-t2-008", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If this timeout occurs in multi-controller monitor mode with SDA released high, the Bus Monitor uses this as a \"bus idle\" condition, which allows the Controller Module to begin transmitting. This timeout can be used to implement SMBus's t_HIGH,MAX bus idle condition.", "rtl_excerpt": "", "question": "In multi-controller monitor mode with SDA released high, the SCL idle (host) timeout occurs. What is the Controller Module then allowed to do?", "answer_format": "exact_value", "gold_answer": "begin transmitting", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "unmutated spec text; n/a", "difficulty": "medium"} {"id": "i2c-t3-001", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "READB (corresponds to FDATA.READB): Signifies the format byte (FDATA.FBYTE) should be treated as an unsigned number, R, and prompts the state machine to read R bytes from the target device. Bytes read from the bus are inserted into the RX FIFO where they can be accessed by software. A value of 0 is treated as a read of 128 bytes. To read a larger byte stream, multiple 256-byte reads can be chained together using the RCONT flag.", "rtl_excerpt": "", "question": "The excerpt below was derived from the I2C spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"READB description ('A value of 0 is treated as a read of 128 bytes') vs the RCONT description in the same list ('multiple 256-byte reads can be chained together using the RCONT flag')\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The mutated 128 contradicts the RCONT bullet, which states that a zero format byte yields 256-byte reads that can be chained; both statements describe the same R=0 case.\"}", "mutation": {"type": "changed_number", "original": "A value of 0 is treated as a read of 256 bytes.", "mutated": "A value of 0 is treated as a read of 128 bytes.", "location": "Theory 'Controller Module' READB bullet"}, "verification": "original text verified verbatim in sources/excerpts/i2c/01_controller_side.md; mutation reverted restores consistency", "difficulty": "easy"} {"id": "i2c-t3-002", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The I2C Target Module supports up to two 7-bit address and 7-bit mask pairs. The Target Module accepts a transaction if the result of the bitwise AND operation performed on the transaction address sent by the controller and a mask matches the assigned address corresponding to the mask. In other words, address matching is performed only for bits where the mask is \"1\". Thus, with the masks set to all ones (0x3F), the target device will respond to either of the two assigned unique addresses and no other.", "rtl_excerpt": "", "question": "The excerpt below was derived from the I2C spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Target Address Registers ('with the masks set to all ones (0x3F)') vs 'supports up to two 7-bit address and 7-bit mask pairs': all ones of a 7-bit mask is 0x7F, not 0x3F\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"A 7-bit mask with every bit set to 1 is 0x7F; the mutated 0x3F has bit 6 clear, so with the stated all-ones semantics the target would not respond to 'either of the two assigned unique addresses and no other'.\"}", "mutation": {"type": "changed_number", "original": "with the masks set to all ones (0x7F),", "mutated": "with the masks set to all ones (0x3F),", "location": "Theory 'Target Address Registers' paragraph"}, "verification": "original text verified verbatim in sources/excerpts/i2c/02_target_side.md; mutation reverted restores consistency", "difficulty": "medium"} {"id": "i2c-t3-003", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The ACK/NACK signal is represented in the MSB of ACQDATA.SIGNAL, in the same entry as the STOP or repeated START signal. For ACK signals, the value of the MSB is 0; for NACK signals, the value is 0.", "rtl_excerpt": "", "question": "The excerpt below was derived from the I2C spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Target Transfers ('For ACK signals, the value of the MSB is 0; for NACK signals, the value is 0') vs the preceding sentence ('The ACK/NACK signal is represented in the MSB of ACQDATA.SIGNAL'): a single bit cannot distinguish ACK from NACK if both are 0\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The paragraph requires the MSB to encode which of ACK/NACK occurred; assigning 0 to both makes the encoding unable to represent the signal it claims to represent.\"}", "mutation": {"type": "changed_number", "original": "for NACK signals, the value is 1.", "mutated": "for NACK signals, the value is 0.", "location": "Theory 'Target Transfers' ACQDATA.SIGNAL paragraph"}, "verification": "original text verified verbatim in sources/excerpts/i2c/02_target_side.md; mutation reverted restores consistency", "difficulty": "medium"} {"id": "i2c-t3-004", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The values programmed into the registers TIMING0 through TIMING4 are to be expressed in units of the input clock period. It is important that the internal clock is at least 15x the bus clock so that the proportions of the timings can be accurately captured. Since there are currently also a few cycles discrepancy between the specified timings and the actual ones (as described in the Programmer's Guide), it is recommended that the internal module clock frequency is at least 24x higher than the I2C line speeds.", "rtl_excerpt": "", "question": "The excerpt below was derived from the I2C spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Timing Control Registers ('internal clock is at least 15x the bus clock') vs Application Notes ('it is recommended that the internal module clock frequency is at least 24x higher than the I2C line speeds' and 'the internal clock is driven at least 24x higher than the desired line speed')\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"15x is below the 24x minimum recommended twice in the application notes for accurate timing; a configuration satisfying the mutated 15x rule would violate the 24x rule.\"}", "mutation": {"type": "changed_number", "original": "the internal clock is at least 50x the bus clock", "mutated": "the internal clock is at least 15x the bus clock", "location": "Theory 'Timing Control Registers' paragraph"}, "verification": "original text verified verbatim in sources/excerpts/i2c/03_timing_timeouts.md; mutation reverted restores consistency", "difficulty": "medium"} {"id": "i2c-t3-005", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The low count must be long enough to cover the round-trip time of the Controller Module's SCL drive to the target through the sampling of the target's data driven on SDA. As there is an output flop, a 2-flop synchronizer, a rise time, and a pad input delay all on the path, TLOW must be at least 2 cycles + T_R + InputDelayCycles.", "rtl_excerpt": "", "question": "The excerpt below was derived from the I2C spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Timing Control Registers ('TLOW must be at least 2 cycles + T_R + InputDelayCycles') vs the preceding sentence ('an output flop, a 2-flop synchronizer, a rise time, and a pad input delay all on the path'): the output flop plus the 2-flop synchronizer alone already account for 3 cycles\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"One output flop plus a 2-flop synchronizer is 3 cycles of flop delay before even counting rise time and pad delay; a 2-cycle minimum contradicts the path the sentence itself enumerates.\"}", "mutation": {"type": "changed_number", "original": "TLOW must be at least 3 cycles + T_R + InputDelayCycles.", "mutated": "TLOW must be at least 2 cycles + T_R + InputDelayCycles.", "location": "Theory 'Timing Control Registers' TLOW minimum"}, "verification": "original text verified verbatim in sources/excerpts/i2c/03_timing_timeouts.md; mutation reverted restores consistency", "difficulty": "hard"} {"id": "i2c-t3-006", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The format indicator consists of 12-bits. That is of one single format byte (entered into the format FIFO through FDATA.FBYTE), and five 1-bit flags (entered into the format FIFO through registers FDATA.READB, FDATA.RCONT, FDATA.START, FDATA.STOP and FDATA.NAKOK).", "rtl_excerpt": "", "question": "The excerpt below was derived from the I2C spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Controller Module ('The format indicator consists of 12-bits') vs the same sentence ('one single format byte' = 8 bits, 'and five 1-bit flags' = 5 bits; 8 + 5 = 13)\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The sentence enumerates 8 + 5 = 13 bits while its headline figure claims 12.\"}", "mutation": {"type": "changed_number", "original": "The format indicator consists of 13-bits.", "mutated": "The format indicator consists of 12-bits.", "location": "Theory 'Controller Module' format indicator paragraph"}, "verification": "original text verified verbatim in sources/excerpts/i2c/01_controller_side.md; mutation reverted restores consistency", "difficulty": "easy"} {"id": "i2c-t3-007", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "When the Controller Module is actively transmitting, the scl_interference or sda_interference interrupts will be asserted if the IP identifies that some other device (controller or target) on the bus is forcing either signal low and interfering with the transmission. It should be noted that the scl_interference interrupt is raised in the case when the target device is stretching the clock. Though normal clock stretching does not count as SCL interference, if the module detects that a target device has held SCL low and stretched any given SCL cycle for more than TIMEOUT_CTRL.VAL clock ticks this will cause the stretch timeout interrupt to be asserted.", "rtl_excerpt": "", "question": "The excerpt below was derived from the I2C spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Interrupts ('the scl_interference interrupt is raised in the case when the target device is stretching the clock') vs the same section ('Though normal clock stretching does not count as SCL interference')\", \"category\": \"RULE_INVERSION\", \"explanation\": \"The section states that normal clock stretching does not count as SCL interference; the mutated sentence inverts this so that stretching asserts scl_interference.\"}", "mutation": {"type": "rule_inversion", "original": "It should be noted that the `scl_interference` interrupt is not raised in the case when the target device is stretching the clock.", "mutated": "It should be noted that the scl_interference interrupt is raised in the case when the target device is stretching the clock.", "location": "Theory 'Interrupts' scl_interference paragraph"}, "verification": "original text verified verbatim in sources/excerpts/i2c/04_interrupts.md; mutation reverted restores consistency", "difficulty": "medium"} {"id": "i2c-t3-008", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "When the Target Module replies with a NACK during the (N)ACK phase, it indicates that it is unable to accept the byte or command. The NACK response is sticky until the end of the transaction. In other words, once the Target Module issues its first NACK, it will ACK all subsequent bytes in the transaction, with one caveat.", "rtl_excerpt": "", "question": "The excerpt below was derived from the I2C spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Target NACKs ('once the Target Module issues its first NACK, it will ACK all subsequent bytes') vs the preceding sentence ('The NACK response is sticky until the end of the transaction')\", \"category\": \"RULE_INVERSION\", \"explanation\": \"'Sticky until the end of the transaction' means the NACK persists; the mutated sentence inverts this so the first NACK is followed by ACKs.\"}", "mutation": {"type": "rule_inversion", "original": "it will NACK all subsequent bytes in the transaction,", "mutated": "it will ACK all subsequent bytes in the transaction,", "location": "Theory 'Target NACKs' paragraph"}, "verification": "original text verified verbatim in sources/excerpts/i2c/02_target_side.md; mutation reverted restores consistency", "difficulty": "easy"} {"id": "i2c-t3-009", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If a STRETCH_TIMEOUT is selected, the Controller Module detects when some other device holds SCL low for more cycles than TIMEOUT_CTRL.VAL clock ticks. If the counter expires, the stretch_timeout interrupt will be asserted. For both cases, the counter resets when SCL goes low, so this count only accumulates during a single bit transfer.", "rtl_excerpt": "", "question": "The excerpt below was derived from the I2C spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Timeout Controls ('the counter resets when SCL goes low') vs the STRETCH_TIMEOUT definition ('the Controller Module detects when some other device holds SCL low for more cycles than TIMEOUT_CTRL.VAL clock ticks. If the counter expires, the stretch_timeout interrupt will be asserted'): a counter that resets whenever SCL is low can never accumulate a long SCL-low interval\", \"category\": \"RULE_INVERSION\", \"explanation\": \"The timeout counts SCL-low cycles; resetting on SCL low (instead of SCL high) clears the count in exactly the condition being measured, so the counter could never reach VAL.\"}", "mutation": {"type": "rule_inversion", "original": "For both cases, the counter resets when SCL goes high,", "mutated": "For both cases, the counter resets when SCL goes low,", "location": "Theory 'Timeout Controls' counter reset sentence"}, "verification": "original text verified verbatim in sources/excerpts/i2c/03_timing_timeouts.md; mutation reverted restores consistency", "difficulty": "hard"} {"id": "i2c-t3-010", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Rather than toggling the buffer inputs, the buffer inputs are continuously asserted low, and instead the buffer enable signals are toggled. The SDA or SCL buffers are enabled for a logical \"High\" output on the respective signal, and are disabled for logical \"Low\" outputs. This arrangement allows the output pins to float high if there is no conflict from external devices, or to be pulled low if there is a conflict (as is required for clock-stretching or multi-controller functionality).", "rtl_excerpt": "", "question": "The excerpt below was derived from the I2C spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Virtual Open Drain ('buffers are enabled for a logical \\\"High\\\" output ... disabled for logical \\\"Low\\\" outputs') vs the preceding sentence ('the buffer inputs are continuously asserted low'): enabling the buffer while its input is hardwired low drives the pin low, so a 'High' output could never float high\", \"category\": \"RULE_INVERSION\", \"explanation\": \"With buffer inputs continuously asserted low, the pin can only float high when the buffer is disabled; the mutated enable polarity drives the pin low exactly when a High is requested, contradicting the float-high behavior the paragraph claims.\"}", "mutation": {"type": "rule_inversion", "original": "The SDA or SCL buffers are enabled for a logical \"Low\" output on the respective signal, and are disabled for logical \"High\" outputs.", "mutated": "The SDA or SCL buffers are enabled for a logical \"High\" output on the respective signal, and are disabled for logical \"Low\" outputs.", "location": "Theory 'Virtual Open Drain' paragraph"}, "verification": "original text verified verbatim in sources/excerpts/i2c/05_app_notes_pg.md; mutation reverted restores consistency", "difficulty": "medium"} {"id": "i2c-t3-011", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Rather than toggling the buffer inputs, the buffer inputs are continuously asserted low, and instead the buffer enable signals are toggled. The SDA or SCL buffers are enabled for a logical \"Low\" output on the respective signal, and are disabled for logical \"High\" outputs. To enter override mode, the register field OVRD.TXOVRDEN is asserted by software. In this state the output drivers scl_tx_o and sda_tx_o are controlled directly by the register fields OVRD.SCLVAL and OVRD.SDAVAL. When OVRD.SCLVAL and OVRD.SDAVAL are set low, the virtual open drain configuration will leave the output resistively pulled high, and controllable by remote targets.", "rtl_excerpt": "", "question": "The excerpt below was derived from the I2C spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Override Mode ('When OVRD.SCLVAL and OVRD.SDAVAL are set low, the virtual open drain configuration will leave the output resistively pulled high') vs Virtual Open Drain ('The SDA or SCL buffers are enabled for a logical \\\"Low\\\" output on the respective signal'): a Low output enables the buffer whose input is hardwired low, driving the pin low rather than leaving it pulled high\", \"category\": \"RULE_INVERSION\", \"explanation\": \"Setting SCLVAL/SDAVAL low requests a logical Low, which enables the open-drain buffer and drives the pin low; the mutated sentence claims the pin is left resistively pulled high under exactly the drive-low condition.\"}", "mutation": {"type": "rule_inversion", "original": "When [`OVRD.SCLVAL`](registers.md#ovrd) and [`OVRD.SDAVAL`](registers.md#ovrd) are set high,", "mutated": "When OVRD.SCLVAL and OVRD.SDAVAL are set low,", "location": "Theory 'Override Mode for Direct Pin Access' paragraph"}, "verification": "original text verified verbatim in sources/excerpts/i2c/05_app_notes_pg.md; mutation reverted restores consistency", "difficulty": "hard"} {"id": "i2c-t3-012", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "To ACK the byte, software would program the Auto ACK Counter to a greater number, and if the value programmed is greater than 1, it would automatically ACK subsequent bytes as well. Even with a nonzero count, though, the Target module could still stop and stretch the clock if the ACQ FIFO doesn't have sufficient space. Otherwise, software can explicitly NACK that byte and the rest of the transaction by writing a 1 to TARGET_ACK_CTRL.NACK. If the Target module is not stretching the clock, writes to TARGET_ACK_CTRL are applied immediately.", "rtl_excerpt": "", "question": "The excerpt below was derived from the I2C spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Target ACK Control Mode ('If the Target module is not stretching the clock, writes to TARGET_ACK_CTRL are applied immediately') vs the same section ('When a transfer reaches the (N)ACK phase and the TARGET_ACK_CTRL.NBYTES CSR is 0, the Target module stretches the clock and awaits instructions from software, up to the stretch timeout'): software's instructions are the TARGET_ACK_CTRL writes, which are only meaningful while the module is stretching\", \"category\": \"RULE_INVERSION\", \"explanation\": \"The section defines TARGET_ACK_CTRL writes as the software instructions the module awaits while stretching; applying them when the module is not stretching inverts the specified gating.\"}", "mutation": {"type": "rule_inversion", "original": "If the Target module is not stretching the clock, writes to [`TARGET_ACK_CTRL`](registers.md#target_ack_ctrl) are ignored.", "mutated": "If the Target module is not stretching the clock, writes to TARGET_ACK_CTRL are applied immediately.", "location": "Theory 'Target ACK Control Mode' paragraph"}, "verification": "original text verified verbatim in sources/excerpts/i2c/02_target_side.md; mutation reverted restores consistency", "difficulty": "medium"} {"id": "i2c-t3-013", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Enabling a timeout at all requires setting TIMEOUT_CTRL.EN and configuring TIMEOUT_CTRL.VAL with the desired number of cycles to count before timing out. With the configuration of TIMEOUT_CTRL.MODE, one of two types of timeouts can be selected. The I2C IP provisions a counter for detecting when SCL has remained high for too long during an active transaction. HOST_TIMEOUT_CTRL is optionally enabled, determined by whether the register value is nonzero. Though normal clock stretching does not count as SCL interference, if the module detects that a target device has held SCL low and stretched any given SCL cycle for more than TIMEOUT_CTRL.VAL clock ticks this will cause the stretch timeout interrupt to be asserted. This interrupt is suppressed, however, if HOST_TIMEOUT_CTRL.EN is deasserted low or if the bus timeout is selected for HOST_TIMEOUT_CTRL.MODE.", "rtl_excerpt": "", "question": "The excerpt below was derived from the I2C spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Interrupts ('This interrupt is suppressed, however, if HOST_TIMEOUT_CTRL.EN is deasserted low or if the bus timeout is selected for HOST_TIMEOUT_CTRL.MODE') vs Timeout Controls ('Enabling a timeout at all requires setting TIMEOUT_CTRL.EN ... With the configuration of TIMEOUT_CTRL.MODE, one of two types of timeouts can be selected') and the SCL Idle Timeout section ('HOST_TIMEOUT_CTRL is optionally enabled, determined by whether the register value is nonzero': no EN or MODE fields exist)\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The stretch-timeout suppression condition points at HOST_TIMEOUT_CTRL.EN/MODE, but the excerpt documents EN and MODE as fields of TIMEOUT_CTRL, while HOST_TIMEOUT_CTRL is enabled merely by being nonzero and has no such fields.\"}", "mutation": {"type": "crossref_conflict", "original": "This interrupt is suppressed, however, if [`TIMEOUT_CTRL.EN`](registers.md#timeout_ctrl) is deasserted low or if the bus timeout is selected for [`TIMEOUT_CTRL.MODE`](registers.md#timeout_ctrl).", "mutated": "This interrupt is suppressed, however, if HOST_TIMEOUT_CTRL.EN is deasserted low or if the bus timeout is selected for HOST_TIMEOUT_CTRL.MODE.", "location": "Theory 'Interrupts' stretch timeout paragraph"}, "verification": "original text verified verbatim in sources/excerpts/i2c/04_interrupts.md; mutation reverted restores consistency", "difficulty": "medium"} {"id": "i2c-t3-014", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "TIMEOUT_CTRL provides a timeout mechanism for determining one of two variants of an SCL low timeout. For both cases, the counter resets when SCL goes high, so this count only accumulates during a single bit transfer. If enabled with TIMEOUT_CTRL.EN, the Target Module will automatically NACK transactions if it stretches the clock for more cycles than TARGET_TIMEOUT_CTRL.VAL. This counter accumulates across an entire transaction, and with the correct choice of timeout value, it complies with SMBus's specified maximum cumulative clock extension time for the target.", "rtl_excerpt": "", "question": "The excerpt below was derived from the I2C spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Target Module Stretch Timeout ('If enabled with TIMEOUT_CTRL.EN ... if it stretches the clock for more cycles than TARGET_TIMEOUT_CTRL.VAL') vs Timeout Controls ('TIMEOUT_CTRL provides a timeout mechanism for determining one of two variants of an SCL low timeout. For both cases, the counter resets when SCL goes high, so this count only accumulates during a single bit transfer'): the target stretch timeout accumulates across an entire transaction and has its own VAL field, so it cannot be enabled by TIMEOUT_CTRL.EN\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The mutated enable reference mixes two different timeouts: TIMEOUT_CTRL counts SCL-low within a single bit transfer, while the target stretch timeout accumulates across an entire transaction and is configured by TARGET_TIMEOUT_CTRL.\"}", "mutation": {"type": "crossref_conflict", "original": "If enabled with [`TARGET_TIMEOUT_CTRL.EN`](registers.md#target_timeout_ctrl),", "mutated": "If enabled with TIMEOUT_CTRL.EN,", "location": "Theory 'Target Module Stretch Timeout' paragraph"}, "verification": "original text verified verbatim in sources/excerpts/i2c/03_timing_timeouts.md; mutation reverted restores consistency", "difficulty": "medium"} {"id": "i2c-t3-015", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "TIMEOUT_CTRL provides a timeout mechanism for determining one of two variants of an SCL low timeout. For both cases, the counter resets when SCL goes high, so this count only accumulates during a single bit transfer. The I2C IP provisions a counter for detecting when SCL has remained high for too long during an active transaction. TIMEOUT_CTRL is optionally enabled, determined by whether the register value is nonzero. If this timeout occurs in multi-controller monitor mode with SDA released high, the Bus Monitor uses this as a \"bus idle\" condition, which allows the Controller Module to begin transmitting. This timeout can be used to implement SMBus's t_HIGH,MAX bus idle condition.", "rtl_excerpt": "", "question": "The excerpt below was derived from the I2C spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"SCL Idle Timeout ('TIMEOUT_CTRL is optionally enabled, determined by whether the register value is nonzero') vs Timeout Controls ('TIMEOUT_CTRL provides a timeout mechanism for determining one of two variants of an SCL low timeout. For both cases, the counter resets when SCL goes high') and the SCL Idle Timeout heading itself ('detecting when SCL has remained high for too long'): an SCL-low timeout cannot detect SCL held high\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The paragraph describes the SCL-high idle timeout (t_HIGH,MAX), but names TIMEOUT_CTRL, which the excerpt defines as an SCL-low timeout whose counter resets when SCL goes high; the register that is 'optionally enabled by being nonzero' is HOST_TIMEOUT_CTRL.\"}", "mutation": {"type": "crossref_conflict", "original": "[`HOST_TIMEOUT_CTRL`](registers.md#host_timeout_ctrl) is optionally enabled, determined by whether the register value is nonzero.", "mutated": "TIMEOUT_CTRL is optionally enabled, determined by whether the register value is nonzero.", "location": "Theory 'SCL Idle Timeout' paragraph"}, "verification": "original text verified verbatim in sources/excerpts/i2c/03_timing_timeouts.md; mutation reverted restores consistency", "difficulty": "hard"} {"id": "i2c-t3-016", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Whenever the RX FIFO exceeds the designated number of entries, the interrupt rx_threshold is asserted to inform firmware. Firmware can configure the threshold value via the register HOST_FIFO_CONFIG.RX_THRESH. Whilst the FMT FIFO level lies below a designated number of entries, the fmt_threshold interrupt is asserted. Firmware can configure the threshold value via the register HOST_FIFO_CONFIG.FMT_THRESH. If the ACQ FIFO exceeds the designated number of entries, the acq_threshold interrupt is raised to inform firmware. Firmware can configure the threshold value via the register HOST_FIFO_CONFIG.ACQ_THRESH. Whilst the TX FIFO level is below a designated number of entries the tx_threshold interrupt is asserted. Firmware can configure the threshold value via the register TARGET_FIFO_CONFIG.TX_THRESH.", "rtl_excerpt": "", "question": "The excerpt below was derived from the I2C spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Target interrupts ('Firmware can configure the threshold value via the register HOST_FIFO_CONFIG.ACQ_THRESH') vs the controller section ('Firmware can configure the threshold value via the register HOST_FIFO_CONFIG.RX_THRESH' and 'via the register HOST_FIFO_CONFIG.FMT_THRESH') and the TX threshold in the same paragraph ('via the register TARGET_FIFO_CONFIG.TX_THRESH'): HOST_FIFO_CONFIG holds RX_THRESH/FMT_THRESH; the ACQ threshold lives in TARGET_FIFO_CONFIG\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The mutated reference puts ACQ_THRESH in HOST_FIFO_CONFIG, but the excerpt shows HOST_FIFO_CONFIG carrying the controller-side RX_THRESH/FMT_THRESH while the target-side tx_threshold in the same paragraph uses TARGET_FIFO_CONFIG.\"}", "mutation": {"type": "crossref_conflict", "original": "Firmware can configure the threshold value via the register [`TARGET_FIFO_CONFIG.ACQ_THRESH`](registers.md#target_fifo_config).", "mutated": "Firmware can configure the threshold value via the register HOST_FIFO_CONFIG.ACQ_THRESH.", "location": "Theory 'Interrupts' target acq_threshold paragraph"}, "verification": "original text verified verbatim in sources/excerpts/i2c/04_interrupts.md; mutation reverted restores consistency", "difficulty": "easy"} {"id": "i2c-t3-017", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If the transfer is a write operation (R/W bit = 0), the target proceeds to read bytes from the bus and insert them into ACQ FIFO. A STOP or repeated START indicator is inserted into ACQ FIFO as the next entry following the last byte received, in which case other bits may be junk or the target address, respectively.", "rtl_excerpt": "", "question": "The excerpt below was derived from the I2C spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Target Transfers (mutated: 'the target proceeds to read bytes from the bus and insert them into ACQ FIFO' with no termination condition) vs the next sentence ('A STOP or repeated START indicator is inserted into ACQ FIFO as the next entry following the last byte received'): without the deleted 'until the controller terminates the transfer by sending a STOP or a repeated START signal', there is no last byte and no defined point to insert the indicator\", \"category\": \"MISSING_CONDITION\", \"explanation\": \"Deleting the termination condition leaves the target reading bytes indefinitely; the following sentence's 'last byte received' and STOP/repeated-START indicator then have no defined point at which they occur.\"}", "mutation": {"type": "deleted_condition", "original": "the target proceeds to read bytes from the bus and insert them into ACQ FIFO until the controller terminates the transfer by sending a STOP or a repeated START signal.", "mutated": "the target proceeds to read bytes from the bus and insert them into ACQ FIFO.", "location": "Theory 'Target Transfers' write-operation paragraph"}, "verification": "original text verified verbatim in sources/excerpts/i2c/02_target_side.md; mutation reverted restores consistency", "difficulty": "medium"} {"id": "i2c-t3-018", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "When a controller receives enough data from a target, it usually signals the end of the transaction by sending a NACK followed by a STOP or a repeated START. In a case when the Target Module receives a STOP, the interrupt unexp_stop is asserted. As mentioned above, the interrupt cmd_complete is asserted whenever a RESTART or a STOP bit is observed by the target, for a transfer that addressed the Target Module.", "rtl_excerpt": "", "question": "The excerpt below was derived from the I2C spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Target interrupts (mutated: 'when the Target Module receives a STOP, the interrupt unexp_stop is asserted') vs the same section ('it usually signals the end of the transaction by sending a NACK followed by a STOP or a repeated START' and 'cmd_complete is asserted whenever a RESTART or a STOP bit is observed by the target'): a STOP after a NACK is the normal end of a read, so flagging every STOP as unexpected contradicts the documented normal termination\", \"category\": \"MISSING_CONDITION\", \"explanation\": \"Deleting 'without the prerequisite NACK' turns every STOP, including the normal NACK-then-STOP end of a read transfer, into an 'unexpected STOP' interrupt.\"}", "mutation": {"type": "deleted_condition", "original": "In a case when the Target Module receives a STOP without the prerequisite NACK, the interrupt `unexp_stop` is asserted.", "mutated": "In a case when the Target Module receives a STOP, the interrupt unexp_stop is asserted.", "location": "Theory 'Interrupts' unexp_stop paragraph"}, "verification": "original text verified verbatim in sources/excerpts/i2c/04_interrupts.md; mutation reverted restores consistency", "difficulty": "medium"} {"id": "i2c-t3-019", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "As described in the I2C specification, a target device can pause a transaction by holding SCL low. There are 3 cases in which this design stretches the clock: After the target receives the address but before pushing it to the ACQ FIFO; After the ACK bit is sent by the controller-transmitter during a read transfer. If the controller tries to write a data byte into the ACQ FIFO when there is no available space, the clock is stretched before the rising edge of SCL on the ACK bit.", "rtl_excerpt": "", "question": "The excerpt below was derived from the I2C spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Target Clock Stretching ('There are 3 cases in which this design stretches the clock' followed by only 2 bullets) vs the 'Stretching during write' subsection ('If the controller tries to write a data byte into the ACQ FIFO when there is no available space, the clock is stretched before the rising edge of SCL on the ACK bit')\", \"category\": \"MISSING_CONDITION\", \"explanation\": \"The deleted 'Before the (N)ACK bit completes transmission during a write transfer' case leaves the count of 3 inconsistent with the 2 listed bullets, and the Stretching-during-write subsection documents the missing case.\"}", "mutation": {"type": "deleted_condition", "original": "There are 3 cases in which this design stretches the clock:\n- After the target receives the address but before pushing it to the ACQ FIFO\n- Before the (N)ACK bit completes transmission during a write transfer\n- After the ACK bit is sent by the controller-transmitter during a read transfer", "mutated": "There are 3 cases in which this design stretches the clock:\n- After the target receives the address but before pushing it to the ACQ FIFO\n- After the ACK bit is sent by the controller-transmitter during a read transfer", "location": "Theory 'Target Clock Stretching' case list"}, "verification": "original text verified verbatim in sources/excerpts/i2c/02_target_side.md; mutation reverted restores consistency", "difficulty": "easy"} {"id": "i2c-t3-020", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "After reset, the initialization of the I2C HWIP primarily consists of four steps: Timing parameter initialization; Interrupt configuration; Enable I2C Controller or Target functionality. Of the four initialization steps, the timing parameter initialization is the most involved.", "rtl_excerpt": "", "question": "The excerpt below was derived from the I2C spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Initialization ('consists of four steps' followed by 3 listed steps; 'Of the four initialization steps' with only three enumerated)\", \"category\": \"MISSING_CONDITION\", \"explanation\": \"Deleting 'FIFO reset and configuration' leaves the 'four steps' claim inconsistent with the three steps actually listed.\"}", "mutation": {"type": "deleted_condition", "original": "four steps:\n1. Timing parameter initialization\n1. FIFO reset and configuration\n1. Interrupt configuration\n1. Enable I2C Controller or Target functionality", "mutated": "four steps: Timing parameter initialization; Interrupt configuration; Enable I2C Controller or Target functionality", "location": "Programmer's Guide 'Initialization' step list"}, "verification": "original text verified verbatim in sources/excerpts/i2c/05_app_notes_pg.md; mutation reverted restores consistency", "difficulty": "easy"} {"id": "i2c-t4-001", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/rtl/i2c_bus_monitor.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "At initial attachment in a multi-controller environment, typically the controller needs to wait until it determines the bus is free, and the initial state should be assumed to be busy. To make this happen, HOST_TIMEOUT_CTRL should be programmed before enabling the bus monitor in CTRL.", "rtl_excerpt": "38: \n39: always_ff @ (posedge clk_i or negedge rst_ni) begin\n40: if (!rst_ni) begin\n41: monitor_enable_q <= 1'b1; // <-- MUTATED\n42: end else begin\n43: monitor_enable_q <= monitor_enable;\n44: end\n[mutated line(s): 41]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"At initial attachment in a multi-controller environment, typically the controller needs to wait until it determines the bus is free, and the initial state should be assumed to be busy. To make this happen, HOST_TIMEOUT_CTRL should be programmed before enabling the bus monitor in CTRL.\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/i2c/rtl/i2c_bus_monitor.sv:41\", \"explanation\": \"monitor_enable_q reset changed from 0 to 1, so the bus monitor's enable is asserted from reset, before software has programmed HOST_TIMEOUT_CTRL. The mutant reports the bus free immediately instead of the initial state being assumed busy (sim: orig holds bus busy after enable, mut reports free at once).\"}", "mutation": {"type": "wrong_reset_value", "original": "monitor_enable_q <= 1'b0;", "mutated": "monitor_enable_q <= 1'b1;", "location": "hw/ip/i2c/rtl/i2c_bus_monitor.sv:41"}, "verification": "iverilog sim: iverilog -g2012 -o sim.vvp /home/hatch/workspace/specbench/sources/rtl/i2c/i2c_pkg.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/i2c-001/i2c-001.log shows `RESULT: DIFFER -- orig holds bus busy after enable, mut reports free at once`", "difficulty": "medium"} {"id": "i2c-t4-002", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/rtl/i2c_bus_monitor.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "In multi-controller monitor mode the monitor will report that the bus is busy until the free time expires after an external controller issues a STOP condition. The free-time wait is programmed via TIMING4.T_BUF (t_BUF).", "rtl_excerpt": "222: // SCL was released due to the bus timeout, so go to BusFree.\n223: state_d = StBusFree;\n224: end\n225: end else if (bus_release_cnt == 30'd2) begin // <-- MUTATED\n226: // The active timeout occurs when SCL has been held continuously low\n227: // for too long. Both the controller and target should respond to\n228: // this timeout and release the bus. We don't consider the bus free\n[mutated line(s): 225]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"In multi-controller monitor mode the monitor will report that the bus is busy until the free time expires after an external controller issues a STOP condition. The free-time wait is programmed via TIMING4.T_BUF (t_BUF).\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/i2c/rtl/i2c_bus_monitor.sv:225\", \"explanation\": \"The bus-release counter terminal comparison changed from == 30'd1 to == 30'd2, so the monitor releases the bus one count off the programmed t_BUF value (sim: active timeout fires at different cycle counts, 40 vs 39).\"}", "mutation": {"type": "off_by_one", "original": "end else if (bus_release_cnt == 30'd1) begin", "mutated": "end else if (bus_release_cnt == 30'd2) begin", "location": "hw/ip/i2c/rtl/i2c_bus_monitor.sv:225"}, "verification": "iverilog sim: iverilog -g2012 -o sim.vvp /home/hatch/workspace/specbench/sources/rtl/i2c/i2c_pkg.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/i2c-002/i2c-002.log shows `RESULT: DIFFER -- active timeout fires at different cycle counts`", "difficulty": "medium"} {"id": "i2c-t4-003", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/rtl/i2c_bus_monitor.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "In multi-controller monitor mode the monitor will report that the bus is busy until the free time expires after an external controller issues a STOP condition.", "rtl_excerpt": "296: // For single-controller cases, the bus is only \"busy\" while waiting for the \"bus free\" time\n297: // after a Stop condition. In other words, that is the only time our controller can't\n298: // continue to the next transaction.\n299: bus_free_o = (state_q == StBusBusyStop); // <-- MUTATED\n300: end\n301: end\n302: \n[mutated line(s): 299]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"In multi-controller monitor mode the monitor will report that the bus is busy until the free time expires after an external controller issues a STOP condition.\", \"category\": \"RULE_INVERSION\", \"rtl_location\": \"hw/ip/i2c/rtl/i2c_bus_monitor.sv:299\", \"explanation\": \"bus_free_o changed from (state_q != StBusBusyStop) to (state_q == StBusBusyStop), so the monitor reports the bus free exactly while it is waiting out the post-STOP free time, i.e. while the bus is still busy (sim: orig busy during t_buf after STOP, mut reports free).\"}", "mutation": {"type": "inverted_enable", "original": "bus_free_o = (state_q != StBusBusyStop);", "mutated": "bus_free_o = (state_q == StBusBusyStop);", "location": "hw/ip/i2c/rtl/i2c_bus_monitor.sv:299"}, "verification": "iverilog sim: iverilog -g2012 -o sim.vvp /home/hatch/workspace/specbench/sources/rtl/i2c/i2c_pkg.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/i2c-003/i2c-003.log shows `RESULT: DIFFER -- orig busy during t_buf after STOP, mut reports free`", "difficulty": "medium"} {"id": "i2c-t4-004", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/rtl/i2c_bus_monitor.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "In multi-controller monitor mode the monitor will report that the bus is busy until the free time expires after an external controller issues a STOP condition.", "rtl_excerpt": "260: \n261: if (!scl_i || !sda_i) begin\n262: state_d = StBusBusyLow;\n263: // <-- MUTATED: DELETED (was: end else if (bus_release_cnt == 30'd1) begin / state_d = StBusFree;)\n265: end\n266: end\n267: \n[mutated line(s): 263, 264]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"In multi-controller monitor mode the monitor will report that the bus is busy until the free time expires after an external controller issues a STOP condition.\", \"category\": \"MISSING_CONDITION\", \"rtl_location\": \"hw/ip/i2c/rtl/i2c_bus_monitor.sv:263-264\", \"explanation\": \"The StBusBusyStop -> StBusFree transition (taken when the free-time counter expires) was deleted, so once the bus goes busy after a STOP it never becomes free again (sim: orig frees bus after t_buf, mut never frees).\"}", "mutation": {"type": "missing_fsm_transition", "original": "end else if (bus_release_cnt == 30'd1) begin\nstate_d = StBusFree;", "mutated": "(lines deleted)", "location": "hw/ip/i2c/rtl/i2c_bus_monitor.sv:263-264"}, "verification": "iverilog sim: iverilog -g2012 -o sim.vvp /home/hatch/workspace/specbench/sources/rtl/i2c/i2c_pkg.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/i2c-004/i2c-004.log shows `RESULT: DIFFER -- orig frees bus after t_buf, mut never frees`", "difficulty": "medium"} {"id": "i2c-t4-005", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/rtl/i2c_bus_monitor.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "In multi-controller monitor mode the monitor will report that the bus is busy until the free time expires after an external controller issues a STOP condition. The free time is t_BUF, set in register TIMING4.T_BUF.", "rtl_excerpt": "210: if (stop_det) begin\n211: state_d = StBusBusyStop;\n212: bus_release_cnt_load = 1'b1;\n213: bus_release_cnt_sel = 30'(thd_dat_i); // <-- MUTATED\n214: end else if (bus_idling && bus_inactive_timeout_en) begin\n215: state_d = StBusBusyHigh;\n216: bus_release_cnt_load = 1'b1;\n[mutated line(s): 213]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"In multi-controller monitor mode the monitor will report that the bus is busy until the free time expires after an external controller issues a STOP condition. The free time is t_BUF, set in register TIMING4.T_BUF.\", \"category\": \"CROSSREF_CONFLICT\", \"rtl_location\": \"hw/ip/i2c/rtl/i2c_bus_monitor.sv:213\", \"explanation\": \"The post-STOP bus-release counter is loaded with thd_dat_i instead of t_buf_i, so the monitor waits a data-hold time rather than the specified t_BUF free time before reporting the bus free (sim: orig waits full t_buf, mut frees after thd_dat).\"}", "mutation": {"type": "field_offset_error", "original": "bus_release_cnt_sel = 30'(t_buf_i);", "mutated": "bus_release_cnt_sel = 30'(thd_dat_i);", "location": "hw/ip/i2c/rtl/i2c_bus_monitor.sv:213"}, "verification": "iverilog sim: iverilog -g2012 -o sim.vvp /home/hatch/workspace/specbench/sources/rtl/i2c/i2c_pkg.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/i2c-005/i2c-005.log shows `RESULT: DIFFER -- orig waits full t_buf, mut frees after thd_dat`", "difficulty": "hard"} {"id": "i2c-t4-006", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/rtl/i2c_bus_monitor.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If a controller ceases to send SCL pulses at any point during an ongoing transaction, the target waits for a specified time period and then asserts the interrupt host_timeout. A controller sending an address and R/W bit to all target devices, writing to the selected target, or reading from the target are examples of ongoing transactions.", "rtl_excerpt": "301: end\n302: \n303: assign event_bus_active_timeout_o = bus_active_timeout_det_d && !bus_active_timeout_det_q;\n304: assign event_host_timeout_o = target_idle_i && bus_inactive_timeout_det; // <-- MUTATED\n305: \n306: endmodule\n[mutated line(s): 304]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"If a controller ceases to send SCL pulses at any point during an ongoing transaction, the target waits for a specified time period and then asserts the interrupt host_timeout. A controller sending an address and R/W bit to all target devices, writing to the selected target, or reading from the target are examples of ongoing transactions.\", \"category\": \"RULE_INVERSION\", \"rtl_location\": \"hw/ip/i2c/rtl/i2c_bus_monitor.sv:304\", \"explanation\": \"event_host_timeout_o changed from (!target_idle_i && bus_inactive_timeout_det) to (target_idle_i && ...), so the host_timeout interrupt fires when the target is idle (no ongoing transaction) and stays silent during a real stall (sim: orig silent when target idle, mut raises host_timeout).\"}", "mutation": {"type": "inverted_enable", "original": "assign event_host_timeout_o = !target_idle_i && bus_inactive_timeout_det;", "mutated": "assign event_host_timeout_o = target_idle_i && bus_inactive_timeout_det;", "location": "hw/ip/i2c/rtl/i2c_bus_monitor.sv:304"}, "verification": "iverilog sim: iverilog -g2012 -o sim.vvp /home/hatch/workspace/specbench/sources/rtl/i2c/i2c_pkg.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/i2c-006/i2c-006.log shows `RESULT: DIFFER -- orig silent when target idle, mut raises host_timeout`", "difficulty": "medium"} {"id": "i2c-t4-007", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/rtl/i2c_bus_monitor.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The Bus Monitor block examines the SCL and SDA inputs ... It detects START and STOP conditions and forwards the events. In addition, it tracks whether a bus transaction is currently active and informs the Controller Module when the bus is free for it to transmit a new transaction.", "rtl_excerpt": "234: StBusBusyHigh: begin\n235: bus_release_cnt_dec = 1'b1;\n236: \n237: if (!bus_idling) begin // <-- MUTATED\n242: state_d = StBusBusyLow;\n243: bus_release_cnt_load = 1'b1;\n244: bus_release_cnt_sel = bus_active_timeout_i;\n[mutated line(s): 237, 238, 239, 240, 241]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"The Bus Monitor block examines the SCL and SDA inputs ... It detects START and STOP conditions and forwards the events. In addition, it tracks whether a bus transaction is currently active and informs the Controller Module when the bus is free for it to transmit a new transaction.\", \"category\": \"MISSING_CONDITION\", \"rtl_location\": \"hw/ip/i2c/rtl/i2c_bus_monitor.sv:237-241\", \"explanation\": \"STOP-condition handling was deleted from the StBusBusyHigh state, so a STOP seen while the bus is busy-high is ignored: the monitor never starts the post-STOP free-time wait and the bus stays busy forever (sim: orig frees bus t_buf after STOP, mut stays busy).\"}", "mutation": {"type": "missing_fsm_transition", "original": "if (stop_det) begin\nstate_d = StBusBusyStop;\nbus_release_cnt_load = 1'b1;\nbus_release_cnt_sel = 30'(t_buf_i);\nend else if (!bus_idling) begin", "mutated": "(lines deleted)", "location": "hw/ip/i2c/rtl/i2c_bus_monitor.sv:237-241"}, "verification": "iverilog sim: iverilog -g2012 -o sim.vvp /home/hatch/workspace/specbench/sources/rtl/i2c/i2c_pkg.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/i2c-007/i2c-007.log shows `RESULT: DIFFER -- orig frees bus t_buf after STOP, mut stays busy`", "difficulty": "hard"} {"id": "i2c-t4-008", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/rtl/i2c_bus_monitor.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The SDA and SCL outputs are assumed to be connected to a tri-state buffer ... The SDA or SCL buffers are enabled for a logical 'Low' output on the respective signal, and are disabled for logical 'High' outputs. This arrangement allows the output pins to float high if there is no conflict from external devices. (An idle I2C bus is high on both lines; the monitor detects a START as SDA falling while SCL is high.)", "rtl_excerpt": "48: logic scl_i_q, sda_i_q;\n49: always_ff @ (posedge clk_i or negedge rst_ni) begin : bus_prev\n50: if (!rst_ni) begin\n51: scl_i_q <= 1'b0; // <-- MUTATED\n52: sda_i_q <= 1'b0; // <-- MUTATED\n53: end else begin\n54: scl_i_q <= scl_i;\n55: sda_i_q <= sda_i;\n[mutated line(s): 51, 52]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"The SDA and SCL outputs are assumed to be connected to a tri-state buffer ... The SDA or SCL buffers are enabled for a logical 'Low' output on the respective signal, and are disabled for logical 'High' outputs. This arrangement allows the output pins to float high if there is no conflict from external devices. (An idle I2C bus is high on both lines; the monitor detects a START as SDA falling while SCL is high.)\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/i2c/rtl/i2c_bus_monitor.sv:51-52\", \"explanation\": \"scl_i_q and sda_i_q reset changed from 1 to 0, so the monitor's sampled history starts as if the bus were driven low. A START condition (SDA falling while SCL high) right after reset is then missed (sim: orig detects START after reset, mut misses it).\"}", "mutation": {"type": "wrong_reset_value", "original": "scl_i_q <= 1'b1;\nsda_i_q <= 1'b1;", "mutated": "scl_i_q <= 1'b0;\nsda_i_q <= 1'b0;", "location": "hw/ip/i2c/rtl/i2c_bus_monitor.sv:51-52"}, "verification": "iverilog sim: iverilog -g2012 -o sim.vvp /home/hatch/workspace/specbench/sources/rtl/i2c/i2c_pkg.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/i2c-008/i2c-008.log shows `RESULT: DIFFER -- orig detects START after reset, mut misses it`", "difficulty": "medium"} {"id": "i2c-t4-009", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/rtl/i2c_bus_monitor.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If a controller ceases to send SCL pulses at any point during an ongoing transaction, the target waits for a specified time period and then asserts the interrupt host_timeout. The time period is counted from the last low-to-high SCL transition and continues counting until SCL goes low. Firmware can configure the timeout value via the register HOST_TIMEOUT_CTRL.", "rtl_excerpt": "242: state_d = StBusBusyLow;\n243: bus_release_cnt_load = 1'b1;\n244: bus_release_cnt_sel = bus_active_timeout_i;\n245: end else if (bus_release_cnt == 30'd2) begin // <-- MUTATED\n246: // The host_timeout interrupt occurs regardless of which value of\n247: // SDA was present, but only transition to StBusFree if we entered\n248: // this state with SDA high. If SDA is low, a change to SCL will\n[mutated line(s): 245]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"If a controller ceases to send SCL pulses at any point during an ongoing transaction, the target waits for a specified time period and then asserts the interrupt host_timeout. The time period is counted from the last low-to-high SCL transition and continues counting until SCL goes low. Firmware can configure the timeout value via the register HOST_TIMEOUT_CTRL.\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/i2c/rtl/i2c_bus_monitor.sv:245\", \"explanation\": \"The host-timeout counter terminal comparison changed from == 30'd1 to == 30'd2, so the host_timeout interrupt fires one count off the programmed HOST_TIMEOUT_CTRL value (sim: host timeout fires at different cycle counts).\"}", "mutation": {"type": "off_by_one", "original": "end else if (bus_release_cnt == 30'd1) begin", "mutated": "end else if (bus_release_cnt == 30'd2) begin", "location": "hw/ip/i2c/rtl/i2c_bus_monitor.sv:245"}, "verification": "iverilog sim: iverilog -g2012 -o sim.vvp /home/hatch/workspace/specbench/sources/rtl/i2c/i2c_pkg.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/i2c-009/i2c-009.log shows `RESULT: DIFFER -- host timeout fires at different cycle counts`", "difficulty": "medium"} {"id": "i2c-t4-010", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/rtl/i2c_bus_monitor.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "t_HD,DAT: set in register TIMING3.THD_DAT. ... when the IP operates as a target, the parameter specifies the required SCL high time after SDA changes to satisfy the Start and Stop symbol decoders.", "rtl_excerpt": "110: \n111: // (Repeated) Start condition detection by target\n112: assign start_det_trigger = monitor_enable && (scl_i_q && scl_i) & (sda_i_q && !sda_i);\n113: assign start_det = monitor_enable && start_det_pending && (ctrl_det_count >= 14'(t_buf_i[12:0])); // <-- MUTATED\n114: assign start_detect_o = start_det;\n115: \n116: // Stop condition detection by target\n[mutated line(s): 113]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"t_HD,DAT: set in register TIMING3.THD_DAT. ... when the IP operates as a target, the parameter specifies the required SCL high time after SDA changes to satisfy the Start and Stop symbol decoders.\", \"category\": \"CROSSREF_CONFLICT\", \"rtl_location\": \"hw/ip/i2c/rtl/i2c_bus_monitor.sv:113\", \"explanation\": \"The START detector's minimum-count threshold changed from thd_dat_i to t_buf_i, so START detection uses the inter-transaction free time instead of the specified t_HD,DAT symbol-decoder time, and valid START conditions are missed (sim: orig detects START, mut never does).\"}", "mutation": {"type": "field_offset_error", "original": "assign start_det = monitor_enable && start_det_pending && (ctrl_det_count >= 14'(thd_dat_i));", "mutated": "assign start_det = monitor_enable && start_det_pending && (ctrl_det_count >= 14'(t_buf_i[12:0]));", "location": "hw/ip/i2c/rtl/i2c_bus_monitor.sv:113"}, "verification": "iverilog sim: iverilog -g2012 -o sim.vvp /home/hatch/workspace/specbench/sources/rtl/i2c/i2c_pkg.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/i2c-010/i2c-010.log shows `RESULT: DIFFER -- orig detects START, mut (t_buf threshold) never does`", "difficulty": "hard"} {"id": "i2c-t4-011", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/rtl/i2c_controller_fsm.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The I2C Control Module reads each format indicator from the head of FMT_FIFO and processes them in turn. ... the I2C FSM simply transmits the format byte onto the SCL and SDA pins according to the specification, waits for acknowledgement, and then proceeds to the next format indicator. (A byte is 8 bits; the FSM counts bit_index from 7 down to 0.)", "rtl_excerpt": "221: // Bit index implementation\n222: always_ff @ (posedge clk_i or negedge rst_ni) begin : bit_counter\n223: if (!rst_ni) begin\n224: bit_index <= 3'd6; // <-- MUTATED\n225: end else if (bit_clr) begin\n226: bit_index <= 3'd7;\n227: end else if (bit_decr) begin\n[mutated line(s): 224]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"The I2C Control Module reads each format indicator from the head of FMT_FIFO and processes them in turn. ... the I2C FSM simply transmits the format byte onto the SCL and SDA pins according to the specification, waits for acknowledgement, and then proceeds to the next format indicator. (A byte is 8 bits; the FSM counts bit_index from 7 down to 0.)\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/i2c/rtl/i2c_controller_fsm.sv:224\", \"explanation\": \"bit_index reset changed from 3'd7 to 3'd6, so after reset the controller shifts only 7 bits of the first byte instead of 8 (sim: orig ships 8 bits, mut ships 7 after reset).\"}", "mutation": {"type": "wrong_reset_value", "original": "bit_index <= 3'd7;", "mutated": "bit_index <= 3'd6;", "location": "hw/ip/i2c/rtl/i2c_controller_fsm.sv:224"}, "verification": "iverilog sim: iverilog -g2012 -I /home/hatch/workspace/specbench/sources/sim_scout/stubs -o sim.vvp /home/hatch/workspace/specbench/sources/rtl/i2c/i2c_pkg.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/i2c-011/i2c-011.log shows `RESULT: DIFFER -- orig ships 8 bits, mut ships 7 after reset`", "difficulty": "easy"} {"id": "i2c-t4-012", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/rtl/i2c_controller_fsm.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The I2C Control Module reads each format indicator from the head of FMT_FIFO and processes them in turn. ... the I2C FSM simply transmits the format byte onto the SCL and SDA pins according to the specification, waits for acknowledgement, and then proceeds to the next format indicator. (A byte is 8 bits; a byte is complete when bit_index reaches 0.)", "rtl_excerpt": "727: if (tcount_q == 16'd1) begin\n728: load_tcount = 1'b1;\n729: tcount_sel = tClockLow;\n730: if (bit_index == 3'd1) begin // <-- MUTATED\n731: state_d = ClockLowAck;\n732: bit_clr = 1'b1;\n733: end else begin\n[mutated line(s): 730]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"The I2C Control Module reads each format indicator from the head of FMT_FIFO and processes them in turn. ... the I2C FSM simply transmits the format byte onto the SCL and SDA pins according to the specification, waits for acknowledgement, and then proceeds to the next format indicator. (A byte is 8 bits; a byte is complete when bit_index reaches 0.)\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/i2c/rtl/i2c_controller_fsm.sv:730\", \"explanation\": \"Byte-completion comparison changed from (bit_index == '0) to (bit_index == 3'd1), so each byte is declared complete after 7 bits instead of 8 (sim: orig ships 8 bits/byte, mut ships 7).\"}", "mutation": {"type": "off_by_one", "original": "if (bit_index == '0) begin", "mutated": "if (bit_index == 3'd1) begin", "location": "hw/ip/i2c/rtl/i2c_controller_fsm.sv:730"}, "verification": "iverilog sim: iverilog -g2012 -I /home/hatch/workspace/specbench/sources/sim_scout/stubs -o sim.vvp /home/hatch/workspace/specbench/sources/rtl/i2c/i2c_pkg.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/i2c-012/i2c-012.log shows `RESULT: DIFFER -- orig ships 8 bits/byte, mut ships 7`", "difficulty": "medium"} {"id": "i2c-t4-013", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/rtl/i2c_controller_fsm.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If the Controller Module transmits a byte and the 9th bit is a NACK from the Target/Bus, the controller_halt interrupt is usually asserted (modulo the effect of FDATA.NAKOK). (A NACK is the 9th bit high, i.e. SDA high; an ACK is SDA low.)", "rtl_excerpt": "453: host_idle_o = 1'b0;\n454: sda_d = 1'b1;\n455: scl_d = 1'b1;\n456: if (!scl_i_q && scl_i && !sda_i && !fmt_flag_nak_ok_i) event_nak_o = 1'b1; // <-- MUTATED\n457: stretch_en = 1'b1;\n458: if (scl_i_q && !scl_i) event_scl_interference_o = 1'b1;\n459: if (scl_i_q && scl_i && (sda_i_q != sda_i)) begin\n[mutated line(s): 456]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"If the Controller Module transmits a byte and the 9th bit is a NACK from the Target/Bus, the controller_halt interrupt is usually asserted (modulo the effect of FDATA.NAKOK). (A NACK is the 9th bit high, i.e. SDA high; an ACK is SDA low.)\", \"category\": \"RULE_INVERSION\", \"rtl_location\": \"hw/ip/i2c/rtl/i2c_controller_fsm.sv:456\", \"explanation\": \"The NACK-event condition changed from (sda_i) to (!sda_i), so the controller raises the NAK event when the target ACKs (SDA low) and stays silent on a real NACK (sim: orig silent on target ACK, mut raises NAK).\"}", "mutation": {"type": "inverted_enable", "original": "if (!scl_i_q && scl_i && sda_i && !fmt_flag_nak_ok_i) event_nak_o = 1'b1;", "mutated": "if (!scl_i_q && scl_i && !sda_i && !fmt_flag_nak_ok_i) event_nak_o = 1'b1;", "location": "hw/ip/i2c/rtl/i2c_controller_fsm.sv:456"}, "verification": "iverilog sim: iverilog -g2012 -I /home/hatch/workspace/specbench/sources/sim_scout/stubs -o sim.vvp /home/hatch/workspace/specbench/sources/rtl/i2c/i2c_pkg.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/i2c-013/i2c-013.log shows `RESULT: DIFFER -- orig silent on target ACK, mut raises NAK`", "difficulty": "medium"} {"id": "i2c-t4-014", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/rtl/i2c_controller_fsm.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "t_HD,STA: set in register TIMING2.THD_STA. The START hold-time counter is loaded with the fall-time budget plus t_HD,STA.", "rtl_excerpt": "124: if (load_tcount) begin\n125: unique case (tcount_sel)\n126: tSetupStart : tcount_d = 16'(t_r_i) + 16'(tsu_sta_i);\n127: tHoldStart : tcount_d = 16'(t_f_i) + 16'(tsu_sta_i); // <-- MUTATED\n128: tClockStart : tcount_d = 16'(thd_dat_i);\n129: tClockLow : tcount_d = 16'(tlow_i) - 16'(thd_dat_i);\n130: tClockPulse : tcount_d = 16'(t_r_i) + 16'(thigh_i);\n[mutated line(s): 127]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"t_HD,STA: set in register TIMING2.THD_STA. The START hold-time counter is loaded with the fall-time budget plus t_HD,STA.\", \"category\": \"CROSSREF_CONFLICT\", \"rtl_location\": \"hw/ip/i2c/rtl/i2c_controller_fsm.sv:127\", \"explanation\": \"The START hold-time counter (tHoldStart) changed from (t_f_i + thd_sta_i) to (t_f_i + tsu_sta_i), substituting the START setup time for the specified START hold time (sim: START hold time 6 vs 11 cycles).\"}", "mutation": {"type": "field_offset_error", "original": "tHoldStart : tcount_d = 16'(t_f_i) + 16'(thd_sta_i);", "mutated": "tHoldStart : tcount_d = 16'(t_f_i) + 16'(tsu_sta_i);", "location": "hw/ip/i2c/rtl/i2c_controller_fsm.sv:127"}, "verification": "iverilog sim: iverilog -g2012 -I /home/hatch/workspace/specbench/sources/sim_scout/stubs -o sim.vvp /home/hatch/workspace/specbench/sources/rtl/i2c/i2c_pkg.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/i2c-014/i2c-014.log shows `RESULT: DIFFER -- START hold time 6 vs 11 cycles`", "difficulty": "hard"} {"id": "i2c-t4-015", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/rtl/i2c_controller_fsm.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "STOP (corresponds to FDATA.STOP): Issue a STOP signal after processing this current entry in the FMT FIFO.", "rtl_excerpt": "765: // HoldDevAck: SCL is pulled low\n766: HoldDevAck : begin\n767: if (tcount_q == 16'd1) begin\n768: state_d = PopFmtFifo; // <-- MUTATED\n769: load_tcount = 1'b1; // <-- MUTATED\n770: tcount_sel = tNoDelay; // <-- MUTATED\n777: end\n778: end\n779: // ReadClockLow: SCL is pulled low, SDA is released\n[mutated line(s): 768, 769, 770, 771, 772, 773, 774, 775, 776]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"STOP (corresponds to FDATA.STOP): Issue a STOP signal after processing this current entry in the FMT FIFO.\", \"category\": \"MISSING_CONDITION\", \"rtl_location\": \"hw/ip/i2c/rtl/i2c_controller_fsm.sv:768-776\", \"explanation\": \"The branch that issues a STOP after the final transmitted byte when FDATA.STOP is set was deleted; the FSM pops the next format entry instead, so no STOP is ever issued (sim: orig issues STOP after final byte, mut never does).\"}", "mutation": {"type": "missing_fsm_transition", "original": "if (fmt_flag_stop_after_i) begin\nstate_d = ClockStop;\nload_tcount = 1'b1;\ntcount_sel = tClockStop;\nend else begin\nstate_d = PopFmtFifo;\nload_tcount = 1'b1;\ntcount_sel = tNoDelay;\nend", "mutated": "(lines deleted)", "location": "hw/ip/i2c/rtl/i2c_controller_fsm.sv:768-776"}, "verification": "iverilog sim: iverilog -g2012 -I /home/hatch/workspace/specbench/sources/sim_scout/stubs -o sim.vvp /home/hatch/workspace/specbench/sources/rtl/i2c/i2c_pkg.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/i2c-015/i2c-015.log shows `RESULT: DIFFER -- orig issues STOP after final byte, mut never does`", "difficulty": "medium"} {"id": "i2c-t4-016", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/rtl/i2c_controller_fsm.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "t_LOW: set in register TIMING0.TLOW. t_HD,DAT: set in register TIMING3.THD_DAT. ... This parameter controls the number of cycles after the falling edge of SCL that SDA is driven. The SCL low-period counter is loaded with (t_low - t_hd,dat).", "rtl_excerpt": "126: tSetupStart : tcount_d = 16'(t_r_i) + 16'(tsu_sta_i);\n127: tHoldStart : tcount_d = 16'(t_f_i) + 16'(thd_sta_i);\n128: tClockStart : tcount_d = 16'(thd_dat_i);\n129: tClockLow : tcount_d = 16'(tlow_i) - 16'(tsu_sta_i); // <-- MUTATED\n130: tClockPulse : tcount_d = 16'(t_r_i) + 16'(thigh_i);\n131: tClockHigh : tcount_d = 16'(thigh_i);\n132: tHoldBit : tcount_d = 16'(t_f_i) + 16'(thd_dat_i);\n[mutated line(s): 129]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"t_LOW: set in register TIMING0.TLOW. t_HD,DAT: set in register TIMING3.THD_DAT. ... This parameter controls the number of cycles after the falling edge of SCL that SDA is driven. The SCL low-period counter is loaded with (t_low - t_hd,dat).\", \"category\": \"CROSSREF_CONFLICT\", \"rtl_location\": \"hw/ip/i2c/rtl/i2c_controller_fsm.sv:129\", \"explanation\": \"The SCL low-period counter (tClockLow) changed from (tlow_i - thd_dat_i) to (tlow_i - tsu_sta_i), subtracting the START setup time instead of the specified data hold time (sim: SCL low period 10 vs 7 cycles).\"}", "mutation": {"type": "field_offset_error", "original": "tClockLow : tcount_d = 16'(tlow_i) - 16'(thd_dat_i);", "mutated": "tClockLow : tcount_d = 16'(tlow_i) - 16'(tsu_sta_i);", "location": "hw/ip/i2c/rtl/i2c_controller_fsm.sv:129"}, "verification": "iverilog sim: iverilog -g2012 -I /home/hatch/workspace/specbench/sources/sim_scout/stubs -o sim.vvp /home/hatch/workspace/specbench/sources/rtl/i2c/i2c_pkg.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/i2c-016/i2c-016.log shows `RESULT: DIFFER -- SCL low period 10 vs 7 cycles`", "difficulty": "hard"} {"id": "i2c-t4-017", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/rtl/i2c_controller_fsm.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If none of the flags are set for the format indicator, the I2C FSM simply transmits the format byte onto the SCL and SDA pins according to the specification, waits for acknowledgement, and then proceeds to the next format indicator. (The controller releases SDA during the 9th bit so the target can drive the acknowledgement.)", "rtl_excerpt": "445: // ClockLowAck: SCL pulled low, SDA is released\n446: ClockLowAck : begin\n447: host_idle_o = 1'b0;\n448: sda_d = 1'b0; // <-- MUTATED\n449: scl_d = 1'b0;\n450: end\n451: // ClockPulseAck: SCL is released\n[mutated line(s): 448]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"If none of the flags are set for the format indicator, the I2C FSM simply transmits the format byte onto the SCL and SDA pins according to the specification, waits for acknowledgement, and then proceeds to the next format indicator. (The controller releases SDA during the 9th bit so the target can drive the acknowledgement.)\", \"category\": \"RULE_INVERSION\", \"rtl_location\": \"hw/ip/i2c/rtl/i2c_controller_fsm.sv:448\", \"explanation\": \"During the target-ACK window the controller's SDA drive changed from released (1'b1) to driven low (1'b0), so the controller jams the ACK bit low instead of letting the target acknowledge (sim: orig releases SDA for device ACK, mut drives it low).\"}", "mutation": {"type": "inverted_enable", "original": "sda_d = 1'b1;", "mutated": "sda_d = 1'b0;", "location": "hw/ip/i2c/rtl/i2c_controller_fsm.sv:448"}, "verification": "iverilog sim: iverilog -g2012 -I /home/hatch/workspace/specbench/sources/sim_scout/stubs -o sim.vvp /home/hatch/workspace/specbench/sources/rtl/i2c/i2c_pkg.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/i2c-017/i2c-017.log shows `RESULT: DIFFER -- orig releases SDA for device ACK, mut drives it low`", "difficulty": "medium"} {"id": "i2c-t4-018", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/rtl/i2c_controller_fsm.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If a NACK handling timeout occurs or CTRL.ENABLEHOST is cleared, then the FSM will halt again after the STOP condition is sent. The STOP condition terminates the transaction, leaving the FSM halted in the 'bus idle' state, with SDA and SCL released.", "rtl_excerpt": "643: state_d = Active;\n644: end\n645: end\n646: // <-- MUTATED: DELETED (was: end else if (trans_started && !host_enable_i) begin / auto_stop_d = 1'b1; / state_d = ClockStop; / load_tcount = 1'b1; / tcount_sel = tClockStop;)\n651: end\n652: end\n653: \n[mutated line(s): 646, 647, 648, 649, 650]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"If a NACK handling timeout occurs or CTRL.ENABLEHOST is cleared, then the FSM will halt again after the STOP condition is sent. The STOP condition terminates the transaction, leaving the FSM halted in the 'bus idle' state, with SDA and SCL released.\", \"category\": \"MISSING_CONDITION\", \"rtl_location\": \"hw/ip/i2c/rtl/i2c_controller_fsm.sv:646-650\", \"explanation\": \"The branch that auto-generates a STOP when host mode is disabled mid-transaction (trans_started && !host_enable_i) was deleted, so disabling the controller mid-transaction releases the bus without terminating it (sim: orig auto-generates STOP on disable, mut releases bus with no STOP).\"}", "mutation": {"type": "missing_fsm_transition", "original": "end else if (trans_started && !host_enable_i) begin\nauto_stop_d = 1'b1;\nstate_d = ClockStop;\nload_tcount = 1'b1;\ntcount_sel = tClockStop;", "mutated": "(lines deleted)", "location": "hw/ip/i2c/rtl/i2c_controller_fsm.sv:646-650"}, "verification": "iverilog sim: iverilog -g2012 -I /home/hatch/workspace/specbench/sources/sim_scout/stubs -o sim.vvp /home/hatch/workspace/specbench/sources/rtl/i2c/i2c_pkg.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/i2c-018/i2c-018.log shows `RESULT: DIFFER -- orig auto-generates STOP on disable, mut releases bus with no STOP`", "difficulty": "hard"} {"id": "i2c-t4-019", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/i2c/rtl/i2c_controller_fsm.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "READB (corresponds to FDATA.READB): Signifies the format byte (FDATA.FBYTE) should be treated as an unsigned number, R, and prompts the state machine to read R bytes from the target device.", "rtl_excerpt": "842: // HostHoldBitAck: SCL is pulled low\n843: HostHoldBitAck : begin\n844: if (tcount_q == 16'd1) begin\n845: if (byte_index == 9'd2) begin // <-- MUTATED\n846: if (fmt_flag_stop_after_i) begin\n847: state_d = ClockStop;\n848: load_tcount = 1'b1;\n[mutated line(s): 845]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"READB (corresponds to FDATA.READB): Signifies the format byte (FDATA.FBYTE) should be treated as an unsigned number, R, and prompts the state machine to read R bytes from the target device.\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/i2c/rtl/i2c_controller_fsm.sv:845\", \"explanation\": \"Read termination changed from (byte_index == 9'd1) to (byte_index == 9'd2), so a 2-byte read (R=2) no longer terminates after exactly R bytes (sim: orig delivers 2 read bytes, mut stops after 1).\"}", "mutation": {"type": "off_by_one", "original": "if (byte_index == 9'd1) begin", "mutated": "if (byte_index == 9'd2) begin", "location": "hw/ip/i2c/rtl/i2c_controller_fsm.sv:845"}, "verification": "iverilog sim: iverilog -g2012 -I /home/hatch/workspace/specbench/sources/sim_scout/stubs -o sim.vvp /home/hatch/workspace/specbench/sources/rtl/i2c/i2c_pkg.sv orig.sv mut.sv tb.sv; vvp sim.vvp; log build/sim_t4/i2c-019/i2c-019.log shows `RESULT: DIFFER -- orig delivers 2 read bytes, mut stops after 1`", "difficulty": "medium"} {"id": "kmac-t1-001", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If KMAC is enabled, the software pushes the `right_encode(output_length)` value at the end of the message.\nFor example, if the desired output length is 256 bit, the software writes `0x00020100` to MSG_FIFO.", "rtl_excerpt": "", "question": "If the desired output length is 256 bit, what value does software write to MSG_FIFO at the end of the message?", "answer_format": "exact_value", "gold_answer": "0x00020100", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "quoted verbatim from hw/ip/kmac/doc/programmers_guide.md, section 'Software Initiated KMAC/SHA3 process'", "difficulty": "easy"} {"id": "kmac-t1-002", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Depending on [`CFG_SHADOWED.entropy_mode`](registers.md#cfg_shadowed), the entropy generator fetches initial entropy from the [Entropy Distribution Network (EDN)][edn] module or software has to provide a seed by writing the [`ENTROPY_SEED`](registers.md#entropy_seed) register 9 times.", "rtl_excerpt": "", "question": "When software must provide the PRNG seed itself, how many times does it write the ENTROPY_SEED register?", "answer_format": "exact_value", "gold_answer": "9 times", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "quoted verbatim from hw/ip/kmac/doc/theory_of_operation.md, section 'Entropy Generator'", "difficulty": "easy"} {"id": "kmac-t1-003", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "After the software reads all the digest values, it issues Done command to [`CMD`](registers.md#cmd) register to clear the internal states.\nDone command clears the Keccak state, FSM in SHA3 and KMAC, and a few internal variables.\nSecret key and other software programmed values won't be reset.", "rtl_excerpt": "", "question": "Does the Done command clear the secret key?", "answer_format": "exact_value", "gold_answer": "No; secret key and other software programmed values won't be reset", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "quoted verbatim from hw/ip/kmac/doc/programmers_guide.md, section 'Software Initiated KMAC/SHA3 process'", "difficulty": "easy"} {"id": "kmac-t1-004", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Value | Error Code | Description\n------|------------|-------------\n0x08 | SwCmdSequence | SW does not follow the guided sequence, `start` -> `process` -> {`run` ->} `done`", "rtl_excerpt": "", "question": "What error code is reported when software does not follow the guided start -> process -> done command sequence?", "answer_format": "exact_value", "gold_answer": "0x08", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "error table in hw/ip/kmac/doc/theory_of_operation.md, section 'Error Report'", "difficulty": "easy"} {"id": "kmac-t1-005", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If software pushes data to the Message FIFO while it is full, the write operation is blocked until there is again space in the FIFO.\nThis means the processor is effectively stalled.\nIf the SHA3 engine is currently running and software fills up the Message FIFO, the resulting stall won't take more than 100 clock cycles.\nThe stall mechanism prevents data loss and the upper bound on the wait time avoids software needing to poll the [`STATUS.fifo_depth`](registers.md#status--fifo_depth) field before writing data.", "rtl_excerpt": "", "question": "If the SHA3 engine is running and software fills the Message FIFO, what is the upper bound on the resulting write stall?", "answer_format": "exact_value", "gold_answer": "100 clock cycles", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "quoted verbatim from hw/ip/kmac/doc/theory_of_operation.md, section 'Message FIFO'", "difficulty": "easy"} {"id": "kmac-t1-006", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "A static interface has the hashing operation defined as a compile-time parameter in its `kmac_pkg::AppCfg` struct and only a fixed digest length is returned.\nA dynamic interface can specify the hashing operation at runtime and supports XOF operation (eXtendable Output Function), so an unlimited digest size can be retrieved.\n\n| Index | App | Type | Algorithm | Prefix for cSHAKE / KMAC |\n|-------|----------|---------|-----------|------------|\n| 0 | KeyMgr | Static | KMAC | \"KMAC\" |\n| 1 | LC_CTRL | Static | cSHAKE128 | \"LC_CTRL\" |\n| 2 | ROM_CTRL | Static | cSHAKE256 | \"ROM_CTRL\" |\n| 3 | OTBN | Dynamic | Dynamic | \"KMAC\" for KMAC mode, otherwise the prefix is taken from the `PREFIX` CSRs. |", "rtl_excerpt": "", "question": "Which application interface is dynamic and can retrieve an unlimited digest size via XOF operation?", "answer_format": "exact_value", "gold_answer": "OTBN", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "quoted verbatim from hw/ip/kmac/doc/theory_of_operation.md, section 'Application Interfaces'", "difficulty": "medium"} {"id": "kmac-t1-007", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The KMAC HWIP assumes the combinations of two to be **SHA3-224**, **SHA3-256**, **SHA3-384**, **SHA3-512**, **SHAKE-128**, **SHAKE-256**, **cSHAKE-128**, and **cSHAKE-256**.", "rtl_excerpt": "", "question": "Which security strengths are expected for SHAKE mode?", "answer_format": "exact_value", "gold_answer": "128 and 256", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "quoted verbatim from hw/ip/kmac/doc/theory_of_operation.md, subsection 'UnexpectedModeStrength (0x06)'", "difficulty": "medium"} {"id": "kmac-t2-001", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The software may write/read the data in big-endian order if [`CFG_SHADOWED.msg_endianness`](registers.md#cfg_shadowed) or [`CFG_SHADOWED.state_endianness`](registers.md#cfg_shadowed) is set.\nIf the endianness bit is 1, the data is assumed to be big-endian.\nSo, the internal logic byte-swap the data.\nFor example, when the software writes `0xDEADBEEF` with endianness as 1, the logic converts it to `0xEFBEADDE` then writes into MSG_FIFO.", "rtl_excerpt": "", "question": "Software writes 0xDEADBEEF to the message FIFO with the endianness bit set to 1. What value does the logic write into the FIFO?", "answer_format": "exact_value", "gold_answer": "0xEFBEADDE", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "worked example in hw/ip/kmac/doc/programmers_guide.md, section 'Endianness'", "difficulty": "medium"} {"id": "kmac-t2-002", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If `EnMasking` is not set and the `SwKeyMasked` compile-time Verilog parameter is set, software has to provide the key in masked form.\nInternally, the design then unmasks the key by XORing the two key shares together when loading the key into the engine.", "rtl_excerpt": "", "question": "With EnMasking unset and SwKeyMasked set, what does the hardware do with the two key shares when loading the key into the engine?", "answer_format": "exact_value", "gold_answer": "unmasks the key by XORing the two key shares together", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "quoted verbatim from hw/ip/kmac/doc/theory_of_operation.md, subsection 'Masking'", "difficulty": "medium"} {"id": "kmac-t2-003", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "4. Configure the module to process a message in cSHAKE mode (but not in KMAC mode).\n More precisely, set [`CFG_SHADOWED.mode`](registers.md#cfg_shadowed--mode) to `0x3` and [`CFG_SHADOWED.kmac_en`](registers.md#cfg_shadowed--kmac_en) to 0.", "rtl_excerpt": "", "question": "In the manual PRNG reseed procedure, software configures cSHAKE mode (not KMAC). What values are written to CFG_SHADOWED.mode and CFG_SHADOWED.kmac_en?", "answer_format": "exact_value", "gold_answer": "mode = 0x3, kmac_en = 0", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "quoted verbatim from hw/ip/kmac/doc/programmers_guide.md, subsection 'Manually triggering PRNG reseeds'", "difficulty": "medium"} {"id": "kmac-t2-004", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "However, the FIFO can also become full because the KMAC block is waiting for fresh entropy from EDN.\nResolving this condition can take much longer, and it can even result in deadlocking the system if the following conditions are met:\n1. Software attempts to push data to the Message FIFO while it is full.\n1. The fresh entropy is not delivered and the value of the [`ENTROPY_PERIOD`](registers.md#entropy_period) register is 0, meaning the wait timer never expires.", "rtl_excerpt": "", "question": "Which situation can deadlock the system? Choose the correct option.\nA) Software pushes to a full Message FIFO while the block waits for fresh entropy that is never delivered and ENTROPY_PERIOD is 0.\nB) Software pushes to a full Message FIFO while the SHA3 engine is running.\nC) Software pushes to the Message FIFO without first checking STATUS.fifo_depth.", "answer_format": "multiple_choice", "gold_answer": "A", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "deadlock conditions enumerated verbatim in hw/ip/kmac/doc/theory_of_operation.md, section 'Message FIFO'", "difficulty": "hard", "options": ["A) Software pushes to a full Message FIFO while the block waits for fresh entropy that is never delivered and ENTROPY_PERIOD is 0", "B) Software pushes to a full Message FIFO while the SHA3 engine is running", "C) Software pushes to the Message FIFO without first checking STATUS.fifo_depth"]} {"id": "kmac-t2-005", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Note that the `fifo_empty` status interrupt will not fire if i) one of the hardware application interfaces is using the KMAC block, ii) the SHA3 core is not in the `Absorb` state, or iii) after software has written the `Process` command.", "rtl_excerpt": "", "question": "Software has written the Process command and the Message FIFO then drains empty. Does the fifo_empty status interrupt fire?", "answer_format": "exact_value", "gold_answer": "No", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "quoted verbatim from hw/ip/kmac/doc/theory_of_operation.md, section 'Message FIFO' (condition iii: after software has written the Process command)", "difficulty": "medium"} {"id": "kmac-t2-006", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "#### WaitTimerExpired (0x04)\n\nIf a non-zero timer expires, the module cancels the transaction and reports the `WaitTimerExpired` error.\n\nThe SW may move the state machine to the reset state by issuing [`CMD.err_processed`](registers.md#cmd).\n\n#### IncorrectEntropyMode (0x05)\n\nIf SW misconfigures the entropy mode and let the entropy module prepare the random data, the module reports `IncorrectEntropyMode` error.\nThe state machine moves to Wait state after reporting the error.\n\nThe SW may move the state machine to the reset state by issuing [`CMD.err_processed`](registers.md#cmd).", "rtl_excerpt": "", "question": "Which two errors are recovered by issuing CMD.err_processed to move the state machine to the reset state?", "answer_format": "exact_value", "gold_answer": "WaitTimerExpired (0x04) and IncorrectEntropyMode (0x05)", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "quoted verbatim from hw/ip/kmac/doc/theory_of_operation.md, subsections 'WaitTimerExpired (0x04)' and 'IncorrectEntropyMode (0x05)'", "difficulty": "hard"} {"id": "kmac-t2-007", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "| Index | App | Type | Algorithm | Prefix for cSHAKE / KMAC |\n|-------|----------|---------|-----------|------------|\n| 0 | KeyMgr | Static | KMAC | \"KMAC\" |\n| 1 | LC_CTRL | Static | cSHAKE128 | \"LC_CTRL\" |\n| 2 | ROM_CTRL | Static | cSHAKE256 | \"ROM_CTRL\" |\n| 3 | OTBN | Dynamic | Dynamic | \"KMAC\" for KMAC mode, otherwise the prefix is taken from the `PREFIX` CSRs. |\n\n`en_xof` | Session | If 1, the app interface will automatically trigger a RUN command once it has pushed the full rate on the response channel. If 0, no squeeze can be performed at all. Only applicable to SHAKE and cSHAKE. Must be 0 for a dynamic interface if `mode` is SHA3 or KMAC. Must always be 0 if the interface is static.", "rtl_excerpt": "", "question": "The OTBN dynamic interface runs a KMAC-mode session. What must en_xof be? Choose the correct option.\nA) 0\nB) 1", "answer_format": "multiple_choice", "gold_answer": "A", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "OTBN is the dynamic interface (app table) and en_xof 'Must be 0 for a dynamic interface if mode is SHA3 or KMAC', hw/ip/kmac/doc/theory_of_operation.md", "difficulty": "medium", "options": ["A) 0", "B) 1"]} {"id": "kmac-t3-001", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "This allows the module to generate 800 bits of fresh, pseudo-random numbers required by the 768 DOM multipliers for remasking in every clock cycle.", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated count ('768 DOM multipliers') vs the same sentence ('generate 800 bits of fresh, pseudo-random numbers required by the 800 DOM multipliers')\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The sentence pairs 800 bits with 800 multipliers; the mutated count breaks that correspondence.\"}", "mutation": {"type": "changed_number", "original": "required by the 800 DOM multipliers", "mutated": "required by the 768 DOM multipliers", "location": "Theory 'Entropy Generator', DOM multiplier count"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "kmac-t3-002", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md; hw/ip/kmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "This FIFO does not support the handling of masked input messages.\nFor app interfaces providing masked input messages, the FIFO is bypassed.\nIf the FIFO is bypassed, there is no packer and therefore these apps must always provide full 32-bit messages (except the last message).\n\nThis KMAC HWIP operates in little-endian.\nInternal SHA3 hashing engine receives in 64-bit granularity.\nThe data written to SHA3 is assumed to be little endian.", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated width ('full 32-bit messages') vs the same excerpt ('Internal SHA3 hashing engine receives in 64-bit granularity')\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The mutated width contradicts the documented 64-bit granularity of the SHA3 engine the messages feed.\"}", "mutation": {"type": "changed_number", "original": "these apps must always provide full 64-bit messages", "mutated": "these apps must always provide full 32-bit messages", "location": "Theory 'Message FIFO', bypassed-FIFO message width"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "kmac-t3-003", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "0x09 | SwCmdSequence | SW does not follow the guided sequence, `start` -> `process` -> {`run` ->} `done`\n0x09 | SwHashingWithoutEntropyReady | SW requests KMAC op without proper config of Entropy in KMAC. This error occurs if KMAC IP masking feature is enabled.\n0x80 | Sha3Control | SW may receive Sha3Control error along with `SwCmdSequence` error. Can be ignored.", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated value (SwCmdSequence = 0x09) vs the table row directly below it (0x09 = SwHashingWithoutEntropyReady)\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The mutated value collides with a different error code's value in the same table.\"}", "mutation": {"type": "changed_number", "original": "0x08 | SwCmdSequence", "mutated": "0x09 | SwCmdSequence", "location": "Theory 'Error Report' table, SwCmdSequence value"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "kmac-t3-004", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md; hw/ip/kmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "the KMAC_ERRCHK checks if the [`PREFIX`](registers.md#prefix) has correct function name, `encode_string(\"KMAC\")`.\nIf the value does not match to the byte form of `encode_string(\"KMAC\")` (`0x4341_4D4B_2002`), it reports the `IncorrectFunctionName` error.\n\nThe `encode_string(\"KMAC\")` represents `0x01 0x20 0x4b 0x4d 0x41 0x43` in byte order.\nThe software writes `0x4d4b2001` into [`PREFIX0`](registers.md#prefix) and `0x????4341` into [`PREFIX1`](registers.md#prefix) .", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated byte form (0x4341_4D4B_2002) vs the Endianness section in the same excerpt (encode_string(\\\"KMAC\\\") = bytes 0x01 0x20 0x4b 0x4d 0x41 0x43, i.e. little-endian words 0x4d4b2001 / 0x00004341, which reassemble to 0x4341_4D4B_2001)\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The mutated constant disagrees with the documented byte encoding of \\\"KMAC\\\" by one in the low byte.\"}", "mutation": {"type": "changed_number", "original": "`0x4341_4D4B_2001`", "mutated": "`0x4341_4D4B_2002`", "location": "Theory 'IncorrectFunctionName (0x07)', expected PREFIX byte form"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "hard"} {"id": "kmac-t3-005", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "| Index | App | Type | Algorithm | Prefix for cSHAKE / KMAC |\n|-------|----------|---------|-----------|------------|\n| 0 | KeyMgr | Static | KMAC | \"KMAC\" |\n| 1 | LC_CTRL | Static | cSHAKE128 | \"LC_CTRL\" |\n| 2 | ROM_CTRL | Static | cSHAKE256 | \"ROM_CTRL\" |\n| 2 | OTBN | Dynamic | Dynamic | \"KMAC\" for KMAC mode, otherwise the prefix is taken from the `PREFIX` CSRs. |", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated index (OTBN at index 2) vs the ROM_CTRL row in the same table, which already occupies index 2\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The mutated table assigns index 2 to two different interfaces.\"}", "mutation": {"type": "changed_number", "original": "| 3 | OTBN", "mutated": "| 2 | OTBN", "location": "Theory 'Application Interfaces', app index table"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "kmac-t3-006", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "0x03 | SwPushedMsgFifo | MsgFifo is updated while not being in the Message Feed state.\n0x03 | SwIssuedCmdInAppActive | SW issued a command while the application interface is being used", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated value (SwPushedMsgFifo = 0x03) vs the table row directly below it (0x03 = SwIssuedCmdInAppActive)\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The mutated value collides with a different error code's value in the same table.\"}", "mutation": {"type": "changed_number", "original": "0x02 | SwPushedMsgFifo", "mutated": "0x03 | SwPushedMsgFifo", "location": "Theory 'Error Report' table, SwPushedMsgFifo value"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "kmac-t3-007", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "0x08 | SwCmdSequence | SW does not follow the guided sequence, `start` -> `process` -> {`run` ->} `done`\n0x09 | SwHashingWithoutEntropyReady | SW requests KMAC op without proper config of Entropy in KMAC. This error occurs if KMAC IP masking feature is enabled.\n0x08 | Sha3Control | SW may receive Sha3Control error along with `SwCmdSequence` error. Can be ignored.", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated value (Sha3Control = 0x08) vs the SwCmdSequence row in the same table (0x08 = SwCmdSequence)\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The mutated value collides with a different error code's value in the same table.\"}", "mutation": {"type": "changed_number", "original": "0x80 | Sha3Control", "mutated": "0x08 | Sha3Control", "location": "Theory 'Error Report' table, Sha3Control value"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "kmac-t3-008", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The `encode_string(\"KMAC\")` represents `0x01 0x20 0x4b 0x4d 0x41 0x43` in byte order.\nThe software writes `0x4d4b2002` into [`PREFIX0`](registers.md#prefix) and `0x????4341` into [`PREFIX1`](registers.md#prefix) .", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated PREFIX0 value (0x4d4b2002) vs the byte order in the same sentence (encode_string(\\\"KMAC\\\") = 0x01 0x20 0x4b 0x4d 0x41 0x43, whose little-endian low word is 0x4d4b2001)\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The mutated word disagrees with the documented byte encoding by one in the low byte.\"}", "mutation": {"type": "changed_number", "original": "The software writes `0x4d4b2001` into [`PREFIX0`](registers.md#prefix)", "mutated": "The software writes `0x4d4b2002` into [`PREFIX0`](registers.md#prefix)", "location": "Programmers guide 'Endianness', PREFIX0 value for encode_string(\"KMAC\")"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "kmac-t3-009", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The software, however, can only push masked messages into the hashing engine.\n\nThis FIFO does not support the handling of masked input messages.\nFor app interfaces providing masked input messages, the FIFO is bypassed.\nIf the FIFO is bypassed, there is no packer and therefore these apps must always provide full 64-bit messages (except the last message).", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated rule ('can only push masked messages') vs the Message FIFO section in the same excerpt ('This FIFO does not support the handling of masked input messages')\", \"category\": \"RULE_INVERSION\", \"explanation\": \"The mutation inverts the rule; the FIFO section still documents that masked messages cannot go through the FIFO.\"}", "mutation": {"type": "rule_inversion", "original": "The software, however, can only push unmasked messages into the hashing engine.", "mutated": "The software, however, can only push masked messages into the hashing engine.", "location": "Theory 'Masking', software message masking rule"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "kmac-t3-010", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "After the software reads all the digest values, it issues Done command to [`CMD`](registers.md#cmd) register to clear the internal states.\nDone command clears the Keccak state, FSM in SHA3 and KMAC, and a few internal variables.\nSecret key and all other software programmed values are cleared as well.", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated Done behavior ('secret key ... cleared as well') vs the same sentence's original scope ('Done command clears the Keccak state, FSM in SHA3 and KMAC, and a few internal variables')\", \"category\": \"RULE_INVERSION\", \"explanation\": \"The mutation inverts the key-preservation guarantee inside a single sentence.\"}", "mutation": {"type": "rule_inversion", "original": "Secret key and other software programmed values won't be reset.", "mutated": "Secret key and all other software programmed values are cleared as well.", "location": "Programmers guide 'Software Initiated KMAC/SHA3 process', Done command effects"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "kmac-t3-011", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If software pushes data to the Message FIFO while it is full, the write operation is dropped and the newly pushed data is lost.\nThis means the processor is effectively stalled.\nIf the SHA3 engine is currently running and software fills up the Message FIFO, the resulting stall won't take more than 100 clock cycles.\nThe stall mechanism prevents data loss and the upper bound on the wait time avoids software needing to poll the [`STATUS.fifo_depth`](registers.md#status--fifo_depth) field before writing data.", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated behavior ('write operation is dropped and the newly pushed data is lost') vs the same paragraph ('The stall mechanism prevents data loss')\", \"category\": \"RULE_INVERSION\", \"explanation\": \"The mutation inverts blocking into dropping; the paragraph still claims the stall mechanism prevents data loss.\"}", "mutation": {"type": "rule_inversion", "original": "the write operation is blocked until there is again space in the FIFO.", "mutated": "the write operation is dropped and the newly pushed data is lost.", "location": "Theory 'Message FIFO', full-FIFO write behavior"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "kmac-t3-012", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If software then tries to push further data to the Message FIFO, the processor will get stalled and if the entropy is not delivered (on time), the system may deadlock (see [Empty and Full status](theory_of_operation.md#empty-and-full-status) for details).\n\nTo avoid this deadlock scenario, software should simply push data without reseeding or checking FIFO depth, since the hardware guarantees forward progress in all cases.", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated guidance ('simply push data ... hardware guarantees forward progress') vs the same passage ('the system may deadlock')\", \"category\": \"RULE_INVERSION\", \"explanation\": \"The mutation inverts the avoidance guidance while the passage still documents the deadlock it was written to prevent.\"}", "mutation": {"type": "rule_inversion", "original": "To avoid this deadlock scenario, software should either:\n- Manually trigger PRNG reseed operations after ensuring the entropy complex is up and running (recommended), or\n- Check the Message FIFO depth before pushing data.", "mutated": "To avoid this deadlock scenario, software should simply push data without reseeding or checking FIFO depth, since the hardware guarantees forward progress in all cases.", "location": "Programmers guide 'Preventing potential deadlocks in EDN mode', avoidance guidance"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "kmac-t3-013", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If the SW issues any commands while the application interface is being used, the module reports `SwIssuedCmdInAppActive` error.\nThe received command is queued by the KMAC_APP module and executed once the Application process completes.", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated handling ('queued ... and executed once the Application process completes') vs the same paragraph ('does not affect the Application process' and 'the request is dropped')\", \"category\": \"RULE_INVERSION\", \"explanation\": \"The mutation inverts drop into queue-and-execute within the same paragraph.\"}", "mutation": {"type": "rule_inversion", "original": "The received command does not affect the Application process.\nThe request is dropped by the KMAC_APP module.", "mutated": "The received command is queued by the KMAC_APP module and executed once the Application process completes.", "location": "Theory 'SwIssuedCmdInAppActive (0x03)', stray-command handling"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "kmac-t3-014", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "`en_xof` | Session | If 1, the app interface will automatically trigger a RUN command once it has pushed the full rate on the response channel. If 0, no squeeze can be performed at all. Only applicable to SHAKE and cSHAKE. Must be 1 for a dynamic interface if `mode` is SHA3 or KMAC. Must always be 0 if the interface is static.", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated rule ('Must be 1 ... if mode is SHA3 or KMAC') vs the same row ('Only applicable to SHAKE and cSHAKE')\", \"category\": \"RULE_INVERSION\", \"explanation\": \"The mutation requires en_xof=1 exactly for the modes the row says it does not apply to.\"}", "mutation": {"type": "rule_inversion", "original": "Must be 0 for a dynamic interface if `mode` is SHA3 or KMAC.", "mutated": "Must be 1 for a dynamic interface if `mode` is SHA3 or KMAC.", "location": "Theory 'Application Interfaces' configuration, en_xof rule"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "kmac-t3-015", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "For all cases, if `EnMasking` is set and [`CFG_SHADOWED.msg_mask`](registers.md#cfg_shadowed) is true, the message is masked (or re-masked) upon loading into the Keccak core using the internal entropy generator.\nThe secret key is always stored/used in unmasked form.\n\nIf `EnMasking` is not set, masking is disabled and the software has to provide the key in unmasked form.\nAny write operations to [`KEY_SHARE1_0`](registers.md#key_share1) - [`KEY_SHARE1_15`](registers.md#key_share1) are ignored.", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated form ('always stored/used in unmasked form') vs the same subsection ('if EnMasking is set ... the message is masked', and with EnMasking unset 'the software has to provide the key in unmasked form', implying masked storage is the EnMasking-set behavior)\", \"category\": \"RULE_INVERSION\", \"explanation\": \"The mutation inverts the key-masking guarantee the subsection is written to document.\"}", "mutation": {"type": "rule_inversion", "original": "The secret key is always stored/used in masked form.", "mutated": "The secret key is always stored/used in unmasked form.", "location": "Theory 'Masking', key storage form"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "kmac-t3-016", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "However, the KMAC HWIP halts the hashing operation since other combinations cause malfunctions inside the IP.\nThe SW may get the incorrect digest value.", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated handling ('halts the hashing operation') vs the next sentence in the same paragraph ('The SW may get the incorrect digest value', which requires the operation to complete and produce a digest)\", \"category\": \"RULE_INVERSION\", \"explanation\": \"The mutation inverts proceed into halt, but the paragraph still describes receiving a (wrong) digest.\"}", "mutation": {"type": "rule_inversion", "original": "the KMAC HWIP proceeds the hashing operation as other combinations does not cause any malfunctions inside the IP.", "mutated": "the KMAC HWIP halts the hashing operation since other combinations cause malfunctions inside the IP.", "location": "Theory 'UnexpectedModeStrength (0x06)', unexpected-combination handling"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "hard"} {"id": "kmac-t3-017", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "the software notifies the KMAC/SHA3 engine to accept incoming messages by issuing Start command into [`CMD`](registers.md#status) .\nIf Start command is not issued, the incoming message is discarded.\n\nAfter the SHA3 engine completes the sponge absorbing step, it generates `kmac_done` interrupt.\nOr the software can poll the [`STATUS.squeeze`](registers.md#status) bit until it becomes 1.", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated link (text 'CMD' resolving to the #status anchor) vs the same excerpt, which uses STATUS for status bits ('poll the STATUS.squeeze bit') and CMD for commands (Start/Process)\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The anchor sends the reader to the status register, but CMD is the command register.\"}", "mutation": {"type": "crossref_conflict", "original": "issuing Start command into [`CMD`](registers.md#cmd)", "mutated": "issuing Start command into [`CMD`](registers.md#status)", "location": "Programmers guide 'Software Initiated KMAC/SHA3 process', CMD cross-reference"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "kmac-t3-018", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/programmers_guide.md; hw/ip/kmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "3. Trigger a manual reseed operation by setting the [`CMD.entropy_req`](registers.md#cfg_shadowed) bit.\n\nSoftware can explicitly request a complete reseed of the PRNG state from EDN through [`CMD.entropy_req`](registers.md#cmd).", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated link (text 'CMD.entropy_req' resolving to the #cfg_shadowed anchor) vs the same excerpt, where entropy_req is documented as a CMD command bit ('Software can explicitly request a complete reseed ... through CMD.entropy_req')\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The anchor points at the configuration register, but entropy_req is a command bit.\"}", "mutation": {"type": "crossref_conflict", "original": "[`CMD.entropy_req`](registers.md#cmd--entropy_req)", "mutated": "[`CMD.entropy_req`](registers.md#cfg_shadowed)", "location": "Programmers guide 'Manually triggering PRNG reseeds', CMD.entropy_req cross-reference"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "kmac-t3-019", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md; hw/ip/kmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If the checkers detect errors, whether they are triggered by the SW mis-configure, or HW malfunctions, they report the error to [`ERR_CODE`](registers.md#status) and raise an `kmac_error` interrupt.\nEach error code gives debugging information at the lower 24 bits of [`ERR_CODE`](registers.md#err_code).\n\nAfter the SHA3 engine completes the sponge absorbing step, it generates `kmac_done` interrupt.\nOr the software can poll the [`STATUS.squeeze`](registers.md#status) bit until it becomes 1.", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated link (text 'ERR_CODE' resolving to the #status anchor) vs the same excerpt ('Each error code gives debugging information at the lower 24 bits of ERR_CODE') while STATUS is used for fifo/squeeze/idle bits ('poll the STATUS.squeeze bit')\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The anchor sends the reader to the status register, but the 24-bit error information lives in ERR_CODE.\"}", "mutation": {"type": "crossref_conflict", "original": "they report the error to [`ERR_CODE`](registers.md#err_code)", "mutated": "they report the error to [`ERR_CODE`](registers.md#status)", "location": "Theory 'Error Report', ERR_CODE cross-reference"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "kmac-t3-020", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md; hw/ip/kmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If `EnMasking` is not set, masking is disabled and the software has to provide the key in unmasked form.\nAny write operations to [`KEY_SHARE1_0`](registers.md#key_share0) - [`KEY_SHARE1_15`](registers.md#key_share1) are ignored.\n\nIf [`CFG_SHADOWED.kmac_en`](registers.md#cfg_shadowed) is set, the software should update the secret key.\nThe software prepares two shares of the secret key and selects its length in [`KEY_LEN`](registers.md#key_len) then writes the shares of the secret key to [`KEY_SHARE0`](registers.md#key_share0) and [`KEY_SHARE1`](registers.md#key_share1) .", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated link (text 'KEY_SHARE1_0' resolving to the #key_share0 anchor) vs the same excerpt, which discusses the second key share (KEY_SHARE1_0..15) while KEY_SHARE0 is documented as the first share's register\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The link text names the second share's register but the anchor resolves to the first share's register.\"}", "mutation": {"type": "crossref_conflict", "original": "[`KEY_SHARE1_0`](registers.md#key_share1)", "mutated": "[`KEY_SHARE1_0`](registers.md#key_share0)", "location": "Theory 'Masking', KEY_SHARE1_0 cross-reference"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "kmac-t3-021", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If the value of [`ENTROPY_REFRESH_HASH_CNT`](registers.md#entropy_refresh_threshold_shadowed) gets sufficiently close to the value of [`ENTROPY_REFRESH_THRESHOLD_SHADOWED`](registers.md#entropy_refresh_threshold_shadowed), software should:", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated link (text 'ENTROPY_REFRESH_HASH_CNT' resolving to #entropy_refresh_threshold_shadowed) vs the same sentence, which names ENTROPY_REFRESH_THRESHOLD_SHADOWED separately with the identical anchor: two distinct registers now resolve to the same anchor\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The sentence distinguishes the hash counter from the threshold register, but both links point at the threshold anchor.\"}", "mutation": {"type": "crossref_conflict", "original": "[`ENTROPY_REFRESH_HASH_CNT`](registers.md#entropy_refresh_hash_cnt)", "mutated": "[`ENTROPY_REFRESH_HASH_CNT`](registers.md#entropy_refresh_threshold_shadowed)", "location": "Programmers guide 'Manually triggering PRNG reseeds', ENTROPY_REFRESH_HASH_CNT cross-reference"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "kmac-t3-022", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If software then tries to push further data to the Message FIFO, the processor will get stalled and if the entropy is not delivered (on time), the system may deadlock (see [Empty and Full status](programmers_guide.md#preventing-potential-deadlocks-in-edn-mode) for details).", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated link (text 'Empty and Full status' resolving to the programmer's guide deadlock-avoidance section) vs the original target recorded in the passage: the 'Empty and Full status' section of theory_of_operation.md\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The link text names the theory section, but the mutated anchor sends the reader to a different document and section.\"}", "mutation": {"type": "crossref_conflict", "original": "[Empty and Full status](theory_of_operation.md#empty-and-full-status)", "mutated": "[Empty and Full status](programmers_guide.md#preventing-potential-deadlocks-in-edn-mode)", "location": "Programmers guide 'Preventing potential deadlocks in EDN mode', section cross-reference"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "kmac-t3-023", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "At first, the software configures [`CFG_SHADOWED.kmac_en`](registers.md#key_len) for KMAC operation.\n\nIf [`CFG_SHADOWED.kmac_en`](registers.md#cfg_shadowed) is set, the software should update the secret key.\nThe software prepares two shares of the secret key and selects its length in [`KEY_LEN`](registers.md#key_len) then writes the shares of the secret key to [`KEY_SHARE0`](registers.md#key_share0) and [`KEY_SHARE1`](registers.md#key_share1) .", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated link (text 'CFG_SHADOWED.kmac_en' resolving to the #key_len anchor) vs the same excerpt, where KEY_LEN is the register that selects the key length while kmac_en is the KMAC enable bit\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The anchor points at the key-length register, but kmac_en is the operation-enable bit.\"}", "mutation": {"type": "crossref_conflict", "original": "the software configures [`CFG_SHADOWED.kmac_en`](registers.md#cfg_shadowed) for KMAC operation.", "mutated": "the software configures [`CFG_SHADOWED.kmac_en`](registers.md#key_len) for KMAC operation.", "location": "Programmers guide 'Software Initiated KMAC/SHA3 process', CFG_SHADOWED.kmac_en cross-reference"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "kmac-t3-024", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md; hw/ip/kmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "the KMAC_ERRCHK checks if the [`PREFIX`](registers.md#key_share1) has correct function name, `encode_string(\"KMAC\")`.\nIf the value does not match to the byte form of `encode_string(\"KMAC\")` (`0x4341_4D4B_2001`), it reports the `IncorrectFunctionName` error.\n\nIf [`CFG_SHADOWED.kmac_en`](registers.md#cfg_shadowed) is set, the software should update the secret key.\nThe software prepares two shares of the secret key and selects its length in [`KEY_LEN`](registers.md#key_len) then writes the shares of the secret key to [`KEY_SHARE0`](registers.md#key_share0) and [`KEY_SHARE1`](registers.md#key_share1) .", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated link (text 'PREFIX' resolving to the #key_share1 anchor) vs the same excerpt, where PREFIX registers hold the encoded function name (encode_string(\\\"KMAC\\\")) while KEY_SHARE1 holds secret-key shares\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The anchor sends the reader to key-share registers instead of the prefix CSRs the check actually reads.\"}", "mutation": {"type": "crossref_conflict", "original": "the KMAC_ERRCHK checks if the [`PREFIX`](registers.md#prefix) has correct function name", "mutated": "the KMAC_ERRCHK checks if the [`PREFIX`](registers.md#key_share1) has correct function name", "location": "Theory 'IncorrectFunctionName (0x07)', PREFIX cross-reference"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "hard"} {"id": "kmac-t3-025", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Note that the KMAC module will not increment the [`ENTROPY_REFRESH_HASH_CNT`](registers.md#entropy_refresh_hash_cnt) register and thus not trigger automatic reseeds.\nIt is safe to push to the Message FIFO without checking the [`STATUS.fifo_depth`](registers.md#status--fifo_depth) register.\n\nFor regular operation, [`CFG_SHADOWED.entropy_mode`](registers.md#cfg_shadowed--entropy_mode) should be set to EDN mode.\nIn this mode, the module automatically reseeds the internal PRNG with fresh entropy from EDN after every [`ENTROPY_REFRESH_THRESHOLD_SHADOWED`](registers.md#entropy_refresh_threshold_shadowed) key absorption phases in KMAC mode.\n\nTo avoid this deadlock scenario, software should either:\n- Manually trigger PRNG reseed operations after ensuring the entropy complex is up and running (recommended), or\n- Check the Message FIFO depth before pushing data.", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated claim ('the KMAC module will not increment the hash counter ... It is safe to push to the Message FIFO without checking fifo_depth', unconditionally) vs the same excerpt: KMAC mode auto-reseeds after key absorption phases and the deadlock guidance requires reseed-or-depth-check discipline\", \"category\": \"MISSING_CONDITION\", \"explanation\": \"Deleting the 'for modes other than KMAC' qualifier extends a non-KMAC safety claim to KMAC mode, where automatic reseeds and the deadlock hazard apply.\"}", "mutation": {"type": "deleted_condition", "original": "Note that for modes other than KMAC, i.e., if [`CFG_SHADOWED.kmac_en`](registers.md#cfg_shadowed--kmac_en) is 0, the KMAC module will not increment", "mutated": "Note that the KMAC module will not increment", "location": "Programmers guide 'Checking Message FIFO depth before pushing data', mode qualifier (deleted)"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "kmac-t3-026", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md; hw/ip/kmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The `SwPushedMsgFifo` error happens when the Message FIFO receives TL-UL transactions.\nThe Message FIFO drops the request.\n\nValue | Error Code | Description\n------|------------|-------------\n0x02 | SwPushedMsgFifo | MsgFifo is updated while not being in the Message Feed state.\n\nthe software notifies the KMAC/SHA3 engine to accept incoming messages by issuing Start command into [`CMD`](registers.md#cmd) .\nIf Start command is not issued, the incoming message is discarded.", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated rule (any TL-UL transaction to the Message FIFO is an error) vs the same excerpt: the table defines the error as 'MsgFifo is updated while not being in the Message Feed state', and the software flow pushes messages into MSG_FIFO after Start as normal operation\", \"category\": \"MISSING_CONDITION\", \"explanation\": \"Deleting 'while the application interface is busy' turns normal software message feeding into an error.\"}", "mutation": {"type": "deleted_condition", "original": "The `SwPushedMsgFifo` error happens when the Message FIFO receives TL-UL transactions while the application interface is busy.", "mutated": "The `SwPushedMsgFifo` error happens when the Message FIFO receives TL-UL transactions.", "location": "Theory 'SwPushedMsgFifo (0x02)', error condition (deleted)"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "kmac-t3-027", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The Message FIFO will eventually run empty again and the `fifo_empty` status interrupt will fire.\nNote that the `fifo_empty` status interrupt will not fire if i) one of the hardware application interfaces is using the KMAC block, ii) the SHA3 core is not in the `Absorb` state, or iii) after software has written the `Process` command.", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated firing rule ('will fire' whenever the FIFO runs empty) vs the note in the same passage ('will not fire ... after software has written the Process command'), since the FIFO still drains empty after Process\", \"category\": \"MISSING_CONDITION\", \"explanation\": \"Deleting the 'after the engine starts popping' condition makes the unconditional fire rule collide with the documented no-fire exception.\"}", "mutation": {"type": "deleted_condition", "original": "After the SHA3 engine starts popping the data again, the Message FIFO will eventually run empty again and the `fifo_empty` status interrupt will fire.", "mutated": "The Message FIFO will eventually run empty again and the `fifo_empty` status interrupt will fire.", "location": "Theory 'Message FIFO', fifo_empty firing rule (condition deleted)"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "hard"} {"id": "kmac-t3-028", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "- `CFG_SHADOWED.msg_mask`\n - Whether masking is performed or not.\n Must be set.\n\nFor all cases, if `EnMasking` is set and [`CFG_SHADOWED.msg_mask`](registers.md#cfg_shadowed) is true, the message is masked (or re-masked) upon loading into the Keccak core using the internal entropy generator.\nThe secret key is always stored/used in masked form.\n\n`masked` | Static | Defines whether the message comes in shares or not. If `EnMasking` is enabled and `masked` is 1, both shares are forwarded as are. If `EnMasking` is disabled and `masked` is 1, the shares are XORed. If `masked` is 0, `data_s1` is ignored.", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated requirement ('msg_mask must be set', unconditionally) vs the same excerpt: masking applies only 'if EnMasking is set and CFG_SHADOWED.msg_mask is true', and the `masked` parameter explicitly allows masked=0 (data_s1 ignored)\", \"category\": \"MISSING_CONDITION\", \"explanation\": \"Deleting the condition turns an interface-specific requirement into a universal one the masking scheme contradicts.\"}", "mutation": {"type": "deleted_condition", "original": "Must be set if `masked` is set in the configuration.", "mutated": "Must be set.", "location": "Theory 'Application Interfaces' configuration, msg_mask requirement (condition deleted)"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "kmac-t3-029", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Current design does not convert cSHAKE mode to SHAKE even if [`PREFIX`](registers.md#prefix) is empty string.\nIt is the software's responsibility to change the [`CFG_SHADOWED.mode`](registers.md#cfg_shadowed) to SHAKE.\n\n4. Configure the module to process a message in cSHAKE mode (but not in KMAC mode).\n More precisely, set [`CFG_SHADOWED.mode`](registers.md#cfg_shadowed--mode) to `0x3` and [`CFG_SHADOWED.kmac_en`](registers.md#cfg_shadowed--kmac_en) to 0.", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated rule (software must always switch mode to SHAKE) vs the same excerpt: cSHAKE with a non-empty prefix is a legitimate mode, and the manual-reseed procedure deliberately configures cSHAKE mode (mode 0x3, kmac_en 0)\", \"category\": \"MISSING_CONDITION\", \"explanation\": \"Deleting 'in case of empty PREFIX' bans cSHAKE outright, contradicting its documented use.\"}", "mutation": {"type": "deleted_condition", "original": "It is the software's responsibility to change the [`CFG_SHADOWED.mode`](registers.md#cfg_shadowed) to SHAKE in case of empty [`PREFIX`](registers.md#prefix).", "mutated": "It is the software's responsibility to change the [`CFG_SHADOWED.mode`](registers.md#cfg_shadowed) to SHAKE.", "location": "Programmers guide 'Software Initiated KMAC/SHA3 process', cSHAKE/SHAKE selection (condition deleted)"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "kmac-t3-030", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If a timer expires, the module cancels the transaction and reports the `WaitTimerExpired` error.\n\nHowever, the FIFO can also become full because the KMAC block is waiting for fresh entropy from EDN.\nResolving this condition can take much longer, and it can even result in deadlocking the system if the following conditions are met:\n1. Software attempts to push data to the Message FIFO while it is full.\n1. The fresh entropy is not delivered and the value of the [`ENTROPY_PERIOD`](registers.md#entropy_period) register is 0, meaning the wait timer never expires.", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated rule ('if a timer expires', unconditionally) vs the same excerpt: 'the value of the ENTROPY_PERIOD register is 0, meaning the wait timer never expires'\", \"category\": \"MISSING_CONDITION\", \"explanation\": \"Deleting 'non-zero' makes the rule claim a timer expiry that the spec says can never happen when ENTROPY_PERIOD is 0.\"}", "mutation": {"type": "deleted_condition", "original": "If a non-zero timer expires, the module cancels the transaction and reports the `WaitTimerExpired` error.", "mutated": "If a timer expires, the module cancels the transaction and reports the `WaitTimerExpired` error.", "location": "Theory 'WaitTimerExpired (0x04)', timer condition (deleted)"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "kmac-t3-031", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/kmac/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If `EnMasking` is not set, masking is disabled and the software has to provide the key in unmasked form.\nAny write operations to [`KEY_SHARE1_0`](registers.md#key_share1) - [`KEY_SHARE1_15`](registers.md#key_share1) are ignored.\n\nIf `EnMasking` is not set, software has to provide the key in masked form.\nInternally, the design then unmasks the key by XORing the two key shares together when loading the key into the engine.", "rtl_excerpt": "", "question": "The excerpt below was derived from the KMAC spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated rule ('if EnMasking is not set, software has to provide the key in masked form') vs the preceding sentence in the same subsection ('If EnMasking is not set, masking is disabled and the software has to provide the key in unmasked form')\", \"category\": \"MISSING_CONDITION\", \"explanation\": \"Deleting the SwKeyMasked qualifier makes the sentence directly contradict the unmasked-key rule stated just above it.\"}", "mutation": {"type": "deleted_condition", "original": "If `EnMasking` is not set and the `SwKeyMasked` compile-time Verilog parameter is set, software has to provide the key in masked form.", "mutated": "If `EnMasking` is not set, software has to provide the key in masked form.", "location": "Theory 'Masking', SwKeyMasked qualifier (deleted)"}, "verification": "original text verified verbatim in the pinned repo docs; mutation reverted restores consistency", "difficulty": "medium"} {"id": "pattgen-t1-001", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/pattgen/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "3. Program the length of the seed pattern using the length field, [`SIZE.LEN_CH0`](registers.md#size).\nNote that since the allowed seed length ranges from 1-64, the value of this field should be one less than the pattern length.\nFor example, to generate a 16-bit pattern, a value of 15 should be written to the field [`SIZE.LEN_CH0`](registers.md#size).", "rtl_excerpt": "", "question": "According to the Programmer's Guide, what value must be written to SIZE.LEN_CH0 to generate a 16-bit seed pattern?", "answer_format": "exact_value", "gold_answer": "15", "mutation": {"type": "none", "original": "", "mutated": "", "location": "n/a"}, "verification": "quoted verbatim from sources/excerpts/pattgen/02_programmers_guide.md (channel-configuration step 3)", "difficulty": "easy"} {"id": "pattgen-t1-002", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/pattgen/doc/registers.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "## SIZE\nPATTGEN pattern length\n- Offset: `0x2c`\n- Reset default: `0x0`\n- Reset mask: `0xffffffff`", "rtl_excerpt": "", "question": "According to the register reference, what is the byte offset of the SIZE register?", "answer_format": "exact_value", "gold_answer": "0x2c", "mutation": {"type": "none", "original": "", "mutated": "", "location": "n/a"}, "verification": "quoted verbatim from sources/excerpts/pattgen/03_registers_interfaces.md (SIZE register header)", "difficulty": "easy"} {"id": "pattgen-t1-003", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/pattgen/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "1. Finally, to start the pattern set the [`CTRL.ENABLE_CH0`](registers.md#ctrl).\nTo start both channel patterns at the same time, configure both channels then simultaneously assert both the [`CTRL.ENABLE_CH0`](registers.md#ctrl) and [`CTRL.ENABLE_CH1`](registers.md#ctrl) bits in the same register access.", "rtl_excerpt": "", "question": "According to the Programmer's Guide, what must software do to start both channel patterns at the same time?", "answer_format": "exact_value", "gold_answer": "configure both channels then simultaneously assert both the CTRL.ENABLE_CH0 and CTRL.ENABLE_CH1 bits in the same register access", "mutation": {"type": "none", "original": "", "mutated": "", "location": "n/a"}, "verification": "quoted verbatim from sources/excerpts/pattgen/02_programmers_guide.md (final configuration step)", "difficulty": "medium"} {"id": "pattgen-t2-001", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/pattgen/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "1. Set the polarity bit, [`CTRL.POLARITY_CH0`](registers.md#ctrl), to determine the desired clock phase.\nFor either channel, a zero in the polarity bit indicates that the channel clock line (`pcl`) should start low, and the channel data line `pda` transitions on every falling edge of `pcl`.\nA one in the polarity bit inverts the `pcl` clock so that it starts high and `pda` transitions on the rising edge.", "rtl_excerpt": "", "question": "CTRL.POLARITY_CH0 is programmed to 1. At what level does pcl start, and on which edge of pcl does pda transition?", "answer_format": "exact_value", "gold_answer": "pcl starts high; pda transitions on the rising edge of pcl", "mutation": {"type": "none", "original": "", "mutated": "", "location": "n/a"}, "verification": "quoted verbatim from sources/excerpts/pattgen/02_programmers_guide.md (polarity configuration step)", "difficulty": "medium"} {"id": "pattgen-t2-002", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/pattgen/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "1. Program the clock divider ratio using the register [`PREDIV_CH0.CLK_RATIO`](registers.md#prediv_ch0).\nThe resulting clock frequency will be slower than the input I/O clock by a ratio of 2×(CLK_RATIO+1):\n$$f_{pclx}=\\frac{f_\\textrm{I/O clk}}{2(\\textrm{CLK\\_RATIO}+1)}$$", "rtl_excerpt": "", "question": "The I/O clock is 100 MHz and PREDIV_CH0.CLK_RATIO is programmed to 3. What is the resulting internal clock frequency f_pclx?", "answer_format": "exact_value", "gold_answer": "12.5 MHz", "mutation": {"type": "none", "original": "", "mutated": "", "location": "n/a"}, "verification": "formula quoted verbatim from sources/excerpts/pattgen/02_programmers_guide.md; 100/(2*(3+1)) = 12.5", "difficulty": "medium"} {"id": "pattgen-t2-003", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/pattgen/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Note that since the allowed seed length ranges from 1-64, the value of this field should be one less than the pattern length.\nNote that since the allowed number of pattern repetitions ranges from 1-1024, the value of this field should be one less than the desired repetition count.", "rtl_excerpt": "", "question": "SIZE.LEN_CH0 is programmed to 15 and SIZE.REPS_CH0 to 29. How many data bits are transmitted in total during one activation of the channel?", "answer_format": "exact_value", "gold_answer": "480 bits", "mutation": {"type": "none", "original": "", "mutated": "", "location": "n/a"}, "verification": "minus-one rules quoted verbatim from sources/excerpts/pattgen/02_programmers_guide.md; (15+1)*(29+1) = 16*30 = 480", "difficulty": "hard"} {"id": "pattgen-t3-001", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/pattgen/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "3. Program the length of the seed pattern using the length field, [`SIZE.LEN_CH0`](registers.md#size).\nNote that since the allowed seed length ranges from 1-64, the value of this field should be one less than the pattern length.\nFor example, to generate a 16-bit pattern, a value of 16 should be written to the field [`SIZE.LEN_CH0`](registers.md#size).\n\n*Register reference (SIZE):*\n\n| 5:0 | rw | 0x0 | LEN_CH0 | Length of the seed pattern for Channel 0, minus 1. Valid values: 0..63. |", "rtl_excerpt": "", "question": "The excerpt below was derived from the pattgen spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Programmer's Guide channel-configuration step 3: the example says 'to generate a 16-bit pattern, a value of 16 should be written' vs the same step's rule ('the value of this field should be one less than the pattern length', i.e. 15) and the SIZE register reference ('Length of the seed pattern for Channel 0, minus 1')\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The guide states the LEN field holds the pattern length minus one, so a 16-bit pattern requires 15; the mutated example value 16 contradicts both the stated rule and the register description.\"}", "mutation": {"type": "changed_number", "original": "a value of 15 should be written to the field [`SIZE.LEN_CH0`](registers.md#size)", "mutated": "a value of 16 should be written to the field [`SIZE.LEN_CH0`](registers.md#size)", "location": "Programmer's Guide channel-configuration step 3 (LEN example)"}, "verification": "excerpt derived verbatim from sources/excerpts/pattgen/02_programmers_guide.md and 03_registers_interfaces.md with the single numeric change noted in mutation", "difficulty": "medium"} {"id": "pattgen-t3-002", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/pattgen/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "For either channel, a zero in the polarity bit indicates that the channel clock line (`pcl`) should start low, and the channel data line `pda` transitions on every falling edge of `pcl`.\nA one in the polarity bit inverts the `pcl` clock so that it starts low and `pda` transitions on the falling edge.", "rtl_excerpt": "", "question": "The excerpt below was derived from the pattgen spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Polarity configuration step: 'A one in the polarity bit inverts the pcl clock so that it starts low and pda transitions on the falling edge' vs the preceding sentence ('a zero in the polarity bit indicates that ... pcl should start low, and ... pda transitions on every falling edge of pcl')\", \"category\": \"RULE_INVERSION\", \"explanation\": \"The mutated sentence makes polarity 1 behave exactly like polarity 0 (pcl starts low, pda on falling edge), so the polarity bit would have no effect; the original rule gives opposite behavior for 1 (starts high, rising edge).\"}", "mutation": {"type": "rule_inversion", "original": "A one in the polarity bit inverts the `pcl` clock so that it starts high and `pda` transitions on the rising edge.", "mutated": "A one in the polarity bit inverts the `pcl` clock so that it starts low and `pda` transitions on the falling edge.", "location": "Programmer's Guide polarity configuration step"}, "verification": "excerpt derived verbatim from sources/excerpts/pattgen/02_programmers_guide.md with the single rule inversion noted in mutation", "difficulty": "medium"} {"id": "pattgen-t3-003", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/pattgen/doc/registers.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "## INTR_STATE\nInterrupt State Register\n| 1 | rw1c | 0x0 | done_ch1 | raise if pattern generation on Channel 1 is complete |\n| 0 | rw1c | 0x0 | done_ch0 | raise if pattern generation on Channel 0 is complete |\n\n## INTR_ENABLE\nInterrupt Enable Register\n| 1 | rw | 0x0 | done_ch1 | Enable interrupt when [`INTR_STATE.done_ch1`](#intr_state) is set. |\n| 0 | rw | 0x0 | done_ch0 | Enable interrupt when [`INTR_STATE.done_ch1`](#intr_state) is set. |", "rtl_excerpt": "", "question": "The excerpt below was derived from the pattgen spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"INTR_ENABLE.done_ch0 description ('Enable interrupt when INTR_STATE.done_ch1 is set') vs the INTR_STATE field table in the same excerpt, where done_ch0 is bit 0 ('raise if pattern generation on Channel 0 is complete') and done_ch1 is bit 1 (Channel 1)\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The bit-0 enable field must gate the bit-0 status field for the same channel; the mutated description cross-references the other channel's status bit, which would make the Channel 0 enable bit arm the Channel 1 interrupt.\"}", "mutation": {"type": "crossref_conflict", "original": "| 0 | rw | 0x0 | done_ch0 | Enable interrupt when [`INTR_STATE.done_ch0`](#intr_state) is set. |", "mutated": "| 0 | rw | 0x0 | done_ch0 | Enable interrupt when [`INTR_STATE.done_ch1`](#intr_state) is set. |", "location": "Register reference INTR_ENABLE.done_ch0 description"}, "verification": "excerpt derived verbatim from sources/excerpts/pattgen/03_registers_interfaces.md with the single cross-reference change noted in mutation", "difficulty": "medium"} {"id": "pattgen-t3-004", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/pattgen/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Please note that writes to a channel's configuration registers have no effect while the channel is enabled.\nFor operational simplicity, the configuration registers are transferred into the internal finite state machines.\nChanges to the configuration registers only take effect once the channel has been disabled and re-enabled.", "rtl_excerpt": "", "question": "The excerpt below was derived from the pattgen spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated shadowing sentence ('the configuration registers are transferred into the internal finite state machines', with no condition) vs the sentences around it: writes 'have no effect while the channel is enabled' and changes 'only take effect once the channel has been disabled and re-enabled'\", \"category\": \"MISSING_CONDITION\", \"explanation\": \"The original sentence limits the transfer to 'while a channel is disabled'; the mutated version drops that condition, implying transfers happen unconditionally, which contradicts the documented write-ineffectiveness and the disable/re-enable requirement.\"}", "mutation": {"type": "deleted_condition", "original": "the configuration registers are only transferred into the internal finite state machines while a channel is disabled.", "mutated": "the configuration registers are transferred into the internal finite state machines.", "location": "Theory of Operation configuration-shadowing paragraph"}, "verification": "excerpt derived verbatim from sources/excerpts/pattgen/01_theory_operation.md with the single condition deletion noted in mutation", "difficulty": "hard"} {"id": "pattgen-t3-005", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/pattgen/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The clock-divide counter `clk_cnt` increments every cycle, except when it return to zero upon matching the value applied to the `prediv` input.\nAt this point, `pcl_int` is toggled.\nTwo overflow events result in a complete clock cycle, resulting in an internal clock frequency of:\n$$f_{pclx}=\\frac{f_\\textrm{I/O clk}}{4(\\textrm{CLK_RATIO}+1)}$$\n\n1. Program the clock divider ratio using the register [`PREDIV_CH0.CLK_RATIO`](registers.md#prediv_ch0).\nThe resulting clock frequency will be slower than the input I/O clock by a ratio of 2×(CLK_RATIO+1).", "rtl_excerpt": "", "question": "The excerpt below was derived from the pattgen spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated theory formula (denominator 4*(CLK_RATIO+1)) vs the theory's own derivation ('Two overflow events result in a complete clock cycle', i.e. a factor of 2) and the Programmer's Guide ('slower than the input I/O clock by a ratio of 2x(CLK_RATIO+1)')\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"Two toggles per clock cycle give a divide factor of 2*(CLK_RATIO+1), as the Programmer's Guide states; the mutated formula's factor of 4 contradicts both the derivation and the guide.\"}", "mutation": {"type": "changed_number", "original": "$$f_{pclx}=\\frac{f_\\textrm{I/O clk}}{2(\\textrm{CLK_RATIO}+1)}$$", "mutated": "$$f_{pclx}=\\frac{f_\\textrm{I/O clk}}{4(\\textrm{CLK_RATIO}+1)}$$", "location": "Theory of Operation internal clock frequency formula"}, "verification": "excerpt derived verbatim from sources/excerpts/pattgen/01_theory_operation.md and 02_programmers_guide.md with the single numeric change noted in mutation", "difficulty": "medium"} {"id": "pattgen-t3-006", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/pattgen/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "To clear the interrupts, a value of `0` must be written to the corresponding bits of the [`INTR_STATE`](registers.md#intr_state) register.\n\n*Register reference (INTR_STATE fields):*\n\n| 31:2 | | | | Reserved |\n| 1 | rw1c | 0x0 | done_ch1 | raise if pattern generation on Channel 1 is complete |\n| 0 | rw1c | 0x0 | done_ch0 | raise if pattern generation on Channel 0 is complete |", "rtl_excerpt": "", "question": "The excerpt below was derived from the pattgen spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated clear rule ('a value of 0 must be written to ... INTR_STATE') vs the INTR_STATE field table in the same excerpt, where done_ch1/done_ch0 are Type 'rw1c' (read-write, write-1-to-clear)\", \"category\": \"RULE_INVERSION\", \"explanation\": \"rw1c fields are cleared by writing 1, not 0; the mutated rule inverts the clear polarity and would leave the interrupts asserted forever.\"}", "mutation": {"type": "rule_inversion", "original": "To clear the interrupts, a value of `1` must be written to the corresponding bits of the [`INTR_STATE`](registers.md#intr_state) register.", "mutated": "To clear the interrupts, a value of `0` must be written to the corresponding bits of the [`INTR_STATE`](registers.md#intr_state) register.", "location": "Theory of Operation Interrupts section (clear rule)"}, "verification": "excerpt derived verbatim from sources/excerpts/pattgen/01_theory_operation.md and 03_registers_interfaces.md with the single rule inversion noted in mutation", "difficulty": "medium"} {"id": "pattgen-t4-001", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/pattgen/rtl/pattgen_chan.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "## Using the *inactive level* feature\n\nBy default, the `pcl` and `pda` outputs are zero when pattgen is inactive (i.e., when pattgen is disabled or after it has sent all data bits).", "rtl_excerpt": "70: // Drive pcl_o and pda_o directly from FF, so that they don't glitch.\n71: always_ff @(posedge clk_i or negedge rst_ni) begin\n72: if (!rst_ni) begin\n73: pcl_o <= 1'b1; // <-- MUTATED\n74: pda_o <= 1'b1; // <-- MUTATED\n75: end else begin\n76: pcl_o <= active ? (polarity_q ? ~pcl_int_q : pcl_int_q)\n77: : inactive_level_pcl_q;\n[mutated line(s): 73, 74]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"By default, the pcl and pda outputs are zero when pattgen is inactive.\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/pattgen/rtl/pattgen_chan.sv:73-74\", \"explanation\": \"The reset values of the pda_o/pcl_o output flops were changed from 1'b0 to 1'b1, so on reset (an inactive state) the pins drive 1 instead of the specified 0; simulation confirms orig drives 0 and the mutated RTL drives 1 during reset.\"}", "mutation": {"type": "wrong_reset_value", "original": " pcl_o <= 1'b0;\n pda_o <= 1'b0;", "mutated": " pcl_o <= 1'b1;\n pda_o <= 1'b1;", "location": "hw/ip/pattgen/rtl/pattgen_chan.sv:73-74"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd build/sim_t4/pattgen-001 && iverilog -g2012 -o sim.vvp ../../../sources/work_a/sim_scout/staged_pattgen_pattgen_ctrl_pkg.sv orig.sv mut.sv tb.sv && vvp sim.vvp # run.log shows RESULT: DIFFER", "difficulty": "medium"} {"id": "pattgen-t4-002", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/pattgen/rtl/pattgen_chan.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The `bit_cnt` counter increments on every falling edge of `pcl_int`, until it returns to zero at the pattern length based on the `len` input.\nNote that since the allowed seed length ranges from 1-64, the value of this field should be one less than the pattern length.", "rtl_excerpt": "121: // - Reset to zero immediately and do not increment when enable is inactive.\n122: assign bit_cnt_en = (pcl_int_q & prediv_clk_rollover) | (~enable);\n123: assign bit_cnt_d = (!enable) ? 6'h0 :\n124: (bit_cnt_q == len_q + 6'h1) ? 6'h0 : // Rollover // <-- MUTATED\n125: bit_cnt_q + 6'h1;\n126: \n127: always_ff @(posedge clk_i or negedge rst_ni) begin\n[mutated line(s): 124]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"bit_cnt returns to zero at the pattern length based on the len input, where len holds the pattern length minus one.\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/pattgen/rtl/pattgen_chan.sv:124\", \"explanation\": \"The rollover comparison was changed from (bit_cnt_q == len_q) to (bit_cnt_q == len_q + 1), so each pattern pass emits one extra bit; simulation confirms orig completes an 8-bit (2x4) pattern in 32 cycles while the mutated RTL runs 10 bits (2x5) and completes in 36.\"}", "mutation": {"type": "off_by_one", "original": "(bit_cnt_q == len_q) ? 6'h0 : // Rollover", "mutated": "(bit_cnt_q == len_q + 6'h1) ? 6'h0 : // Rollover", "location": "hw/ip/pattgen/rtl/pattgen_chan.sv:124"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd build/sim_t4/pattgen-002 && iverilog -g2012 -o sim.vvp ../../../sources/work_a/sim_scout/staged_pattgen_pattgen_ctrl_pkg.sv orig.sv mut.sv tb.sv && vvp sim.vvp # run.log shows RESULT: DIFFER", "difficulty": "medium"} {"id": "pattgen-t4-003", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/pattgen/rtl/pattgen_chan.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The FSM clock output, `pcl`, is directly driven by `pcl_int`, unless the `polarity` input is high, in which case `pcl` is inverted from `pcl_int`.", "rtl_excerpt": "73: pcl_o <= 1'b0;\n74: pda_o <= 1'b0;\n75: end else begin\n76: pcl_o <= active ? (polarity_q ? pcl_int_q : ~pcl_int_q) // <-- MUTATED\n77: : inactive_level_pcl_q;\n78: pda_o <= active ? data_q[bit_cnt_q]\n79: : inactive_level_pda_q;\n[mutated line(s): 76]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"pcl is directly driven by pcl_int unless polarity is high, in which case pcl is inverted from pcl_int.\", \"category\": \"RULE_INVERSION\", \"rtl_location\": \"hw/ip/pattgen/rtl/pattgen_chan.sv:77\", \"explanation\": \"The polarity mux branches were swapped: with polarity low the RTL now drives ~pcl_int instead of pcl_int (and vice versa); simulation confirms with polarity=0 orig pcl=1 while the mutated RTL gives pcl=0.\"}", "mutation": {"type": "inverted_enable", "original": "pcl_o <= active ? (polarity_q ? ~pcl_int_q : pcl_int_q)", "mutated": "pcl_o <= active ? (polarity_q ? pcl_int_q : ~pcl_int_q)", "location": "hw/ip/pattgen/rtl/pattgen_chan.sv:77"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd build/sim_t4/pattgen-003 && iverilog -g2012 -o sim.vvp ../../../sources/work_a/sim_scout/staged_pattgen_pattgen_ctrl_pkg.sv orig.sv mut.sv tb.sv && vvp sim.vvp # run.log shows RESULT: DIFFER", "difficulty": "medium"} {"id": "pattgen-t4-004", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/pattgen/rtl/pattgen_chan.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Each FSM ... a single state variable with three states `IDLE`, `ACTIVE`, and `END`.\nWhenever `bit_cnt` returns to zero, the repetition counter `rep_cnt` increments, and the pattern starts again.\nFinally, `rep_cnt` returns to zero upon reaching the input value `reps`.\nWhen this reset occurs, the FSM transitions to the `END` state.\nAll counters halt, the `pda` data line returns to its inactive state as specified by `inactive_level_pda`, the `pcl` clock line similarly assumes `inactive_level_pcl` and an interrupt event is sent out to signal completion.", "rtl_excerpt": "175: // ACTIVE -> (complete_q -> 1) -> END\n176: // ACTIVE -> (enable -> 0) -> IDLE\n177: // END -> (enable -> 0) -> IDLE\n178: assign active_d = // <-- MUTATED: END transition on complete_q deleted\n179: enable ? 1'b1 : // set to active when enabled (and not complete)\n180: active_q; // otherwise hold\n181: assign active = enable ? active_d : active_q;\n[mutated line(s): 178]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"When rep_cnt reaches the reps input value, the FSM transitions to the END state, counters halt, and pda/pcl return to their inactive levels.\", \"category\": \"MISSING_CONDITION\", \"rtl_location\": \"hw/ip/pattgen/rtl/pattgen_chan.sv:178\", \"explanation\": \"The ACTIVE->END transition on complete_q was deleted from active_d, so the FSM never leaves the active state after completion; simulation confirms orig returns pda to inactive 0 while the mutated RTL keeps driving active data (pda=1).\"}", "mutation": {"type": "missing_fsm_transition", "original": "assign active_d = complete_q ? 1'b0 : // clearing on completion takes precedence\n enable ? 1'b1 :", "mutated": "assign active_d = // END transition on complete_q deleted\n enable ? 1'b1 :", "location": "hw/ip/pattgen/rtl/pattgen_chan.sv:178"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd build/sim_t4/pattgen-004 && iverilog -g2012 -o sim.vvp ../../../sources/work_a/sim_scout/staged_pattgen_pattgen_ctrl_pkg.sv orig.sv mut.sv tb.sv && vvp sim.vvp # run.log shows RESULT: DIFFER", "difficulty": "hard"} {"id": "pattgen-t4-005", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/pattgen/rtl/pattgen_chan.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Please note that writes to a channel's configuration registers have no effect while the channel is enabled.\nFor operational simplicity, the configuration registers are only transferred into the internal finite state machines while a channel is disabled.\nChanges to the configuration registers only take effect once the channel has been disabled and re-enabled.", "rtl_excerpt": "57: len_q <= 6'h0;\n58: reps_q <= 10'h0;\n59: end else begin\n60: polarity_q <= enable ? ctrl_i.polarity : polarity_q; // <-- MUTATED\n61: inactive_level_pcl_q <= enable ? inactive_level_pcl_q : ctrl_i.inactive_level_pcl;\n62: inactive_level_pda_q <= enable ? inactive_level_pda_q : ctrl_i.inactive_level_pda;\n63: prediv_q <= enable ? prediv_q : ctrl_i.prediv;\n[mutated line(s): 60]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"Writes to a channel's configuration registers have no effect while the channel is enabled; they only take effect once the channel has been disabled and re-enabled.\", \"category\": \"RULE_INVERSION\", \"rtl_location\": \"hw/ip/pattgen/rtl/pattgen_chan.sv:60\", \"explanation\": \"The config-latch condition was inverted: polarity_q now loads ctrl_i.polarity while enabled (and holds while disabled), exactly backwards from the spec; simulation confirms orig ignores a polarity change made while enabled while the mutated RTL latches it.\"}", "mutation": {"type": "inverted_enable", "original": "polarity_q <= enable ? polarity_q : ctrl_i.polarity;", "mutated": "polarity_q <= enable ? ctrl_i.polarity : polarity_q;", "location": "hw/ip/pattgen/rtl/pattgen_chan.sv:60"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd build/sim_t4/pattgen-005 && iverilog -g2012 -o sim.vvp ../../../sources/work_a/sim_scout/staged_pattgen_pattgen_ctrl_pkg.sv orig.sv mut.sv tb.sv && vvp sim.vvp # run.log shows RESULT: DIFFER", "difficulty": "medium"} {"id": "pattgen-t4-006", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/pattgen/rtl/pattgen_chan.sv", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "Whenever `bit_cnt` returns to zero, the repetition counter `rep_cnt` increments, and the pattern starts again.\nFinally, `rep_cnt` returns to zero upon reaching the input value `reps`.\nNote that since the allowed number of pattern repetitions ranges from 1-1024, the value of this field should be one less than the desired repetition count.", "rtl_excerpt": "139: // - Reset to zero immediately and do not increment when enable is inactive.\n140: assign rep_cnt_en = (bit_cnt_en & (bit_cnt_q == len_q)) | (~enable);\n141: assign rep_cnt_d = (!enable) ? 10'h0 :\n142: (rep_cnt_q == reps_q + 10'h1) ? 10'h0 : // Rollover // <-- MUTATED\n143: rep_cnt_q + 10'h1;\n144: \n145: always_ff @(posedge clk_i or negedge rst_ni) begin\n...\n153: // Set the completion signal (complete_q) when rep_cnt reaches the configured limit and rolls\n154: // over to zero.\n155: // Clear / reset to zero when enable goes inactive.\n156: assign complete_en = (rep_cnt_en & (rep_cnt_q == reps_q + 10'h1)) | (~enable); // <-- MUTATED\n157: assign complete_d = (!enable) ? 1'h0 : 1'h1;\n158: \n159: always_ff @(posedge clk_i or negedge rst_ni) begin\n[mutated line(s): 142, 156]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": "{\"verdict\": \"violation\", \"rule\": \"rep_cnt returns to zero upon reaching the input value reps, where the REPS field holds the desired repetition count minus one.\", \"category\": \"NUMERIC_MISMATCH\", \"rtl_location\": \"hw/ip/pattgen/rtl/pattgen_chan.sv:142,156\", \"explanation\": \"Both the rep_cnt rollover and the completion-enable comparisons were changed from (rep_cnt_q == reps_q) to (rep_cnt_q == reps_q + 1), so the channel runs one extra repetition; simulation confirms orig completes after 2 repetitions (32 cycles) while the mutated RTL needs 3 (48 cycles).\"}", "mutation": {"type": "off_by_one", "original": "(rep_cnt_q == reps_q) ? 10'h0 : // Rollover ... (rep_cnt_en & (rep_cnt_q == reps_q))", "mutated": "(rep_cnt_q == reps_q + 10'h1) ? 10'h0 : // Rollover ... (rep_cnt_en & (rep_cnt_q == reps_q + 10'h1))", "location": "hw/ip/pattgen/rtl/pattgen_chan.sv:142,156"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd build/sim_t4/pattgen-006 && iverilog -g2012 -o sim.vvp ../../../sources/work_a/sim_scout/staged_pattgen_pattgen_ctrl_pkg.sv orig.sv mut.sv tb.sv && vvp sim.vvp # run.log shows RESULT: DIFFER", "difficulty": "medium"} {"id": "rv_timer-t1-001", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/rv_timer/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "A tick generator creates a tick every time its internal counter hits the [`CFG0.prescaler`](registers.md#cfg0) value. The tick is used to increment `mtime` by the [`CFG0.step`](registers.md#cfg0) value.", "rtl_excerpt": "", "question": "According to the Theory of Operation, a tick generator creates a tick every time its internal counter hits what value?", "answer_format": "exact_value", "gold_answer": "the CFG0.prescaler value", "mutation": {"type": "none", "original": "", "mutated": "", "location": "n/a"}, "verification": "quoted verbatim from sources/excerpts/rv_timer/01_theory_operation.md (Theory of Operation)", "difficulty": "easy"} {"id": "rv_timer-t1-002", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/rv_timer/doc/registers.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "## CFG0\nConfiguration for Hart 0\n- Offset: `0x10c`\n- Reset default: `0x10000`\n- Reset mask: `0xff0fff`", "rtl_excerpt": "", "question": "According to the register reference, what is the reset default of CFG0?", "answer_format": "exact_value", "gold_answer": "0x10000", "mutation": {"type": "none", "original": "", "mutated": "", "location": "n/a"}, "verification": "quoted verbatim from sources/excerpts/rv_timer/03_registers.md (CFG0 header)", "difficulty": "easy"} {"id": "rv_timer-t1-003", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/rv_timer/doc/registers.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "## COMPARE_LOWER0_0\nTimer value Lower\n- Offset: `0x118`\n- Reset default: `0xffffffff`\n- Reset mask: `0xffffffff`", "rtl_excerpt": "", "question": "According to the register reference, what is the reset default of COMPARE_LOWER0_0?", "answer_format": "exact_value", "gold_answer": "0xffffffff", "mutation": {"type": "none", "original": "", "mutated": "", "location": "n/a"}, "verification": "quoted verbatim from sources/excerpts/rv_timer/03_registers.md (COMPARE_LOWER0_0 header)", "difficulty": "medium"} {"id": "rv_timer-t1-004", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/rv_timer/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The timer IP supports more than one HART and/or more than one timer per hart.\nEach hart has a set of tick generator and counter.\nThis version of the IP is fixed to have one Hart and one Timer per Hart.", "rtl_excerpt": "", "question": "According to the Theory of Operation, how many harts and timers per hart is this version of the IP fixed to have?", "answer_format": "exact_value", "gold_answer": "one Hart and one Timer per Hart", "mutation": {"type": "none", "original": "", "mutated": "", "location": "n/a"}, "verification": "quoted verbatim from sources/excerpts/rv_timer/01_theory_operation.md (Configurable number of timers and harts)", "difficulty": "medium"} {"id": "rv_timer-t2-001", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/rv_timer/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "For instance, if a system switches between 48MHz and 200MHz clocks, a prescaler value of **47** for 48MHz and **199** for 200MHz will generate a 1us tick.\n| 23:16 | rw | 0x1 | step | Incremental value for each tick |", "rtl_excerpt": "", "question": "CFG0.prescaler is programmed to 47 on a 48 MHz clock, and CFG0.step is at its reset value. What tick period does this generate, and by how much does mtime increment on each tick?", "answer_format": "exact_value", "gold_answer": "1us tick; mtime increments by 1 per tick", "mutation": {"type": "none", "original": "", "mutated": "", "location": "n/a"}, "verification": "quoted verbatim from sources/excerpts/rv_timer/01_theory_operation.md (Tick Generator) and 03_registers.md (CFG0 step field, reset 0x1)", "difficulty": "medium"} {"id": "rv_timer-t2-002", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/rv_timer/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "For instance, if a system switches between 48MHz and 200MHz clocks, a prescaler value of **47** for 48MHz and **199** for 200MHz will generate a 1us tick.\nA tick generator creates a tick every time its internal counter hits the [`CFG0.prescaler`](registers.md#cfg0) value.", "rtl_excerpt": "", "question": "A system runs on a 200 MHz clock and firmware wants a 10us tick. What value must be written to CFG0.prescaler?", "answer_format": "exact_value", "gold_answer": "1999", "mutation": {"type": "none", "original": "", "mutated": "", "location": "n/a"}, "verification": "tick semantics from sources/excerpts/rv_timer/01_theory_operation.md; the 47/48MHz example shows tick period = (prescaler+1)/f_clk, so 10us at 200MHz needs (2000-1) = 1999", "difficulty": "hard"} {"id": "rv_timer-t2-003", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/rv_timer/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "If `mtime` is greater than or equal to the value of `mtimecmp`, the interrupt is generated from the RV_TIMER module.", "rtl_excerpt": "", "question": "mtime reads 0x1_0000_0000 and mtimecmp reads 0x1_FFFF_FFFF. Is the timer interrupt raised?", "answer_format": "exact_value", "gold_answer": "No", "mutation": {"type": "none", "original": "", "mutated": "", "location": "n/a"}, "verification": "rule quoted verbatim from sources/excerpts/rv_timer/02_programmers_guide.md (Interrupt Handling); 0x1_0000_0000 < 0x1_FFFF_FFFF so the >= condition is false", "difficulty": "medium"} {"id": "rv_timer-t2-004", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/rv_timer/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "In typical usage the `mtime` register would not be written, but if there is a need to set it to an arbitrary, dynamically-determined value, the following sequence should be used to prevent the operation of the timer yielding an indeterminate result:\n```asm\n# Desired time is in a1:a0\nli t1, TOP_EARLGREY_RV_TIMER_BASE_ADDR\nsw x0, RV_TIMER_TIMER_V_LOWER0_0_REG_OFFSET(t1)\nsw a1, RV_TIMER_TIMER_V_UPPER0_0_REG_OFFSET(t1) # Upper half of target value.\nsw a0, RV_TIMER_TIMER_V_LOWER0_0_REG_OFFSET(t1) # Lower half of target value.\n```\nIf the value of `mtime` is modified in this manner then `mtimecmp` shall be written after `mtime` in order to clear any pending interrupt condition.", "rtl_excerpt": "", "question": "After software rewrites mtime with the recommended sequence, why must mtimecmp be written after mtime?", "answer_format": "exact_value", "gold_answer": "in order to clear any pending interrupt condition", "mutation": {"type": "none", "original": "", "mutated": "", "location": "n/a"}, "verification": "quoted verbatim from sources/excerpts/rv_timer/02_programmers_guide.md (Register Access)", "difficulty": "medium"} {"id": "rv_timer-t3-001", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/rv_timer/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The 64-bit `mtime` value is compared with the 64-bit `mtimecmp`. If `mtime` is greater than `mtimecmp`, the timer raises an interrupt.\n\n*Programmer's Guide (Interrupt Handling):*\n\nIf `mtime` is greater than or equal to the value of `mtimecmp`, the interrupt is generated from the RV_TIMER module.", "rtl_excerpt": "", "question": "The excerpt below was derived from the rv_timer spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated Theory of Operation sentence ('If mtime is greater than mtimecmp, the timer raises an interrupt') vs the Programmer's Guide ('If mtime is greater than or equal to the value of mtimecmp, the interrupt is generated')\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The mutated theory drops the equality case, so at mtime == mtimecmp the two sections disagree about whether the interrupt fires.\"}", "mutation": {"type": "changed_number", "original": "If `mtime` is greater than or equal to `mtimecmp`, the timer raises an interrupt.", "mutated": "If `mtime` is greater than `mtimecmp`, the timer raises an interrupt.", "location": "Theory of Operation interrupt-condition sentence"}, "verification": "excerpt derived verbatim from sources/excerpts/rv_timer/01_theory_operation.md and 02_programmers_guide.md with the single numeric change noted in mutation", "difficulty": "medium"} {"id": "rv_timer-t3-002", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/rv_timer/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "The IP has a latching mechanism that freezes the timer value while software performs the two reads. It is the programmer's responsibility to ensure the correct value is read. For instance, if the CPU reads `0xFFFF_FFFF` from lower 32-bit timer value (`mtime`) and `0x0000_0001` from upper 32-bit timer value (`mtimeh`), there is a chance that rather than having the value `0x1_FFFF_FFFF` the timer value has changed from `0x0_FFFF_FFFF` to `0x1_0000_0000` between the two reads.", "rtl_excerpt": "", "question": "The excerpt below was derived from the rv_timer spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated sentence ('The IP has a latching mechanism that freezes the timer value while software performs the two reads') vs the example in the same paragraph, which describes the value changing between the two reads (0x0_FFFF_FFFF to 0x1_0000_0000) and possibly being misread as 0x1_FFFF_FFFF\", \"category\": \"RULE_INVERSION\", \"explanation\": \"A latching mechanism would make the race impossible, yet the paragraph goes on to describe exactly that race and puts the burden on the programmer; the original rule is that the IP has NO latching or blocking mechanism.\"}", "mutation": {"type": "rule_inversion", "original": "The IP doesn't have a latching or blocking mechanism to avoid this issue.", "mutated": "The IP has a latching mechanism that freezes the timer value while software performs the two reads.", "location": "Programmer's Guide Register Access (latching-mechanism sentence)"}, "verification": "excerpt derived verbatim from sources/excerpts/rv_timer/02_programmers_guide.md with the single rule inversion noted in mutation", "difficulty": "medium"} {"id": "rv_timer-t3-003", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/rv_timer/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "## Interrupt Handling\n\nIf `mtime` is greater than or equal to the value of `mtimecmp`, the interrupt is generated from the RV_TIMER module.\nIf the core enables the timer interrupt in `MIE` CSR, it jumps into the timer interrupt service routine.\nClearing the interrupt can be done by writing 1 into the Interrupt Status register [`INTR_ENABLE0`](../../spi_device/data/spi_device.hjson#intr_enable0).\n\n*Register reference:*\n\n## INTR_ENABLE0\nInterrupt Enable\n| 0 | rw | 0x0 | IE_0 | Interrupt Enable for timer |\n\n## INTR_STATE0\nInterrupt Status\n| 0 | rw1c | 0x0 | IS_0 | Interrupt status for timer |", "rtl_excerpt": "", "question": "The excerpt below was derived from the rv_timer spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated Interrupt Handling sentence ('Clearing the interrupt can be done by writing 1 into ... INTR_ENABLE0') vs the register reference in the same excerpt: INTR_ENABLE0 is the Interrupt Enable register (IE_0, rw), while interrupt status lives in INTR_STATE0 (IS_0, rw1c)\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The mutated cross-reference points at the enable register instead of the status register; writing 1 to an rw enable bit cannot clear a status bit, and the original reference is to INTR_STATE0.\"}", "mutation": {"type": "crossref_conflict", "original": "Clearing the interrupt can be done by writing 1 into the Interrupt Status register [`INTR_STATE0`](../../spi_device/data/spi_device.hjson#intr_state0).", "mutated": "Clearing the interrupt can be done by writing 1 into the Interrupt Status register [`INTR_ENABLE0`](../../spi_device/data/spi_device.hjson#intr_enable0).", "location": "Programmer's Guide Interrupt Handling (interrupt-clear register reference)"}, "verification": "excerpt derived verbatim from sources/excerpts/rv_timer/02_programmers_guide.md and 03_registers.md with the single cross-reference change noted in mutation", "difficulty": "medium"} {"id": "rv_timer-t3-004", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/rv_timer/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "## Initialization\n\nSoftware is expected to configure `prescaler` and `step` to correctly increment the timer value. These two fields need to be stable to correctly increment the timer value. If software wants to change these fields, it should de-activate the timer and then proceed.", "rtl_excerpt": "", "question": "The excerpt below was derived from the rv_timer spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated Initialization sentence ('Software is expected to configure prescaler and step to correctly increment the timer value', with no timing condition) vs the following sentences: the fields 'need to be stable', and changing them requires de-activating the timer first\", \"category\": \"MISSING_CONDITION\", \"explanation\": \"The deleted condition 'before activating the timer' is load-bearing: without it the sentence no longer constrains when configuration may happen, contradicting the stability requirement and the de-activate-before-change rule.\"}", "mutation": {"type": "deleted_condition", "original": "Software is expected to configure `prescaler` and `step` before activating the timer.", "mutated": "Software is expected to configure `prescaler` and `step` to correctly increment the timer value.", "location": "Programmer's Guide Initialization (configuration-timing sentence)"}, "verification": "excerpt derived verbatim from sources/excerpts/rv_timer/02_programmers_guide.md with the single condition deletion noted in mutation", "difficulty": "medium"} {"id": "rv_timer-t3-005", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/rv_timer/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "A tick generator creates a tick every time its internal counter hits the [`CFG0.prescaler`](registers.md#cfg0) value.\nFor instance, if a system switches between 48MHz and 200MHz clocks, a prescaler value of **48** for 48MHz and **200** for 200MHz will generate a 1us tick.", "rtl_excerpt": "", "question": "The excerpt below was derived from the rv_timer spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated example ('a prescaler value of 48 for 48MHz and 200 for 200MHz will generate a 1us tick') vs the tick-generation rule in the same excerpt: the original example calibrates the semantics (47 -> 48 counter cycles = 1us at 48MHz), so prescaler 48 gives 49 cycles ~= 1.02us, not 1us\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The example's own numbers define that a tick takes prescaler+1 clock cycles (47+1 = 48 cycles of 48MHz = 1us); the mutated values 48/200 give 49/201 cycles, contradicting the '1us tick' claim.\"}", "mutation": {"type": "changed_number", "original": "a prescaler value of **47** for 48MHz and **199** for 200MHz will generate a 1us tick.", "mutated": "a prescaler value of **48** for 48MHz and **200** for 200MHz will generate a 1us tick.", "location": "Theory of Operation Tick Generator (prescaler example values)"}, "verification": "excerpt derived verbatim from sources/excerpts/rv_timer/01_theory_operation.md with the single numeric change noted in mutation", "difficulty": "hard"} {"id": "rv_timer-t3-006", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/rv_timer/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "In typical usage the `mtime` register would not be written, but if there is a need to set it to an arbitrary, dynamically-determined value, the following sequence should be used to prevent the operation of the timer yielding an indeterminate result:\n```asm\n# Desired time is in a1:a0\nli t1, TOP_EARLGREY_RV_TIMER_BASE_ADDR\nsw x0, RV_TIMER_TIMER_V_LOWER0_0_REG_OFFSET(t1)\nsw a1, RV_TIMER_TIMER_V_UPPER0_0_REG_OFFSET(t1) # Upper half of target value.\nsw a0, RV_TIMER_TIMER_V_LOWER0_0_REG_OFFSET(t1) # Lower half of target value.\n```\nIn the event that the target value of the lower half is close to 0xFFFF_FFFF, this sequence causes the timer to assume an incorrect time between the two 32-bit writes required to set the 64-bit timer value.", "rtl_excerpt": "", "question": "The excerpt below was derived from the rv_timer spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated sentence ('this sequence causes the timer to assume an incorrect time between the two 32-bit writes') vs the introduction of the same sequence ('the following sequence should be used to prevent the operation of the timer yielding an indeterminate result')\", \"category\": \"RULE_INVERSION\", \"explanation\": \"The sequence is recommended precisely because it prevents the incorrect-time hazard; the mutated sentence inverts its purpose, making the recommendation nonsensical.\"}", "mutation": {"type": "rule_inversion", "original": "this sequence prevents the timer from assuming an incorrect time between the two 32-bit writes required to set the 64-bit timer value.", "mutated": "this sequence causes the timer to assume an incorrect time between the two 32-bit writes required to set the 64-bit timer value.", "location": "Programmer's Guide Register Access (mtime-write sequence rationale)"}, "verification": "excerpt derived verbatim from sources/excerpts/rv_timer/02_programmers_guide.md with the single rule inversion noted in mutation", "difficulty": "medium"} {"id": "rv_timer-t3-007", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/rv_timer/doc/registers.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "## CFG0\nConfiguration for Hart 0\n- Offset: `0x10c`\n- Reset default: `0x00000`\n- Reset mask: `0xff0fff`\n\n| 23:16 | rw | 0x1 | step | Incremental value for each tick |\n| 11:0 | rw | 0x0 | prescale | Prescaler to generate tick |", "rtl_excerpt": "", "question": "The excerpt below was derived from the rv_timer spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"CFG0 header ('Reset default: 0x00000') vs the field table in the same excerpt: the step field (bits 23:16) resets to 0x1, so the register must reset to 0x10000, not 0x00000\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"The per-field reset values require bit 16 set (step = 0x1); the mutated header value 0x00000 is incompatible with the documented field resets.\"}", "mutation": {"type": "changed_number", "original": "- Reset default: `0x10000`", "mutated": "- Reset default: `0x00000`", "location": "Register reference CFG0 header (reset default)"}, "verification": "excerpt derived verbatim from sources/excerpts/rv_timer/03_registers.md with the single numeric change noted in mutation", "difficulty": "medium"} {"id": "rv_timer-t3-008", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/rv_timer/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "A tick generator creates a tick every time its internal counter hits the [`CFG0.step`](registers.md#cfg0) value. The tick is used to increment `mtime` by the [`CFG0.step`](registers.md#cfg0) value.\n\n*Register reference (CFG0 fields):*\n\n| 23:16 | rw | 0x1 | step | Incremental value for each tick |\n| 11:0 | rw | 0x0 | prescale | Prescaler to generate tick |", "rtl_excerpt": "", "question": "The excerpt below was derived from the rv_timer spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated tick sentence ('creates a tick every time its internal counter hits the CFG0.step value') vs the CFG0 field table in the same excerpt: step is the 'Incremental value for each tick' while the prescaler ('Prescaler to generate tick') sets the tick period\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The mutated cross-reference assigns the tick-period role to the step field; the register reference shows the prescaler generates the tick and the step is added to mtime per tick, so the sentence now uses the wrong field for both roles.\"}", "mutation": {"type": "crossref_conflict", "original": "A tick generator creates a tick every time its internal counter hits the [`CFG0.prescaler`](registers.md#cfg0) value.", "mutated": "A tick generator creates a tick every time its internal counter hits the [`CFG0.step`](registers.md#cfg0) value.", "location": "Theory of Operation tick-generator sentence (field cross-reference)"}, "verification": "excerpt derived verbatim from sources/excerpts/rv_timer/01_theory_operation.md and 03_registers.md with the single cross-reference change noted in mutation", "difficulty": "medium"} {"id": "rv_timer-t3-009", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/rv_timer/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "2. When the timer is setup to trigger a `timeout` some number of timer ticks into the future, the computation of the comparison value `mtime + timeout` may overflow. If this value is set in `mtimecmp` it would make `mtime` greater than `mtimecmp` and immediately signal an interrupt.\nA possible solution is to have an intermediate interrupt by setting the `mtimecmp` to 64-bit all-ones, `0xFFFF_FFFF_FFFF_FFFF`. Then the service routine for that interrupt will immediately schedule the required interrupt using the originally computed `mtimecmp` value.", "rtl_excerpt": "", "question": "The excerpt below was derived from the rv_timer spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated solution ('the service routine ... will immediately schedule the required interrupt using the originally computed mtimecmp value') vs the problem statement in the same paragraph: the overflowed mtimecmp 'would make mtime greater than mtimecmp and immediately signal an interrupt'\", \"category\": \"MISSING_CONDITION\", \"explanation\": \"The deleted step (poll mtime until it wraps before scheduling) is what makes the solution work; scheduling the overflowed comparand immediately would instantly re-trigger, contradicting the stated purpose of the workaround.\"}", "mutation": {"type": "deleted_condition", "original": "Then the service routine for that interrupt will need to poll `mtime` until it wraps (which could take up to a timer clock tick) before scheduling the required interrupt using the originally computed `mtimecmp` value.", "mutated": "Then the service routine for that interrupt will immediately schedule the required interrupt using the originally computed `mtimecmp` value.", "location": "Programmer's Guide 2^64-behavior case 2 (intermediate-interrupt solution)"}, "verification": "excerpt derived verbatim from sources/excerpts/rv_timer/02_programmers_guide.md with the single condition deletion noted in mutation", "difficulty": "hard"} {"id": "rv_timer-t3-010", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/rv_timer/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "For instance, if a system switches between 48MHz and 200MHz clocks, a prescaler value of **47** for 48MHz and **199** for 200MHz will generate a 1us tick.\nIn this version, the timer only supports a single fixed clock, so the firmware never needs to change [`CFG0.prescaler`](registers.md#cfg0).", "rtl_excerpt": "", "question": "The excerpt below was derived from the rv_timer spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated sentence ('the firmware never needs to change CFG0.prescaler') vs the example in the same paragraph: switching between 48MHz and 200MHz clocks needs prescaler 47 vs 199 for the same 1us tick\", \"category\": \"RULE_INVERSION\", \"explanation\": \"The example proves the prescaler must be reprogrammed when the clock changes; the mutated 'never needs to change' inverts the documented guidance ('should change CFG0.prescaler appropriately').\"}", "mutation": {"type": "rule_inversion", "original": "In this version, the timer only supports a single fixed clock, so the firmware should change [`CFG0.prescaler`](registers.md#cfg0) appropriately.", "mutated": "In this version, the timer only supports a single fixed clock, so the firmware never needs to change [`CFG0.prescaler`](registers.md#cfg0).", "location": "Theory of Operation Tick Generator (prescaler-change guidance)"}, "verification": "excerpt derived verbatim from sources/excerpts/rv_timer/01_theory_operation.md with the single rule inversion noted in mutation", "difficulty": "medium"} {"id": "rv_timer-t3-011", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/rv_timer/doc/theory_of_operation.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "```hjson\n{ name: \"CFG0\",\n desc: \"Configuration for Hart 0\",\n fields: [\n { bits: \"11:0\", name: \"prescale\", desc: \"Prescaler to generate tick\" },\n { bits: \"23:16\", name: \"step\", resval: \"0x2\", desc: \"Incremental value for each tick\" },\n ],\n},\n```\n\n*Register reference (CFG0):*\n- Reset default: `0x10000`\n| 23:16 | rw | 0x1 | step | Incremental value for each tick |", "rtl_excerpt": "", "question": "The excerpt below was derived from the rv_timer spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated hjson example (step resval 0x2) vs the CFG0 register reference in the same excerpt: the step field resets to 0x1 and the register reset default is 0x10000\", \"category\": \"NUMERIC_MISMATCH\", \"explanation\": \"A step reset value of 0x2 would make the CFG0 reset default 0x20000, contradicting both the documented 0x10000 default and the field table's 0x1.\"}", "mutation": {"type": "changed_number", "original": "{ bits: \"23:16\", name: \"step\", resval: \"0x1\", desc: \"Incremental value for each tick\" },", "mutated": "{ bits: \"23:16\", name: \"step\", resval: \"0x2\", desc: \"Incremental value for each tick\" },", "location": "Theory of Operation hjson configuration example (CFG0 step resval)"}, "verification": "excerpt derived verbatim from sources/excerpts/rv_timer/01_theory_operation.md and 03_registers.md with the single numeric change noted in mutation", "difficulty": "medium"} {"id": "rv_timer-t3-012", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/rv_timer/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "This condition can be detected in a standard way using a third read. Figure 10.1 in the RISC-V unprivileged specification explains how to avoid this.\n\nUpdating `mtimecmp` register also follows a similar approach to avoid a spurious interrupt during the register update. Please refer to the `mtimecmp` section in the RISC-V unprivileged specification.\n\nThe RV_TIMER module also follows RISC-V Privileged spec that requires the interrupt to be cleared by updating `mtimecmp` memory-mapped CSRs.", "rtl_excerpt": "", "question": "The excerpt below was derived from the rv_timer spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated reference ('the mtimecmp section in the RISC-V unprivileged specification') vs the Interrupt Handling sentence in the same excerpt: 'The RV_TIMER module also follows RISC-V Privileged spec that requires the interrupt to be cleared by updating mtimecmp memory-mapped CSRs'\", \"category\": \"CROSSREF_CONFLICT\", \"explanation\": \"The excerpt itself ties mtimecmp to the Privileged spec; the mutated pointer sends the reader to the unprivileged spec, where the mtimecmp section does not exist (the unprivileged reference correctly belongs to the rdcycle read side).\"}", "mutation": {"type": "crossref_conflict", "original": "Please refer to the `mtimecmp` section in the RISC-V privileged specification.", "mutated": "Please refer to the `mtimecmp` section in the RISC-V unprivileged specification.", "location": "Programmer's Guide Register Access (mtimecmp specification reference)"}, "verification": "excerpt derived verbatim from sources/excerpts/rv_timer/02_programmers_guide.md with the single cross-reference change noted in mutation", "difficulty": "hard"} {"id": "rv_timer-t3-013", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/rv_timer/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "In typical usage the `mtime` register would not be written, but if there is a need to set it to an arbitrary, dynamically-determined value, the following sequence should be used to prevent the operation of the timer yielding an indeterminate result:\n```asm\n# Desired time is in a1:a0\nli t1, TOP_EARLGREY_RV_TIMER_BASE_ADDR\nsw a1, RV_TIMER_TIMER_V_UPPER0_0_REG_OFFSET(t1) # Upper half of target value.\nsw a0, RV_TIMER_TIMER_V_LOWER0_0_REG_OFFSET(t1) # Lower half of target value.\n```\nIn the event that the target value of the lower half is close to 0xFFFF_FFFF, this sequence prevents the timer from assuming an incorrect time between the two 32-bit writes required to set the 64-bit timer value.", "rtl_excerpt": "", "question": "The excerpt below was derived from the rv_timer spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated sequence (upper write, then lower write, with no initial lower-half zeroing) vs the paragraph's stated purpose: 'this sequence prevents the timer from assuming an incorrect time between the two 32-bit writes' when the lower half is close to 0xFFFF_FFFF\", \"category\": \"MISSING_CONDITION\", \"explanation\": \"The deleted first write (lower half to zero) is what keeps the interim 64-bit value small while the upper half is programmed; without it, programming the upper half first can expose an incorrect interim time, defeating the sequence's documented purpose.\"}", "mutation": {"type": "deleted_condition", "original": "sw x0, RV_TIMER_TIMER_V_LOWER0_0_REG_OFFSET(t1)\nsw a1, RV_TIMER_TIMER_V_UPPER0_0_REG_OFFSET(t1) # Upper half of target value.", "mutated": "sw a1, RV_TIMER_TIMER_V_UPPER0_0_REG_OFFSET(t1) # Upper half of target value.", "location": "Programmer's Guide Register Access (mtime-write sequence, first write)"}, "verification": "excerpt derived verbatim from sources/excerpts/rv_timer/02_programmers_guide.md with the single condition deletion noted in mutation", "difficulty": "medium"} {"id": "rv_timer-t3-014", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "file": "hw/ip/rv_timer/doc/programmers_guide.md", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "license": "Apache-2.0"}, "spec_excerpt": "1. `mtimecmp` close to 0xFFFF_FFFF_FFFF_FFFF. In this case the time-out event will be signaled when `mtime` passes the comparison value, the interrupt will be raised and the source indicated in the corresponding bit of the interrupt status register. However, if there is a delay in servicing the interrupt the `mtime` value could wrap to zero (and continue to increment) so the value read by the interrupt service routine will be greater than the comparison value.", "rtl_excerpt": "", "question": "The excerpt below was derived from the rv_timer spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"location\": \"Mutated sentence ('the value read by the interrupt service routine will be greater than the comparison value') vs the same sentence's setup: mtimecmp is close to 0xFFFF_FFFF_FFFF_FFFF and mtime 'could wrap to zero (and continue to increment)'\", \"category\": \"RULE_INVERSION\", \"explanation\": \"After wrapping to near zero, mtime is arithmetically far below a near-maximum mtimecmp; the read value must be less than the comparison value, not greater. The mutated 'greater than' inverts the documented wrap-around consequence.\"}", "mutation": {"type": "rule_inversion", "original": "so the value read by the interrupt service routine will be less than the comparison value.", "mutated": "so the value read by the interrupt service routine will be greater than the comparison value.", "location": "Programmer's Guide 2^64-behavior case 1 (post-wrap read value)"}, "verification": "excerpt derived verbatim from sources/excerpts/rv_timer/02_programmers_guide.md with the single rule inversion noted in mutation", "difficulty": "hard"} {"id": "spi_device-t1-001", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/01_flash_passthrough_modes.md", "license": "Apache-2.0"}, "spec_excerpt": "SPI Device currently provides 28 command information entries: [`CMD_INFO_0`-`CMD_INFO_23`](registers.md#cmd_info) and\n[`CMD_INFO_EN4B`](registers.md#cmd_info_en4b)-[`CMD_INFO_WRDI`](registers.md#cmd_info_wrdi).", "rtl_excerpt": null, "question": "How many command information entries does the SPI Device provide?", "answer_format": "exact_value", "gold_answer": "28", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (retrieval baseline)", "difficulty": "easy"} {"id": "spi_device-t1-002", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/02_read_path.md", "license": "Apache-2.0"}, "spec_excerpt": "In the current version, the read buffer size is 2kB.", "rtl_excerpt": null, "question": "What is the read buffer size of the SPI Device?", "answer_format": "exact_value", "gold_answer": "2kB", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (retrieval baseline)", "difficulty": "easy"} {"id": "spi_device-t1-003", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/02_read_path.md", "license": "Apache-2.0"}, "spec_excerpt": "The SW may configure the number of dummy cycles for each individual read command, from 0 to 8 cycles.", "rtl_excerpt": null, "question": "What range of dummy cycles can software configure for each individual read command?", "answer_format": "exact_value", "gold_answer": "from 0 to 8 cycles", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (retrieval baseline)", "difficulty": "easy"} {"id": "spi_device-t1-004", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/03_upload_passthrough.md", "license": "Apache-2.0"}, "spec_excerpt": "If the host systems sends more than the maximum allowed payload size (currently 256B), `payload_start_idx` may be non-zero.", "rtl_excerpt": null, "question": "What is the maximum allowed upload payload size?", "answer_format": "exact_value", "gold_answer": "256B", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (retrieval baseline)", "difficulty": "easy"} {"id": "spi_device-t1-005", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/04_tpm_reliability.md", "license": "Apache-2.0"}, "spec_excerpt": "If the request is in the supported locality (0-4)", "rtl_excerpt": null, "question": "Which TPM localities does the SPI Device support?", "answer_format": "exact_value", "gold_answer": "0-4", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (retrieval baseline)", "difficulty": "easy"} {"id": "spi_device-t1-006", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/04_tpm_reliability.md", "license": "Apache-2.0"}, "spec_excerpt": "The SPI Device IP only internally supports mode 0", "rtl_excerpt": null, "question": "Which SPI mode does the SPI Device IP internally support?", "answer_format": "exact_value", "gold_answer": "mode 0", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (retrieval baseline)", "difficulty": "easy"} {"id": "spi_device-t1-007", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/01_flash_passthrough_modes.md", "license": "Apache-2.0"}, "spec_excerpt": "In the unlikely case of multiple matching entries, the entry with the highest index is used.", "rtl_excerpt": null, "question": "If multiple command information entries match a received opcode, which entry is used?", "answer_format": "exact_value", "gold_answer": "the entry with the highest index", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (retrieval baseline)", "difficulty": "easy"} {"id": "spi_device-t2-001", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/02_read_path.md", "license": "Apache-2.0"}, "spec_excerpt": "The IP only uses lower 11 bits of the received read command address (`addr[10:0]`) to issue the read requests to the DPSRAM", "rtl_excerpt": null, "question": "The host issues a read command with address 0x0001_2345. Which offset of the read buffer is accessed?\n\nA) 0x2345 (addr[15:0])\nB) 0x45 (addr[7:0])\nC) 0x345 (addr[10:0])\nD) 0x12345 (the full received address)", "answer_format": "multiple_choice", "gold_answer": "C", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (cross-section baseline)", "difficulty": "medium", "options": ["A) 0x2345 (addr[15:0])", "B) 0x45 (addr[7:0])", "C) 0x345 (addr[10:0])", "D) 0x12345 (the full received address)"], "repair_note": "v2.1 2026-09-25: option list appended; gold letter assigned by shuffle"} {"id": "spi_device-t2-002", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/05_programmers_guide.md", "license": "Apache-2.0"}, "spec_excerpt": "In FIFO mode, when [`TPM_CFG.tpm_mode`](registers.md#tpm_cfg) is set to 0, HW registers reads must be returned after a maximum of 1 wait state.\nIn CRB mode, when [`TPM_CFG.tpm_mode`](registers.md#tpm_cfg) is set to 1, there are no such restrictions.\nThe logic always uploads both the command and address to the SW and waits for the return data in CRB mode.", "rtl_excerpt": null, "question": "How do FIFO mode and CRB mode differ in TPM register handling?\n\nA) In FIFO mode HW register reads must be returned after at most 1 wait state; in CRB mode there is no such restriction and the command and address are always uploaded to software\nB) In CRB mode HW register reads must be returned after at most 1 wait state; in FIFO mode there is no such restriction and the command and address are always uploaded to software\nC) Both modes require HW register reads to return within 1 wait state; only CRB mode uploads the command and address to software\nD) FIFO mode never uploads commands to software; CRB mode returns HW register reads after at most 1 wait state", "answer_format": "multiple_choice", "gold_answer": "A", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (cross-section baseline)", "difficulty": "medium", "options": ["A) In FIFO mode HW register reads must be returned after at most 1 wait state; in CRB mode there is no such restriction and the command and address are always uploaded to software", "B) In CRB mode HW register reads must be returned after at most 1 wait state; in FIFO mode there is no such restriction and the command and address are always uploaded to software", "C) Both modes require HW register reads to return within 1 wait state; only CRB mode uploads the command and address to software", "D) FIFO mode never uploads commands to software; CRB mode returns HW register reads after at most 1 wait state"], "repair_note": "v2.1 2026-09-25: option list appended; gold letter assigned by shuffle"} {"id": "spi_device-t2-003", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/03_upload_passthrough.md", "license": "Apache-2.0"}, "spec_excerpt": "If the received command meets following conditions, the HW stores the command into the command/address FIFOs and the payload buffer:\n\n- The command does not match to the first 11 command information entries nor EN4B, EX4B, WREN, or WRDI.\n- The command matches any of the rest command information entries.\n- The matched entry has the *upload* field set.", "rtl_excerpt": null, "question": "Under what conditions does the hardware upload a received command?\n\nA) It matches one of the first 11 command entries, regardless of the upload field\nB) It matches EN4B, EX4B, WREN or WRDI and the matched entry has the upload field set\nC) Every received command is uploaded as long as it matches any configured command entry\nD) It does not match the first 11 command entries nor EN4B/EX4B/WREN/WRDI, it matches one of the remaining entries, and the matched entry has the upload field set", "answer_format": "multiple_choice", "gold_answer": "D", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (cross-section baseline)", "difficulty": "medium", "options": ["A) It matches one of the first 11 command entries, regardless of the upload field", "B) It matches EN4B, EX4B, WREN or WRDI and the matched entry has the upload field set", "C) Every received command is uploaded as long as it matches any configured command entry", "D) It does not match the first 11 command entries nor EN4B/EX4B/WREN/WRDI, it matches one of the remaining entries, and the matched entry has the upload field set"], "repair_note": "v2.1 2026-09-25: option list appended; gold letter assigned by shuffle"} {"id": "spi_device-t2-004", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/02_read_path.md", "license": "Apache-2.0"}, "spec_excerpt": "SW may configure the HW to handle the EN4B ([`CMD_INFO_EN4B`](registers.md#cmd_info_en4b)) and EX4B ([`CMD_INFO_EX4B`](registers.md#cmd_info_ex4b)) commands and change the address size for read commands between 3 bytes and 4 bytes.", "rtl_excerpt": null, "question": "What do the EN4B and EX4B commands do?\n\nA) They switch the SPI clock rate between 3 MHz and 4 MHz\nB) They change the address size for read commands between 3 bytes and 4 bytes\nC) They change the data payload size between 3 bytes and 4 bytes\nD) They enable or disable 3-byte versus 4-byte write commands", "answer_format": "multiple_choice", "gold_answer": "B", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (cross-section baseline)", "difficulty": "medium", "options": ["A) They switch the SPI clock rate between 3 MHz and 4 MHz", "B) They change the address size for read commands between 3 bytes and 4 bytes", "C) They change the data payload size between 3 bytes and 4 bytes", "D) They enable or disable 3-byte versus 4-byte write commands"], "repair_note": "v2.1 2026-09-25: option list appended; gold letter assigned by shuffle"} {"id": "spi_device-t2-005", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/02_read_path.md", "license": "Apache-2.0"}, "spec_excerpt": "It takes at most three SYS_CLK cycles to update the value in the `ADDR_MODE` register after the completion of the SPI transaction (CSb de-assertion).", "rtl_excerpt": null, "question": "After CSb de-assertion, how long does it take at most for ADDR_MODE to update?\n\nA) Exactly one SYS_CLK cycle\nB) At most three SPI_CLK cycles\nC) At most three SYS_CLK cycles\nD) Up to one full SPI transaction time", "answer_format": "multiple_choice", "gold_answer": "C", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (cross-section baseline)", "difficulty": "medium", "options": ["A) Exactly one SYS_CLK cycle", "B) At most three SPI_CLK cycles", "C) At most three SYS_CLK cycles", "D) Up to one full SPI transaction time"], "repair_note": "v2.1 2026-09-25: option list appended; gold letter assigned by shuffle"} {"id": "spi_device-t2-006", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/07_registers_cmdinfo_filter.md", "license": "Apache-2.0"}, "spec_excerpt": "If the bit corresponding to a received command's opcode is set,\nthe command is filtered (CSb is de-asserted) and does not reach the\ndownstream flash device.", "rtl_excerpt": null, "question": "What happens when a received command's opcode has its CMD_FILTER bit set?\n\nA) The command is filtered: CSb is de-asserted and the command does not reach the downstream flash device\nB) The command is uploaded to software and held until acknowledged\nC) CSb stays asserted and the command is forwarded with one wait state inserted\nD) The command is executed locally and its result is returned to the host", "answer_format": "multiple_choice", "gold_answer": "A", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (cross-section baseline)", "difficulty": "medium", "options": ["A) The command is filtered: CSb is de-asserted and the command does not reach the downstream flash device", "B) The command is uploaded to software and held until acknowledged", "C) CSb stays asserted and the command is forwarded with one wait state inserted", "D) The command is executed locally and its result is returned to the host"], "repair_note": "v2.1 2026-09-25: option list appended; gold letter assigned by shuffle"} {"id": "spi_device-t2-007", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/02_read_path.md", "license": "Apache-2.0"}, "spec_excerpt": "For commands with dummy cycles, the SPI Device IP can be configured to insert a 2-stage pipeline into the return path to enable higher clock rates.", "rtl_excerpt": null, "question": "What is the purpose of the configurable 2-stage pipeline in the read return path?\n\nA) To reduce power consumption in the read return path\nB) To support longer dummy-cycle counts\nC) To synchronize the read return path across clock domains\nD) To enable higher clock rates", "answer_format": "multiple_choice", "gold_answer": "D", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (cross-section baseline)", "difficulty": "medium", "options": ["A) To reduce power consumption in the read return path", "B) To support longer dummy-cycle counts", "C) To synchronize the read return path across clock domains", "D) To enable higher clock rates"], "repair_note": "v2.1 2026-09-25: option list appended; gold letter assigned by shuffle"} {"id": "spi_device-t3-001", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/02_read_path.md", "license": "Apache-2.0"}, "spec_excerpt": "In the current version, the read buffer size is 4kB.\n\n[Also stated:]\nThe IP only uses lower 11 bits of the received read command address (`addr[10:0]`) to issue the read requests to the DPSRAM", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_DEVICE spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"NUMERIC_MISMATCH\", \"location\": \"02_read_path.md, read buffer paragraph\", \"explanation\": \"The mutated paragraph claims a 4kB read buffer, but the device only uses addr[10:0], i.e. 11 address bits, which address exactly 2kB; a 4kB buffer would need 12 bits.\"}", "mutation": {"type": "changed_number", "original": "the read buffer size is 2kB", "mutated": "the read buffer size is 4kB", "location": "02_read_path.md, read buffer paragraph"}, "verification": "n/a (spec-only item)", "difficulty": "medium"} {"id": "spi_device-t3-002", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/03_upload_passthrough.md", "license": "Apache-2.0"}, "spec_excerpt": "If the host systems sends more than the maximum allowed payload size (currently 512B), `payload_start_idx` may be non-zero.\n\n[Also stated:]\nIn that case it is expected that [`UPLOAD_STATUS2.payload_depth`](registers.md#upload_status2) is the maximum payload size.\n\n[Also stated:]\nFor example, if 258 bytes of payload are issued, [`UPLOAD_STATUS2.payload_depth`](registers.md#upload_status2) will be 256 (as the Payload Buffer only has capacity for 256 bytes), but [`UPLOAD_STATUS2.payload_start_idx`](registers.md#upload_status2) will be 2.", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_DEVICE spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"NUMERIC_MISMATCH\", \"location\": \"03_upload_passthrough.md, payload paragraph\", \"explanation\": \"The mutated paragraph claims a 512B maximum payload, but the upload buffer and payload_depth accounting are sized for 256B; a 512B payload would overflow the payload buffer before payload_start_idx wraps.\"}", "mutation": {"type": "changed_number", "original": "(currently 256B)", "mutated": "(currently 512B)", "location": "03_upload_passthrough.md, payload paragraph"}, "verification": "n/a (spec-only item)", "difficulty": "medium"} {"id": "spi_device-t3-003", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/02_read_path.md", "license": "Apache-2.0"}, "spec_excerpt": "The SW may configure the number of dummy cycles for each individual read command, from 0 to 16 cycles.\n\n[Also stated:]\nBy contrast, Fast Read and Dual Output Read conventionally require 8 dummy cycles\n\n[Also stated:]\nCMD_INFO register bits 14:12 hold `dummy_size` (reset 0x7): the number of dummy cycles between this command's opcode/address phase and the payload phase, minus one. A 3-bit field cannot represent 16.", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_DEVICE spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"NUMERIC_MISMATCH\", \"location\": \"02_read_path.md, dummy-cycle paragraph\", \"explanation\": \"The mutated paragraph claims up to 16 dummy cycles are configurable, but the CMD_INFO dummy_size field is 3 bits (reset 0x7) and the conventional Fast Read requirement is 8; a 16-cycle setting is unrepresentable.\"}", "mutation": {"type": "changed_number", "original": "from 0 to 8 cycles", "mutated": "from 0 to 16 cycles", "location": "02_read_path.md, dummy-cycle paragraph"}, "verification": "n/a (spec-only item)", "difficulty": "medium"} {"id": "spi_device-t3-004", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/04_tpm_reliability.md", "license": "Apache-2.0"}, "spec_excerpt": "If the request is in the supported locality (0-5)\n\n[Also stated:]\nIf `invalid_locality` configuration is set, the logic returns `INVALID` value to the host system, when the host system sends a read request to the Locality greater than 4.", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_DEVICE spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"NUMERIC_MISMATCH\", \"location\": \"04_tpm_reliability.md, locality paragraph\", \"explanation\": \"The mutated paragraph claims locality 5 is supported, but the same section states the device may return INVALID for locality greater than 4; locality 5 cannot be both supported and invalid.\"}", "mutation": {"type": "changed_number", "original": "locality (0-4)", "mutated": "locality (0-5)", "location": "04_tpm_reliability.md, locality paragraph"}, "verification": "n/a (spec-only item)", "difficulty": "medium"} {"id": "spi_device-t3-005", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/01_flash_passthrough_modes.md", "license": "Apache-2.0"}, "spec_excerpt": "SPI Device currently provides 32 command information entries: [`CMD_INFO_0`-`CMD_INFO_23`](registers.md#cmd_info) and\n[`CMD_INFO_EN4B`](registers.md#cmd_info_en4b)-[`CMD_INFO_WRDI`](registers.md#cmd_info_wrdi).\n\n[Also stated:]\nThe first 11 command entries (`CMD_INFO_0`-`CMD_INFO_10`) are assigned to specific HW submodules.\nThe remaining 13 command entries are for generic SW use.", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_DEVICE spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"NUMERIC_MISMATCH\", \"location\": \"01_flash_passthrough_modes.md, command information list\", \"explanation\": \"The mutated paragraph claims 32 entries, but the enumerated list is CMD_INFO_0-23 (24 entries) plus 4 special entries = 28, and the breakdown (11 HW + 13 generic + 4 special) also sums to 28.\"}", "mutation": {"type": "changed_number", "original": "provides 28 command information entries", "mutated": "provides 32 command information entries", "location": "01_flash_passthrough_modes.md, command information list"}, "verification": "n/a (spec-only item)", "difficulty": "medium"} {"id": "spi_device-t3-006", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/06_registers_flash.md", "license": "Apache-2.0"}, "spec_excerpt": "Module stores bitstream from MSB to LSB if value is 1.\n\n[Also stated:]\n| 3 | rw | 0x0 | rx_order | RX bit order on SDI.", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_DEVICE spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"RULE_INVERSION\", \"location\": \"06_registers_flash.md, CFG.rx_order description\", \"explanation\": \"The mutated description claims MSB-to-LSB storage happens when rx_order is 1, but the register resets to 0x0, which is documented as the MSB-to-LSB setting; the inversion makes the reset value mean the opposite.\"}", "mutation": {"type": "rule_inversion", "original": "Module stores bitstream from MSB to LSB if value is 0.", "mutated": "Module stores bitstream from MSB to LSB if value is 1.", "location": "06_registers_flash.md, CFG.rx_order description"}, "verification": "n/a (spec-only item)", "difficulty": "medium"} {"id": "spi_device-t3-007", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/01_flash_passthrough_modes.md", "license": "Apache-2.0"}, "spec_excerpt": "In the unlikely case of multiple matching entries, the entry with the lowest index is used.\n\n[Also stated:]\nThe command parser looks for the received opcode byte in the *opcode* field of each command information entry.\nIf the opcode is found and the *valid* bit is set for that entry, the entry is *matched* and the submodule corresponding to the matched entry's index is activated", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_DEVICE spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"RULE_INVERSION\", \"location\": \"01_flash_passthrough_modes.md, command parser\", \"explanation\": \"The mutated paragraph selects the lowest-index match, but the parser rule gives priority to the highest index; with duplicate opcode entries the two rules activate different submodules.\"}", "mutation": {"type": "rule_inversion", "original": "the entry with the highest index is used", "mutated": "the entry with the lowest index is used", "location": "01_flash_passthrough_modes.md, command parser"}, "verification": "n/a (spec-only item)", "difficulty": "medium"} {"id": "spi_device-t3-008", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/01_flash_passthrough_modes.md", "license": "Apache-2.0"}, "spec_excerpt": "Note that the passthrough gate only updates on CSb assertion and derives its value from the committed `BUSY` bit.\n\n[Also stated:]\nThis means that after the `BUSY` bit is set, there must be at least one command before the passthrough gate will open again.", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_DEVICE spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"RULE_INVERSION\", \"location\": \"01_flash_passthrough_modes.md, passthrough gate\", \"explanation\": \"The mutated note claims the gate updates on CSb assertion, but the gate must be stable during the transaction and only re-evaluated between transactions at de-assertion; updating on assertion would change gating mid-transaction.\"}", "mutation": {"type": "rule_inversion", "original": "the passthrough gate only updates on CSb de-assertion", "mutated": "the passthrough gate only updates on CSb assertion", "location": "01_flash_passthrough_modes.md, passthrough gate"}, "verification": "n/a (spec-only item)", "difficulty": "medium"} {"id": "spi_device-t3-009", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/04_tpm_reliability.md", "license": "Apache-2.0"}, "spec_excerpt": "The SPI Device IP internally supports all four SPI modes (mode 0 through mode 3), where data is shifted out on the falling edge and sampled on the rising edge, and SPI clock returns to low at the end of the transaction.", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_DEVICE spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"RULE_INVERSION\", \"location\": \"04_tpm_reliability.md, SPI mode paragraph\", \"explanation\": \"The mutated sentence claims all four SPI modes are supported, yet in the same breath describes mode-0-only timing (shift on falling edge, sample on rising edge, clock returns low); modes 1-3 use different polarity/phase, so the sentence contradicts itself.\"}", "mutation": {"type": "rule_inversion", "original": "The SPI Device IP only internally supports mode 0", "mutated": "The SPI Device IP internally supports all four SPI modes (mode 0 through mode 3)", "location": "04_tpm_reliability.md, SPI mode paragraph"}, "verification": "n/a (spec-only item)", "difficulty": "medium"} {"id": "spi_device-t3-010", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/04_tpm_reliability.md", "license": "Apache-2.0"}, "spec_excerpt": "the logic always sends `START(0x01)` at the last byte of the incoming address phase.\n\n[Also stated:]\nThe module sends `START(0x01)` at the next byte followed by the actual return-by-HW value if the received address falls into the list of the return-by-HW registers.", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_DEVICE spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"RULE_INVERSION\", \"location\": \"04_tpm_reliability.md, TPM response bytes\", \"explanation\": \"The mutated paragraph claims START(0x01) is sent at the last address byte, but the next sentence sends START(0x01) at the following byte; START cannot occupy both bytes, and WAIT is what buys time during the address phase.\"}", "mutation": {"type": "rule_inversion", "original": "the logic always sends `WAIT(0x00)` at the last byte of the incoming address phase", "mutated": "the logic always sends `START(0x01)` at the last byte of the incoming address phase", "location": "04_tpm_reliability.md, TPM response bytes"}, "verification": "n/a (spec-only item)", "difficulty": "medium"} {"id": "spi_device-t3-011", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/02_read_path.md", "license": "Apache-2.0"}, "spec_excerpt": "The SW may configure the number of dummy cycles for each individual read command, from 0 to 8 cycles.\n\n[Read command conventions:]\nBy contrast, Fast Read and Dual Output Read conventionally require 16 dummy cycles", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_DEVICE spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"CROSSREF_CONFLICT\", \"location\": \"02_read_path.md, dummy-cycle configuration vs conventions\", \"explanation\": \"The configuration paragraph caps dummy cycles at 8, while the mutated conventions paragraph requires 16 for Fast Read/Dual Output Read; the conventional requirement exceeds the configurable maximum.\"}", "mutation": {"type": "changed_number", "original": "conventionally require 8 dummy cycles", "mutated": "conventionally require 16 dummy cycles", "location": "02_read_path.md, dummy-cycle configuration vs conventions"}, "verification": "n/a (spec-only item)", "difficulty": "hard"} {"id": "spi_device-t3-012", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/03_upload_passthrough.md", "license": "Apache-2.0"}, "spec_excerpt": "The first 11 command entries (`CMD_INFO_0`-`CMD_INFO_10`) are assigned to specific HW submodules.\n\n[Upload conditions:]\n- The command does not match to the first 12 command information entries nor EN4B, EX4B, WREN, or WRDI.", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_DEVICE spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"CROSSREF_CONFLICT\", \"location\": \"01_flash_passthrough_modes.md vs 03_upload_passthrough.md\", \"explanation\": \"The command list assigns the first 11 entries (CMD_INFO_0-10) to HW submodules, but the mutated upload condition excludes the first 12, i.e. it also excludes CMD_INFO_11, which is a generic SW entry eligible for upload.\"}", "mutation": {"type": "changed_number", "original": "does not match to the first 11 command information entries", "mutated": "does not match to the first 12 command information entries", "location": "01_flash_passthrough_modes.md vs 03_upload_passthrough.md"}, "verification": "n/a (spec-only item)", "difficulty": "hard"} {"id": "spi_device-t3-013", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/02_read_path.md", "license": "Apache-2.0"}, "spec_excerpt": "The read command region has two 1kB buffers.\n\n[Buffer management:]\nIf HW receives the read access to the next quarter of the space first time, then the HW reports to the SW to refill the current 512B region with new content.\n\n[Also stated:]\nThis is designed so that SW implements a double-buffering scheme - when the host system accesses one half of the read buffer (1kB), the SW should prepare the other 1kB by copying data from the internal non-volatile memory.", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_DEVICE spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"CROSSREF_CONFLICT\", \"location\": \"02_read_path.md, buffer organization vs buffer management\", \"explanation\": \"The region paragraph describes two 1kB buffers with a double-buffering scheme, but the mutated management paragraph describes four 512B quarters; the readbuf_flip interrupt fires on buffer-boundary crossing, which is only well-defined for the two-buffer organization.\"}", "mutation": {"type": "rule_inversion", "original": "refill the current 1kB region with new content", "mutated": "refill the current 512B region with new content", "location": "02_read_path.md, buffer organization vs buffer management"}, "verification": "n/a (spec-only item)", "difficulty": "hard"} {"id": "spi_device-t3-014", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/03_upload_passthrough.md", "license": "Apache-2.0"}, "spec_excerpt": "This bit is set by HW when a matched command with [`CMD_INFO.upload`](#cmd_info) and [`CMD_INFO.busy`](#cmd_info) set is received.\n\n[Upload module:]\nIf the *busy* field in the command information entry is set, the upload module clears the `BUSY` bit in the [`FLASH_STATUS`](registers.md#flash_status) register.", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_DEVICE spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"CROSSREF_CONFLICT\", \"location\": \"06_registers_flash.md vs 03_upload_passthrough.md\", \"explanation\": \"The FLASH_STATUS register description says the busy bit is set by HW on a matched upload+busy command, while the mutated upload paragraph claims the upload module clears it; the same event cannot both set and clear the bit.\"}", "mutation": {"type": "rule_inversion", "original": "the upload module also sets `BUSY` bit", "mutated": "the upload module clears the `BUSY` bit", "location": "06_registers_flash.md vs 03_upload_passthrough.md"}, "verification": "n/a (spec-only item)", "difficulty": "hard"} {"id": "spi_device-t3-015", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/01_flash_passthrough_modes.md", "license": "Apache-2.0"}, "spec_excerpt": "In the unlikely case of multiple matching entries, the entry is used.\n\n[Also stated:]\nThe command parser looks for the received opcode byte in the *opcode* field of each command information entry.\nIf the opcode is found and the *valid* bit is set for that entry, the entry is *matched* and the submodule corresponding to the matched entry's index is activated", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_DEVICE spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"MISSING_CONDITION\", \"location\": \"01_flash_passthrough_modes.md, command parser\", \"explanation\": \"The mutated paragraph drops the 'with the highest index' tie-break, leaving 'the entry is used' ambiguous, while the parser description allows multiple entries to match (opcode + valid); the deleted tie-break was what made the selection deterministic.\"}", "mutation": {"type": "deleted_condition", "original": "the entry with the highest index is used", "mutated": "the entry is used", "location": "01_flash_passthrough_modes.md, command parser"}, "verification": "n/a (spec-only item)", "difficulty": "hard"} {"id": "spi_device-t3-016", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/04_tpm_reliability.md", "license": "Apache-2.0"}, "spec_excerpt": "The SW is allowed to modify the return-by-HW registers.\n\n[Also stated:]\nThe module latches the CSRs from the SYS_CLK domain into the SPI SCK domain when CSb is asserted.", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_DEVICE spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"MISSING_CONDITION\", \"location\": \"04_tpm_reliability.md, return-by-HW registers\", \"explanation\": \"The mutated paragraph drops the 'when CSb is de-asserted' condition, permitting modification at any time, while the same section states the CSRs are latched into the SPI clock domain when CSb is asserted; modifying them mid-transaction races the latch, and the deleted condition prevented that.\"}", "mutation": {"type": "deleted_condition", "original": "The SW is allowed to modify the return-by-HW registers when CSb is de-asserted.", "mutated": "The SW is allowed to modify the return-by-HW registers.", "location": "04_tpm_reliability.md, return-by-HW registers"}, "verification": "n/a (spec-only item)", "difficulty": "hard"} {"id": "spi_device-t3-017", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/03_upload_passthrough.md", "license": "Apache-2.0"}, "spec_excerpt": "SW should read from `payload_start_idx` to the end of the payload buffer.\n\n[Also stated:]\nIf the host systems sends more than the maximum allowed payload size (currently 256B), `payload_start_idx` may be non-zero.", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_DEVICE spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"MISSING_CONDITION\", \"location\": \"03_upload_passthrough.md, payload read sequence\", \"explanation\": \"The mutated paragraph drops the second read from the beginning of the buffer, but payload_start_idx is non-zero exactly when the payload wrapped around the 256B buffer; without the second read the wrapped bytes at the buffer start are never read.\"}", "mutation": {"type": "deleted_condition", "original": "then do a second read from the beginning of the buffer to read the remaining bytes", "mutated": "(sentence deleted)", "location": "03_upload_passthrough.md, payload read sequence"}, "verification": "n/a (spec-only item)", "difficulty": "hard"} {"id": "spi_device-t3-018", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/doc/04_tpm_reliability.md", "license": "Apache-2.0"}, "spec_excerpt": "The TPM submodule accepts the payload for the TPM write command without the `WAIT` state.\n\n[Also stated:]\nIn other case, the TPM submodule sends `WAIT` until the write and command FIFOs become available (empty).", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_DEVICE spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"MISSING_CONDITION\", \"location\": \"04_tpm_reliability.md, TPM write flow\", \"explanation\": \"The mutated paragraph drops the 'if the write and command FIFOs are empty' condition, claiming WAIT is never needed, while the same section states the submodule sends `WAIT` until the FIFOs become available; the deleted condition reconciled the two.\"}", "mutation": {"type": "deleted_condition", "original": "without the `WAIT` state if the write and command FIFOs are empty", "mutated": "without the `WAIT` state", "location": "04_tpm_reliability.md, TPM write flow"}, "verification": "n/a (spec-only item)", "difficulty": "hard"} {"id": "spi_device-t4-001", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/rtl/spid_csb_sync.sv", "license": "Apache-2.0"}, "spec_excerpt": "Note that the passthrough gate only updates on CSb de-assertion and derives its value from the committed `BUSY` bit.\nThis means that after the `BUSY` bit is set, there must be at least one command before the passthrough gate will open again.", "rtl_excerpt": "1: always_ff @(posedge sck_i or negedge rst_ni) begin\n2: if (!rst_ni) begin\n3: sck_toggle <= 1'b1; // <-- MUTATED\n4: end else begin\n5: if (sck_pulse_en_i) begin", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "The passthrough gate only updates on CSb de-assertion and derives its value from the committed BUSY bit.", "category": "NUMERIC_MISMATCH", "rtl_location": "hw/ip/spi_device/rtl/spid_csb_sync.sv:33", "explanation": "sck_toggle resets to 1 instead of 0, so the first CSb de-assertion looks like a toggle event even with no SCK activity; a phantom de-assertion pulse is emitted. This phantom pulse drives the passthrough gate update path, causing the gate to update without an actual CSb de-assertion, violating the 'only updates on CSb de-assertion' rule."}, "mutation": {"type": "wrong_reset_value", "original": " sck_toggle <= 1'b0;", "mutated": " sck_toggle <= 1'b1;", "location": "hw/ip/spi_device/rtl/spid_csb_sync.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_device-001 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/work_a/sim_scout/stubs/prim_flop_2sync.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_device-001.log for RESULT: DIFFER", "difficulty": "medium"} {"id": "spi_device-t4-002", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/rtl/spid_csb_sync.sv", "license": "Apache-2.0"}, "spec_excerpt": "Note that the passthrough gate only updates on CSb de-assertion and derives its value from the committed `BUSY` bit.\nThis means that after the `BUSY` bit is set, there must be at least one command before the passthrough gate will open again.", "rtl_excerpt": "1: always_ff @(posedge csb_i or negedge rst_ni) begin\n2: if (!rst_ni) begin\n3: csb_toggle <= 1'b1; // <-- MUTATED\n4: end else begin\n5: csb_toggle <= sck_toggle;", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "The passthrough gate only updates on CSb de-assertion and derives its value from the committed BUSY bit.", "category": "NUMERIC_MISMATCH", "rtl_location": "hw/ip/spi_device/rtl/spid_csb_sync.sv:45", "explanation": "csb_toggle resets to 1 instead of 0, so the first CSb de-assertion captures a 1-to-0 change and emits a phantom pulse even though nothing happened on the bus. This phantom pulse drives the passthrough gate update path, causing the gate to update without an actual CSb de-assertion, violating the 'only updates on CSb de-assertion' rule."}, "mutation": {"type": "wrong_reset_value", "original": " csb_toggle <= 1'b0;", "mutated": " csb_toggle <= 1'b1;", "location": "hw/ip/spi_device/rtl/spid_csb_sync.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_device-002 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/work_a/sim_scout/stubs/prim_flop_2sync.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_device-002.log for RESULT: DIFFER", "difficulty": "medium"} {"id": "spi_device-t4-003", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/rtl/spid_csb_sync.sv", "license": "Apache-2.0"}, "spec_excerpt": "Note that the passthrough gate only updates on CSb de-assertion and derives its value from the committed `BUSY` bit.\nThis means that after the `BUSY` bit is set, there must be at least one command before the passthrough gate will open again.", "rtl_excerpt": "1: always_ff @(posedge clk_i or negedge rst_ni) begin\n2: if (!rst_ni) begin\n3: sys_toggle_last <= 1'b1; // <-- MUTATED\n4: end else begin\n5: sys_toggle_last <= sys_toggle;", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "The passthrough gate only updates on CSb de-assertion and derives its value from the committed BUSY bit.", "category": "NUMERIC_MISMATCH", "rtl_location": "hw/ip/spi_device/rtl/spid_csb_sync.sv:64", "explanation": "sys_toggle_last resets to 1 while the synchronizer output is 0, so the difference detector immediately reports a (nonexistent) toggle and asserts a phantom pulse."}, "mutation": {"type": "wrong_reset_value", "original": " sys_toggle_last <= 1'b0;", "mutated": " sys_toggle_last <= 1'b1;", "location": "hw/ip/spi_device/rtl/spid_csb_sync.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_device-003 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/work_a/sim_scout/stubs/prim_flop_2sync.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_device-003.log for RESULT: DIFFER", "difficulty": "easy"} {"id": "spi_device-t4-004", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/rtl/spid_csb_sync.sv", "license": "Apache-2.0"}, "spec_excerpt": "It takes at most three SYS_CLK cycles to update the value in the `ADDR_MODE` register after the completion of the SPI transaction (CSb de-assertion).", "rtl_excerpt": "1: \n2: // clk_i is asynchronous to CSB/SCK, so use a synchronizer.\n3: prim_flop_3sync #( // <-- MUTATED\n4: .Width (1)\n5: ) u_count_sync (", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "It takes at most three SYS_CLK cycles to update the value in the ADDR_MODE register after the completion of the SPI transaction (CSb de-assertion).", "category": "NUMERIC_MISMATCH", "rtl_location": "hw/ip/spi_device/rtl/spid_csb_sync.sv:52", "explanation": "The toggle synchronizer gains a third stage, delaying the de-assertion pulse by one extra SYS_CLK cycle; the pulse now arrives later than the specified at-most-three-cycle bound."}, "mutation": {"type": "off_by_one", "original": " prim_flop_2sync #(\n .Width (1)\n ) u_count_sync (", "mutated": " prim_flop_3sync #(\n .Width (1)\n ) u_count_sync (", "location": "hw/ip/spi_device/rtl/spid_csb_sync.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_device-004 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/work_a/sim_scout/stubs/prim_flop_2sync.sv prim_flop_3sync.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_device-004.log for RESULT: DIFFER", "difficulty": "hard"} {"id": "spi_device-t4-005", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/rtl/spid_csb_sync.sv", "license": "Apache-2.0"}, "spec_excerpt": "Note that the passthrough gate only updates on CSb de-assertion and derives its value from the committed `BUSY` bit.\nThis means that after the `BUSY` bit is set, there must be at least one command before the passthrough gate will open again.", "rtl_excerpt": "1: sck_toggle <= 1'b0;\n2: end else begin\n3: if (!sck_pulse_en_i) begin // <-- MUTATED\n4: sck_toggle <= ~csb_toggle;\n5: end", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "The passthrough gate only updates on CSb de-assertion and derives its value from the committed BUSY bit.", "category": "MISSING_CONDITION", "rtl_location": "hw/ip/spi_device/rtl/spid_csb_sync.sv:35", "explanation": "The sck_pulse_en_i gate is inverted, so the SCK toggle is armed only when the pulse input is disabled; with it enabled the de-assertion is never detected and no pulse is emitted."}, "mutation": {"type": "inverted_enable", "original": " if (sck_pulse_en_i) begin", "mutated": " if (!sck_pulse_en_i) begin", "location": "hw/ip/spi_device/rtl/spid_csb_sync.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_device-005 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/work_a/sim_scout/stubs/prim_flop_2sync.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_device-005.log for RESULT: DIFFER", "difficulty": "easy"} {"id": "spi_device-t4-006", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/rtl/spid_csb_sync.sv", "license": "Apache-2.0"}, "spec_excerpt": "Note that the passthrough gate only updates on CSb de-assertion and derives its value from the committed `BUSY` bit.\nThis means that after the `BUSY` bit is set, there must be at least one command before the passthrough gate will open again.", "rtl_excerpt": "1: end else begin\n2: if (sck_pulse_en_i) begin\n3: // sck_toggle update removed // <-- MUTATED\n4: end\n5: end", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "The passthrough gate only updates on CSb de-assertion and derives its value from the committed BUSY bit.", "category": "MISSING_CONDITION", "rtl_location": "hw/ip/spi_device/rtl/spid_csb_sync.sv:36", "explanation": "The sck_toggle update on the SCK pulse is deleted, so the toggle never changes and the CSb de-assertion capture sees no difference; no pulse is ever emitted."}, "mutation": {"type": "missing_fsm_transition", "original": " sck_toggle <= ~csb_toggle;", "mutated": " // sck_toggle update removed", "location": "hw/ip/spi_device/rtl/spid_csb_sync.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_device-006 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/work_a/sim_scout/stubs/prim_flop_2sync.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_device-006.log for RESULT: DIFFER", "difficulty": "medium"} {"id": "spi_device-t4-007", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/rtl/spid_csb_sync.sv", "license": "Apache-2.0"}, "spec_excerpt": "Note that the passthrough gate only updates on CSb de-assertion and derives its value from the committed `BUSY` bit.\nThis means that after the `BUSY` bit is set, there must be at least one command before the passthrough gate will open again.", "rtl_excerpt": "1: end else begin\n2: if (sck_pulse_en_i) begin\n3: sck_toggle <= csb_toggle; // <-- MUTATED\n4: end\n5: end", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "The passthrough gate only updates on CSb de-assertion and derives its value from the committed BUSY bit.", "category": "RULE_INVERSION", "rtl_location": "hw/ip/spi_device/rtl/spid_csb_sync.sv:36", "explanation": "sck_toggle copies csb_toggle instead of complementing it, so the toggle never actually toggles; the CSb de-assertion capture sees no change and no pulse is emitted."}, "mutation": {"type": "inverted_enable", "original": " sck_toggle <= ~csb_toggle;", "mutated": " sck_toggle <= csb_toggle;", "location": "hw/ip/spi_device/rtl/spid_csb_sync.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_device-007 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/work_a/sim_scout/stubs/prim_flop_2sync.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_device-007.log for RESULT: DIFFER", "difficulty": "medium"} {"id": "spi_device-t4-008", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/rtl/spid_csb_sync.sv", "license": "Apache-2.0"}, "spec_excerpt": "Note that the passthrough gate only updates on CSb de-assertion and derives its value from the committed `BUSY` bit.\nThis means that after the `BUSY` bit is set, there must be at least one command before the passthrough gate will open again.", "rtl_excerpt": "1: .clk_i,\n2: .rst_ni,\n3: .d_i (sck_toggle), // <-- MUTATED\n4: .q_o (sys_toggle)\n5: );", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "The passthrough gate only updates on CSb de-assertion and derives its value from the committed BUSY bit.", "category": "RULE_INVERSION", "rtl_location": "hw/ip/spi_device/rtl/spid_csb_sync.sv:57", "explanation": "The synchronizer samples sck_toggle instead of csb_toggle, so the de-assertion pulse fires on SCK activity alone, before any CSb de-assertion; the output no longer tracks de-assertion events."}, "mutation": {"type": "field_offset_error", "original": " .d_i (csb_toggle),", "mutated": " .d_i (sck_toggle),", "location": "hw/ip/spi_device/rtl/spid_csb_sync.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_device-008 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/work_a/sim_scout/stubs/prim_flop_2sync.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_device-008.log for RESULT: DIFFER", "difficulty": "medium"} {"id": "spi_device-t4-009", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/rtl/spid_csb_sync.sv", "license": "Apache-2.0"}, "spec_excerpt": "Note that the passthrough gate only updates on CSb de-assertion and derives its value from the committed `BUSY` bit.\nThis means that after the `BUSY` bit is set, there must be at least one command before the passthrough gate will open again.", "rtl_excerpt": "1: // Signal CSB de-assertion with a change in count, but only do it if the\n2: // change originated from the SCK domain.\n3: always_ff @(negedge csb_i or negedge rst_ni) begin // <-- MUTATED\n4: if (!rst_ni) begin\n5: csb_toggle <= 1'b0;", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "The passthrough gate only updates on CSb de-assertion and derives its value from the committed BUSY bit.", "category": "RULE_INVERSION", "rtl_location": "hw/ip/spi_device/rtl/spid_csb_sync.sv:43", "explanation": "csb_toggle is captured on the CSb falling edge (assertion) instead of the rising edge (de-assertion), so the pulse fires when the transaction starts rather than when it completes."}, "mutation": {"type": "inverted_enable", "original": " always_ff @(posedge csb_i or negedge rst_ni) begin", "mutated": " always_ff @(negedge csb_i or negedge rst_ni) begin", "location": "hw/ip/spi_device/rtl/spid_csb_sync.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_device-009 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/work_a/sim_scout/stubs/prim_flop_2sync.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_device-009.log for RESULT: DIFFER", "difficulty": "medium"} {"id": "spi_device-t4-010", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/rtl/spid_csb_sync.sv", "license": "Apache-2.0"}, "spec_excerpt": "Note that the passthrough gate only updates on CSb de-assertion and derives its value from the committed `BUSY` bit.\nThis means that after the `BUSY` bit is set, there must be at least one command before the passthrough gate will open again.", "rtl_excerpt": "29: // CSB and SCK have setup / hold relationships for SPI flash devices. Only\n30: // change counts on CSB posedge if there is at least one SCK cycle.\n31: always_ff @(posedge sck_i or negedge rst_ni) begin\n32: if (!rst_ni) begin\n33: sck_toggle <= 1'b0;\n34: end else begin\n35: end\n35b: // <-- MUTATED: DELETED 'if (sck_pulse_en_i) begin sck_toggle <= ~csb_toggle; end' (sck_toggle never toggles)\n36: end\n37: \n38: // Signal CSB de-assertion with a change in count, but only do it if the\n[mutated line(s): 35 (deleted block)]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "The passthrough gate only updates on CSb de-assertion and derives its value from the committed BUSY bit.", "category": "MISSING_CONDITION", "rtl_location": "hw/ip/spi_device/rtl/spid_csb_sync.sv:31", "explanation": "The sck_pulse_en_i arm that toggles sck_toggle is deleted, so the toggle never changes and the CSb de-assertion capture sees no difference; no pulse is ever emitted."}, "mutation": {"type": "missing_fsm_transition", "original": " end else begin\n if (sck_pulse_en_i) begin\n sck_toggle <= ~csb_toggle;\n end\n end", "mutated": " end else begin\n end", "location": "hw/ip/spi_device/rtl/spid_csb_sync.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_device-010 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/work_a/sim_scout/stubs/prim_flop_2sync.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_device-010.log for RESULT: DIFFER", "difficulty": "medium"} {"id": "spi_device-t4-011", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/rtl/spid_csb_sync.sv", "license": "Apache-2.0"}, "spec_excerpt": "Note that the passthrough gate only updates on CSb de-assertion and derives its value from the committed `BUSY` bit.\nThis means that after the `BUSY` bit is set, there must be at least one command before the passthrough gate will open again.", "rtl_excerpt": "1: // Signal CSB de-assertion with a change in count, but only do it if the\n2: // change originated from the SCK domain.\n3: always_ff @(posedge csb_i or negedge rst_ni) begin // <-- MUTATED\n4: if (!rst_ni) begin\n5: csb_toggle <= 1'b0;", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "The passthrough gate only updates on CSb de-assertion and derives its value from the committed BUSY bit.", "category": "MISSING_CONDITION", "rtl_location": "hw/ip/spi_device/rtl/spid_csb_sync.sv:43", "explanation": "The csb_toggle capture arm on the CSb de-assertion edge is deleted, so the toggle is never sampled into the system domain and no pulse is ever emitted."}, "mutation": {"type": "missing_fsm_transition", "original": " if (!rst_ni) begin\n csb_toggle <= 1'b0;\n end else begin\n csb_toggle <= sck_toggle;\n end", "mutated": " if (!rst_ni) begin\n csb_toggle <= 1'b0;\n end", "location": "hw/ip/spi_device/rtl/spid_csb_sync.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_device-011 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/work_a/sim_scout/stubs/prim_flop_2sync.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_device-011.log for RESULT: DIFFER", "difficulty": "medium"} {"id": "spi_device-t4-012", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/rtl/spid_csb_sync.sv", "license": "Apache-2.0"}, "spec_excerpt": "It takes at most three SYS_CLK cycles to update the value in the `ADDR_MODE` register after the completion of the SPI transaction (CSb de-assertion).", "rtl_excerpt": "1: sys_toggle_last <= 1'b0;\n2: end else begin\n3: // sys_toggle_last update removed // <-- MUTATED\n4: end\n5: end", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "It takes at most three SYS_CLK cycles to update the value in the ADDR_MODE register after the completion of the SPI transaction (CSb de-assertion).", "category": "MISSING_CONDITION", "rtl_location": "hw/ip/spi_device/rtl/spid_csb_sync.sv:66", "explanation": "The sys_toggle_last update is deleted, so the difference detector never re-arms; the output sticks high after the first de-assertion instead of producing a bounded single-cycle pulse."}, "mutation": {"type": "missing_fsm_transition", "original": " sys_toggle_last <= sys_toggle;", "mutated": " // sys_toggle_last update removed", "location": "hw/ip/spi_device/rtl/spid_csb_sync.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_device-012 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/work_a/sim_scout/stubs/prim_flop_2sync.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_device-012.log for RESULT: DIFFER", "difficulty": "medium"} {"id": "spi_device-t4-013", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/rtl/spi_s2p.sv", "license": "Apache-2.0"}, "spec_excerpt": "| 3 | rw | 0x0 | rx_order | RX bit order on SDI. Module stores bitstream from MSB to LSB if value is 0. |", "rtl_excerpt": "1: always_ff @(posedge clk_i or negedge rst_ni) begin\n2: if (!rst_ni) begin\n3: cnt <= count_t'(Bits-2); // <-- MUTATED\n4: end else if (cnt == '0) begin\n5: cnt <= count_t'(Bits-1);", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "RX bit order on SDI. Module stores bitstream from MSB to LSB if value is 0.", "category": "NUMERIC_MISMATCH", "rtl_location": "hw/ip/spi_device/rtl/spi_s2p.sv:78", "explanation": "The window counter resets to Bits-2 instead of Bits-1, so data_valid_o is delayed by one bit window relative to the received bitstream."}, "mutation": {"type": "wrong_reset_value", "original": " if (!rst_ni) begin\n cnt <= count_t'(Bits-1);", "mutated": " if (!rst_ni) begin\n cnt <= count_t'(Bits-2);", "location": "hw/ip/spi_device/rtl/spi_s2p.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_device-013 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/work_a/sim_scout/stubs/spi_device_pkg_sim.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_device-013.log for RESULT: DIFFER", "difficulty": "medium"} {"id": "spi_device-t4-014", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/rtl/spi_s2p.sv", "license": "Apache-2.0"}, "spec_excerpt": "| 3 | rw | 0x0 | rx_order | RX bit order on SDI. Module stores bitstream from MSB to LSB if value is 0. |", "rtl_excerpt": "1: end else begin\n2: unique case (io_mode_i)\n3: SingleIO: cnt <= cnt - count_t'('h1); // <-- MUTATED\n4: DualIO: cnt <= cnt - count_t'('h1); // <-- MUTATED\n5: QuadIO: cnt <= cnt - count_t'('h4);\n6: default: cnt <= cnt;", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "RX bit order on SDI. Module stores bitstream from MSB to LSB if value is 0.", "category": "NUMERIC_MISMATCH", "rtl_location": "hw/ip/spi_device/rtl/spi_s2p.sv:83", "explanation": "The dual-IO window counter decrements by 1 instead of 2 per window, so data_valid_o asserts two windows late relative to the received bitstream."}, "mutation": {"type": "off_by_one", "original": " DualIO: cnt <= cnt - count_t'('h2);", "mutated": " DualIO: cnt <= cnt - count_t'('h1);", "location": "hw/ip/spi_device/rtl/spi_s2p.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_device-014 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/work_a/sim_scout/stubs/spi_device_pkg_sim.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_device-014.log for RESULT: DIFFER", "difficulty": "hard"} {"id": "spi_device-t4-016", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/rtl/spi_s2p.sv", "license": "Apache-2.0"}, "spec_excerpt": "| 3 | rw | 0x0 | rx_order | RX bit order on SDI. Module stores bitstream from MSB to LSB if value is 0. |", "rtl_excerpt": "1: SingleIO: cnt <= cnt - count_t'('h1);\n2: DualIO: cnt <= cnt - count_t'('h2);\n3: QuadIO: cnt <= cnt - count_t'('h3); // <-- MUTATED\n4: default: cnt <= cnt;\n5: endcase", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "RX bit order on SDI. Module stores bitstream from MSB to LSB if value is 0.", "category": "NUMERIC_MISMATCH", "rtl_location": "hw/ip/spi_device/rtl/spi_s2p.sv:85", "explanation": "The quad-IO window counter decrements by 3 instead of 4 per window, so data_valid_o never lines up with the actual end of the received nibble stream."}, "mutation": {"type": "off_by_one", "original": " QuadIO: cnt <= cnt - count_t'('h4);", "mutated": " QuadIO: cnt <= cnt - count_t'('h3);", "location": "hw/ip/spi_device/rtl/spi_s2p.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_device-016 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/work_a/sim_scout/stubs/spi_device_pkg_sim.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_device-016.log for RESULT: DIFFER", "difficulty": "easy"} {"id": "spi_device-t4-017", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/rtl/spi_s2p.sv", "license": "Apache-2.0"}, "spec_excerpt": "| 3 | rw | 0x0 | rx_order | RX bit order on SDI. Module stores bitstream from MSB to LSB if value is 0. |", "rtl_excerpt": "1: \n2: DualIO: begin\n3: data_d = (order_i) ? {s_i[1:0], data_q[7:2]} : {s_i[1:0], data_q[5:0]}; // <-- MUTATED\n4: end", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "RX bit order on SDI. Module stores bitstream from MSB to LSB if value is 0.", "category": "RULE_INVERSION", "rtl_location": "hw/ip/spi_device/rtl/spi_s2p.sv:51", "explanation": "The DualIO order=0 arm shifts each received pair in from the MSB side ({s_i[1:0], data_q[5:0]}) instead of the LSB side, so the assembled byte is pair-reversed relative to the specified bit order."}, "mutation": {"type": "field_offset_error", "original": " data_d = (order_i) ? {s_i[1:0], data_q[7:2]} : {data_q[5:0], s_i[1:0]};", "mutated": " data_d = (order_i) ? {s_i[1:0], data_q[7:2]} : {s_i[1:0], data_q[5:0]};", "location": "hw/ip/spi_device/rtl/spi_s2p.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_device-017 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/work_a/sim_scout/stubs/spi_device_pkg_sim.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_device-017.log for RESULT: DIFFER", "difficulty": "medium"} {"id": "spi_device-t4-018", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_device/rtl/spi_s2p.sv", "license": "Apache-2.0"}, "spec_excerpt": "| 3 | rw | 0x0 | rx_order | RX bit order on SDI. Module stores bitstream from MSB to LSB if value is 0. |", "rtl_excerpt": "1: unique case (io_mode_i)\n2: SingleIO: begin\n3: data_d = (order_i) ? {s_i[0], data_q[7:1]} : {s_i[0], data_q[7:1]}; // <-- MUTATED\n4: end", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "RX bit order on SDI. Module stores bitstream from MSB to LSB if value is 0.", "category": "RULE_INVERSION", "rtl_location": "hw/ip/spi_device/rtl/spi_s2p.sv:47", "explanation": "The single-IO order=0 arm is reversed to {s_i[0], data_q[7:1]}, so the received bitstream is assembled LSB-first and the byte comes out bit-reversed relative to the specified MSB-to-LSB order."}, "mutation": {"type": "field_offset_error", "original": " data_d = (order_i) ? {s_i[0], data_q[7:1]} : {data_q[6:0], s_i[0]};", "mutated": " data_d = (order_i) ? {s_i[0], data_q[7:1]} : {s_i[0], data_q[7:1]};", "location": "hw/ip/spi_device/rtl/spi_s2p.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_device-018 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/work_a/sim_scout/stubs/spi_device_pkg_sim.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_device-018.log for RESULT: DIFFER", "difficulty": "hard"} {"id": "spi_host-t1-001", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/08_registers_key.md", "license": "Apache-2.0"}, "spec_excerpt": "### COMMAND . LEN\nSegment Length.\n\n For read or write segments, this field controls the\n number of 1-byte bursts to transmit and or receive in\n this command segment. The number of cycles required\n to send or received a byte will depend on [`COMMAND.SPEED.`](#command)\n For dummy segments, ([`COMMAND.DIRECTION`](#command) == 0), this register\n controls the number of dummy cycles to issue.\n The number of bytes (or dummy cycles) in the segment will be\n equal to [`COMMAND.LEN`](#command) + 1.", "rtl_excerpt": null, "question": "According to the COMMAND.LEN register description, how many bytes (or dummy cycles) does a segment contain, as a function of the LEN field value?", "answer_format": "exact_value", "gold_answer": "COMMAND.LEN + 1", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (retrieval baseline)", "difficulty": "easy"} {"id": "spi_host-t1-002", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/08_registers_key.md", "license": "Apache-2.0"}, "spec_excerpt": "### COMMAND . SPEED\nThe speed for this command segment: \"0\" = Standard SPI. \"1\" = Dual SPI.\n \"2\"=Quad SPI, \"3\": RESERVED.", "rtl_excerpt": null, "question": "According to the COMMAND.SPEED description, which SPEED field value is RESERVED?", "answer_format": "exact_value", "gold_answer": "3", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (retrieval baseline)", "difficulty": "easy"} {"id": "spi_host-t1-003", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/03_segment_fields_csid.md", "license": "Apache-2.0"}, "spec_excerpt": "| [LEN](registers.md#command--len) | 8 | [0:255] |", "rtl_excerpt": null, "question": "According to the segment field table, how wide is the LEN field and what values can it take?", "answer_format": "exact_value", "gold_answer": "8 bits wide, values [0:255]", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (retrieval baseline)", "difficulty": "easy"} {"id": "spi_host-t1-004", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/08_registers_key.md", "license": "Apache-2.0"}, "spec_excerpt": "### CONFIGOPTS . CLKDIV\nCore clock divider. Slows down subsequent SPI transactions by a\n factor of (CLKDIV+1) relative to the core clock frequency. The\n period of sck, T(sck) then becomes `2*(CLK_DIV+1)*T(core)`", "rtl_excerpt": null, "question": "By what factor does CONFIGOPTS.CLKDIV slow down SPI transactions relative to the core clock frequency?", "answer_format": "exact_value", "gold_answer": "(CLKDIV+1)", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (retrieval baseline)", "difficulty": "easy"} {"id": "spi_host-t1-005", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/08_registers_key.md", "license": "Apache-2.0"}, "spec_excerpt": "### COMMAND . CSAAT\n**C**hip **S**elect **A**ctive **A**fter **T**ransaction.\n If [`COMMAND.CSAAT`](#command) = 0, the chip select line is raised immediately\n at the end of the command segment.", "rtl_excerpt": null, "question": "According to the COMMAND.CSAAT description, what happens to the chip select line at the end of a segment when CSAAT = 0?", "answer_format": "exact_value", "gold_answer": "the chip select line is raised immediately", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (retrieval baseline)", "difficulty": "easy"} {"id": "spi_host-t1-006", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/06_interrupts_errors_status.md", "license": "Apache-2.0"}, "spec_excerpt": "- `TXWM`: The number of 32-bit words in the TX FIFO currently is currently less than the value set in [`CONTROL.TX_WATERMARK`](registers.md#control)", "rtl_excerpt": null, "question": "According to the SPI event list, what condition raises the TXWM event?", "answer_format": "exact_value", "gold_answer": "The number of 32-bit words in the TX FIFO is less than CONTROL.TX_WATERMARK", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (retrieval baseline)", "difficulty": "easy"} {"id": "spi_host-t1-007", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/06_interrupts_errors_status.md", "license": "Apache-2.0"}, "spec_excerpt": "- `RXWM`: The number of 32-bit words in the RXFIFO currently exceeds the value set in [`CONTROL.RX_WATERMARK`](registers.md#control).", "rtl_excerpt": null, "question": "According to the SPI event list, what condition raises the RXWM event?", "answer_format": "exact_value", "gold_answer": "The number of 32-bit words in the RXFIFO exceeds CONTROL.RX_WATERMARK", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (retrieval baseline)", "difficulty": "easy"} {"id": "spi_host-t1-008", "task_type": 1, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/01_spi_protocol_command_interface.md", "license": "Apache-2.0"}, "spec_excerpt": "This IP only supports single transfer rate (STR), *not* DTR.", "rtl_excerpt": null, "question": "Does the SPI_HOST IP support double transfer rate (DTR)?", "answer_format": "exact_value", "gold_answer": "No, only single transfer rate (STR)", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (retrieval baseline)", "difficulty": "easy"} {"id": "spi_host-t2-001", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/01_spi_protocol_command_interface.md", "license": "Apache-2.0"}, "spec_excerpt": "When it comes to devices there is no universal convention on clock polarity (CPOL) or clock phase (CPHA).\nSome devices expect the clock line to be low when the host is idle, thus the clock should come as a sequence of positive pulses (`CPOL = 0`).\nOn the other hand, some devices expect `CPOL = 1`, meaning that the clock line is inverted: *high* when idle with sequences of *negative* pulses.\nDevices also differ in their expectations of clock *phase* (CPHA) relative to the data.\nDevices with `CPHA = 0` expect that both the host and device will be sampling data on the *leading* edge, and asserting data on the *trailing* edge.\n(Because of the option for either polarity, the terms \"leading\" and \"trailing\" are preferred to \"rising\" or \"falling\").\nWhen `CPHA = 0` the first output bit is asserted with the falling edge of `CSB`.\nConversely, if `CPHA = 1` data is always asserted on the leading edge of `SCK` and sampled on the trailing edge of `SCK`.\n\nAs well as supporting any combination of CPOL/CPHA, this IP also offers an additional [Full-Cycle sampling](#full-cycle-sampling) option", "rtl_excerpt": null, "question": "Which combinations of clock polarity (CPOL) and clock phase (CPHA) does the SPI_HOST IP support?\n\nA) Only CPOL=0, CPHA=0\nB) Any combination of CPOL/CPHA\nC) CPOL=0 with either CPHA value; CPOL=1 is unsupported\nD) Only CPOL=1, CPHA=1", "answer_format": "multiple_choice", "gold_answer": "B", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (cross-section baseline)", "difficulty": "medium", "options": ["A) Only CPOL=0, CPHA=0", "B) Any combination of CPOL/CPHA", "C) CPOL=0 with either CPHA value; CPOL=1 is unsupported", "D) Only CPOL=1, CPHA=1"], "repair_note": "v2.1 2026-09-25: option list appended; gold letter assigned by shuffle"} {"id": "spi_host-t2-002", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/03_segment_fields_csid.md", "license": "Apache-2.0"}, "spec_excerpt": "Changes in [`CSID`](registers.md#csid) also affect the `CSB` lines, because a change in CSID can also implicitly end a command, overriding [`COMMAND.CSAAT`](registers.md#command).\nIf a change is detected in [`CSID`](registers.md#csid), but the previous segment was submitted with the `CSAAT` bit asserted, the FSM terminates the previous command before moving on to the next segment.", "rtl_excerpt": null, "question": "A segment is submitted with CSAAT=1, and then the CSID register is changed before the next segment is issued. What does the FSM do?\n\nA) It finishes the previous segment and starts the next one with CSB still asserted\nB) It ignores the CSID change until the current segment completes\nC) It terminates the previous command (deasserting CSB) before moving on to the next segment\nD) It raises an error event and halts the state machine", "answer_format": "multiple_choice", "gold_answer": "C", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (cross-section baseline)", "difficulty": "medium", "options": ["A) It finishes the previous segment and starts the next one with CSB still asserted", "B) It ignores the CSID change until the current segment completes", "C) It terminates the previous command (deasserting CSB) before moving on to the next segment", "D) It raises an error event and halts the state machine"], "repair_note": "v2.1 2026-09-25: option list appended; gold letter assigned by shuffle"} {"id": "spi_host-t2-003", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/04_configopts_timing.md", "license": "Apache-2.0"}, "spec_excerpt": "In order to support these fastest data rates, the SPI_HOST IP offers a modified \"Full-cycle\" ([`CONFIGOPTS.FULLCYC`](registers.md#configopts--fullcyc)) timing mode where data can be sampled a *full* cycle after the target device asserts data on the SD bus.\nThis full cycle mode has no effect on any of the signals transmitted, only on the timing of the sampling of the incoming signals.", "rtl_excerpt": null, "question": "What does Full-cycle sampling mode change about the SPI transaction?\n\nA) Only the timing of sampling of the incoming signals\nB) The phase of the transmitted SCK signal\nC) Both the transmitted signals and the sampling timing\nD) The CSB assertion timing relative to SCK", "answer_format": "multiple_choice", "gold_answer": "A", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (cross-section baseline)", "difficulty": "medium", "options": ["A) Only the timing of sampling of the incoming signals", "B) The phase of the transmitted SCK signal", "C) Both the transmitted signals and the sampling timing", "D) The CSB assertion timing relative to SCK"], "repair_note": "v2.1 2026-09-25: option list appended; gold letter assigned by shuffle"} {"id": "spi_host-t2-004", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/06_interrupts_errors_status.md", "license": "Apache-2.0"}, "spec_excerpt": "All of these programming violations will create an error event when they occur.\nThey will also halt the IP until the corresponding bit is cleared in the [`ERROR_STATUS`](registers.md#error_status) register.\nWhenever an error event occurs, the error must be acknowledged by clearing (write 1 to clear) the corresponding bit in [`ERROR_STATUS`](registers.md#error_status).", "rtl_excerpt": null, "question": "What happens to the SPI_HOST IP when a programming-violation error event occurs?\n\nA) It continues execution and logs the error into the next segment descriptor\nB) It automatically clears the error after one idle cycle\nC) It immediately resets the entire IP\nD) It halts until the corresponding ERROR_STATUS bit is cleared", "answer_format": "multiple_choice", "gold_answer": "D", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (cross-section baseline)", "difficulty": "medium", "options": ["A) It continues execution and logs the error into the next segment descriptor", "B) It automatically clears the error after one idle cycle", "C) It immediately resets the entire IP", "D) It halts until the corresponding ERROR_STATUS bit is cleared"], "repair_note": "v2.1 2026-09-25: option list appended; gold letter assigned by shuffle"} {"id": "spi_host-t2-005", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/07_programmers_guide.md", "license": "Apache-2.0"}, "spec_excerpt": "## Software Reset Procedure\n\nIn the event of an error the SPI_HOST IP can be reset under software control using the following procedure:\n\n1. Set [`CONTROL.SW_RST`](registers.md#control).\n2. Poll IP status registers for confirmation of successful state machine reset:\n - Wait for [`STATUS.ACTIVE`](registers.md#status) to clear.\n - Wait for both FIFOs to completely drain by polling [`STATUS.TXQD`](registers.md#status) and [`STATUS.RXQD`](registers.md#status) until they reach zero.\n3. Clear [`CONTROL.SW_RST`](registers.md#control).", "rtl_excerpt": null, "question": "What is the correct software reset procedure for the SPI_HOST IP?\n\nA) Clear SW_RST, wait for ACTIVE to assert, then set SW_RST\nB) Set SW_RST, wait for ACTIVE to clear and both FIFOs to drain, then clear SW_RST\nC) Set SW_RST and clear it immediately; the FIFOs drain on their own\nD) Set SW_RST, wait for RXQD to reach its maximum, then clear SW_RST", "answer_format": "multiple_choice", "gold_answer": "B", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (cross-section baseline)", "difficulty": "medium", "options": ["A) Clear SW_RST, wait for ACTIVE to assert, then set SW_RST", "B) Set SW_RST, wait for ACTIVE to clear and both FIFOs to drain, then clear SW_RST", "C) Set SW_RST and clear it immediately; the FIFOs drain on their own", "D) Set SW_RST, wait for RXQD to reach its maximum, then clear SW_RST"], "repair_note": "v2.1 2026-09-25: option list appended; gold letter assigned by shuffle"} {"id": "spi_host-t2-006", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/07_programmers_guide.md", "license": "Apache-2.0"}, "spec_excerpt": "While each command segment is being processed, the SPI_HOST has room to queue up exactly one additional segment descriptor in the Command Clock Domain Crossing.\nOnce a second command segment descriptor has been submitted, software must wait for the state machine to finish processing the current segment before submitting more.", "rtl_excerpt": null, "question": "While a command segment is being processed, how many additional segment descriptors can software queue?\n\nA) None; software must wait until the IP is idle\nB) Up to four\nC) Exactly one\nD) An unlimited number until the FIFO is full", "answer_format": "multiple_choice", "gold_answer": "C", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (cross-section baseline)", "difficulty": "medium", "options": ["A) None; software must wait until the IP is idle", "B) Up to four", "C) Exactly one", "D) An unlimited number until the FIFO is full"], "repair_note": "v2.1 2026-09-25: option list appended; gold letter assigned by shuffle"} {"id": "spi_host-t2-007", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/05_data_formatting.md", "license": "Apache-2.0"}, "spec_excerpt": "When writing to the [`TXDATA`](registers.md#txdata) window, only three types of data are expected: individual bytes, half-words, and full-words.\nOther types of write transactions (i.e., non-contiguous, zero-byte and three-byte writes) are not supported by most processors.\nTherefore it is assumed that if such transactions do appear, it is likely a sign of a system integrity error, and so these other classes of writes are not supported.\n\nIf such transactions ever occur, they trigger an \"Invalid Access\" error event, which suspends the processing of future commands until the error has been cleared by setting the [`ERROR_STATUS.ACCESSINVAL`](registers.md#error_status) bit.", "rtl_excerpt": null, "question": "Which TXDATA write sizes are supported, and what happens on any other write type?\n\nA) Bytes, half-words and full-words; other types trigger an Invalid Access error event\nB) Only full-words; any other write type is silently dropped\nC) Bytes and half-words only; full-word writes trigger an Invalid Access error event\nD) Any write size; unsupported sizes are automatically split into supported ones", "answer_format": "multiple_choice", "gold_answer": "A", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (cross-section baseline)", "difficulty": "medium", "options": ["A) Bytes, half-words and full-words; other types trigger an Invalid Access error event", "B) Only full-words; any other write type is silently dropped", "C) Bytes and half-words only; full-word writes trigger an Invalid Access error event", "D) Any write size; unsupported sizes are automatically split into supported ones"], "repair_note": "v2.1 2026-09-25: option list appended; gold letter assigned by shuffle"} {"id": "spi_host-t2-008", "task_type": 2, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/06_interrupts_errors_status.md", "license": "Apache-2.0"}, "spec_excerpt": "The SPI event interrupt is signaled only when the IP enters the corresponding state.\nFor example if an interrupt is requested when the TX FIFO is empty, the IP will only generate one interrupt when the last data word is transmitted from the TX FIFO.\nIn this case, no new interrupts will be created until more data has been added to the FIFO, and all of it has been transmitted.", "rtl_excerpt": null, "question": "How does the SPI event interrupt behave when its condition persists?\n\nA) It re-signals on every clock cycle while the condition persists\nB) It signals once per command segment while the condition persists\nC) It never signals; software must poll the state\nD) It signals once when the IP enters the state; no new interrupt until the condition clears and re-occurs", "answer_format": "multiple_choice", "gold_answer": "D", "mutation": {"type": "none", "original": "", "mutated": "", "location": ""}, "verification": "n/a (cross-section baseline)", "difficulty": "medium", "options": ["A) It re-signals on every clock cycle while the condition persists", "B) It signals once per command segment while the condition persists", "C) It never signals; software must poll the state", "D) It signals once when the IP enters the state; no new interrupt until the condition clears and re-occurs"], "repair_note": "v2.1 2026-09-25: option list appended; gold letter assigned by shuffle"} {"id": "spi_host-t3-001", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/08_registers_key.md", "license": "Apache-2.0"}, "spec_excerpt": " The number of bytes (or dummy cycles) in the segment will be\n equal to [`COMMAND.LEN`](#command) + 2.\n\n[Segment field table:]\n| [LEN](registers.md#command--len) | 8 | [0:255] |", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_HOST spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"NUMERIC_MISMATCH\", \"location\": \"08_registers_key.md, COMMAND.LEN description\", \"explanation\": \"The LEN paragraph claims LEN+2 bytes, but LEN is an 8-bit field ([0:255]), so LEN=255 would require 257 bytes, one more than the field can address.\"}", "mutation": {"type": "changed_number", "original": "equal to [`COMMAND.LEN`](#command) + 1.", "mutated": "equal to [`COMMAND.LEN`](#command) + 2.", "location": "08_registers_key.md, COMMAND.LEN description"}, "verification": "n/a (spec-only item)", "difficulty": "medium"} {"id": "spi_host-t3-002", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/03_segment_fields_csid.md", "license": "Apache-2.0"}, "spec_excerpt": "| [LEN](registers.md#command--len) | 7 | [0:127] |\n\n[COMMAND.LEN description:]\n The number of bytes (or dummy cycles) in the segment will be\n equal to [`COMMAND.LEN`](#command) + 1.", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_HOST spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"NUMERIC_MISMATCH\", \"location\": \"03_segment_fields_csid.md, segment field table\", \"explanation\": \"The table claims LEN is 7 bits ([0:127]), but the LEN register description requires LEN+1 bytes, and other passages (e.g. Fast Read examples with LEN=255-class lengths) need the full 8-bit range; a 7-bit field caps segments at 128 bytes.\"}", "mutation": {"type": "changed_number", "original": "8 | [0:255]", "mutated": "7 | [0:127]", "location": "03_segment_fields_csid.md, segment field table"}, "verification": "n/a (spec-only item)", "difficulty": "medium"} {"id": "spi_host-t3-003", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/08_registers_key.md", "license": "Apache-2.0"}, "spec_excerpt": "Core clock divider. Slows down subsequent SPI transactions by a\n factor of (CLKDIV+2) relative to the core clock frequency.\n period of sck, T(sck) then becomes `2*(CLK_DIV+1)*T(core)`", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_HOST spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"NUMERIC_MISMATCH\", \"location\": \"08_registers_key.md, CONFIGOPTS.CLKDIV description\", \"explanation\": \"The divider paragraph claims a factor of (CLKDIV+2), but the T(sck) formula in the same register description gives 2*(CLKDIV+1)*T(core); at CLKDIV=0 that is 2*T(core) (factor 1), not 2 (factor 2).\"}", "mutation": {"type": "changed_number", "original": "factor of (CLKDIV+1)", "mutated": "factor of (CLKDIV+2)", "location": "08_registers_key.md, CONFIGOPTS.CLKDIV description"}, "verification": "n/a (spec-only item)", "difficulty": "medium"} {"id": "spi_host-t3-004", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/04_configopts_timing.md", "license": "Apache-2.0"}, "spec_excerpt": "This time delay is a half `SCK` cycle by default but can be extended to as long as sixteen `SCK` cycles by setting the [`CONFIGOPTS.CSNIDLE`](registers.md#configopts) register.\n\n[Also stated:]\nThis time delay is a half `SCK` cycle by default but can be extended to as long as eight `SCK` cycles by setting the [`CONFIGOPTS.CSNLEAD`](registers.md#configopts) register.", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_HOST spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"NUMERIC_MISMATCH\", \"location\": \"04_configopts_timing.md, CSNIDLE paragraph\", \"explanation\": \"The CSNIDLE paragraph claims the idle time extends to sixteen SCK cycles, while the very next paragraph states the CSNLEAD/CSNTRAIL delays extend to at most eight SCK cycles; the register map gives all three fields the same 4-bit encoding, so sixteen is unrepresentable.\"}", "mutation": {"type": "changed_number", "original": "eight SCK cycles", "mutated": "sixteen SCK cycles", "location": "04_configopts_timing.md, CSNIDLE paragraph"}, "verification": "n/a (spec-only item)", "difficulty": "medium"} {"id": "spi_host-t3-005", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/05_data_formatting.md", "license": "Apache-2.0"}, "spec_excerpt": "the IP should fully utilize the TL-UL bus, using 16-bit I/O instructions.\n\n[Also stated:]\n32-bit words placed in [`TXDATA`](registers.md#txdata) are transmitted in first-in-first-out order.\nLikewise, words received from the SPI data lines are made available for reading from [`RXDATA`](registers.md#rxdata) in first-in-first-out order.", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_HOST spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"NUMERIC_MISMATCH\", \"location\": \"05_data_formatting.md, window access paragraph\", \"explanation\": \"The window-access paragraph claims 16-bit I/O instructions fully utilize the TL-UL bus, but the FIFO paragraphs describe 32-bit DATA words transferred in FIFO order; 16-bit accesses only half-fill each word.\"}", "mutation": {"type": "changed_number", "original": "32-bit I/O instructions", "mutated": "16-bit I/O instructions", "location": "05_data_formatting.md, window access paragraph"}, "verification": "n/a (spec-only item)", "difficulty": "medium"} {"id": "spi_host-t3-006", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/05_data_formatting.md", "license": "Apache-2.0"}, "spec_excerpt": "By default (`ByteOrder = 1`, for Little-Endian processors), the MSB of [`TXDATA`](registers.md#txdata) (i.e bits 31 though 24) is transmitted first, and the other bytes follow in order of decreasing significance.\n\n[Also stated:]\nOn the other hand, if `ByteOrder` is set to 0 (for Big-Endian processors), the MSB is transmitted first from [`TXDATA`](registers.md#txdata), and received data is loaded first into the MSB of [`RXDATA`](registers.md#rxdata).", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_HOST spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"RULE_INVERSION\", \"location\": \"05_data_formatting.md, byte-order paragraph\", \"explanation\": \"The mutated paragraph claims ByteOrder=1 transmits the MSB first, but the same section states ByteOrder=0 (big-endian) transmits the MSB first; the two settings cannot both mean MSB-first.\"}", "mutation": {"type": "rule_inversion", "original": "(`ByteOrder = 1`...) the LSB of TXDATA (i.e bits 7 though 0) is transmitted first", "mutated": "(`ByteOrder = 1`...) the MSB of TXDATA (i.e bits 31 though 24) is transmitted first", "location": "05_data_formatting.md, byte-order paragraph"}, "verification": "n/a (spec-only item)", "difficulty": "medium"} {"id": "spi_host-t3-007", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/04_configopts_timing.md", "license": "Apache-2.0"}, "spec_excerpt": "This full cycle mode also affects the signals transmitted, changing both the transmit timing and the timing of the sampling of the incoming signals.\n\n[Also stated:]\nAs well as supporting any combination of CPOL/CPHA, this IP also offers an additional [Full-Cycle sampling](#full-cycle-sampling) option", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_HOST spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"RULE_INVERSION\", \"location\": \"04_configopts_timing.md, full-cycle paragraph\", \"explanation\": \"The mutated paragraph claims full-cycle mode also affects transmitted signals, but the spec defines it purely as a receive-sampling option (half- vs full-cycle sampling of incoming data); changing transmit timing would break CPOL/CPHA compliance.\"}", "mutation": {"type": "rule_inversion", "original": "This full cycle mode has no effect on any of the signals transmitted", "mutated": "This full cycle mode also affects the signals transmitted", "location": "04_configopts_timing.md, full-cycle paragraph"}, "verification": "n/a (spec-only item)", "difficulty": "medium"} {"id": "spi_host-t3-008", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/08_registers_key.md", "license": "Apache-2.0"}, "spec_excerpt": " If [`COMMAND.CSAAT`](#command) = 1, the chip select line is raised immediately\n at the end of the command segment.\n If [`COMMAND.CSAAT`](#command) = 0, the chip select line is left low\n\n[Also stated:]\n This allows the creation of longer, more complete SPI transactions,\n consisting of several separate segments for issuing instructions,", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_HOST spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"RULE_INVERSION\", \"location\": \"08_registers_key.md, COMMAND.CSAAT description\", \"explanation\": \"The mutated register description swaps the CSAAT semantics, but the same section states CSAAT=1 leaves chip select low to compose longer multi-segment transactions; the mutated text makes CSAAT=1 end the transaction.\"}", "mutation": {"type": "rule_inversion", "original": "CSAAT = 0 ... raised / CSAAT = 1 ... left low", "mutated": "CSAAT = 1 ... raised / CSAAT = 0 ... left low", "location": "08_registers_key.md, COMMAND.CSAAT description"}, "verification": "n/a (spec-only item)", "difficulty": "medium"} {"id": "spi_host-t3-009", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/06_interrupts_errors_status.md", "license": "Apache-2.0"}, "spec_excerpt": "- `RXWM`: The number of 32-bit words in the RXFIFO is currently less than the value set in [`CONTROL.RX_WATERMARK`](registers.md#control).\n\n[Also stated:]\n- `TXWM`: The number of 32-bit words in the TX FIFO currently is currently less than the value set in [`CONTROL.TX_WATERMARK`](registers.md#control)", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_HOST spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"RULE_INVERSION\", \"location\": \"06_interrupts_errors_status.md, event list\", \"explanation\": \"The mutated list makes RXWM fire when the RXFIFO is below the watermark, i.e. the TXWM condition; the true rule is that RXWM fires when the RXFIFO exceeds the watermark (firmware drains a filling FIFO).\"}", "mutation": {"type": "rule_inversion", "original": "RXWM ... exceeds", "mutated": "RXWM ... is currently less than", "location": "06_interrupts_errors_status.md, event list"}, "verification": "n/a (spec-only item)", "difficulty": "medium"} {"id": "spi_host-t3-010", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/05_data_formatting.md", "license": "Apache-2.0"}, "spec_excerpt": "For RX (or Bidirectional) segments, if the last few bytes received do not fill an entire DATA word, the partial word will be dropped and never inserted into the RX FIFO.\n\n[Also stated:]\nSimilarly, the first byte received is packed into the LSB of [`RXDATA`](registers.md#rxdata), and the subsequent bytes of each [`RXDATA`](registers.md#rxdata) word are packed in order of increasing significance.", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_HOST spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"RULE_INVERSION\", \"location\": \"05_data_formatting.md, RX FIFO paragraph\", \"explanation\": \"The mutated paragraph claims partial trailing words are dropped, but the same section requires every received byte to be packed into RXDATA words in order of increasing significance; dropping partial words would silently lose trailing received bytes.\"}", "mutation": {"type": "rule_inversion", "original": "zero-padded and inserted into the RX FIFO", "mutated": "dropped and never inserted into the RX FIFO", "location": "05_data_formatting.md, RX FIFO paragraph"}, "verification": "n/a (spec-only item)", "difficulty": "medium"} {"id": "spi_host-t3-011", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/01_spi_protocol_command_interface.md", "license": "Apache-2.0"}, "spec_excerpt": "For even faster transfer rates, some flash chips support double transfer rate (DTR) variations to the SPI protocol wherein the device receives and transmits fresh data on *both* the leading and trailing edge.\nThis IP only supports single transfer rate (STR), *not* DTR.\n\n[Full-cycle paragraph:]\nThis full cycle mode has no effect on any of the signals transmitted, only on the timing of the sampling of the incoming signals.\nFull-cycle mode additionally enables double transfer rate (DTR) transfers for even higher throughput.", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_HOST spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"CROSSREF_CONFLICT\", \"location\": \"01_spi_protocol_command_interface.md vs 04_configopts_timing.md\", \"explanation\": \"The SPI overview states the IP supports only STR, not DTR, while the mutated full-cycle paragraph claims full-cycle mode enables DTR transfers; both cannot hold.\"}", "mutation": {"type": "rule_inversion", "original": "This IP only supports single transfer rate (STR), *not* DTR.", "mutated": "Full-cycle mode additionally enables double transfer rate (DTR) transfers", "location": "01_spi_protocol_command_interface.md vs 04_configopts_timing.md"}, "verification": "n/a (spec-only item)", "difficulty": "hard"} {"id": "spi_host-t3-012", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/07_programmers_guide.md", "license": "Apache-2.0"}, "spec_excerpt": "They will also halt the IP until the corresponding bit is cleared in the [`ERROR_STATUS`](registers.md#error_status) register.\n\n[Programmer's guide:]\nThe SPI_HOST will assert one of the [`ERROR_STATUS`](registers.md#error_status) bits in the event of a firmware programming error, and will continue processing commands without waiting for firmware to acknowledge the error.", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_HOST spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"CROSSREF_CONFLICT\", \"location\": \"06_interrupts_errors_status.md vs 07_programmers_guide.md\", \"explanation\": \"The error-handling section states the IP halts until ERROR_STATUS is cleared, while the mutated programmer's guide claims the IP continues processing without waiting for acknowledgement; the IP cannot both halt and continue.\"}", "mutation": {"type": "rule_inversion", "original": "will become unresponsive until firmware acknowledges the error by clearing the corresponding error bit", "mutated": "will continue processing commands without waiting for firmware to acknowledge the error", "location": "06_interrupts_errors_status.md vs 07_programmers_guide.md"}, "verification": "n/a (spec-only item)", "difficulty": "hard"} {"id": "spi_host-t3-013", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/08_registers_key.md", "license": "Apache-2.0"}, "spec_excerpt": "| [SPEED](registers.md#command--speed) | 2 | {Std, Dual, Quad} |\n\n[COMMAND.SPEED description:]\nThe speed for this command segment: \"0\" = Standard SPI. \"1\" = Dual SPI.\n \"2\"=Quad SPI, \"3\"=Octal SPI.", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_HOST spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"CROSSREF_CONFLICT\", \"location\": \"03_segment_fields_csid.md vs 08_registers_key.md\", \"explanation\": \"The segment field table restricts SPEED to {Std, Dual, Quad}, while the mutated register description assigns Octal SPI to value 3; a 2-bit SD[3:0] datapath has no octal mode, so the two cannot both hold.\"}", "mutation": {"type": "rule_inversion", "original": "\"3\": RESERVED", "mutated": "\"3\"=Octal SPI", "location": "03_segment_fields_csid.md vs 08_registers_key.md"}, "verification": "n/a (spec-only item)", "difficulty": "hard"} {"id": "spi_host-t3-014", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/01_spi_protocol_command_interface.md", "license": "Apache-2.0"}, "spec_excerpt": "### COMMAND . CSAAT\n**C**hip **S**elect **A**ctive **A**fter **T**ransaction.\n If [`COMMAND.CSAAT`](#command) = 0, the chip select line is raised immediately\n at the end of the command segment.\n\n[SPI transaction paragraph:]\nSetting [`COMMAND.CSAAT`](registers.md#command--csaat) to zero indicates the end of a transaction, prompting the IP to keep `CSB` asserted at the end of the segment.", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_HOST spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"CROSSREF_CONFLICT\", \"location\": \"08_registers_key.md vs 01_spi_protocol_command_interface.md\", \"explanation\": \"The register description states CSAAT=0 raises the chip select line at segment end, while the mutated overview paragraph claims CSAAT=0 keeps CSB asserted; the same condition cannot both raise and hold CSB.\"}", "mutation": {"type": "rule_inversion", "original": "prompting the IP to raise `CSB` at the end of the segment", "mutated": "prompting the IP to keep `CSB` asserted at the end of the segment", "location": "08_registers_key.md vs 01_spi_protocol_command_interface.md"}, "verification": "n/a (spec-only item)", "difficulty": "hard"} {"id": "spi_host-t3-015", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/08_registers_key.md", "license": "Apache-2.0"}, "spec_excerpt": "The SPI protocol usually requires activity (either sampling or asserting data) on either edge of the `SCK` clock.\nFor this reason the maximum `SCK` frequency is at most one half the SPI_HOST core frequency.\n\n[CONFIGOPTS.CLKDIV description:]\n period of sck, T(sck) then becomes `(CLK_DIV+1)*T(core)`", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_HOST spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"CROSSREF_CONFLICT\", \"location\": \"04_configopts_timing.md vs 08_registers_key.md\", \"explanation\": \"The timing overview caps SCK at half the core frequency, but the mutated CLKDIV formula gives T(sck)=(CLKDIV+1)*T(core), which at CLKDIV=0 yields T(sck)=T(core), i.e. the full core frequency, violating the cap.\"}", "mutation": {"type": "changed_number", "original": "`2*(CLK_DIV+1)*T(core)`", "mutated": "`(CLK_DIV+1)*T(core)`", "location": "04_configopts_timing.md vs 08_registers_key.md"}, "verification": "n/a (spec-only item)", "difficulty": "hard"} {"id": "spi_host-t3-016", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/06_interrupts_errors_status.md", "license": "Apache-2.0"}, "spec_excerpt": "They will also halt the IP.\n\n[Programmer's guide:]\nThe SPI_HOST will assert one of the [`ERROR_STATUS`](registers.md#error_status) bits in the event of a firmware programming error, and will become unresponsive until firmware acknowledges the error by clearing the corresponding error bit.", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_HOST spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"MISSING_CONDITION\", \"location\": \"06_interrupts_errors_status.md, error paragraph\", \"explanation\": \"The mutated paragraph drops the 'until cleared' condition, reading as a permanent halt, while the programmer's guide states the IP is unresponsive only until firmware clears the error bit; the deleted resumption condition reconciled the two.\"}", "mutation": {"type": "deleted_condition", "original": "They will also halt the IP until the corresponding bit is cleared in the [`ERROR_STATUS`](registers.md#error_status) register.", "mutated": "They will also halt the IP.", "location": "06_interrupts_errors_status.md, error paragraph"}, "verification": "n/a (spec-only item)", "difficulty": "hard"} {"id": "spi_host-t3-017", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/04_configopts_timing.md", "license": "Apache-2.0"}, "spec_excerpt": "The `CSB` line can then be deasserted by either issuing another command without the [`COMMAND.CSAAT`](registers.md#command) field, issuing a command to a different device, or simply resetting the core FSM via the [`CONTROL.SW_RST`](registers.md#control) register.\n\n[Also stated:]\nThe [`CSID`](registers.md#csid) register is used to identify the target device for the next command segment.", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_HOST spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"MISSING_CONDITION\", \"location\": \"04_configopts_timing.md, CSB deassertion paragraph\", \"explanation\": \"The mutated paragraph drops the '(after changing the CSID register)' condition, implying a command can target a different device without changing CSID, while the segment-fields section states CSID is what identifies the target device; the deleted condition reconciled how a 'different device' is selected.\"}", "mutation": {"type": "deleted_condition", "original": "issuing a command to a different device (after changing the [`CSID`](registers.md#csid) register)", "mutated": "issuing a command to a different device", "location": "04_configopts_timing.md, CSB deassertion paragraph"}, "verification": "n/a (spec-only item)", "difficulty": "hard"} {"id": "spi_host-t3-018", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/07_programmers_guide.md", "license": "Apache-2.0"}, "spec_excerpt": "While each command segment is being processed, the SPI_HOST has room to queue up additional segment descriptors in the Command Clock Domain Crossing.\n\n[Also stated:]\nOnce a second command segment descriptor has been submitted, software must wait for the state machine to finish processing the current segment before submitting more.", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_HOST spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"MISSING_CONDITION\", \"location\": \"07_programmers_guide.md, queueing paragraph\", \"explanation\": \"The mutated paragraph drops the 'exactly one' bound, implying an unbounded queue, while the same section states software must wait after submitting a second descriptor; the deleted bound reconciled the two.\"}", "mutation": {"type": "deleted_condition", "original": "has room to queue up exactly one additional segment descriptor", "mutated": "has room to queue up additional segment descriptors", "location": "07_programmers_guide.md, queueing paragraph"}, "verification": "n/a (spec-only item)", "difficulty": "hard"} {"id": "spi_host-t3-019", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/04_configopts_timing.md", "license": "Apache-2.0"}, "spec_excerpt": "To avoid spurious clock signals, changes to the [`CONFIGOPTS`](registers.md#configopts) parameters take effect only at the end of a command segment.\n\n[Also stated:]\n2. CSAAT = 1 for the previous segment:\nConfiguration changes are not typically expected after CSAAT segments, and require special treatment as the IP does not usually return the `CSB` lines to the idle/inactive state at this time.\nIn such cases, the SPI_HOST IP closes out the ongoing transaction, ignoring CSAAT, and the configuration is then applied once the SPI_HOST has returned to the idle state.", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_HOST spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"MISSING_CONDITION\", \"location\": \"04_configopts_timing.md, CONFIGOPTS paragraph\", \"explanation\": \"The mutated paragraph drops the 'only when all CSB lines are deasserted' condition, implying config changes apply at the end of any segment, while the CSAAT=1 case states the IP closes the transaction and applies them only once back in idle; the deleted condition reconciled the two.\"}", "mutation": {"type": "deleted_condition", "original": "take effect only at the end of a command segment and only when all `CSB` lines are deasserted", "mutated": "take effect only at the end of a command segment", "location": "04_configopts_timing.md, CONFIGOPTS paragraph"}, "verification": "n/a (spec-only item)", "difficulty": "hard"} {"id": "spi_host-t3-020", "task_type": 3, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/doc/01_spi_protocol_command_interface.md", "license": "Apache-2.0"}, "spec_excerpt": "The IP will automatically control the chip-select for each segment, by asserting it at the start of a segment and desasserting it at the end, allowing multiple segments to be composed into a longer continuous command.\n\n[Also stated:]\nIf a command consists of multiple segments, [`COMMAND.CSAAT`](registers.md#command--csaat) (**C**hip-**S**elect **A**ctive **A**fter **T**ransaction) should be set to one for all segments except the final one.", "rtl_excerpt": null, "question": "The excerpt below was derived from the SPI_HOST spec with a single inconsistency introduced. Identify the contradiction: quote the two conflicting statements (or their locations) and name the category.", "answer_format": "location+category", "gold_answer": "{\"category\": \"MISSING_CONDITION\", \"location\": \"01_spi_protocol_command_interface.md, transaction paragraph\", \"explanation\": \"The mutated paragraph drops the CSAAT exception, claiming CSB always deasserts at segment end while still claiming segments compose a continuous command, while the same section states CSAAT=1 is required on all but the final segment; the deleted exception reconciled the two.\"}", "mutation": {"type": "deleted_condition", "original": "By setting [`COMMAND.CSAAT`](registers.md#command--csaat), the `CSB` will **not** be deasserted at the end of a segment, allowing multiple segments to be composed into a longer continuous command.", "mutated": "allowing multiple segments to be composed into a longer continuous command.", "location": "01_spi_protocol_command_interface.md, transaction paragraph"}, "verification": "n/a (spec-only item)", "difficulty": "hard"} {"id": "spi_host-t4-001", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/rtl/spi_host_shift_register.sv", "license": "Apache-2.0"}, "spec_excerpt": "### CONTROL . SW_RST\nClears the internal state (not registers) to the reset state when set to 1,\n including the FIFOs, the CDC's, the core state machine and the shift register.", "rtl_excerpt": "1: if (!rst_ni) begin\n2: sd_i_q <= 4'h0;\n3: sr_q <= 8'hFF;\n4: rx_buf_valid_q <= 1'b0;\n5: rx_buf_q <= 9'h0;", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "CONTROL.SW_RST clears the internal state to the reset state when set to 1, including the shift register.", "category": "NUMERIC_MISMATCH", "rtl_location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv:102", "explanation": "The reset value of sr_q is 8'hFF instead of 8'h0, so after a software reset the shift register holds stale 1 bits that appear on sd_o (and would be shifted out) instead of the clean reset state."}, "mutation": {"type": "wrong_reset_value", "original": " sr_q <= 8'h0;", "mutated": " sr_q <= 8'hFF;", "location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_host-001 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/rtl/spi_host/spi_host_cmd_pkg.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_host-001.log for RESULT: DIFFER", "difficulty": "medium"} {"id": "spi_host-t4-002", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/rtl/spi_host_shift_register.sv", "license": "Apache-2.0"}, "spec_excerpt": "32-bit words placed in [`TXDATA`](registers.md#txdata) are transmitted in first-in-first-out order.\nLikewise, words received from the SPI data lines are made available for reading from [`RXDATA`](registers.md#rxdata) in first-in-first-out order.", "rtl_excerpt": "1: sd_i_q <= 4'h0;\n2: sr_q <= 8'h0;\n3: rx_buf_valid_q <= 1'b1;\n4: rx_buf_q <= 9'h0;\n5: end else begin", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "Words received from the SPI data lines are made available for reading from RXDATA in first-in-first-out order.", "category": "NUMERIC_MISMATCH", "rtl_location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv:103", "explanation": "rx_buf_valid_q resets to 1, so rx_valid_o is asserted right after reset even though no byte was ever received from the SD lines; software would read a phantom word."}, "mutation": {"type": "wrong_reset_value", "original": " rx_buf_valid_q <= 1'b0;", "mutated": " rx_buf_valid_q <= 1'b1;", "location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_host-002 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/rtl/spi_host/spi_host_cmd_pkg.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_host-002.log for RESULT: DIFFER", "difficulty": "easy"} {"id": "spi_host-t4-003", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/rtl/spi_host_shift_register.sv", "license": "Apache-2.0"}, "spec_excerpt": "the SPI_HOST IP offers a modified \"Full-cycle\" ([`CONFIGOPTS.FULLCYC`](registers.md#configopts--fullcyc)) timing mode where data can be sampled a *full* cycle after the target device asserts data on the SD bus.\nThis full cycle mode has no effect on any of the signals transmitted, only on the timing of the sampling of the incoming signals.", "rtl_excerpt": "1: always_ff @(posedge clk_i or negedge rst_ni) begin\n2: if (!rst_ni) begin\n3: sd_i_q <= 4'hF;\n4: sr_q <= 8'h0;\n5: rx_buf_valid_q <= 1'b0;", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "Data can be sampled a full cycle after the target device asserts data on the SD bus.", "category": "NUMERIC_MISMATCH", "rtl_location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv:101", "explanation": "sd_i_q (the sampled SD register used when full-cycle mode is off) resets to 4'hF, so received bytes are built from the reset constant (all ones) rather than data actually asserted on the SD bus."}, "mutation": {"type": "wrong_reset_value", "original": " sd_i_q <= 4'h0;", "mutated": " sd_i_q <= 4'hF;", "location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_host-003 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/rtl/spi_host/spi_host_cmd_pkg.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_host-003.log for RESULT: DIFFER", "difficulty": "medium"} {"id": "spi_host-t4-004", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/rtl/spi_host_shift_register.sv", "license": "Apache-2.0"}, "spec_excerpt": "For RX (or Bidirectional) segments, if the last few bytes received do not fill an entire DATA word, the partial word will be zero-padded and inserted into the RX FIFO once the segment is completed.", "rtl_excerpt": "1: sr_q <= 8'h0;\n2: rx_buf_valid_q <= 1'b0;\n3: rx_buf_q <= 9'h1FF;\n4: end else begin\n5: sd_i_q <= sd_i_d;", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "For RX segments, if the last few bytes received do not fill an entire DATA word, the partial word will be zero-padded.", "category": "NUMERIC_MISMATCH", "rtl_location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv:104", "explanation": "rx_buf_q resets to 9'h1FF (last=1, data=0xFF) instead of zero, so the RX buffer powers up looking like a last-byte 0xFF word, contradicting the clean/zero-padded reset state."}, "mutation": {"type": "wrong_reset_value", "original": " rx_buf_q <= 9'h0;", "mutated": " rx_buf_q <= 9'h1FF;", "location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_host-004 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/rtl/spi_host/spi_host_cmd_pkg.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_host-004.log for RESULT: DIFFER", "difficulty": "medium"} {"id": "spi_host-t4-005", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/rtl/spi_host_shift_register.sv", "license": "Apache-2.0"}, "spec_excerpt": "Finally *within a given byte*, the most significant bits are transmitted and received first.\nFor Dual and Quad transactions the least significant bit in any instantaneous pair or nibble is transmitted or received on `SD[0]`, and the remaining SD bits (1 though 3) are populated in order of increasing significance.", "rtl_excerpt": "1: 8'h00;\n2: \n3: assign sd_o = (speed_i == Standard) ? {3'b000, sr_q[6]} :\n4: (speed_i == Dual) ? {2'b00, sr_q[7:6]} :\n5: (speed_i == Quad) ? {sr_q[7:4]} :", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "Within a given byte, the most significant bits are transmitted and received first.", "category": "NUMERIC_MISMATCH", "rtl_location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv:62", "explanation": "sd_o in Standard mode taps sr_q[6] instead of sr_q[7], so the transmitted bit stream is shifted one position late (bit 6 goes out first instead of the MSB)."}, "mutation": {"type": "off_by_one", "original": " assign sd_o = (speed_i == Standard) ? {3'b000, sr_q[7]} :", "mutated": " assign sd_o = (speed_i == Standard) ? {3'b000, sr_q[6]} :", "location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_host-005 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/rtl/spi_host/spi_host_cmd_pkg.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_host-005.log for RESULT: DIFFER", "difficulty": "medium"} {"id": "spi_host-t4-006", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/rtl/spi_host_shift_register.sv", "license": "Apache-2.0"}, "spec_excerpt": "Finally *within a given byte*, the most significant bits are transmitted and received first.\nFor Dual and Quad transactions the least significant bit in any instantaneous pair or nibble is transmitted or received on `SD[0]`, and the remaining SD bits (1 though 3) are populated in order of increasing significance.", "rtl_excerpt": "1: \n2: assign next_bits = full_cyc_i ? sd_i : sd_i_q;\n3: assign sr_shifted = (speed_i == Standard) ? {sr_q[7:1], next_bits[1]} :\n4: (speed_i == Dual) ? {sr_q[5:0], next_bits[1:0]} :\n5: (speed_i == Quad) ? {sr_q[3:0], next_bits[3:0]} :", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "Within a given byte, the most significant bits are transmitted and received first.", "category": "NUMERIC_MISMATCH", "rtl_location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv:57", "explanation": "The Standard-mode shift concatenation uses sr_q[7:1] instead of sr_q[6:0], so the register shifts toward the LSB (dropping bit 0, keeping bit 7) instead of shifting the MSB out first."}, "mutation": {"type": "off_by_one", "original": " assign sr_shifted = (speed_i == Standard) ? {sr_q[6:0], next_bits[1]} :", "mutated": " assign sr_shifted = (speed_i == Standard) ? {sr_q[7:1], next_bits[1]} :", "location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_host-006 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/rtl/spi_host/spi_host_cmd_pkg.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_host-006.log for RESULT: DIFFER", "difficulty": "medium"} {"id": "spi_host-t4-007", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/rtl/spi_host_shift_register.sv", "license": "Apache-2.0"}, "spec_excerpt": "Finally *within a given byte*, the most significant bits are transmitted and received first.\nFor Dual and Quad transactions the least significant bit in any instantaneous pair or nibble is transmitted or received on `SD[0]`, and the remaining SD bits (1 though 3) are populated in order of increasing significance.", "rtl_excerpt": "1: \n2: assign sd_o = (speed_i == Standard) ? {3'b000, sr_q[7]} :\n3: (speed_i == Dual) ? {2'b00, sr_q[6:5]} :\n4: (speed_i == Quad) ? {sr_q[7:4]} :\n5: 4'h0;", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "The least significant bit in any instantaneous pair or nibble is transmitted or received on SD[0], and the remaining SD bits (1 though 3) are populated in order of increasing significance.", "category": "NUMERIC_MISMATCH", "rtl_location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv:63", "explanation": "In Dual mode sd_o taps sr_q[6:5] instead of sr_q[7:6], so each transmitted pair is off by one bit position relative to the specified pair-to-SD mapping."}, "mutation": {"type": "off_by_one", "original": " (speed_i == Dual) ? {2'b00, sr_q[7:6]} :", "mutated": " (speed_i == Dual) ? {2'b00, sr_q[6:5]} :", "location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_host-007 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/rtl/spi_host/spi_host_cmd_pkg.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_host-007.log for RESULT: DIFFER", "difficulty": "medium"} {"id": "spi_host-t4-008", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/rtl/spi_host_shift_register.sv", "license": "Apache-2.0"}, "spec_excerpt": "Finally *within a given byte*, the most significant bits are transmitted and received first.\nFor Dual and Quad transactions the least significant bit in any instantaneous pair or nibble is transmitted or received on `SD[0]`, and the remaining SD bits (1 though 3) are populated in order of increasing significance.", "rtl_excerpt": "1: assign sr_shifted = (speed_i == Standard) ? {sr_q[6:0], next_bits[1]} :\n2: (speed_i == Dual) ? {sr_q[5:0], next_bits[1:0]} :\n3: (speed_i == Quad) ? {sr_q[4:1], next_bits[3:0]} :\n4: 8'h00;", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "The least significant bit in any instantaneous pair or nibble is transmitted or received on SD[0], and the remaining SD bits (1 though 3) are populated in order of increasing significance.", "category": "NUMERIC_MISMATCH", "rtl_location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv:59", "explanation": "The Quad-mode shift keeps sr_q[4:1] instead of sr_q[3:0], so the retained nibble is off by one bit position and the assembled received byte is wrong (0x7F instead of 0xFF)."}, "mutation": {"type": "off_by_one", "original": " (speed_i == Quad) ? {sr_q[3:0], next_bits[3:0]} :", "mutated": " (speed_i == Quad) ? {sr_q[4:1], next_bits[3:0]} :", "location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_host-008 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/rtl/spi_host/spi_host_cmd_pkg.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_host-008.log for RESULT: DIFFER", "difficulty": "medium"} {"id": "spi_host-t4-009", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/rtl/spi_host_shift_register.sv", "license": "Apache-2.0"}, "spec_excerpt": "the SPI_HOST IP offers a modified \"Full-cycle\" ([`CONFIGOPTS.FULLCYC`](registers.md#configopts--fullcyc)) timing mode where data can be sampled a *full* cycle after the target device asserts data on the SD bus.\nThis full cycle mode has no effect on any of the signals transmitted, only on the timing of the sampling of the incoming signals.", "rtl_excerpt": "1: `ASSERT(SpeedValid, speed_i != RsvdSpd, clk_i, rst_ni)\n2: \n3: assign next_bits = full_cyc_i ? sd_i_q : sd_i;\n4: assign sr_shifted = (speed_i == Standard) ? {sr_q[6:0], next_bits[1]} :\n5: (speed_i == Dual) ? {sr_q[5:0], next_bits[1:0]} :", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "This full cycle mode has no effect on any of the signals transmitted, only on the timing of the sampling of the incoming signals.", "category": "RULE_INVERSION", "rtl_location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv:56", "explanation": "The full_cyc select is inverted: with full-cycle sampling requested the logic uses the registered (half-cycle-delayed) sample, and with it off it uses the live line, inverting the specified sampling behavior."}, "mutation": {"type": "inverted_enable", "original": " assign next_bits = full_cyc_i ? sd_i : sd_i_q;", "mutated": " assign next_bits = full_cyc_i ? sd_i_q : sd_i;", "location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_host-009 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/rtl/spi_host/spi_host_cmd_pkg.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_host-009.log for RESULT: DIFFER", "difficulty": "medium"} {"id": "spi_host-t4-010", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/rtl/spi_host_shift_register.sv", "license": "Apache-2.0"}, "spec_excerpt": "32-bit words placed in [`TXDATA`](registers.md#txdata) are transmitted in first-in-first-out order.\nLikewise, words received from the SPI data lines are made available for reading from [`RXDATA`](registers.md#rxdata) in first-in-first-out order.", "rtl_excerpt": "1: // need to transmit tx_flush as we fetch the\n2: // last-needed byte.\n3: assign wr_ready_o = ~tx_valid_i;\n4: assign tx_ready_o = wr_en_i;\n5: assign tx_flush_o = last_write_i;", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "32-bit words placed in TXDATA are transmitted in first-in-first-out order.", "category": "RULE_INVERSION", "rtl_location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv:90", "explanation": "wr_ready_o is inverted, so the write handshake completes exactly when tx_valid is low; bytes presented with tx_valid high are never loaded into the shift register and never transmitted."}, "mutation": {"type": "inverted_enable", "original": " assign wr_ready_o = tx_valid_i;", "mutated": " assign wr_ready_o = ~tx_valid_i;", "location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_host-010 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/rtl/spi_host/spi_host_cmd_pkg.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_host-010.log for RESULT: DIFFER", "difficulty": "easy"} {"id": "spi_host-t4-011", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/rtl/spi_host_shift_register.sv", "license": "Apache-2.0"}, "spec_excerpt": "the SPI_HOST IP offers a modified \"Full-cycle\" ([`CONFIGOPTS.FULLCYC`](registers.md#configopts--fullcyc)) timing mode where data can be sampled a *full* cycle after the target device asserts data on the SD bus.\nThis full cycle mode has no effect on any of the signals transmitted, only on the timing of the sampling of the incoming signals.", "rtl_excerpt": "1: \n2: assign sd_i_d = sw_rst_i ? 4'b0 :\n3: sample_en_i ? sd_i_q :\n4: sd_i_q;", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "Data can be sampled a full cycle after the target device asserts data on the SD bus.", "category": "RULE_INVERSION", "rtl_location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv:82", "explanation": "The sample_en arms are swapped, so sd_i_q captures the SD lines when sampling is disabled and holds when it is enabled; the received byte reflects stale zeros instead of the asserted data."}, "mutation": {"type": "inverted_enable", "original": " sample_en_i ? sd_i :", "mutated": " sample_en_i ? sd_i_q :", "location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_host-011 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/rtl/spi_host/spi_host_cmd_pkg.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_host-011.log for RESULT: DIFFER", "difficulty": "medium"} {"id": "spi_host-t4-012", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/rtl/spi_host_shift_register.sv", "license": "Apache-2.0"}, "spec_excerpt": "32-bit words placed in [`TXDATA`](registers.md#txdata) are transmitted in first-in-first-out order.\nLikewise, words received from the SPI data lines are made available for reading from [`RXDATA`](registers.md#rxdata) in first-in-first-out order.", "rtl_excerpt": "1: assign rx_buf_valid_d = sw_rst_i ? 1'b0 :\n2: (rd_en_i && rd_ready_o) ? 1'b1 :\n3: (rx_valid_o & rx_ready_i) ? 1'b1 :\n4: rx_buf_valid_q;", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "Words received from the SPI data lines are made available for reading from RXDATA in first-in-first-out order.", "category": "RULE_INVERSION", "rtl_location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv:78", "explanation": "The valid-clear arm is inverted to 1'b1, so once a byte is captured rx_valid_o never deasserts; the same word is presented repeatedly instead of advancing through the RX FIFO order."}, "mutation": {"type": "inverted_enable", "original": " (rx_valid_o & rx_ready_i) ? 1'b0 :", "mutated": " (rx_valid_o & rx_ready_i) ? 1'b1 :", "location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_host-012 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/rtl/spi_host/spi_host_cmd_pkg.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_host-012.log for RESULT: DIFFER", "difficulty": "medium"} {"id": "spi_host-t4-013", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/rtl/spi_host_shift_register.sv", "license": "Apache-2.0"}, "spec_excerpt": "Finally *within a given byte*, the most significant bits are transmitted and received first.\nFor Dual and Quad transactions the least significant bit in any instantaneous pair or nibble is transmitted or received on `SD[0]`, and the remaining SD bits (1 though 3) are populated in order of increasing significance.", "rtl_excerpt": "1: assign tx_flush_o = last_write_i;\n2: \n3: assign sr_d = sw_rst_i ? 8'h0 :\n4: (wr_en_i & wr_ready_o) ? tx_data_i :\n5: sr_q;", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "Within a given byte, the most significant bits are transmitted and received first.", "category": "MISSING_CONDITION", "rtl_location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv:94", "explanation": "The shift_en arm of sr_d is deleted, so the shift register never advances; sd_o repeats bit 7 indefinitely instead of shifting the byte out MSB-first."}, "mutation": {"type": "missing_fsm_transition", "original": " assign sr_d = sw_rst_i ? 8'h0 :\n (wr_en_i & wr_ready_o) ? tx_data_i :\n shift_en_i ? sr_shifted :\n sr_q;", "mutated": " assign sr_d = sw_rst_i ? 8'h0 :\n (wr_en_i & wr_ready_o) ? tx_data_i :\n sr_q;", "location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_host-013 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/rtl/spi_host/spi_host_cmd_pkg.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_host-013.log for RESULT: DIFFER", "difficulty": "medium"} {"id": "spi_host-t4-014", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/rtl/spi_host_shift_register.sv", "license": "Apache-2.0"}, "spec_excerpt": "32-bit words placed in [`TXDATA`](registers.md#txdata) are transmitted in first-in-first-out order.\nLikewise, words received from the SPI data lines are made available for reading from [`RXDATA`](registers.md#rxdata) in first-in-first-out order.", "rtl_excerpt": "74: assign rx_buf_d = sw_rst_i ? 9'h0 :\n74b: // <-- MUTATED: DELETED '(rd_en_i && rd_ready_o) ? {last_read_i, sr_shifted} :' (rx_buf never loads received byte)\n75: rx_buf_q;\n76: \n77: assign rx_buf_valid_d = sw_rst_i ? 1'b0 :\n78: (rd_en_i && rd_ready_o) ? 1'b1 :\n[mutated line(s): 74 (deleted line)]", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "Words received from the SPI data lines are made available for reading from RXDATA in first-in-first-out order.", "category": "MISSING_CONDITION", "rtl_location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv:93", "explanation": "The rd_en capture arm of rx_buf_d is deleted, so received bytes are never moved into the RX buffer; the buffer keeps its reset value instead of the captured word."}, "mutation": {"type": "missing_fsm_transition", "original": " assign rx_buf_d = sw_rst_i ? 9'h0 :\n (rd_en_i && rd_ready_o) ? {last_read_i, sr_shifted} :\n rx_buf_q;", "mutated": " assign rx_buf_d = sw_rst_i ? 9'h0 :\n rx_buf_q;", "location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_host-014 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/rtl/spi_host/spi_host_cmd_pkg.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_host-014.log for RESULT: DIFFER", "difficulty": "easy"} {"id": "spi_host-t4-015", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/rtl/spi_host_shift_register.sv", "license": "Apache-2.0"}, "spec_excerpt": "32-bit words placed in [`TXDATA`](registers.md#txdata) are transmitted in first-in-first-out order.\nLikewise, words received from the SPI data lines are made available for reading from [`RXDATA`](registers.md#rxdata) in first-in-first-out order.", "rtl_excerpt": "// Port declarations (from spi_host_shift_register.sv):\n// input wr_en_i,\n// input [7:0] tx_data_i,\n// input tx_valid_i,\n// output logic wr_ready_o,\n1: assign tx_flush_o = last_write_i;\n2: \n3: assign sr_d = sw_rst_i ? 8'h0 :\n4: shift_en_i ? sr_shifted :\n5: sr_q;\n// Note: tx_data_i and wr_en_i are declared inputs but never consumed in sr_d.", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "32-bit words placed in TXDATA are transmitted in first-in-first-out order.", "category": "MISSING_CONDITION", "rtl_location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv:94", "explanation": "The wr_en load arm of sr_d is deleted, so TX bytes are never loaded into the shift register and the transmitted stream stays zero."}, "mutation": {"type": "missing_fsm_transition", "original": " assign sr_d = sw_rst_i ? 8'h0 :\n (wr_en_i & wr_ready_o) ? tx_data_i :\n shift_en_i ? sr_shifted :\n sr_q;", "mutated": " assign sr_d = sw_rst_i ? 8'h0 :\n shift_en_i ? sr_shifted :\n sr_q;", "location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_host-015 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/rtl/spi_host/spi_host_cmd_pkg.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_host-015.log for RESULT: DIFFER", "difficulty": "easy"} {"id": "spi_host-t4-016", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/rtl/spi_host_shift_register.sv", "license": "Apache-2.0"}, "spec_excerpt": "### CONTROL . SW_RST\nClears the internal state (not registers) to the reset state when set to 1,\n including the FIFOs, the CDC's, the core state machine and the shift register.", "rtl_excerpt": "1: assign tx_flush_o = last_write_i;\n2: \n3: assign sr_d = (wr_en_i & wr_ready_o) ? tx_data_i :\n4: shift_en_i ? sr_shifted :\n5: sr_q;", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "CONTROL.SW_RST clears the internal state to the reset state when set to 1, including the shift register.", "category": "MISSING_CONDITION", "rtl_location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv:94", "explanation": "The sw_rst arm of sr_d is deleted, so asserting sw_rst no longer returns the shift register to its reset state; the stale byte remains and appears on sd_o."}, "mutation": {"type": "missing_fsm_transition", "original": " assign sr_d = sw_rst_i ? 8'h0 :\n (wr_en_i & wr_ready_o) ? tx_data_i :\n shift_en_i ? sr_shifted :\n sr_q;", "mutated": " assign sr_d = (wr_en_i & wr_ready_o) ? tx_data_i :\n shift_en_i ? sr_shifted :\n sr_q;", "location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_host-016 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/rtl/spi_host/spi_host_cmd_pkg.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_host-016.log for RESULT: DIFFER", "difficulty": "medium"} {"id": "spi_host-t4-017", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/rtl/spi_host_shift_register.sv", "license": "Apache-2.0"}, "spec_excerpt": "Finally *within a given byte*, the most significant bits are transmitted and received first.\nFor Dual and Quad transactions the least significant bit in any instantaneous pair or nibble is transmitted or received on `SD[0]`, and the remaining SD bits (1 though 3) are populated in order of increasing significance.", "rtl_excerpt": "1: sd_i_q;\n2: \n3: assign {rx_last_o, rx_data_o} = {rx_buf_q[7:0], 1'b0};\n4: \n5: // tx_data cannot be buffered, because of the", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "Within a given byte, the most significant bits are transmitted and received first.", "category": "NUMERIC_MISMATCH", "rtl_location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv:85", "explanation": "The {rx_last_o, rx_data_o} extraction window is shifted down one bit ({buf[7:0], 1'b0}), so the last flag lands in the data MSB position and every received byte is corrupted."}, "mutation": {"type": "field_offset_error", "original": " assign {rx_last_o, rx_data_o} = rx_buf_q;", "mutated": " assign {rx_last_o, rx_data_o} = {rx_buf_q[7:0], 1'b0};", "location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_host-017 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/rtl/spi_host/spi_host_cmd_pkg.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_host-017.log for RESULT: DIFFER", "difficulty": "medium"} {"id": "spi_host-t4-018", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/rtl/spi_host_shift_register.sv", "license": "Apache-2.0"}, "spec_excerpt": "Finally *within a given byte*, the most significant bits are transmitted and received first.\nFor Dual and Quad transactions the least significant bit in any instantaneous pair or nibble is transmitted or received on `SD[0]`, and the remaining SD bits (1 though 3) are populated in order of increasing significance.", "rtl_excerpt": "// 9-bit buffer to hold shift register data\n// and the last_read bit to indicate whether\n// it is the last in a series.\n1: \n2: assign rx_buf_d = sw_rst_i ? 9'h0 :\n3: (rd_en_i && rd_ready_o) ? {sr_shifted, last_read_i} :\n4: rx_buf_q;\n5: \n6: assign {rx_last_o, rx_data_o} = rx_buf_q;", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "Within a given byte, the most significant bits are transmitted and received first.", "category": "NUMERIC_MISMATCH", "rtl_location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv:73", "explanation": "rx_buf_d packs {sr_shifted, last_read_i} instead of {last_read_i, sr_shifted}, moving the last-byte flag from the top bit into the data LSB and corrupting both the flag and the byte."}, "mutation": {"type": "field_offset_error", "original": " (rd_en_i && rd_ready_o) ? {last_read_i, sr_shifted} :", "mutated": " (rd_en_i && rd_ready_o) ? {sr_shifted, last_read_i} :", "location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_host-018 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/rtl/spi_host/spi_host_cmd_pkg.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_host-018.log for RESULT: DIFFER", "difficulty": "medium"} {"id": "spi_host-t4-019", "task_type": 4, "source": {"repo": "https://github.com/lowRISC/opentitan", "commit": "80b5b3213453156fe62683962664d1afd9695ec4", "file": "hw/ip/spi_host/rtl/spi_host_shift_register.sv", "license": "Apache-2.0"}, "spec_excerpt": "Finally *within a given byte*, the most significant bits are transmitted and received first.\nFor Dual and Quad transactions the least significant bit in any instantaneous pair or nibble is transmitted or received on `SD[0]`, and the remaining SD bits (1 though 3) are populated in order of increasing significance.", "rtl_excerpt": "1: \n2: assign sd_o = (speed_i == Standard) ? {3'b000, sr_q[7]} :\n3: (speed_i == Dual) ? {sr_q[7:6], 2'b00} :\n4: (speed_i == Quad) ? {sr_q[7:4]} :\n5: 4'h0;", "question": "Does this RTL comply with the spec excerpt? If it violates the spec, cite the violated rule and name the violation category.", "answer_format": "location+category", "gold_answer": {"verdict": "violation", "rule": "The least significant bit in any instantaneous pair or nibble is transmitted or received on SD[0], and the remaining SD bits (1 though 3) are populated in order of increasing significance.", "category": "NUMERIC_MISMATCH", "rtl_location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv:63", "explanation": "In Dual mode sd_o places the bit pair on SD[3:2] ({sr_q[7:6], 2'b00}) instead of SD[1:0], violating the specified pair-to-SD-line mapping."}, "mutation": {"type": "field_offset_error", "original": " (speed_i == Dual) ? {2'b00, sr_q[7:6]} :", "mutated": " (speed_i == Dual) ? {sr_q[7:6], 2'b00} :", "location": "hw/ip/spi_host/rtl/spi_host_shift_register.sv"}, "verification": "export PATH=~/workspace/specbench/tools/iverilog-root/usr/bin:$PATH; cd ~/workspace/specbench/build/sim_t4/spi_host-019 && iverilog -g2012 -o sim.vvp -I ~/workspace/specbench/sources/work_a/sim_scout/stubs ~/workspace/specbench/sources/rtl/spi_host/spi_host_cmd_pkg.sv orig.sv mut.sv tb.sv && vvp sim.vvp # see spi_host-019.log for RESULT: DIFFER", "difficulty": "medium"}