-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add `VexRiscvWrapped`. This module gets wrapped around the core generated by Spinal. Can be used to install debugging hooks or capture signals for debugging purposes. It will currently dump all signals into a VCD. * Handle `debug_resetOut`. Before this, resets issued by JTAG wouldn't be properly handled. Change `soft_reset_halt` to `halt` in `vexriscv_sim.cfg` to prevent resetting the core on attaching a GDB session. * Add `vexrsicv_gdb.cfg`. A crude version of a config file that should be passed to GDB in order to debug.
- Loading branch information
1 parent
c02b632
commit 03c7e5e
Showing
11 changed files
with
351 additions
and
6,230 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,3 +65,6 @@ log | |
vivado_* | ||
tight_setup_hold_pins.txt | ||
.Xil | ||
|
||
# Verilator debug output | ||
simulation_dump.vcd |
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
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,89 @@ | ||
`timescale 1ns/1ps | ||
|
||
module VexRiscv ( | ||
input timerInterrupt, | ||
input externalInterrupt, | ||
input softwareInterrupt, | ||
output debug_resetOut, | ||
output iBusWishbone_CYC, | ||
output iBusWishbone_STB, | ||
input iBusWishbone_ACK, | ||
output iBusWishbone_WE, | ||
output [29:0] iBusWishbone_ADR, | ||
input [31:0] iBusWishbone_DAT_MISO, | ||
output [31:0] iBusWishbone_DAT_MOSI, | ||
output [3:0] iBusWishbone_SEL, | ||
input iBusWishbone_ERR, | ||
output [2:0] iBusWishbone_CTI, | ||
output [1:0] iBusWishbone_BTE, | ||
output dBusWishbone_CYC, | ||
output dBusWishbone_STB, | ||
input dBusWishbone_ACK, | ||
output dBusWishbone_WE, | ||
output [29:0] dBusWishbone_ADR, | ||
input [31:0] dBusWishbone_DAT_MISO, | ||
output [31:0] dBusWishbone_DAT_MOSI, | ||
output reg [3:0] dBusWishbone_SEL, | ||
input dBusWishbone_ERR, | ||
output [2:0] dBusWishbone_CTI, | ||
output [1:0] dBusWishbone_BTE, | ||
input jtag_tms, | ||
input jtag_tdi, | ||
output jtag_tdo, | ||
input jtag_tck, | ||
input clk, | ||
input reset | ||
); | ||
initial begin | ||
// Specify the dump file name | ||
$dumpfile("simulation_dump.vcd"); | ||
|
||
// Dump all signals to the VCD file | ||
$dumpvars(1, VexRiscv); | ||
end | ||
|
||
reg reset_cpu; | ||
wire reqCpuReset; | ||
|
||
// Handle reset logic in Verilog instead of Haskell | ||
assign debug_resetOut = 1'b0; | ||
always @(posedge clk) begin | ||
reset_cpu <= reset || reqCpuReset; | ||
end | ||
|
||
VexRiscvInner VexRiscvInner | ||
( .timerInterrupt (timerInterrupt) | ||
, .externalInterrupt (externalInterrupt) | ||
, .softwareInterrupt (softwareInterrupt) | ||
, .debug_resetOut (reqCpuReset) | ||
, .iBusWishbone_CYC (iBusWishbone_CYC) | ||
, .iBusWishbone_STB (iBusWishbone_STB) | ||
, .iBusWishbone_ACK (iBusWishbone_ACK) | ||
, .iBusWishbone_WE (iBusWishbone_WE) | ||
, .iBusWishbone_ADR (iBusWishbone_ADR) | ||
, .iBusWishbone_DAT_MISO (iBusWishbone_DAT_MISO) | ||
, .iBusWishbone_DAT_MOSI (iBusWishbone_DAT_MOSI) | ||
, .iBusWishbone_SEL (iBusWishbone_SEL) | ||
, .iBusWishbone_ERR (iBusWishbone_ERR) | ||
, .iBusWishbone_CTI (iBusWishbone_CTI) | ||
, .iBusWishbone_BTE (iBusWishbone_BTE) | ||
, .dBusWishbone_CYC (dBusWishbone_CYC) | ||
, .dBusWishbone_STB (dBusWishbone_STB) | ||
, .dBusWishbone_ACK (dBusWishbone_ACK) | ||
, .dBusWishbone_WE (dBusWishbone_WE) | ||
, .dBusWishbone_ADR (dBusWishbone_ADR) | ||
, .dBusWishbone_DAT_MISO (dBusWishbone_DAT_MISO) | ||
, .dBusWishbone_DAT_MOSI (dBusWishbone_DAT_MOSI) | ||
, .dBusWishbone_SEL (dBusWishbone_SEL) | ||
, .dBusWishbone_ERR (dBusWishbone_ERR) | ||
, .dBusWishbone_CTI (dBusWishbone_CTI) | ||
, .dBusWishbone_BTE (dBusWishbone_BTE) | ||
, .jtag_tms (jtag_tms) | ||
, .jtag_tdi (jtag_tdi) | ||
, .jtag_tdo (jtag_tdo) | ||
, .jtag_tck (jtag_tck) | ||
, .clk (clk) | ||
, .reset (reset_cpu) | ||
); | ||
|
||
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
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,3 @@ | ||
file "target/riscv32imc-unknown-none-elf/debug/debug-test" | ||
set remotetimeout unlimited | ||
target extended-remote :3333 |
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