-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Connected a virtual UART to the verilator sim
- Loading branch information
Showing
7 changed files
with
81 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Copyright lowRISC contributors. | ||
// Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// This is the top level that connects the demo system to the virtual devices. | ||
module top_verilator (input logic clk_i, rst_ni); | ||
|
||
localparam ClockFrequency = 50_000_000; | ||
localparam BaudRate = 115_200; | ||
|
||
logic uart_sys_rx, uart_sys_tx; | ||
|
||
// Instantiating the Ibex Demo System. | ||
ibex_demo_system #( | ||
.GpiWidth ( 8 ), | ||
.GpoWidth ( 16 ), | ||
.PwmWidth ( 12 ), | ||
.ClockFrequency ( ClockFrequency ), | ||
.BaudRate ( BaudRate ), | ||
.RegFile ( ibex_pkg::RegFileFF ) | ||
) u_ibex_demo_system ( | ||
//Input | ||
.clk_sys_i (clk_i), | ||
.rst_sys_ni(rst_ni), | ||
.uart_rx_i (uart_sys_rx), | ||
|
||
//Output | ||
.uart_tx_o(uart_sys_tx), | ||
|
||
// tie off JTAG | ||
.trst_ni(1'b1), | ||
.tms_i (1'b0), | ||
.tck_i (1'b0), | ||
.td_i (1'b0), | ||
.td_o ( ), | ||
|
||
// Remaining IO | ||
.gp_i (0), | ||
.gp_o ( ), | ||
.pwm_o ( ), | ||
.spi_rx_i (0), | ||
.spi_tx_o ( ), | ||
.spi_sck_o ( ) | ||
); | ||
|
||
// Virtual UART | ||
uartdpi #( | ||
.BAUD(BaudRate), | ||
.FREQ(ClockFrequency) | ||
) u_uartdpi ( | ||
.clk_i, | ||
.rst_ni, | ||
.active (1'b1 ), | ||
.tx_o (uart_sys_rx), | ||
.rx_i (uart_sys_tx) | ||
); | ||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters