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

Integrated OpenTitan's DPI based Virtual UART into the verilator test bench #93

Merged
merged 5 commits into from
Feb 29, 2024

Conversation

HU90m
Copy link
Member

@HU90m HU90m commented Feb 7, 2024

Draft because it's currently sitting atop #91

Recommend making the following change when testing:

diff --git a/sw/c/demo/hello_world/main.c b/sw/c/demo/hello_world/main.c
index 3d4b333..0ef4b4a 100644
--- a/sw/c/demo/hello_world/main.c
+++ b/sw/c/demo/hello_world/main.c
@@ -29,7 +29,7 @@ int main(void) {
 
   // This indicates how often the timer gets updated.
   timer_init();
-  timer_enable(5000000);
+  timer_enable(500);
 
   uint64_t last_elapsed_time = get_elapsed_time();

Copy link
Contributor

@alees24 alees24 left a comment

Choose a reason for hiding this comment

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

Some comments and suggested changes to the location and expression of the Verilator-specific top level.
Otherwise, this looks good to me, thanks.

rtl/fpga/top_verilator.sv Outdated Show resolved Hide resolved
rtl/fpga/top_verilator.sv Outdated Show resolved Hide resolved
rtl/fpga/top_verilator.sv Outdated Show resolved Hide resolved
rtl/fpga/top_verilator.sv Outdated Show resolved Hide resolved
Copy link
Contributor

@marnovandermaas marnovandermaas left a comment

Choose a reason for hiding this comment

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

Just a few comments from my end. I still need to test this PR and will approve afterwards.

dv/verilator/demo_system_verilator_lint.vlt Outdated Show resolved Hide resolved
rtl/fpga/top_verilator.sv Outdated Show resolved Hide resolved
@marnovandermaas
Copy link
Contributor

With my initial test the uart0.log file is empty after simulation. I'll have a deeper look tomorrow.

Copy link
Contributor

@marnovandermaas marnovandermaas left a comment

Choose a reason for hiding this comment

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

Ok, both screen output and log file are now generating properly for me, so this all looks good to me!

@marnovandermaas
Copy link
Contributor

Thanks so much for making these changes! This is will increase the usability of the Ibex demo system drastically 👍

Update code from upstream repository
https://github.com/lowRISC/opentitan to revision
042415198f3dc6b3bc387c669c7e9cf982d208e2

Signed-off-by: Hugo McNally <hugo.mcnally@gmail.com>
There's a bug in verilator 5.018, which means the system can't be built.
Reverting to ibex's officially supported version, 4.210.
@HU90m
Copy link
Member Author

HU90m commented Feb 29, 2024

↑ Rebased

↓ Made suggested changes

@HU90m HU90m merged commit 8264f86 into lowRISC:main Feb 29, 2024
2 checks 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.

3 participants