1
0

tilelink2: unit test for the clock crossing

This commit is contained in:
Wesley W. Terpstra
2016-09-13 16:35:06 -07:00
parent c8e6d47884
commit acedd3688a
2 changed files with 44 additions and 1 deletions

19
vsrc/ClockDivider.v Normal file
View File

@ -0,0 +1,19 @@
// You can't divide clocks in Chisel
module ClockDivider(
input clock_in,
input reset_in,
output clock_out,
output reset_out
);
reg [2:0] shift = 3'b001;
always @(posedge clock_in)
begin
shift <= {shift[0], shift[2:1]};
end
assign reset_out = reset_in;
assign clock_out = shift[0];
endmodule