-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sync: Parameterize reset value (#122)
- Loading branch information
Showing
2 changed files
with
4 additions
and
2 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
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 |
---|---|---|
|
@@ -11,7 +11,8 @@ | |
// Antonio Pullini <[email protected]> | ||
|
||
module sync #( | ||
parameter int unsigned STAGES = 2 | ||
parameter int unsigned STAGES = 2, | ||
parameter bit ResetValue = 1'b0 | ||
) ( | ||
input logic clk_i, | ||
input logic rst_ni, | ||
|
@@ -23,7 +24,7 @@ module sync #( | |
|
||
always_ff @(posedge clk_i, negedge rst_ni) begin | ||
if (!rst_ni) begin | ||
reg_q <= 'h0; | ||
reg_q <= {STAGES{ResetValue}}; | ||
end else begin | ||
reg_q <= {reg_q[STAGES-2:0], serial_i}; | ||
end | ||
|