Files
common/rtl/cdc/cdc_rst_ctrlr.sv
T
maksyuki a542f1ee57 feat: enhance validation and error handling in RTL modules
- Added geometry validation for BIT_WIDTH, WORD_DEPTH, and ADDR_WIDTH in tech_ram, tech_ram_bm, tech_regfile, and tech_regfile_bm modules to ensure proper configurations.
- Implemented address range checks in tech_ram, tech_ram_bm, tech_regfile, and tech_regfile_bm modules to prevent out-of-bounds access.
- Improved error messages for unsupported access types in regfield module, including validation for DATA_WIDTH.
- Added DATA_WIDTH validation in spill_register module to ensure positive values.
- Refactored APB4AXI4Master and APB4Master classes to streamline constructor definitions and improve readability.
- Enhanced AXI4Master class with additional burst address calculations and legality checks for read/write operations.
- Updated read/write tasks in AXI4Master to include error handling for response mismatches and illegal burst conditions.
- Simplified the filtering of reference data in rd_check task of AXI4Master to improve clarity and maintainability.
- Cleaned up the TestBase class constructor for consistency and clarity.
2026-08-03 20:10:19 +08:00

60 lines
1.4 KiB
Systemverilog

// Copyright (c) 2026 Yuchi Miao <miaoyuchi@ict.ac.cn>
// SPDX-License-Identifier: MulanPSL-2.0
// Reset assertion is asynchronous; release is independently synchronized into
// each clock domain. release_i must remain high until both outputs are high.
module cdc_reset_barrier #(
parameter int STAGES = 3
) (
input logic clk_a_i,
input logic clk_b_i,
input logic rst_n_i,
input logic release_i,
output logic rst_a_n_o,
output logic rst_b_n_o
);
logic s_release_a;
logic s_release_b;
logic s_reset_a_n;
logic s_reset_b_n;
initial begin
if (STAGES < 2) begin
$fatal(1, "cdc_reset_barrier: STAGES must be at least two");
end
end
cdc_sync #(
.STAGE(STAGES)
) u_release_a (
.clk_i (clk_a_i),
.rst_n_i(rst_n_i),
.dat_i (release_i),
.dat_o (s_release_a)
);
cdc_sync #(
.STAGE(STAGES)
) u_release_b (
.clk_i (clk_b_i),
.rst_n_i(rst_n_i),
.dat_i (release_i),
.dat_o (s_release_b)
);
rst_sync #(
.STAGE(STAGES)
) u_reset_a (
.clk_i (clk_a_i),
.rst_n_i(rst_n_i),
.rst_n_o(s_reset_a_n)
);
rst_sync #(
.STAGE(STAGES)
) u_reset_b (
.clk_i (clk_b_i),
.rst_n_i(rst_n_i),
.rst_n_o(s_reset_b_n)
);
assign rst_a_n_o = s_reset_a_n && s_release_a;
assign rst_b_n_o = s_reset_b_n && s_release_b;
endmodule