Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 2 commits
  • 6 files changed
  • 0 commit comments
  • 1 contributor
Commits on Mar 02, 2012
@wpwrak wpwrak softusb: added access to Navre's PC via CSR
This is for debugging. Removed reading back the reset status via CSR,
since it seems not very useful and we don't have to decode the address
this way.
ff72330
@wpwrak wpwrak softusb: added the usual set of -W... flags and corrected code accord…
…ingly

The problem were:

- missing "void" in function declarations in main.c

- debug.c didn't include debug.h

None of these caused actual malfunction.
5cdd93f
View
13 cores/softusb/rtl/softusb.v
@@ -76,8 +76,11 @@ softusb_timer timer(
.io_do(io_dr_timer)
);
+wire [pmem_width-1:0] dbg_pc;
+
softusb_hostif #(
- .csr_addr(csr_addr)
+ .csr_addr(csr_addr),
+ .pmem_width(pmem_width)
) hostif (
.sys_clk(sys_clk),
.sys_rst(sys_rst),
@@ -93,7 +96,9 @@ softusb_hostif #(
.irq(irq),
.io_we(io_we),
- .io_a(io_a)
+ .io_a(io_a),
+
+ .dbg_pc(dbg_pc)
);
softusb_sie sie(
@@ -178,7 +183,9 @@ softusb_navre #(
.io_we(io_we),
.io_a(io_a),
.io_do(io_dw),
- .io_di(io_dr_sie|io_dr_timer)
+ .io_di(io_dr_sie|io_dr_timer),
+
+ .dbg_pc(dbg_pc)
);
endmodule
View
9 cores/softusb/rtl/softusb_hostif.v
@@ -16,7 +16,8 @@
*/
module softusb_hostif #(
- parameter csr_addr = 4'h0
+ parameter csr_addr = 4'h0,
+ parameter pmem_width = 12
) (
input sys_clk,
input sys_rst,
@@ -32,7 +33,9 @@ module softusb_hostif #(
output irq,
input io_we,
- input [5:0] io_a
+ input [5:0] io_a,
+
+ input [pmem_width-1:0] dbg_pc
);
wire csr_selected = csr_a[13:10] == csr_addr;
@@ -48,7 +51,7 @@ always @(posedge sys_clk) begin
if(csr_selected) begin
if(csr_we)
usb_rst0 <= csr_di[0];
- csr_do <= usb_rst0;
+ csr_do <= { dbg_pc, 1'b0 };
end
end
end
View
5 cores/softusb/rtl/softusb_navre.v
@@ -35,7 +35,9 @@ module softusb_navre #(
output reg io_we,
output [5:0] io_a,
output [7:0] io_do,
- input [7:0] io_di
+ input [7:0] io_di,
+
+ output reg [pmem_width-1:0] dbg_pc
);
/* Register file */
@@ -195,6 +197,7 @@ always @(posedge clk) begin
PC_SEL_Z: PC <= pZ - 1;
endcase
end
+ dbg_pc <= PC;
end
reg pmem_selz;
assign pmem_a = rst ?
View
5 softusb-input/Makefile
@@ -6,7 +6,10 @@ INCLUDES=comloc.h crc.h debug.h host.h io.h libc.h progmem.h sie.h timer.h
all: softusb-input.h
softusb-input.elf: $(SOURCES) $(INCLUDES)
- avr-gcc -o $@ -mmcu=avr2 -mno-interrupts -Wall -Os \
+ avr-gcc -o $@ -mmcu=avr2 -mno-interrupts -Os \
+ -Wall -Wstrict-prototypes -Wmissing-prototypes \
+ -Wold-style-declaration -Wold-style-definition \
+ -Wno-char-subscripts \
$(SOURCES) $(CFLAGS) -nostdlib -Wl,-T -Wl,navre.ld
%.bin: %.elf
View
1  softusb-input/debug.c
@@ -18,6 +18,7 @@
#include "progmem.h"
#include "host.h"
#include "comloc.h"
+#include "debug.h"
void print_char(char c)
{
View
8 softusb-input/main.c
@@ -829,7 +829,7 @@ static void port_service(struct port_status *p, char name)
static const char banner[] PROGMEM = "softusb-input v"VERSION"\n";
-static void sof()
+static void sof(void)
{
unsigned char mask;
unsigned char usb_buffer[3];
@@ -849,7 +849,7 @@ static void sof()
}
}
-static void keepalive()
+static void keepalive(void)
{
unsigned char mask;
@@ -868,7 +868,7 @@ static void keepalive()
}
}
-static void set_rx_speed()
+static void set_rx_speed(void)
{
unsigned char mask;
@@ -878,7 +878,7 @@ static void set_rx_speed()
wio8(SIE_LOW_SPEED, mask);
}
-int main()
+int main(void)
{
unsigned char i;

No commit comments for this range

Something went wrong with that request. Please try again.