Skip to content

[rtl,doc] Align IIR Rx timeout interrupt behaviour with 16550 spec - #13

Merged
raylau1 merged 2 commits into
mainfrom
fix-rx-timeout-intr
Dec 2, 2026
Merged

raylau1 merged 2 commits into
mainfrom
fix-rx-timeout-intr

Conversation

@raylau1

@raylau1 raylau1 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Depends on #12 (merged) to be merged first, only the last commit is new.

Closes #9.

@raylau1 raylau1 self-assigned this Nov 16, 2026
@raylau1
raylau1 force-pushed the fix-rx-timeout-intr branch from 228beb2 to c95bf72 Compare November 17, 2026 11:25
@raylau1

raylau1 commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

@marnovandermaas Please check the RTL and also skim the docs change.

@martin-velay Please check if the IIR behaviour change in the docs works for you.

@marnovandermaas marnovandermaas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some initial comments from me. Also god to update the README on the rx_timeout behaviour.

Comment thread hw/ip/uart16550/rtl/uart16550_init.sv Resolved
Comment thread hw/ip/uart16550/rtl/uart16550_init.sv Outdated
//////////

// State register
prim_sparse_fsm_flop #(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to set EnableAlertTriggerSVA to zero?

@raylau1 raylau1 Nov 20, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No AFAIK, I've added a commit which changes this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second thought this requires the new FSM to trigger an alert when there is an invalid FSM state, and also a mechanism to "or" together this with the alert from the OT UART core. Perhaps enabling alert is better left for a future PR. WDYT?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without it AssertConnected_A fails at 1 ps in Xcelium and VCS. The pre_dv TB passes only because Verilator uses the dummy assertion macros.

@raylau1
raylau1 force-pushed the fix-rx-timeout-intr branch 2 times, most recently from b53107f to 9afeeba Compare November 23, 2026 11:48

@martin-velay martin-velay left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall thanks

Another comment: README.md still lists rx_timeout as an always-inactive interrupt output.

Comment thread hw/ip/uart16550/rtl/uart16550_init.sv Resolved
Comment thread hw/ip/uart16550/rtl/uart16550.sv Resolved
@raylau1
raylau1 force-pushed the fix-rx-timeout-intr branch 4 times, most recently from 604793d to 3f8aef7 Compare November 26, 2026 17:21
Signed-off-by: Ray Lau <ray.lau@lowrisc.org>
@raylau1
raylau1 force-pushed the fix-rx-timeout-intr branch 3 times, most recently from 8109a3c to 40b7514 Compare November 27, 2026 13:53

@marnovandermaas marnovandermaas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments, also there is a typo "tiemout" in the second commit message. I haven't tested this but happy for you to merge it if you are happy with it.

if (req_step_q == 0) begin
uart_tl_o.a_opcode = tlul_pkg::Get;
uart_tl_o.a_address = top_pkg::TL_AW'(uart_reg_pkg::UART_RDATA_OFFSET);
uart_tl_o.a_data = '1;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be all zeroes or is there a reason you chose all ones?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This matches BlankedAData in tlul_pkg which is all ones for security reasons.

@raylau1
raylau1 force-pushed the fix-rx-timeout-intr branch from 40b7514 to 582bf6b Compare December 2, 2026 10:23
- RBR read now clears any pending character timeout interrupt
- Enabling ERBFI enables rx_timeout interrupt in the OT UART core
- IIR[3] is asserted only when the character timeout interrupt is active
  and there is no other higher priority interrupt
- Resetting the RCVR FIFO clears any pending character timeout interrupt
- When changing the parity enable in LCR, the timeout bit time duration of
  the OT UART core is automatically updated to reflect 4 character times

Signed-off-by: Ray Lau <ray.lau@lowrisc.org>
@raylau1
raylau1 force-pushed the fix-rx-timeout-intr branch from 582bf6b to a5bbd22 Compare December 2, 2026 11:11
@raylau1
raylau1 merged commit ed3bfda into main Dec 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[rtl] Align IIR Rx timeout interrupt behaviour with 16550 spec

3 participants