📄 altmemddr_phy_alt_mem_phy_ciii.v
字号:
.reset_seq_n (reset_phy_clk_1x_n), .ctl_doing_rd (ctl_doing_rd), .ctl_mem_rdata (ctl_mem_rdata), .ctl_mem_rdata_valid (ctl_mem_rdata_valid), .ctl_init_done (ctl_init_done), .ctl_usr_mode_rdy (ctl_usr_mode_rdy), .mmc_seq_done (mmc_seq_done), .mmc_seq_value (mmc_seq_value), .mux_seq_controller_ready (mux_seq_controller_ready), .mux_seq_wdata_req (mux_seq_wdata_req), .phs_shft_busy (phs_shft_busy), .resync_clk_index (3'h5), .measure_clk_index (3'h4), .seq_mux_burstbegin (seq_mux_burstbegin), .seq_mux_size (seq_mux_size), .seq_mux_address (seq_mux_address), .seq_mux_read_req (seq_mux_read_req), .seq_mux_wdata (seq_mux_wdata), .seq_mux_write_req (seq_mux_write_req), .seq_pll_inc_dec_n (seq_pll_inc_dec_n), .seq_pll_start_reconfig (seq_pll_start_reconfig), .seq_pll_select (seq_pll_select), .seq_rdp_dec_read_lat_1x (seq_rdp_dec_read_lat_1x), .seq_rdp_dmx_swap (seq_rdp_dmx_swap), .seq_rdp_inc_read_lat_1x (seq_rdp_inc_read_lat_1x), .seq_poa_lat_dec_1x (seq_poa_lat_dec_1x), .seq_poa_lat_inc_1x (seq_poa_lat_inc_1x), .seq_poa_protection_override_1x (seq_poa_protection_override_1x), .seq_mmc_start (seq_mmc_start), .resynchronisation_successful (resynchronisation_successful), .postamble_successful (postamble_successful), .tracking_successful (tracking_successful), .tracking_adjustment_up (tracking_adjustment_up), .tracking_adjustment_down (tracking_adjustment_down));// Instance the mimic block ://altmemddr_phy_alt_mem_phy_mimic #( .NUM_MIMIC_SAMPLE_CYCLES (NUM_MIMIC_SAMPLE_CYCLES)) mmc ( .measure_clk (measure_clk_2x), .mimic_data_in (mimic_data), .mmc_seq_done (mmc_seq_done), .mmc_seq_value (mmc_seq_value), .reset_measure_clk_n (reset_measure_clk_2x_n), .seq_mmc_start (seq_mmc_start)); // If required, instance the Mimic debug block. If the debug block is used, a top level input// for mimic_recapture_debug_data should be created.generate if (MIMIC_DEBUG_EN == 1) begin // altmemddr_phy_alt_mem_phy_mimic_debug #( .NUM_DEBUG_SAMPLES_TO_STORE (NUM_DEBUG_SAMPLES_TO_STORE), .PLL_STEPS_PER_CYCLE (PLL_STEPS_PER_CYCLE) ) mmc_debug ( .measure_clk (measure_clk_2x), .mmc_seq_done (mmc_seq_done), .mmc_seq_value (mmc_seq_value), .reset_measure_clk_n (reset_measure_clk_2x_n), .mimic_recapture_debug_data (1'b0) ); endendgenerate// Instance the mux block :// NB. The address widths need not be the same ://altmemddr_phy_alt_mem_phy_mux #( .LOCAL_IF_AWIDTH (LOCAL_IF_AWIDTH), .LOCAL_IF_DWIDTH (LOCAL_IF_DWIDTH), .LOCAL_BURST_LEN_BITS (LOCAL_BURST_LEN_BITS), .MEM_IF_DQ_PER_DQS (MEM_IF_DQ_PER_DQS), .MEM_IF_DWIDTH (MEM_IF_DWIDTH)) mux ( .phy_clk_1x (phy_clk_1x), .reset_phy_clk_1x_n (reset_phy_clk_1x_n), .ctl_address (ctl_address), .ctl_read_req (ctl_read_req), .ctl_ready (ctl_ready), .ctl_wdata (ctl_wdata), .ctl_wdata_req (ctl_wdata_req), .ctl_write_req (ctl_write_req), .ctl_size (ctl_size), .ctl_be (ctl_be), .ctl_refresh_req (ctl_refresh_req), .ctl_burstbegin (ctl_burstbegin), .ctl_rdata (ctl_rdata), .ctl_rdata_valid (ctl_rdata_valid), .ctl_refresh_ack (ctl_refresh_ack), .ctl_init_done (ctl_init_done), .ctl_usr_mode_rdy (ctl_usr_mode_rdy), .local_ready (local_ready), .local_address (local_address), .local_read_req (local_read_req), .local_wdata (local_wdata), .local_wdata_req (local_wdata_req), .local_write_req (local_write_req), .local_size (local_size), .local_be (local_be), .local_refresh_req (local_refresh_req), .local_burstbegin (local_burstbegin), .mux_seq_controller_ready (mux_seq_controller_ready), .mux_seq_wdata_req (mux_seq_wdata_req), .seq_mux_address (seq_mux_address), .seq_mux_read_req (seq_mux_read_req), .seq_mux_wdata (seq_mux_wdata), .seq_mux_write_req (seq_mux_write_req), .seq_mux_size (seq_mux_size), .seq_mux_be ({LOCAL_IF_DWIDTH/8{1'b1}}), .seq_mux_refresh_req (1'b0), .seq_mux_burstbegin (seq_mux_burstbegin), .local_init_done (local_init_done), .local_rdata (local_rdata), .local_rdata_valid (local_rdata_valid), .local_refresh_ack (local_refresh_ack));endmodule
//`ifdef ALT_MEM_PHY_DEFINES`else`include "alt_mem_phy_defines.v"`endif//module altmemddr_phy_alt_mem_phy_ac_ciii ( clk_2x, reset_2x_n, phy_clk_1x, ctl_add_1t_ac_lat, ctl_negedge_en, ctl_add_intermediate_regs, period_sel, ac_h, ac_l, mem_ac );parameter POWER_UP_HIGH = 1;parameter DWIDTH_RATIO = 4;// NB. clk_2x could be either ac_clk_2x or cs_n_clk_2x :input wire clk_2x;input wire reset_2x_n;input wire phy_clk_1x;input wire ctl_add_1t_ac_lat;input wire ctl_negedge_en;input wire ctl_add_intermediate_regs;input wire period_sel;input wire ac_h;input wire ac_l;output wire mem_ac;(* preserve *) reg ac_h_r = POWER_UP_HIGH[0];(* preserve *) reg ac_l_r = POWER_UP_HIGH[0];(* preserve *) reg ac_h_2r = POWER_UP_HIGH[0];(* preserve *) reg ac_l_2r = POWER_UP_HIGH[0];(* preserve *) reg ac_1t = POWER_UP_HIGH[0];(* preserve *) reg ac_2x = POWER_UP_HIGH[0];(* preserve *) reg ac_2x_r = POWER_UP_HIGH[0];(* preserve *) reg ac_2x_2r = POWER_UP_HIGH[0];(* preserve *) reg ac_2x_mux = POWER_UP_HIGH[0];reg ac_2x_retime = POWER_UP_HIGH[0];reg ac_2x_retime_r = POWER_UP_HIGH[0];reg ac_2x_deg_choice = POWER_UP_HIGH[0];wire reset_2x ;assign reset_2x = ~reset_2x_n;generate if (DWIDTH_RATIO == 4) begin : half_rate // Initial registering of inputs : always @(posedge phy_clk_1x) begin ac_h_r <= ac_h; ac_l_r <= ac_l; end // Select high and low phases periodically to create the _2x signal : always @* begin casez(period_sel) 1'b0 : ac_2x = ac_l_2r; 1'b1 : ac_2x = ac_h_2r; default : ac_2x = 1'bx; // X propagaton endcase end always @(posedge clk_2x) begin // Second stage of registering - on clk_2x ac_h_2r <= ac_h_r; ac_l_2r <= ac_l_r; // 1t registering - used if ctl_add_1t_ac_lat is true ac_1t <= ac_2x; // AC_PHASE==270 requires an extra cycle of delay : ac_2x_deg_choice <= ac_1t; // If not at AC_PHASE==270, ctl_add_intermediate_regs shall be zero : if (ctl_add_intermediate_regs == 1'b0) begin if (ctl_add_1t_ac_lat == 1'b1) begin ac_2x_r <= ac_1t; end else begin ac_2x_r <= ac_2x; end end // If at AC_PHASE==270, ctl_add_intermediate_regs shall be one // and an extra cycle delay is required : else begin if (ctl_add_1t_ac_lat == 1'b1) begin ac_2x_r <= ac_2x_deg_choice; end else begin ac_2x_r <= ac_1t; end end // Register the above output for use when ctl_negedge_en is set : ac_2x_2r <= ac_2x_r; end // Determine whether to select the "_r" or "_2r" variant : always @* begin casez(ctl_negedge_en) 1'b0 : ac_2x_mux = ac_2x_r; 1'b1 : ac_2x_mux = ac_2x_2r; default : ac_2x_mux = 1'bx; // X propagaton endcase end if (POWER_UP_HIGH == 1) begin altddio_out #( .extend_oe_disable ("UNUSED"), .intended_device_family ("Cyclone III"), .lpm_hint ("UNUSED"), .lpm_type ("altddio_out"), .oe_reg ("UNUSED"), .power_up_high ("ON"), .width (1) ) addr_pin ( .aset (reset_2x), .datain_h (ac_2x_mux), .datain_l (ac_2x_r), .dataout (mem_ac), .oe (1'b1), .outclock (clk_2x), .outclocken (1'b1), .aclr (), .sset (), .sclr (), .oe_out () ); end else begin altddio_out #( .extend_oe_disable ("UNUSED"), .intended_device_family ("Cyclone III"), .lpm_hint ("UNUSED"), .lpm_type ("altddio_out"), .oe_reg ("UNUSED"), .power_up_high ("OFF"),
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -