Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verilator Integration: Define a UART peripheral based on TI 16550 part #476

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

econnellmc
Copy link
Contributor

Texas Instruments 16550 UART shares register address 0x00 between the Transmit register and Divisor Latch. This causes problems for the base Verilator Integration Library UART code which expects to see serial data following any write to reg 0x00.
Related issue
#475

Description
Add a component to the VerilatorIntegrationLibrary that supports UARTs based on the TI 16550 design. The existing UART handler throws an exception due to a difference in how the registers are used in the 16550 design.

I created a UART_16550 class that inherits most of it's functionality from the UART class, but it overrides the write methods that differ in the 16550 part.

This approach should mean that any existing UARTs will not be effected by my changes.

Usage example
https://github.com/econnellmc/renode-issue-reproduction-template/tree/475-UART_fail

https://github.com/econnellmc/renode-issue-reproduction-template/tree/475-UART_pass

I'm not sure how useful this example is. I cannot currently share the verilog code that is being compiled into the Vtop executables, so I have had to commit the built binaries. The difference between the two Vtop is in the Sim_main.cpp, where one of them uses the existing UART class and fails. The other uses the UART_16550 class and passes.

Additional information
I need some assistance to get the Robot scripts working correctly. I got it working locally by running Renode portable which was copied to the local directory. However, this doesn't gel with the way the github workflow works.

Very happy to make changes based on feedback if there is a different way you'd prefer this to be done.

Texas Instruments 16550 UART shares register address 0x00 between the
Transmit register and Divisor Latch.  This causes problems for the
base Verilator Integration Library UART code which expects to see
serial data following any write to reg 0x00.

Signed-off-by: Edward Connell <Edward.Connell@microchip.com>
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.

None yet

1 participant