module radio_mirror_regs ( input clk, input reset, input [13:0] spi_reg_wr_data, input [ 3:0] spi_reg_wr_addr, input spi_reg_wr_en, output [13:0] mirror_reg0, output [13:0] mirror_reg1, output [13:0] mirror_reg2, output [13:0] mirror_reg3, output [13:0] mirror_reg4, output [13:0] mirror_reg5, output [13:0] mirror_reg6, output [13:0] mirror_reg7, output [13:0] mirror_reg8, output [13:0] mirror_reg9, output [13:0] mirror_regA, output [13:0] mirror_regB, output [13:0] mirror_regC ); wire [13:0] radio_mirrorRegs [12:0]; //Thirteen 14-bit registers assign mirror_reg0 = radio_mirrorRegs[0]; assign mirror_reg1 = radio_mirrorRegs[1]; assign mirror_reg2 = radio_mirrorRegs[2]; assign mirror_reg3 = radio_mirrorRegs[3]; assign mirror_reg4 = radio_mirrorRegs[4]; assign mirror_reg5 = radio_mirrorRegs[5]; assign mirror_reg6 = radio_mirrorRegs[6]; assign mirror_reg7 = radio_mirrorRegs[7]; assign mirror_reg8 = radio_mirrorRegs[8]; assign mirror_reg9 = radio_mirrorRegs[9]; assign mirror_regA = radio_mirrorRegs[10]; assign mirror_regB = radio_mirrorRegs[11]; assign mirror_regC = radio_mirrorRegs[12]; localparam MAX2829_REG0_ON_RESET = 14'b01000101000000; localparam MAX2829_REG1_ON_RESET = 14'b00000011001010; localparam MAX2829_REG2_ON_RESET = 14'b01000000000111; localparam MAX2829_REG3_ON_RESET = 14'b11000010100010; localparam MAX2829_REG4_ON_RESET = 14'b01110111011101; localparam MAX2829_REG5_ON_RESET = 14'b01100000100100; localparam MAX2829_REG6_ON_RESET = 14'b01110000000000; localparam MAX2829_REG7_ON_RESET = 14'b00000000101010; localparam MAX2829_REG8_ON_RESET = 14'b00000000100101; localparam MAX2829_REG9_ON_RESET = 14'b00001000000000; localparam MAX2829_REGA_ON_RESET = 14'b00001111000000; localparam MAX2829_REGB_ON_RESET = 14'b00000001111111; localparam MAX2829_REGC_ON_RESET = 14'b00000000000000; localparam MAX2829_REGS_ON_RESET = {MAX2829_REGC_ON_RESET, MAX2829_REGB_ON_RESET, MAX2829_REGA_ON_RESET, MAX2829_REG9_ON_RESET, MAX2829_REG8_ON_RESET, MAX2829_REG7_ON_RESET, MAX2829_REG6_ON_RESET, MAX2829_REG5_ON_RESET, MAX2829_REG4_ON_RESET, MAX2829_REG3_ON_RESET, MAX2829_REG2_ON_RESET, MAX2829_REG1_ON_RESET, MAX2829_REG0_ON_RESET}; genvar bit_index; genvar reg_index; for(reg_index = 0; reg_index <= 12; reg_index = reg_index + 1) begin: MIRROR_REGS_GEN for(bit_index = 0; bit_index <= 13; bit_index = bit_index + 1) begin: MIRROR_REGS_BITS_GEN FDRE #(.INIT(MAX2829_REGS_ON_RESET[(reg_index * 14) + bit_index])) FDRE_RFA_MIRRORREG ( .C(clk), .CE(spi_reg_wr_en & (spi_reg_wr_addr == reg_index)), .R(reset), .D(spi_reg_wr_data[bit_index]), .Q(radio_mirrorRegs[reg_index][bit_index]) ); end end endmodule