1
0
mirror of git://projects.qi-hardware.com/nn-usb-fpga.git synced 2025-01-09 14:00:14 +02:00
nn-usb-fpga/PS2_INTERFACE/logic/writePulseGenerator.v
2010-11-30 19:26:56 -05:00

34 lines
680 B
Verilog
Executable File

`timescale 1ns / 1ps
module writePulseGenerator (input clk,
input snwe,
input sncs,
input reset,
output reg we);
reg w_st;
// write access cpu to bram
always @(posedge clk)
if(~reset) {w_st, we} <= 0;
else begin
case (w_st)
0: begin
we <= 0;
if(sncs | snwe)
w_st <= 1;
end
1: begin
if(~(sncs | snwe))
begin
we <= 1;
w_st <= 0;
end
else we <= 0;
end
endcase
end
endmodule