-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0e34d3e
commit b585b7c
Showing
3 changed files
with
61 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module ResetGen( | ||
input clock, | ||
input reset_in, | ||
output reset_out | ||
); | ||
|
||
reg sync_reg1; | ||
reg sync_reg2; | ||
|
||
always @(posedge clock or negedge reset_in) begin | ||
if(~reset_in) begin | ||
sync_reg1 <= 1'b1; | ||
sync_reg2 <= 1'b1; | ||
end | ||
else begin | ||
sync_reg1 <= 1'b0; | ||
sync_reg2 <= sync_reg1; | ||
end | ||
|
||
end | ||
|
||
assign reset_out = sync_reg2; | ||
|
||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import chisel3._ | ||
import chisel3.util._ | ||
|
||
class ResetSync extends HasBlackBoxResource { | ||
val io = IO(new Bundle{ | ||
val clock = Input(Clock()) | ||
val resetIn = Input(Bool()) | ||
val resetOut = Output(Bool()) | ||
}) | ||
addResource("ResetSync.sv") | ||
} |