{#- Error Handling Signal Declarations Template -#}
    // Error Handling Signals
    logic [7:0] error_status = 8'h0;
    logic [7:0] correctable_error_count = 8'h0;
    logic [7:0] uncorrectable_error_count = 8'h0;
    logic error_recovery_active = 1'b0;
    logic [15:0] error_recovery_timer = 16'h0;
    logic [3:0] retry_count = 4'h0;
    logic error_injection_active = 1'b0;

    // Error Detection Signals
    logic parity_error = 1'b0;
    logic crc_error = 1'b0;
    logic timeout_error = 1'b0;
    logic ecc_error = 1'b0;
    logic [31:0] timeout_counter = 32'h0;

{%- if config.enable_crc_check %}
    logic [7:0] calculated_crc = 8'h0;
    logic [7:0] expected_crc = 8'h0;
{%- endif %}

{%- if config.enable_error_logging %}
    logic [31:0] error_log [0:15];
    logic [3:0] error_log_ptr = 4'h0;
{%- endif %}