Skip to content

Commit 06e519a

Browse files
authored
sync: Parameterize reset value (#122)
1 parent 067d94d commit 06e519a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1111
- `isochronous_4phase_handshake`: Isochronous clock domain crossing cutting all paths using a 4-phase handshake.
1212
- Changed `isochronous_spill_register_tb` to `isochronous_crossing_tb` also covering the `isochronous_4phase_handshake`
1313
module.
14+
- Make reset value of `sync` module parameterizable.
1415

1516
## 1.22.1 - 2021-06-14
1617
### Fixed

src/sync.sv

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
// Antonio Pullini <[email protected]>
1212

1313
module sync #(
14-
parameter int unsigned STAGES = 2
14+
parameter int unsigned STAGES = 2,
15+
parameter bit ResetValue = 1'b0
1516
) (
1617
input logic clk_i,
1718
input logic rst_ni,
@@ -23,7 +24,7 @@ module sync #(
2324

2425
always_ff @(posedge clk_i, negedge rst_ni) begin
2526
if (!rst_ni) begin
26-
reg_q <= 'h0;
27+
reg_q <= {STAGES{ResetValue}};
2728
end else begin
2829
reg_q <= {reg_q[STAGES-2:0], serial_i};
2930
end

0 commit comments

Comments
 (0)