mirror of
https://github.com/olofk/serv.git
synced 2025-04-20 03:47:09 -04:00
Temporary hack to blink LED on tinyfpga BX
This commit is contained in:
parent
2062d084bf
commit
ff63519607
4 changed files with 31 additions and 11 deletions
|
@ -89,10 +89,24 @@ module serv_wrapper
|
|||
|
||||
wb_gpio gpio
|
||||
(.i_wb_clk (wb_clk),
|
||||
.i_wb_rst (wb_rst),
|
||||
.i_wb_dat (wb_m2s_gpio_dat[0]),
|
||||
.i_wb_cyc (wb_m2s_gpio_cyc),
|
||||
.o_wb_ack (wb_s2m_gpio_ack),
|
||||
.o_gpio (q));
|
||||
.o_gpio (/*q*/));
|
||||
|
||||
reg canary;
|
||||
|
||||
always @(posedge wb_clk)
|
||||
if (wb_rst)
|
||||
canary <= 1'b0;
|
||||
/*else if (wb_m2s_cpu_ibus_cyc &
|
||||
wb_s2m_cpu_ibus_ack &
|
||||
(wb_m2s_cpu_ibus_adr == 32'h00000020))*/
|
||||
else if (wb_m2s_cpu_dbus_cyc & wb_s2m_cpu_dbus_ack)
|
||||
canary <= ~canary;
|
||||
|
||||
assign q = canary;
|
||||
|
||||
assign wb_s2m_gpio_dat = 32'h0;
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
30000537
|
||||
00a00313
|
||||
00018337
|
||||
6a030313
|
||||
00550023
|
||||
0012c293
|
||||
000073b3
|
||||
|
@ -2045,4 +2046,3 @@ fedff06f
|
|||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
|
|
|
@ -1,14 +1,20 @@
|
|||
module wb_gpio
|
||||
(
|
||||
input wire i_wb_clk,
|
||||
input wire i_wb_rst,
|
||||
input wire i_wb_dat,
|
||||
input wire i_wb_cyc,
|
||||
output reg o_wb_ack = 1'b0,
|
||||
output reg o_wb_ack,
|
||||
output reg o_gpio = 1'b0);
|
||||
|
||||
always @(posedge i_wb_clk)
|
||||
if (i_wb_cyc) begin
|
||||
o_wb_ack <= ~o_wb_ack;
|
||||
o_gpio <= i_wb_dat;
|
||||
end
|
||||
always @(posedge i_wb_clk) begin
|
||||
o_wb_ack <= 1'b0;
|
||||
if (i_wb_cyc) begin
|
||||
if (!o_wb_ack)
|
||||
o_wb_ack <= 1'b1;
|
||||
o_gpio <= i_wb_dat;
|
||||
end
|
||||
if (i_wb_rst)
|
||||
o_wb_ack <= 1'b0;
|
||||
end
|
||||
endmodule
|
||||
|
|
|
@ -66,13 +66,13 @@ targets:
|
|||
|
||||
synth:
|
||||
default_tool : icestorm
|
||||
filesets : [core, wrapper, pcf]
|
||||
filesets : [core, mem_files, wrapper, pcf]
|
||||
generate : [wb_intercon]
|
||||
toplevel : serv_wrapper
|
||||
|
||||
tinyfpga_bx:
|
||||
default_tool : icestorm
|
||||
filesets : [core, wrapper, tinyfpga_bx]
|
||||
filesets : [core, mem_files, wrapper, tinyfpga_bx]
|
||||
generate : [wb_intercon]
|
||||
tools:
|
||||
icestorm:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue