Update PicoSoC hx8kdemo

This commit is contained in:
Clifford Wolf 2017-09-15 15:34:45 +02:00
parent 66638dcee0
commit 48f729d13c
2 changed files with 40 additions and 10 deletions

View File

@ -7,12 +7,28 @@ set_io flash_csb R12
set_io flash_clk R11 set_io flash_clk R11
set_io flash_io0 P12 set_io flash_io0 P12
set_io flash_io1 P11 set_io flash_io1 P11
set_io flash_io2 T9 # center on J3
set_io flash_io3 P8 # center on J3 # for QSPI mode the flash chip on the iCE40-HX8K Breakout Board
# must be replaced with one that supports QSPI and the IO2 and IO3
# pins must be soldered to T9 and P8 (center on J3)
set_io flash_io2 T9
set_io flash_io3 P8
set_io ser_tx B12 set_io ser_tx B12
set_io ser_rx B10 set_io ser_rx B10
# left on J3
set_io debug_ser_tx T1
set_io debug_ser_rx R3
# right on J3
set_io debug_flash_csb T15
set_io debug_flash_clk R16
set_io debug_flash_io0 N12
set_io debug_flash_io1 P13
set_io debug_flash_io2 T13
set_io debug_flash_io3 T14
set_io leds[7] B5 # D9 set_io leds[7] B5 # D9
set_io leds[6] B4 # D8 set_io leds[6] B4 # D8
set_io leds[5] A2 # D7 set_io leds[5] A2 # D7

View File

@ -30,7 +30,17 @@ module hx8kdemo (
inout flash_io0, inout flash_io0,
inout flash_io1, inout flash_io1,
inout flash_io2, inout flash_io2,
inout flash_io3 inout flash_io3,
output debug_ser_tx,
output debug_ser_rx,
output debug_flash_csb,
output debug_flash_clk,
output debug_flash_io0,
output debug_flash_io1,
output debug_flash_io2,
output debug_flash_io3
); );
reg [5:0] reset_cnt = 0; reg [5:0] reset_cnt = 0;
wire resetn = &reset_cnt; wire resetn = &reset_cnt;
@ -62,14 +72,11 @@ module hx8kdemo (
reg [31:0] iomem_rdata; reg [31:0] iomem_rdata;
reg [31:0] gpio; reg [31:0] gpio;
reg [4:0] gpio_shr; assign leds = gpio;
assign leds = gpio >> gpio_shr;
always @(posedge clk) begin always @(posedge clk) begin
if (!resetn) begin if (!resetn) begin
gpio <= 0; gpio <= 0;
gpio_shr <= 0;
end else begin end else begin
iomem_ready <= 0; iomem_ready <= 0;
if (iomem_valid && !iomem_ready && iomem_addr[31:24] == 8'h 03) begin if (iomem_valid && !iomem_ready && iomem_addr[31:24] == 8'h 03) begin
@ -80,9 +87,6 @@ module hx8kdemo (
if (iomem_wstrb[2]) gpio[23:16] <= iomem_wdata[23:16]; if (iomem_wstrb[2]) gpio[23:16] <= iomem_wdata[23:16];
if (iomem_wstrb[3]) gpio[31:24] <= iomem_wdata[31:24]; if (iomem_wstrb[3]) gpio[31:24] <= iomem_wdata[31:24];
end end
if (&leds && gpio_shr < 10) begin
gpio_shr <= gpio_shr + 1;
end
end end
end end
@ -118,4 +122,14 @@ module hx8kdemo (
.iomem_wdata (iomem_wdata ), .iomem_wdata (iomem_wdata ),
.iomem_rdata (iomem_rdata ) .iomem_rdata (iomem_rdata )
); );
assign debug_ser_tx = ser_tx;
assign debug_ser_rx = ser_rx;
assign debug_flash_csb = flash_csb;
assign debug_flash_clk = flash_clk;
assign debug_flash_io0 = flash_io0_di;
assign debug_flash_io1 = flash_io1_di;
assign debug_flash_io2 = flash_io2_di;
assign debug_flash_io3 = flash_io3_di;
endmodule endmodule