gateware

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit abbd84a64a49974efac41ed0cf89937068188856
parent 87b8699ce5c9a8b39120021a1e9df593c0c8881b
Author: Brian Swetland <swetland@frotz.net>
Date:   Sat, 15 Dec 2018 05:53:46 -0800

udebug: update cpu16-icebreaker/lattice-evb to use udebug

Diffstat:
Mhdl/board_icebreaker_vga444.pcf | 8+++++++-
Mhdl/board_icebreaker_vga444.v | 8++++++++
Mhdl/board_lattice_evb.v | 4++++
Mhdl/system_cpu16_vga40x30.v | 17+++++++++++++++++
Mproject/cpu16-icebreaker-vga444.def | 3++-
Mproject/cpu16-lattice-evb.def | 3++-
6 files changed, 40 insertions(+), 3 deletions(-)

diff --git a/hdl/board_icebreaker_vga444.pcf b/hdl/board_icebreaker_vga444.pcf @@ -22,4 +22,10 @@ set_io spi_cs 16 set_io out1 32 set_io out2 28 -set_io uart_tx 37 + +set_io uart_rx 6 +set_io uart_tx 9 + +set_io led_red 11 +set_io led_grn 37 + diff --git a/hdl/board_icebreaker_vga444.v b/hdl/board_icebreaker_vga444.v @@ -8,6 +8,10 @@ module top( output [3:0]vga_blu, output vga_hsync, output vga_vsync, + input uart_rx, + output uart_tx, + output led_red, + output led_grn, output out1, output out2 ); @@ -25,6 +29,10 @@ system_cpu16_vga40x30 #( .spi_miso(), .spi_clk(), .spi_cs(), + .uart_rx(uart_rx), + .uart_tx(uart_tx), + .led_red(led_red), + .led_grn(led_grn), .out1(out1), .out2(out2) ); diff --git a/hdl/board_lattice_evb.v b/hdl/board_lattice_evb.v @@ -29,6 +29,10 @@ system_cpu16_vga40x30 #( .spi_miso(spi_miso), .spi_clk(spi_clk), .spi_cs(spi_cs), + .uart_rx(1'b0), + .uart_tx(), + .led_grn(), + .led_red(), .out1(out1), .out2(out2) ); diff --git a/hdl/system_cpu16_vga40x30.v b/hdl/system_cpu16_vga40x30.v @@ -18,6 +18,10 @@ module system_cpu16_vga40x30 #( output spi_miso, input spi_clk, input spi_cs, + input uart_rx, + output uart_tx, + output led_red, + output led_grn, output out1, output out2 ); @@ -113,6 +117,7 @@ wire [15:0]dbg_waddr; wire [15:0]dbg_wdata; wire dbg_we; +`ifdef WITH_SPI_DEBUG spi_debug_ifc sdi( .spi_clk(spi_clk), .spi_cs_i(spi_cs), @@ -123,6 +128,18 @@ spi_debug_ifc sdi( .sys_waddr_o(dbg_waddr), .sys_wdata_o(dbg_wdata) ); +`else +uart_debug_ifc uart( + .sys_clk(sys_clk), + .sys_wr(dbg_we), + .sys_waddr(dbg_waddr), + .sys_wdata(dbg_wdata), + .uart_rx(uart_rx), + .uart_tx(uart_tx), + .led_red(led_red), + .led_grn(led_grn) + ); +`endif // debug interface has priority over cpu writes wire we = dbg_we | dat_wr_req; diff --git a/project/cpu16-icebreaker-vga444.def b/project/cpu16-icebreaker-vga444.def @@ -3,7 +3,8 @@ PROJECT_TYPE := nextpnr-ice40 PROJECT_SRCS := hdl/board_icebreaker_vga444.v hdl/board_icebreaker_vga444.pcf PROJECT_SRCS += hdl/system_cpu16_vga40x30.v hdl/lattice/pll_12_25.v -PROJECT_SRCS += hdl/spi_debug_ifc.v +#PROJECT_SRCS += hdl/spi_debug_ifc.v +PROJECT_SRCS += hdl/uart_debug_ifc.sv hdl/uart_rx.sv hdl/crc8_serial.sv PROJECT_SRCS += hdl/vga/vga40x30x2.v hdl/vga/vga.v hdl/vga/videoram.v hdl/vga/chardata.v PROJECT_SRCS += hdl/cpu16.sv hdl/cpu16_regs.sv hdl/cpu16_alu.sv diff --git a/project/cpu16-lattice-evb.def b/project/cpu16-lattice-evb.def @@ -3,7 +3,8 @@ PROJECT_TYPE := nextpnr-ice40 PROJECT_SRCS := hdl/board_lattice_evb.v hdl/board_lattice_evb.pcf PROJECT_SRCS += hdl/system_cpu16_vga40x30.v hdl/lattice/pll_12_25.v -PROJECT_SRCS += hdl/spi_debug_ifc.v +#PROJECT_SRCS += hdl/spi_debug_ifc.v +PROJECT_SRCS += hdl/uart_debug_ifc.sv hdl/uart_rx.sv hdl/crc8_serial.sv PROJECT_SRCS += hdl/vga/vga40x30x2.v hdl/vga/vga.v hdl/vga/videoram.v hdl/vga/chardata.v PROJECT_SRCS += hdl/cpu16.sv hdl/cpu16_regs.sv hdl/cpu16_alu.sv