text
stringlengths
938
1.05M
//----------------------------------------------------------------------------- // The way that we connect things in low-frequency simulation mode. In this // case just pass everything through to the ARM, which can bit-bang this // (because it is so slow). // // Jonathan Westhues, April 2006 //----------------------------------------------------------------------------- module lo_simulate( pck0, ck_1356meg, ck_1356megb, pwr_lo, pwr_hi, pwr_oe1, pwr_oe2, pwr_oe3, pwr_oe4, adc_d, adc_clk, ssp_frame, ssp_din, ssp_dout, ssp_clk, cross_hi, cross_lo, dbg, divisor ); input pck0, ck_1356meg, ck_1356megb; output pwr_lo, pwr_hi, pwr_oe1, pwr_oe2, pwr_oe3, pwr_oe4; input [7:0] adc_d; output adc_clk; input ssp_dout; output ssp_frame, ssp_din, ssp_clk; input cross_hi, cross_lo; output dbg; input [7:0] divisor; // No logic, straight through. assign pwr_oe3 = 1'b0; assign pwr_oe1 = ssp_dout; assign pwr_oe2 = ssp_dout; assign pwr_oe4 = ssp_dout; assign ssp_clk = cross_lo; assign pwr_lo = 1'b0; assign pwr_hi = 1'b0; assign dbg = ssp_frame; // Divide the clock to be used for the ADC reg [7:0] pck_divider; reg clk_state; always @(posedge pck0) begin if(pck_divider == divisor[7:0]) begin pck_divider <= 8'd0; clk_state = !clk_state; end else begin pck_divider <= pck_divider + 1; end end assign adc_clk = ~clk_state; // Toggle the output with hysteresis // Set to high if the ADC value is above 200 // Set to low if the ADC value is below 64 reg is_high; reg is_low; reg output_state; always @(posedge pck0) begin if((pck_divider == 8'd7) && !clk_state) begin is_high = (adc_d >= 8'd200); is_low = (adc_d <= 8'd64); end end always @(posedge is_high or posedge is_low) begin if(is_high) output_state <= 1'd1; else if(is_low) output_state <= 1'd0; end assign ssp_frame = output_state; endmodule
//----------------------------------------------------------------------------- // The way that we connect things in low-frequency simulation mode. In this // case just pass everything through to the ARM, which can bit-bang this // (because it is so slow). // // Jonathan Westhues, April 2006 //----------------------------------------------------------------------------- module lo_simulate( pck0, ck_1356meg, ck_1356megb, pwr_lo, pwr_hi, pwr_oe1, pwr_oe2, pwr_oe3, pwr_oe4, adc_d, adc_clk, ssp_frame, ssp_din, ssp_dout, ssp_clk, cross_hi, cross_lo, dbg, divisor ); input pck0, ck_1356meg, ck_1356megb; output pwr_lo, pwr_hi, pwr_oe1, pwr_oe2, pwr_oe3, pwr_oe4; input [7:0] adc_d; output adc_clk; input ssp_dout; output ssp_frame, ssp_din, ssp_clk; input cross_hi, cross_lo; output dbg; input [7:0] divisor; // No logic, straight through. assign pwr_oe3 = 1'b0; assign pwr_oe1 = ssp_dout; assign pwr_oe2 = ssp_dout; assign pwr_oe4 = ssp_dout; assign ssp_clk = cross_lo; assign pwr_lo = 1'b0; assign pwr_hi = 1'b0; assign dbg = ssp_frame; // Divide the clock to be used for the ADC reg [7:0] pck_divider; reg clk_state; always @(posedge pck0) begin if(pck_divider == divisor[7:0]) begin pck_divider <= 8'd0; clk_state = !clk_state; end else begin pck_divider <= pck_divider + 1; end end assign adc_clk = ~clk_state; // Toggle the output with hysteresis // Set to high if the ADC value is above 200 // Set to low if the ADC value is below 64 reg is_high; reg is_low; reg output_state; always @(posedge pck0) begin if((pck_divider == 8'd7) && !clk_state) begin is_high = (adc_d >= 8'd200); is_low = (adc_d <= 8'd64); end end always @(posedge is_high or posedge is_low) begin if(is_high) output_state <= 1'd1; else if(is_low) output_state <= 1'd0; end assign ssp_frame = output_state; endmodule
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 21:09:39 08/25/2015 // Design Name: // Module Name: FSM_Add_Subtract // Project Name: // Target Devices: // Tool versions: // Description: // // Dependencies: // // Revision: // Revision 0.01 - File Created // Additional Comments: // ////////////////////////////////////////////////////////////////////////////////// module FSM_Add_Subtract ( //INPUTS input wire clk, //system clock input wire rst, //system reset input wire rst_FSM, input wire beg_FSM, //Begin Finite State Machine //**REVISAD ////////////////////////////////////////////////////////////////////////////// //Oper_Start_In evaluation signals input wire zero_flag_i, //Exp_operation evaluation signals input wire norm_iteration_i, //Barrel_Shifter evaluation signals //None //Add_Subt_Sgf evaluation signals input wire add_overflow_i, //LZA evaluation signals //None //Deco_round evaluation Signals input wire round_i, //Final_result evaluation signals //None //OUTPUT SIGNALS //////////////////////////////////////////////////////////////////////////////////// //Oper_Start_In control signals output wire load_1_o,//Enable input registers output wire load_2_o,//Enable output registers //Exp_operation control signals output reg load_3_o, //Enable Output registers output reg load_8_o, output reg A_S_op_o, //Select operation for exponent normalization(Subt for left shift, Add for right shift) //Barrel shifter control signals output reg load_4_o, //Enable Output registers output reg left_right_o, //Select direction shift (right=0, left=1) output reg bit_shift_o, //bit input for shifts fills //Add_Subt_sgf control signals output reg load_5_o, //Enables Output registers //LZA control signals output reg load_6_o, //Enables Output registers //Deco_Round control signals //None //Final_Result control signals output reg load_7_o, ///////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ //Multiplexer selector for Exp_operation's OPER_A output reg ctrl_a_o, //Multiplexer selector for Exp_operation's OPER_B & Barrel_Shifter's Shift value output reg [1:0] ctrl_b_o, output reg ctrl_b_load_o, //Multiplexer selector for Data shift output reg ctrl_c_o, //Multiplexer selector for Add_Subt_Sgf's inputs output reg ctrl_d_o, //Internal reset signal output reg rst_int, //Ready Signal output reg ready ); localparam [3:0] //First I'm going to declarate the registers of the first phase of execution start = 4'd0, //This state evaluates the beg_FSM to begin operations load_oper = 4'd1, //This state enables the registers that contains //both operands and the operator zero_info_state = 4'd2, //Evaluate zero condition load_diff_exp = 4'd3, //Enable registers for the exponent on the small value normalization and for the first //result normalization extra1_64= 4'd4, norm_sgf_first= 4'd5, //Enable the barrel shifter's registers and evaluate if it's the first time (small operand) or the //second time (result normalization) add_subt = 4'd6, //Enable the add_subt_sgf's registers add_subt_r = 4'd7, //Enable the add_subt_sgf's registers for round condition overflow_add = 4'd8, round_sgf = 4'd9, //Evaluate the significand round condition overflow_add_r = 4'd10, extra2_64= 4'd11, //Enable registers for the exponent normalization on round condition norm_sgf_r = 4'd12, //Enable the barrel shifter's registers for round condition load_final_result = 4'd13, //Load the final_result's register with the result ready_flag = 4'd14; //Enable the ready flag with the final result //**********************REVISADO reg [3:0] state_reg, state_next ; //state registers declaration ////////////////////////Logic outputs///////////////77 assign load_1_o= (state_reg==load_oper); assign load_2_o= (state_reg==zero_info_state); //// always @(posedge clk, posedge rst) if (rst) begin state_reg <= start; end else begin state_reg <= state_next; end /// always @* begin state_next = state_reg; rst_int = 0; //Oper_Start_In control signals //load_1_o=0; //load_2_o=0; //Exp_operation control signals load_3_o=0; load_8_o=0; A_S_op_o=1; //Barrel shifter control signals load_4_o=0; left_right_o=0; bit_shift_o=0; //bit input for shifts fills //Add_Subt_sgf control signals load_5_o=0; //LZA control signals load_6_o=0; //Deco_Round control signals //None //Final_Result control signals load_7_o=0; ///////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ //Multiplexer selector for Exp_operation's OPER_A ctrl_a_o=0; //Multiplexer selector for Exp_operation's OPER_B ctrl_b_o=2'b00; ctrl_b_load_o=0; //Multiplexer selector for Barrel_Shifter's Data shift ctrl_c_o=0; //Multiplexer selector for Barrel_Shifter's Shift value //Multiplexer selector for Add_Subt_Sgf's inputs ctrl_d_o=0; //Ready Phase ready = 0; //**REVISADO rst_int = 0; case(state_reg) //FPU reset start: begin rst_int=1; if(beg_FSM) begin state_next = load_oper; end end load_oper: //Load input registers for Oper_star in evaluation begin // load_1_o = 1; state_next = zero_info_state; end zero_info_state: //In case of zero condition, go to final result for ready flag. Else, continue with the calculation begin if (zero_flag_i)begin state_next = ready_flag;end else begin //load_2_o = 1; state_next = load_diff_exp;end end load_diff_exp: //in first instance, Calculate DMP - DmP exponents, in other iteration, evaluation in begin load_3_o = 1; /* if ()*/ state_next = extra1_64; end extra1_64: begin load_3_o = 1; if (norm_iteration_i)begin load_8_o=1; if(add_overflow_i)begin A_S_op_o=0; left_right_o=0; bit_shift_o=1; end else begin A_S_op_o=1; left_right_o=1; bit_shift_o=0; end end state_next = norm_sgf_first; end norm_sgf_first: // begin load_4_o = 1; if (norm_iteration_i)begin if(add_overflow_i)begin left_right_o=0; bit_shift_o=1; state_next = round_sgf; end else begin left_right_o=1; bit_shift_o=0; state_next = round_sgf;end end else state_next = add_subt; end add_subt: begin //Reg enables load_5_o = 1; ctrl_c_o = 1; state_next = overflow_add; end overflow_add: begin //Reg enables/Disables load_6_o=1; ctrl_b_load_o=1; if ( add_overflow_i)begin ctrl_b_o=2'b10; end else begin A_S_op_o=1; ctrl_b_o=2'b01; end //state_next = load_exp_oper_over; state_next = extra1_64; end round_sgf: begin load_4_o = 0; if(round_i) begin ctrl_d_o =1; ctrl_a_o = 1; state_next = add_subt_r; end else begin state_next = load_final_result; end end add_subt_r: begin load_5_o = 1; state_next = overflow_add_r; end overflow_add_r: begin ctrl_b_load_o=1; if ( add_overflow_i)begin ctrl_b_o=2'b10; end else begin ctrl_b_o=2'b11; end state_next = extra2_64; end extra2_64: begin load_3_o = 1; load_8_o = 1; if ( add_overflow_i)begin A_S_op_o=0; bit_shift_o=1; end state_next = norm_sgf_r; end norm_sgf_r: begin load_4_o = 1; if ( add_overflow_i)begin left_right_o=0; bit_shift_o=1; end state_next = load_final_result; end load_final_result: begin load_7_o = 1; state_next = ready_flag; end ready_flag: begin ready = 1; if(rst_FSM) begin state_next = start;end end default: begin state_next =start;end endcase end endmodule
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 21:09:39 08/25/2015 // Design Name: // Module Name: FSM_Add_Subtract // Project Name: // Target Devices: // Tool versions: // Description: // // Dependencies: // // Revision: // Revision 0.01 - File Created // Additional Comments: // ////////////////////////////////////////////////////////////////////////////////// module FSM_Add_Subtract ( //INPUTS input wire clk, //system clock input wire rst, //system reset input wire rst_FSM, input wire beg_FSM, //Begin Finite State Machine //**REVISAD ////////////////////////////////////////////////////////////////////////////// //Oper_Start_In evaluation signals input wire zero_flag_i, //Exp_operation evaluation signals input wire norm_iteration_i, //Barrel_Shifter evaluation signals //None //Add_Subt_Sgf evaluation signals input wire add_overflow_i, //LZA evaluation signals //None //Deco_round evaluation Signals input wire round_i, //Final_result evaluation signals //None //OUTPUT SIGNALS //////////////////////////////////////////////////////////////////////////////////// //Oper_Start_In control signals output wire load_1_o,//Enable input registers output wire load_2_o,//Enable output registers //Exp_operation control signals output reg load_3_o, //Enable Output registers output reg load_8_o, output reg A_S_op_o, //Select operation for exponent normalization(Subt for left shift, Add for right shift) //Barrel shifter control signals output reg load_4_o, //Enable Output registers output reg left_right_o, //Select direction shift (right=0, left=1) output reg bit_shift_o, //bit input for shifts fills //Add_Subt_sgf control signals output reg load_5_o, //Enables Output registers //LZA control signals output reg load_6_o, //Enables Output registers //Deco_Round control signals //None //Final_Result control signals output reg load_7_o, ///////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ //Multiplexer selector for Exp_operation's OPER_A output reg ctrl_a_o, //Multiplexer selector for Exp_operation's OPER_B & Barrel_Shifter's Shift value output reg [1:0] ctrl_b_o, output reg ctrl_b_load_o, //Multiplexer selector for Data shift output reg ctrl_c_o, //Multiplexer selector for Add_Subt_Sgf's inputs output reg ctrl_d_o, //Internal reset signal output reg rst_int, //Ready Signal output reg ready ); localparam [3:0] //First I'm going to declarate the registers of the first phase of execution start = 4'd0, //This state evaluates the beg_FSM to begin operations load_oper = 4'd1, //This state enables the registers that contains //both operands and the operator zero_info_state = 4'd2, //Evaluate zero condition load_diff_exp = 4'd3, //Enable registers for the exponent on the small value normalization and for the first //result normalization extra1_64= 4'd4, norm_sgf_first= 4'd5, //Enable the barrel shifter's registers and evaluate if it's the first time (small operand) or the //second time (result normalization) add_subt = 4'd6, //Enable the add_subt_sgf's registers add_subt_r = 4'd7, //Enable the add_subt_sgf's registers for round condition overflow_add = 4'd8, round_sgf = 4'd9, //Evaluate the significand round condition overflow_add_r = 4'd10, extra2_64= 4'd11, //Enable registers for the exponent normalization on round condition norm_sgf_r = 4'd12, //Enable the barrel shifter's registers for round condition load_final_result = 4'd13, //Load the final_result's register with the result ready_flag = 4'd14; //Enable the ready flag with the final result //**********************REVISADO reg [3:0] state_reg, state_next ; //state registers declaration ////////////////////////Logic outputs///////////////77 assign load_1_o= (state_reg==load_oper); assign load_2_o= (state_reg==zero_info_state); //// always @(posedge clk, posedge rst) if (rst) begin state_reg <= start; end else begin state_reg <= state_next; end /// always @* begin state_next = state_reg; rst_int = 0; //Oper_Start_In control signals //load_1_o=0; //load_2_o=0; //Exp_operation control signals load_3_o=0; load_8_o=0; A_S_op_o=1; //Barrel shifter control signals load_4_o=0; left_right_o=0; bit_shift_o=0; //bit input for shifts fills //Add_Subt_sgf control signals load_5_o=0; //LZA control signals load_6_o=0; //Deco_Round control signals //None //Final_Result control signals load_7_o=0; ///////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ //Multiplexer selector for Exp_operation's OPER_A ctrl_a_o=0; //Multiplexer selector for Exp_operation's OPER_B ctrl_b_o=2'b00; ctrl_b_load_o=0; //Multiplexer selector for Barrel_Shifter's Data shift ctrl_c_o=0; //Multiplexer selector for Barrel_Shifter's Shift value //Multiplexer selector for Add_Subt_Sgf's inputs ctrl_d_o=0; //Ready Phase ready = 0; //**REVISADO rst_int = 0; case(state_reg) //FPU reset start: begin rst_int=1; if(beg_FSM) begin state_next = load_oper; end end load_oper: //Load input registers for Oper_star in evaluation begin // load_1_o = 1; state_next = zero_info_state; end zero_info_state: //In case of zero condition, go to final result for ready flag. Else, continue with the calculation begin if (zero_flag_i)begin state_next = ready_flag;end else begin //load_2_o = 1; state_next = load_diff_exp;end end load_diff_exp: //in first instance, Calculate DMP - DmP exponents, in other iteration, evaluation in begin load_3_o = 1; /* if ()*/ state_next = extra1_64; end extra1_64: begin load_3_o = 1; if (norm_iteration_i)begin load_8_o=1; if(add_overflow_i)begin A_S_op_o=0; left_right_o=0; bit_shift_o=1; end else begin A_S_op_o=1; left_right_o=1; bit_shift_o=0; end end state_next = norm_sgf_first; end norm_sgf_first: // begin load_4_o = 1; if (norm_iteration_i)begin if(add_overflow_i)begin left_right_o=0; bit_shift_o=1; state_next = round_sgf; end else begin left_right_o=1; bit_shift_o=0; state_next = round_sgf;end end else state_next = add_subt; end add_subt: begin //Reg enables load_5_o = 1; ctrl_c_o = 1; state_next = overflow_add; end overflow_add: begin //Reg enables/Disables load_6_o=1; ctrl_b_load_o=1; if ( add_overflow_i)begin ctrl_b_o=2'b10; end else begin A_S_op_o=1; ctrl_b_o=2'b01; end //state_next = load_exp_oper_over; state_next = extra1_64; end round_sgf: begin load_4_o = 0; if(round_i) begin ctrl_d_o =1; ctrl_a_o = 1; state_next = add_subt_r; end else begin state_next = load_final_result; end end add_subt_r: begin load_5_o = 1; state_next = overflow_add_r; end overflow_add_r: begin ctrl_b_load_o=1; if ( add_overflow_i)begin ctrl_b_o=2'b10; end else begin ctrl_b_o=2'b11; end state_next = extra2_64; end extra2_64: begin load_3_o = 1; load_8_o = 1; if ( add_overflow_i)begin A_S_op_o=0; bit_shift_o=1; end state_next = norm_sgf_r; end norm_sgf_r: begin load_4_o = 1; if ( add_overflow_i)begin left_right_o=0; bit_shift_o=1; end state_next = load_final_result; end load_final_result: begin load_7_o = 1; state_next = ready_flag; end ready_flag: begin ready = 1; if(rst_FSM) begin state_next = start;end end default: begin state_next =start;end endcase end endmodule
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 21:09:39 08/25/2015 // Design Name: // Module Name: FSM_Add_Subtract // Project Name: // Target Devices: // Tool versions: // Description: // // Dependencies: // // Revision: // Revision 0.01 - File Created // Additional Comments: // ////////////////////////////////////////////////////////////////////////////////// module FSM_Add_Subtract ( //INPUTS input wire clk, //system clock input wire rst, //system reset input wire rst_FSM, input wire beg_FSM, //Begin Finite State Machine //**REVISAD ////////////////////////////////////////////////////////////////////////////// //Oper_Start_In evaluation signals input wire zero_flag_i, //Exp_operation evaluation signals input wire norm_iteration_i, //Barrel_Shifter evaluation signals //None //Add_Subt_Sgf evaluation signals input wire add_overflow_i, //LZA evaluation signals //None //Deco_round evaluation Signals input wire round_i, //Final_result evaluation signals //None //OUTPUT SIGNALS //////////////////////////////////////////////////////////////////////////////////// //Oper_Start_In control signals output wire load_1_o,//Enable input registers output wire load_2_o,//Enable output registers //Exp_operation control signals output reg load_3_o, //Enable Output registers output reg load_8_o, output reg A_S_op_o, //Select operation for exponent normalization(Subt for left shift, Add for right shift) //Barrel shifter control signals output reg load_4_o, //Enable Output registers output reg left_right_o, //Select direction shift (right=0, left=1) output reg bit_shift_o, //bit input for shifts fills //Add_Subt_sgf control signals output reg load_5_o, //Enables Output registers //LZA control signals output reg load_6_o, //Enables Output registers //Deco_Round control signals //None //Final_Result control signals output reg load_7_o, ///////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ //Multiplexer selector for Exp_operation's OPER_A output reg ctrl_a_o, //Multiplexer selector for Exp_operation's OPER_B & Barrel_Shifter's Shift value output reg [1:0] ctrl_b_o, output reg ctrl_b_load_o, //Multiplexer selector for Data shift output reg ctrl_c_o, //Multiplexer selector for Add_Subt_Sgf's inputs output reg ctrl_d_o, //Internal reset signal output reg rst_int, //Ready Signal output reg ready ); localparam [3:0] //First I'm going to declarate the registers of the first phase of execution start = 4'd0, //This state evaluates the beg_FSM to begin operations load_oper = 4'd1, //This state enables the registers that contains //both operands and the operator zero_info_state = 4'd2, //Evaluate zero condition load_diff_exp = 4'd3, //Enable registers for the exponent on the small value normalization and for the first //result normalization extra1_64= 4'd4, norm_sgf_first= 4'd5, //Enable the barrel shifter's registers and evaluate if it's the first time (small operand) or the //second time (result normalization) add_subt = 4'd6, //Enable the add_subt_sgf's registers add_subt_r = 4'd7, //Enable the add_subt_sgf's registers for round condition overflow_add = 4'd8, round_sgf = 4'd9, //Evaluate the significand round condition overflow_add_r = 4'd10, extra2_64= 4'd11, //Enable registers for the exponent normalization on round condition norm_sgf_r = 4'd12, //Enable the barrel shifter's registers for round condition load_final_result = 4'd13, //Load the final_result's register with the result ready_flag = 4'd14; //Enable the ready flag with the final result //**********************REVISADO reg [3:0] state_reg, state_next ; //state registers declaration ////////////////////////Logic outputs///////////////77 assign load_1_o= (state_reg==load_oper); assign load_2_o= (state_reg==zero_info_state); //// always @(posedge clk, posedge rst) if (rst) begin state_reg <= start; end else begin state_reg <= state_next; end /// always @* begin state_next = state_reg; rst_int = 0; //Oper_Start_In control signals //load_1_o=0; //load_2_o=0; //Exp_operation control signals load_3_o=0; load_8_o=0; A_S_op_o=1; //Barrel shifter control signals load_4_o=0; left_right_o=0; bit_shift_o=0; //bit input for shifts fills //Add_Subt_sgf control signals load_5_o=0; //LZA control signals load_6_o=0; //Deco_Round control signals //None //Final_Result control signals load_7_o=0; ///////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ //Multiplexer selector for Exp_operation's OPER_A ctrl_a_o=0; //Multiplexer selector for Exp_operation's OPER_B ctrl_b_o=2'b00; ctrl_b_load_o=0; //Multiplexer selector for Barrel_Shifter's Data shift ctrl_c_o=0; //Multiplexer selector for Barrel_Shifter's Shift value //Multiplexer selector for Add_Subt_Sgf's inputs ctrl_d_o=0; //Ready Phase ready = 0; //**REVISADO rst_int = 0; case(state_reg) //FPU reset start: begin rst_int=1; if(beg_FSM) begin state_next = load_oper; end end load_oper: //Load input registers for Oper_star in evaluation begin // load_1_o = 1; state_next = zero_info_state; end zero_info_state: //In case of zero condition, go to final result for ready flag. Else, continue with the calculation begin if (zero_flag_i)begin state_next = ready_flag;end else begin //load_2_o = 1; state_next = load_diff_exp;end end load_diff_exp: //in first instance, Calculate DMP - DmP exponents, in other iteration, evaluation in begin load_3_o = 1; /* if ()*/ state_next = extra1_64; end extra1_64: begin load_3_o = 1; if (norm_iteration_i)begin load_8_o=1; if(add_overflow_i)begin A_S_op_o=0; left_right_o=0; bit_shift_o=1; end else begin A_S_op_o=1; left_right_o=1; bit_shift_o=0; end end state_next = norm_sgf_first; end norm_sgf_first: // begin load_4_o = 1; if (norm_iteration_i)begin if(add_overflow_i)begin left_right_o=0; bit_shift_o=1; state_next = round_sgf; end else begin left_right_o=1; bit_shift_o=0; state_next = round_sgf;end end else state_next = add_subt; end add_subt: begin //Reg enables load_5_o = 1; ctrl_c_o = 1; state_next = overflow_add; end overflow_add: begin //Reg enables/Disables load_6_o=1; ctrl_b_load_o=1; if ( add_overflow_i)begin ctrl_b_o=2'b10; end else begin A_S_op_o=1; ctrl_b_o=2'b01; end //state_next = load_exp_oper_over; state_next = extra1_64; end round_sgf: begin load_4_o = 0; if(round_i) begin ctrl_d_o =1; ctrl_a_o = 1; state_next = add_subt_r; end else begin state_next = load_final_result; end end add_subt_r: begin load_5_o = 1; state_next = overflow_add_r; end overflow_add_r: begin ctrl_b_load_o=1; if ( add_overflow_i)begin ctrl_b_o=2'b10; end else begin ctrl_b_o=2'b11; end state_next = extra2_64; end extra2_64: begin load_3_o = 1; load_8_o = 1; if ( add_overflow_i)begin A_S_op_o=0; bit_shift_o=1; end state_next = norm_sgf_r; end norm_sgf_r: begin load_4_o = 1; if ( add_overflow_i)begin left_right_o=0; bit_shift_o=1; end state_next = load_final_result; end load_final_result: begin load_7_o = 1; state_next = ready_flag; end ready_flag: begin ready = 1; if(rst_FSM) begin state_next = start;end end default: begin state_next =start;end endcase end endmodule
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 21:09:39 08/25/2015 // Design Name: // Module Name: FSM_Add_Subtract // Project Name: // Target Devices: // Tool versions: // Description: // // Dependencies: // // Revision: // Revision 0.01 - File Created // Additional Comments: // ////////////////////////////////////////////////////////////////////////////////// module FSM_Add_Subtract ( //INPUTS input wire clk, //system clock input wire rst, //system reset input wire rst_FSM, input wire beg_FSM, //Begin Finite State Machine //**REVISAD ////////////////////////////////////////////////////////////////////////////// //Oper_Start_In evaluation signals input wire zero_flag_i, //Exp_operation evaluation signals input wire norm_iteration_i, //Barrel_Shifter evaluation signals //None //Add_Subt_Sgf evaluation signals input wire add_overflow_i, //LZA evaluation signals //None //Deco_round evaluation Signals input wire round_i, //Final_result evaluation signals //None //OUTPUT SIGNALS //////////////////////////////////////////////////////////////////////////////////// //Oper_Start_In control signals output wire load_1_o,//Enable input registers output wire load_2_o,//Enable output registers //Exp_operation control signals output reg load_3_o, //Enable Output registers output reg load_8_o, output reg A_S_op_o, //Select operation for exponent normalization(Subt for left shift, Add for right shift) //Barrel shifter control signals output reg load_4_o, //Enable Output registers output reg left_right_o, //Select direction shift (right=0, left=1) output reg bit_shift_o, //bit input for shifts fills //Add_Subt_sgf control signals output reg load_5_o, //Enables Output registers //LZA control signals output reg load_6_o, //Enables Output registers //Deco_Round control signals //None //Final_Result control signals output reg load_7_o, ///////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ //Multiplexer selector for Exp_operation's OPER_A output reg ctrl_a_o, //Multiplexer selector for Exp_operation's OPER_B & Barrel_Shifter's Shift value output reg [1:0] ctrl_b_o, output reg ctrl_b_load_o, //Multiplexer selector for Data shift output reg ctrl_c_o, //Multiplexer selector for Add_Subt_Sgf's inputs output reg ctrl_d_o, //Internal reset signal output reg rst_int, //Ready Signal output reg ready ); localparam [3:0] //First I'm going to declarate the registers of the first phase of execution start = 4'd0, //This state evaluates the beg_FSM to begin operations load_oper = 4'd1, //This state enables the registers that contains //both operands and the operator zero_info_state = 4'd2, //Evaluate zero condition load_diff_exp = 4'd3, //Enable registers for the exponent on the small value normalization and for the first //result normalization extra1_64= 4'd4, norm_sgf_first= 4'd5, //Enable the barrel shifter's registers and evaluate if it's the first time (small operand) or the //second time (result normalization) add_subt = 4'd6, //Enable the add_subt_sgf's registers add_subt_r = 4'd7, //Enable the add_subt_sgf's registers for round condition overflow_add = 4'd8, round_sgf = 4'd9, //Evaluate the significand round condition overflow_add_r = 4'd10, extra2_64= 4'd11, //Enable registers for the exponent normalization on round condition norm_sgf_r = 4'd12, //Enable the barrel shifter's registers for round condition load_final_result = 4'd13, //Load the final_result's register with the result ready_flag = 4'd14; //Enable the ready flag with the final result //**********************REVISADO reg [3:0] state_reg, state_next ; //state registers declaration ////////////////////////Logic outputs///////////////77 assign load_1_o= (state_reg==load_oper); assign load_2_o= (state_reg==zero_info_state); //// always @(posedge clk, posedge rst) if (rst) begin state_reg <= start; end else begin state_reg <= state_next; end /// always @* begin state_next = state_reg; rst_int = 0; //Oper_Start_In control signals //load_1_o=0; //load_2_o=0; //Exp_operation control signals load_3_o=0; load_8_o=0; A_S_op_o=1; //Barrel shifter control signals load_4_o=0; left_right_o=0; bit_shift_o=0; //bit input for shifts fills //Add_Subt_sgf control signals load_5_o=0; //LZA control signals load_6_o=0; //Deco_Round control signals //None //Final_Result control signals load_7_o=0; ///////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ //Multiplexer selector for Exp_operation's OPER_A ctrl_a_o=0; //Multiplexer selector for Exp_operation's OPER_B ctrl_b_o=2'b00; ctrl_b_load_o=0; //Multiplexer selector for Barrel_Shifter's Data shift ctrl_c_o=0; //Multiplexer selector for Barrel_Shifter's Shift value //Multiplexer selector for Add_Subt_Sgf's inputs ctrl_d_o=0; //Ready Phase ready = 0; //**REVISADO rst_int = 0; case(state_reg) //FPU reset start: begin rst_int=1; if(beg_FSM) begin state_next = load_oper; end end load_oper: //Load input registers for Oper_star in evaluation begin // load_1_o = 1; state_next = zero_info_state; end zero_info_state: //In case of zero condition, go to final result for ready flag. Else, continue with the calculation begin if (zero_flag_i)begin state_next = ready_flag;end else begin //load_2_o = 1; state_next = load_diff_exp;end end load_diff_exp: //in first instance, Calculate DMP - DmP exponents, in other iteration, evaluation in begin load_3_o = 1; /* if ()*/ state_next = extra1_64; end extra1_64: begin load_3_o = 1; if (norm_iteration_i)begin load_8_o=1; if(add_overflow_i)begin A_S_op_o=0; left_right_o=0; bit_shift_o=1; end else begin A_S_op_o=1; left_right_o=1; bit_shift_o=0; end end state_next = norm_sgf_first; end norm_sgf_first: // begin load_4_o = 1; if (norm_iteration_i)begin if(add_overflow_i)begin left_right_o=0; bit_shift_o=1; state_next = round_sgf; end else begin left_right_o=1; bit_shift_o=0; state_next = round_sgf;end end else state_next = add_subt; end add_subt: begin //Reg enables load_5_o = 1; ctrl_c_o = 1; state_next = overflow_add; end overflow_add: begin //Reg enables/Disables load_6_o=1; ctrl_b_load_o=1; if ( add_overflow_i)begin ctrl_b_o=2'b10; end else begin A_S_op_o=1; ctrl_b_o=2'b01; end //state_next = load_exp_oper_over; state_next = extra1_64; end round_sgf: begin load_4_o = 0; if(round_i) begin ctrl_d_o =1; ctrl_a_o = 1; state_next = add_subt_r; end else begin state_next = load_final_result; end end add_subt_r: begin load_5_o = 1; state_next = overflow_add_r; end overflow_add_r: begin ctrl_b_load_o=1; if ( add_overflow_i)begin ctrl_b_o=2'b10; end else begin ctrl_b_o=2'b11; end state_next = extra2_64; end extra2_64: begin load_3_o = 1; load_8_o = 1; if ( add_overflow_i)begin A_S_op_o=0; bit_shift_o=1; end state_next = norm_sgf_r; end norm_sgf_r: begin load_4_o = 1; if ( add_overflow_i)begin left_right_o=0; bit_shift_o=1; end state_next = load_final_result; end load_final_result: begin load_7_o = 1; state_next = ready_flag; end ready_flag: begin ready = 1; if(rst_FSM) begin state_next = start;end end default: begin state_next =start;end endcase end endmodule
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 21:09:39 08/25/2015 // Design Name: // Module Name: FSM_Add_Subtract // Project Name: // Target Devices: // Tool versions: // Description: // // Dependencies: // // Revision: // Revision 0.01 - File Created // Additional Comments: // ////////////////////////////////////////////////////////////////////////////////// module FSM_Add_Subtract ( //INPUTS input wire clk, //system clock input wire rst, //system reset input wire rst_FSM, input wire beg_FSM, //Begin Finite State Machine //**REVISAD ////////////////////////////////////////////////////////////////////////////// //Oper_Start_In evaluation signals input wire zero_flag_i, //Exp_operation evaluation signals input wire norm_iteration_i, //Barrel_Shifter evaluation signals //None //Add_Subt_Sgf evaluation signals input wire add_overflow_i, //LZA evaluation signals //None //Deco_round evaluation Signals input wire round_i, //Final_result evaluation signals //None //OUTPUT SIGNALS //////////////////////////////////////////////////////////////////////////////////// //Oper_Start_In control signals output wire load_1_o,//Enable input registers output wire load_2_o,//Enable output registers //Exp_operation control signals output reg load_3_o, //Enable Output registers output reg load_8_o, output reg A_S_op_o, //Select operation for exponent normalization(Subt for left shift, Add for right shift) //Barrel shifter control signals output reg load_4_o, //Enable Output registers output reg left_right_o, //Select direction shift (right=0, left=1) output reg bit_shift_o, //bit input for shifts fills //Add_Subt_sgf control signals output reg load_5_o, //Enables Output registers //LZA control signals output reg load_6_o, //Enables Output registers //Deco_Round control signals //None //Final_Result control signals output reg load_7_o, ///////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ //Multiplexer selector for Exp_operation's OPER_A output reg ctrl_a_o, //Multiplexer selector for Exp_operation's OPER_B & Barrel_Shifter's Shift value output reg [1:0] ctrl_b_o, output reg ctrl_b_load_o, //Multiplexer selector for Data shift output reg ctrl_c_o, //Multiplexer selector for Add_Subt_Sgf's inputs output reg ctrl_d_o, //Internal reset signal output reg rst_int, //Ready Signal output reg ready ); localparam [3:0] //First I'm going to declarate the registers of the first phase of execution start = 4'd0, //This state evaluates the beg_FSM to begin operations load_oper = 4'd1, //This state enables the registers that contains //both operands and the operator zero_info_state = 4'd2, //Evaluate zero condition load_diff_exp = 4'd3, //Enable registers for the exponent on the small value normalization and for the first //result normalization extra1_64= 4'd4, norm_sgf_first= 4'd5, //Enable the barrel shifter's registers and evaluate if it's the first time (small operand) or the //second time (result normalization) add_subt = 4'd6, //Enable the add_subt_sgf's registers add_subt_r = 4'd7, //Enable the add_subt_sgf's registers for round condition overflow_add = 4'd8, round_sgf = 4'd9, //Evaluate the significand round condition overflow_add_r = 4'd10, extra2_64= 4'd11, //Enable registers for the exponent normalization on round condition norm_sgf_r = 4'd12, //Enable the barrel shifter's registers for round condition load_final_result = 4'd13, //Load the final_result's register with the result ready_flag = 4'd14; //Enable the ready flag with the final result //**********************REVISADO reg [3:0] state_reg, state_next ; //state registers declaration ////////////////////////Logic outputs///////////////77 assign load_1_o= (state_reg==load_oper); assign load_2_o= (state_reg==zero_info_state); //// always @(posedge clk, posedge rst) if (rst) begin state_reg <= start; end else begin state_reg <= state_next; end /// always @* begin state_next = state_reg; rst_int = 0; //Oper_Start_In control signals //load_1_o=0; //load_2_o=0; //Exp_operation control signals load_3_o=0; load_8_o=0; A_S_op_o=1; //Barrel shifter control signals load_4_o=0; left_right_o=0; bit_shift_o=0; //bit input for shifts fills //Add_Subt_sgf control signals load_5_o=0; //LZA control signals load_6_o=0; //Deco_Round control signals //None //Final_Result control signals load_7_o=0; ///////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ //Multiplexer selector for Exp_operation's OPER_A ctrl_a_o=0; //Multiplexer selector for Exp_operation's OPER_B ctrl_b_o=2'b00; ctrl_b_load_o=0; //Multiplexer selector for Barrel_Shifter's Data shift ctrl_c_o=0; //Multiplexer selector for Barrel_Shifter's Shift value //Multiplexer selector for Add_Subt_Sgf's inputs ctrl_d_o=0; //Ready Phase ready = 0; //**REVISADO rst_int = 0; case(state_reg) //FPU reset start: begin rst_int=1; if(beg_FSM) begin state_next = load_oper; end end load_oper: //Load input registers for Oper_star in evaluation begin // load_1_o = 1; state_next = zero_info_state; end zero_info_state: //In case of zero condition, go to final result for ready flag. Else, continue with the calculation begin if (zero_flag_i)begin state_next = ready_flag;end else begin //load_2_o = 1; state_next = load_diff_exp;end end load_diff_exp: //in first instance, Calculate DMP - DmP exponents, in other iteration, evaluation in begin load_3_o = 1; /* if ()*/ state_next = extra1_64; end extra1_64: begin load_3_o = 1; if (norm_iteration_i)begin load_8_o=1; if(add_overflow_i)begin A_S_op_o=0; left_right_o=0; bit_shift_o=1; end else begin A_S_op_o=1; left_right_o=1; bit_shift_o=0; end end state_next = norm_sgf_first; end norm_sgf_first: // begin load_4_o = 1; if (norm_iteration_i)begin if(add_overflow_i)begin left_right_o=0; bit_shift_o=1; state_next = round_sgf; end else begin left_right_o=1; bit_shift_o=0; state_next = round_sgf;end end else state_next = add_subt; end add_subt: begin //Reg enables load_5_o = 1; ctrl_c_o = 1; state_next = overflow_add; end overflow_add: begin //Reg enables/Disables load_6_o=1; ctrl_b_load_o=1; if ( add_overflow_i)begin ctrl_b_o=2'b10; end else begin A_S_op_o=1; ctrl_b_o=2'b01; end //state_next = load_exp_oper_over; state_next = extra1_64; end round_sgf: begin load_4_o = 0; if(round_i) begin ctrl_d_o =1; ctrl_a_o = 1; state_next = add_subt_r; end else begin state_next = load_final_result; end end add_subt_r: begin load_5_o = 1; state_next = overflow_add_r; end overflow_add_r: begin ctrl_b_load_o=1; if ( add_overflow_i)begin ctrl_b_o=2'b10; end else begin ctrl_b_o=2'b11; end state_next = extra2_64; end extra2_64: begin load_3_o = 1; load_8_o = 1; if ( add_overflow_i)begin A_S_op_o=0; bit_shift_o=1; end state_next = norm_sgf_r; end norm_sgf_r: begin load_4_o = 1; if ( add_overflow_i)begin left_right_o=0; bit_shift_o=1; end state_next = load_final_result; end load_final_result: begin load_7_o = 1; state_next = ready_flag; end ready_flag: begin ready = 1; if(rst_FSM) begin state_next = start;end end default: begin state_next =start;end endcase end endmodule
/////////////////////////////////////////////////////////////////////////////// // // File name: axi_protocol_converter_v2_1_b2s_r_channel.v // // Description: // Read data channel module to buffer read data from MC, ignore // extra data in case of BL8 and send the data to AXI. // The MC will send out the read data as it is ready and it has to be // accepted. The read data FIFO in the axi_protocol_converter_v2_1_b2s_r_channel module will buffer // the data before being sent to AXI. The address channel module will // send the transaction information for every command that is sent to the // MC. The transaction information will be buffered in a transaction FIFO. // Based on the transaction FIFO information data will be ignored in // BL8 mode and the last signal to the AXI will be asserted. /////////////////////////////////////////////////////////////////////////////// `timescale 1ps/1ps `default_nettype none (* DowngradeIPIdentifiedWarnings="yes" *) module axi_protocol_converter_v2_1_b2s_r_channel # ( /////////////////////////////////////////////////////////////////////////////// // Parameter Definitions /////////////////////////////////////////////////////////////////////////////// // Width of ID signals. // Range: >= 1. parameter integer C_ID_WIDTH = 4, // Width of AXI xDATA and MCB xx_data // Range: 32, 64, 128. parameter integer C_DATA_WIDTH = 32 ) ( /////////////////////////////////////////////////////////////////////////////// // Port Declarations /////////////////////////////////////////////////////////////////////////////// input wire clk , input wire reset , output wire [C_ID_WIDTH-1:0] s_rid , output wire [C_DATA_WIDTH-1:0] s_rdata , output wire [1:0] s_rresp , output wire s_rlast , output wire s_rvalid , input wire s_rready , input wire [C_DATA_WIDTH-1:0] m_rdata , input wire [1:0] m_rresp , input wire m_rvalid , output wire m_rready , // Connections to/from axi_protocol_converter_v2_1_b2s_ar_channel module input wire r_push , output wire r_full , // length not needed. Can be removed. input wire [C_ID_WIDTH-1:0] r_arid , input wire r_rlast ); //////////////////////////////////////////////////////////////////////////////// // Local parameters //////////////////////////////////////////////////////////////////////////////// localparam P_WIDTH = 1+C_ID_WIDTH; localparam P_DEPTH = 32; localparam P_AWIDTH = 5; localparam P_D_WIDTH = C_DATA_WIDTH + 2; // rd data FIFO depth varies based on burst length. // For Bl8 it is two times the size of transaction FIFO. // Only in 2:1 mode BL8 transactions will happen which results in // two beats of read data per read transaction. localparam P_D_DEPTH = 32; localparam P_D_AWIDTH = 5; //////////////////////////////////////////////////////////////////////////////// // Wire and register declarations //////////////////////////////////////////////////////////////////////////////// wire [C_ID_WIDTH+1-1:0] trans_in; wire [C_ID_WIDTH+1-1:0] trans_out; wire tr_empty; wire rhandshake; wire r_valid_i; wire [P_D_WIDTH-1:0] rd_data_fifo_in; wire [P_D_WIDTH-1:0] rd_data_fifo_out; wire rd_en; wire rd_full; wire rd_empty; wire rd_a_full; wire fifo_a_full; reg [C_ID_WIDTH-1:0] r_arid_r; reg r_rlast_r; reg r_push_r; wire fifo_full; //////////////////////////////////////////////////////////////////////////////// // BEGIN RTL //////////////////////////////////////////////////////////////////////////////// assign s_rresp = rd_data_fifo_out[P_D_WIDTH-1:C_DATA_WIDTH]; assign s_rid = trans_out[1+:C_ID_WIDTH]; assign s_rdata = rd_data_fifo_out[C_DATA_WIDTH-1:0]; assign s_rlast = trans_out[0]; assign s_rvalid = ~rd_empty & ~tr_empty; // assign MCB outputs assign rd_en = rhandshake & (~rd_empty); assign rhandshake =(s_rvalid & s_rready); // register for timing always @(posedge clk) begin r_arid_r <= r_arid; r_rlast_r <= r_rlast; r_push_r <= r_push; end assign trans_in[0] = r_rlast_r; assign trans_in[1+:C_ID_WIDTH] = r_arid_r; // rd data fifo axi_protocol_converter_v2_1_b2s_simple_fifo #( .C_WIDTH (P_D_WIDTH), .C_AWIDTH (P_D_AWIDTH), .C_DEPTH (P_D_DEPTH) ) rd_data_fifo_0 ( .clk ( clk ) , .rst ( reset ) , .wr_en ( m_rvalid & m_rready ) , .rd_en ( rd_en ) , .din ( rd_data_fifo_in ) , .dout ( rd_data_fifo_out ) , .a_full ( rd_a_full ) , .full ( rd_full ) , .a_empty ( ) , .empty ( rd_empty ) ); assign rd_data_fifo_in = {m_rresp, m_rdata}; axi_protocol_converter_v2_1_b2s_simple_fifo #( .C_WIDTH (P_WIDTH), .C_AWIDTH (P_AWIDTH), .C_DEPTH (P_DEPTH) ) transaction_fifo_0 ( .clk ( clk ) , .rst ( reset ) , .wr_en ( r_push_r ) , .rd_en ( rd_en ) , .din ( trans_in ) , .dout ( trans_out ) , .a_full ( fifo_a_full ) , .full ( ) , .a_empty ( ) , .empty ( tr_empty ) ); assign fifo_full = fifo_a_full | rd_a_full ; assign r_full = fifo_full ; assign m_rready = ~rd_a_full; endmodule `default_nettype wire
/////////////////////////////////////////////////////////////////////////////// // // File name: axi_protocol_converter_v2_1_b2s_r_channel.v // // Description: // Read data channel module to buffer read data from MC, ignore // extra data in case of BL8 and send the data to AXI. // The MC will send out the read data as it is ready and it has to be // accepted. The read data FIFO in the axi_protocol_converter_v2_1_b2s_r_channel module will buffer // the data before being sent to AXI. The address channel module will // send the transaction information for every command that is sent to the // MC. The transaction information will be buffered in a transaction FIFO. // Based on the transaction FIFO information data will be ignored in // BL8 mode and the last signal to the AXI will be asserted. /////////////////////////////////////////////////////////////////////////////// `timescale 1ps/1ps `default_nettype none (* DowngradeIPIdentifiedWarnings="yes" *) module axi_protocol_converter_v2_1_b2s_r_channel # ( /////////////////////////////////////////////////////////////////////////////// // Parameter Definitions /////////////////////////////////////////////////////////////////////////////// // Width of ID signals. // Range: >= 1. parameter integer C_ID_WIDTH = 4, // Width of AXI xDATA and MCB xx_data // Range: 32, 64, 128. parameter integer C_DATA_WIDTH = 32 ) ( /////////////////////////////////////////////////////////////////////////////// // Port Declarations /////////////////////////////////////////////////////////////////////////////// input wire clk , input wire reset , output wire [C_ID_WIDTH-1:0] s_rid , output wire [C_DATA_WIDTH-1:0] s_rdata , output wire [1:0] s_rresp , output wire s_rlast , output wire s_rvalid , input wire s_rready , input wire [C_DATA_WIDTH-1:0] m_rdata , input wire [1:0] m_rresp , input wire m_rvalid , output wire m_rready , // Connections to/from axi_protocol_converter_v2_1_b2s_ar_channel module input wire r_push , output wire r_full , // length not needed. Can be removed. input wire [C_ID_WIDTH-1:0] r_arid , input wire r_rlast ); //////////////////////////////////////////////////////////////////////////////// // Local parameters //////////////////////////////////////////////////////////////////////////////// localparam P_WIDTH = 1+C_ID_WIDTH; localparam P_DEPTH = 32; localparam P_AWIDTH = 5; localparam P_D_WIDTH = C_DATA_WIDTH + 2; // rd data FIFO depth varies based on burst length. // For Bl8 it is two times the size of transaction FIFO. // Only in 2:1 mode BL8 transactions will happen which results in // two beats of read data per read transaction. localparam P_D_DEPTH = 32; localparam P_D_AWIDTH = 5; //////////////////////////////////////////////////////////////////////////////// // Wire and register declarations //////////////////////////////////////////////////////////////////////////////// wire [C_ID_WIDTH+1-1:0] trans_in; wire [C_ID_WIDTH+1-1:0] trans_out; wire tr_empty; wire rhandshake; wire r_valid_i; wire [P_D_WIDTH-1:0] rd_data_fifo_in; wire [P_D_WIDTH-1:0] rd_data_fifo_out; wire rd_en; wire rd_full; wire rd_empty; wire rd_a_full; wire fifo_a_full; reg [C_ID_WIDTH-1:0] r_arid_r; reg r_rlast_r; reg r_push_r; wire fifo_full; //////////////////////////////////////////////////////////////////////////////// // BEGIN RTL //////////////////////////////////////////////////////////////////////////////// assign s_rresp = rd_data_fifo_out[P_D_WIDTH-1:C_DATA_WIDTH]; assign s_rid = trans_out[1+:C_ID_WIDTH]; assign s_rdata = rd_data_fifo_out[C_DATA_WIDTH-1:0]; assign s_rlast = trans_out[0]; assign s_rvalid = ~rd_empty & ~tr_empty; // assign MCB outputs assign rd_en = rhandshake & (~rd_empty); assign rhandshake =(s_rvalid & s_rready); // register for timing always @(posedge clk) begin r_arid_r <= r_arid; r_rlast_r <= r_rlast; r_push_r <= r_push; end assign trans_in[0] = r_rlast_r; assign trans_in[1+:C_ID_WIDTH] = r_arid_r; // rd data fifo axi_protocol_converter_v2_1_b2s_simple_fifo #( .C_WIDTH (P_D_WIDTH), .C_AWIDTH (P_D_AWIDTH), .C_DEPTH (P_D_DEPTH) ) rd_data_fifo_0 ( .clk ( clk ) , .rst ( reset ) , .wr_en ( m_rvalid & m_rready ) , .rd_en ( rd_en ) , .din ( rd_data_fifo_in ) , .dout ( rd_data_fifo_out ) , .a_full ( rd_a_full ) , .full ( rd_full ) , .a_empty ( ) , .empty ( rd_empty ) ); assign rd_data_fifo_in = {m_rresp, m_rdata}; axi_protocol_converter_v2_1_b2s_simple_fifo #( .C_WIDTH (P_WIDTH), .C_AWIDTH (P_AWIDTH), .C_DEPTH (P_DEPTH) ) transaction_fifo_0 ( .clk ( clk ) , .rst ( reset ) , .wr_en ( r_push_r ) , .rd_en ( rd_en ) , .din ( trans_in ) , .dout ( trans_out ) , .a_full ( fifo_a_full ) , .full ( ) , .a_empty ( ) , .empty ( tr_empty ) ); assign fifo_full = fifo_a_full | rd_a_full ; assign r_full = fifo_full ; assign m_rready = ~rd_a_full; endmodule `default_nettype wire
/////////////////////////////////////////////////////////////////////////////// // // File name: axi_protocol_converter_v2_1_b2s_r_channel.v // // Description: // Read data channel module to buffer read data from MC, ignore // extra data in case of BL8 and send the data to AXI. // The MC will send out the read data as it is ready and it has to be // accepted. The read data FIFO in the axi_protocol_converter_v2_1_b2s_r_channel module will buffer // the data before being sent to AXI. The address channel module will // send the transaction information for every command that is sent to the // MC. The transaction information will be buffered in a transaction FIFO. // Based on the transaction FIFO information data will be ignored in // BL8 mode and the last signal to the AXI will be asserted. /////////////////////////////////////////////////////////////////////////////// `timescale 1ps/1ps `default_nettype none (* DowngradeIPIdentifiedWarnings="yes" *) module axi_protocol_converter_v2_1_b2s_r_channel # ( /////////////////////////////////////////////////////////////////////////////// // Parameter Definitions /////////////////////////////////////////////////////////////////////////////// // Width of ID signals. // Range: >= 1. parameter integer C_ID_WIDTH = 4, // Width of AXI xDATA and MCB xx_data // Range: 32, 64, 128. parameter integer C_DATA_WIDTH = 32 ) ( /////////////////////////////////////////////////////////////////////////////// // Port Declarations /////////////////////////////////////////////////////////////////////////////// input wire clk , input wire reset , output wire [C_ID_WIDTH-1:0] s_rid , output wire [C_DATA_WIDTH-1:0] s_rdata , output wire [1:0] s_rresp , output wire s_rlast , output wire s_rvalid , input wire s_rready , input wire [C_DATA_WIDTH-1:0] m_rdata , input wire [1:0] m_rresp , input wire m_rvalid , output wire m_rready , // Connections to/from axi_protocol_converter_v2_1_b2s_ar_channel module input wire r_push , output wire r_full , // length not needed. Can be removed. input wire [C_ID_WIDTH-1:0] r_arid , input wire r_rlast ); //////////////////////////////////////////////////////////////////////////////// // Local parameters //////////////////////////////////////////////////////////////////////////////// localparam P_WIDTH = 1+C_ID_WIDTH; localparam P_DEPTH = 32; localparam P_AWIDTH = 5; localparam P_D_WIDTH = C_DATA_WIDTH + 2; // rd data FIFO depth varies based on burst length. // For Bl8 it is two times the size of transaction FIFO. // Only in 2:1 mode BL8 transactions will happen which results in // two beats of read data per read transaction. localparam P_D_DEPTH = 32; localparam P_D_AWIDTH = 5; //////////////////////////////////////////////////////////////////////////////// // Wire and register declarations //////////////////////////////////////////////////////////////////////////////// wire [C_ID_WIDTH+1-1:0] trans_in; wire [C_ID_WIDTH+1-1:0] trans_out; wire tr_empty; wire rhandshake; wire r_valid_i; wire [P_D_WIDTH-1:0] rd_data_fifo_in; wire [P_D_WIDTH-1:0] rd_data_fifo_out; wire rd_en; wire rd_full; wire rd_empty; wire rd_a_full; wire fifo_a_full; reg [C_ID_WIDTH-1:0] r_arid_r; reg r_rlast_r; reg r_push_r; wire fifo_full; //////////////////////////////////////////////////////////////////////////////// // BEGIN RTL //////////////////////////////////////////////////////////////////////////////// assign s_rresp = rd_data_fifo_out[P_D_WIDTH-1:C_DATA_WIDTH]; assign s_rid = trans_out[1+:C_ID_WIDTH]; assign s_rdata = rd_data_fifo_out[C_DATA_WIDTH-1:0]; assign s_rlast = trans_out[0]; assign s_rvalid = ~rd_empty & ~tr_empty; // assign MCB outputs assign rd_en = rhandshake & (~rd_empty); assign rhandshake =(s_rvalid & s_rready); // register for timing always @(posedge clk) begin r_arid_r <= r_arid; r_rlast_r <= r_rlast; r_push_r <= r_push; end assign trans_in[0] = r_rlast_r; assign trans_in[1+:C_ID_WIDTH] = r_arid_r; // rd data fifo axi_protocol_converter_v2_1_b2s_simple_fifo #( .C_WIDTH (P_D_WIDTH), .C_AWIDTH (P_D_AWIDTH), .C_DEPTH (P_D_DEPTH) ) rd_data_fifo_0 ( .clk ( clk ) , .rst ( reset ) , .wr_en ( m_rvalid & m_rready ) , .rd_en ( rd_en ) , .din ( rd_data_fifo_in ) , .dout ( rd_data_fifo_out ) , .a_full ( rd_a_full ) , .full ( rd_full ) , .a_empty ( ) , .empty ( rd_empty ) ); assign rd_data_fifo_in = {m_rresp, m_rdata}; axi_protocol_converter_v2_1_b2s_simple_fifo #( .C_WIDTH (P_WIDTH), .C_AWIDTH (P_AWIDTH), .C_DEPTH (P_DEPTH) ) transaction_fifo_0 ( .clk ( clk ) , .rst ( reset ) , .wr_en ( r_push_r ) , .rd_en ( rd_en ) , .din ( trans_in ) , .dout ( trans_out ) , .a_full ( fifo_a_full ) , .full ( ) , .a_empty ( ) , .empty ( tr_empty ) ); assign fifo_full = fifo_a_full | rd_a_full ; assign r_full = fifo_full ; assign m_rready = ~rd_a_full; endmodule `default_nettype wire
/////////////////////////////////////////////////////////////////////////////// // // File name: axi_protocol_converter_v2_1_b2s_r_channel.v // // Description: // Read data channel module to buffer read data from MC, ignore // extra data in case of BL8 and send the data to AXI. // The MC will send out the read data as it is ready and it has to be // accepted. The read data FIFO in the axi_protocol_converter_v2_1_b2s_r_channel module will buffer // the data before being sent to AXI. The address channel module will // send the transaction information for every command that is sent to the // MC. The transaction information will be buffered in a transaction FIFO. // Based on the transaction FIFO information data will be ignored in // BL8 mode and the last signal to the AXI will be asserted. /////////////////////////////////////////////////////////////////////////////// `timescale 1ps/1ps `default_nettype none (* DowngradeIPIdentifiedWarnings="yes" *) module axi_protocol_converter_v2_1_b2s_r_channel # ( /////////////////////////////////////////////////////////////////////////////// // Parameter Definitions /////////////////////////////////////////////////////////////////////////////// // Width of ID signals. // Range: >= 1. parameter integer C_ID_WIDTH = 4, // Width of AXI xDATA and MCB xx_data // Range: 32, 64, 128. parameter integer C_DATA_WIDTH = 32 ) ( /////////////////////////////////////////////////////////////////////////////// // Port Declarations /////////////////////////////////////////////////////////////////////////////// input wire clk , input wire reset , output wire [C_ID_WIDTH-1:0] s_rid , output wire [C_DATA_WIDTH-1:0] s_rdata , output wire [1:0] s_rresp , output wire s_rlast , output wire s_rvalid , input wire s_rready , input wire [C_DATA_WIDTH-1:0] m_rdata , input wire [1:0] m_rresp , input wire m_rvalid , output wire m_rready , // Connections to/from axi_protocol_converter_v2_1_b2s_ar_channel module input wire r_push , output wire r_full , // length not needed. Can be removed. input wire [C_ID_WIDTH-1:0] r_arid , input wire r_rlast ); //////////////////////////////////////////////////////////////////////////////// // Local parameters //////////////////////////////////////////////////////////////////////////////// localparam P_WIDTH = 1+C_ID_WIDTH; localparam P_DEPTH = 32; localparam P_AWIDTH = 5; localparam P_D_WIDTH = C_DATA_WIDTH + 2; // rd data FIFO depth varies based on burst length. // For Bl8 it is two times the size of transaction FIFO. // Only in 2:1 mode BL8 transactions will happen which results in // two beats of read data per read transaction. localparam P_D_DEPTH = 32; localparam P_D_AWIDTH = 5; //////////////////////////////////////////////////////////////////////////////// // Wire and register declarations //////////////////////////////////////////////////////////////////////////////// wire [C_ID_WIDTH+1-1:0] trans_in; wire [C_ID_WIDTH+1-1:0] trans_out; wire tr_empty; wire rhandshake; wire r_valid_i; wire [P_D_WIDTH-1:0] rd_data_fifo_in; wire [P_D_WIDTH-1:0] rd_data_fifo_out; wire rd_en; wire rd_full; wire rd_empty; wire rd_a_full; wire fifo_a_full; reg [C_ID_WIDTH-1:0] r_arid_r; reg r_rlast_r; reg r_push_r; wire fifo_full; //////////////////////////////////////////////////////////////////////////////// // BEGIN RTL //////////////////////////////////////////////////////////////////////////////// assign s_rresp = rd_data_fifo_out[P_D_WIDTH-1:C_DATA_WIDTH]; assign s_rid = trans_out[1+:C_ID_WIDTH]; assign s_rdata = rd_data_fifo_out[C_DATA_WIDTH-1:0]; assign s_rlast = trans_out[0]; assign s_rvalid = ~rd_empty & ~tr_empty; // assign MCB outputs assign rd_en = rhandshake & (~rd_empty); assign rhandshake =(s_rvalid & s_rready); // register for timing always @(posedge clk) begin r_arid_r <= r_arid; r_rlast_r <= r_rlast; r_push_r <= r_push; end assign trans_in[0] = r_rlast_r; assign trans_in[1+:C_ID_WIDTH] = r_arid_r; // rd data fifo axi_protocol_converter_v2_1_b2s_simple_fifo #( .C_WIDTH (P_D_WIDTH), .C_AWIDTH (P_D_AWIDTH), .C_DEPTH (P_D_DEPTH) ) rd_data_fifo_0 ( .clk ( clk ) , .rst ( reset ) , .wr_en ( m_rvalid & m_rready ) , .rd_en ( rd_en ) , .din ( rd_data_fifo_in ) , .dout ( rd_data_fifo_out ) , .a_full ( rd_a_full ) , .full ( rd_full ) , .a_empty ( ) , .empty ( rd_empty ) ); assign rd_data_fifo_in = {m_rresp, m_rdata}; axi_protocol_converter_v2_1_b2s_simple_fifo #( .C_WIDTH (P_WIDTH), .C_AWIDTH (P_AWIDTH), .C_DEPTH (P_DEPTH) ) transaction_fifo_0 ( .clk ( clk ) , .rst ( reset ) , .wr_en ( r_push_r ) , .rd_en ( rd_en ) , .din ( trans_in ) , .dout ( trans_out ) , .a_full ( fifo_a_full ) , .full ( ) , .a_empty ( ) , .empty ( tr_empty ) ); assign fifo_full = fifo_a_full | rd_a_full ; assign r_full = fifo_full ; assign m_rready = ~rd_a_full; endmodule `default_nettype wire
/////////////////////////////////////////////////////////////////////////////// // // File name: axi_protocol_converter_v2_1_b2s_r_channel.v // // Description: // Read data channel module to buffer read data from MC, ignore // extra data in case of BL8 and send the data to AXI. // The MC will send out the read data as it is ready and it has to be // accepted. The read data FIFO in the axi_protocol_converter_v2_1_b2s_r_channel module will buffer // the data before being sent to AXI. The address channel module will // send the transaction information for every command that is sent to the // MC. The transaction information will be buffered in a transaction FIFO. // Based on the transaction FIFO information data will be ignored in // BL8 mode and the last signal to the AXI will be asserted. /////////////////////////////////////////////////////////////////////////////// `timescale 1ps/1ps `default_nettype none (* DowngradeIPIdentifiedWarnings="yes" *) module axi_protocol_converter_v2_1_b2s_r_channel # ( /////////////////////////////////////////////////////////////////////////////// // Parameter Definitions /////////////////////////////////////////////////////////////////////////////// // Width of ID signals. // Range: >= 1. parameter integer C_ID_WIDTH = 4, // Width of AXI xDATA and MCB xx_data // Range: 32, 64, 128. parameter integer C_DATA_WIDTH = 32 ) ( /////////////////////////////////////////////////////////////////////////////// // Port Declarations /////////////////////////////////////////////////////////////////////////////// input wire clk , input wire reset , output wire [C_ID_WIDTH-1:0] s_rid , output wire [C_DATA_WIDTH-1:0] s_rdata , output wire [1:0] s_rresp , output wire s_rlast , output wire s_rvalid , input wire s_rready , input wire [C_DATA_WIDTH-1:0] m_rdata , input wire [1:0] m_rresp , input wire m_rvalid , output wire m_rready , // Connections to/from axi_protocol_converter_v2_1_b2s_ar_channel module input wire r_push , output wire r_full , // length not needed. Can be removed. input wire [C_ID_WIDTH-1:0] r_arid , input wire r_rlast ); //////////////////////////////////////////////////////////////////////////////// // Local parameters //////////////////////////////////////////////////////////////////////////////// localparam P_WIDTH = 1+C_ID_WIDTH; localparam P_DEPTH = 32; localparam P_AWIDTH = 5; localparam P_D_WIDTH = C_DATA_WIDTH + 2; // rd data FIFO depth varies based on burst length. // For Bl8 it is two times the size of transaction FIFO. // Only in 2:1 mode BL8 transactions will happen which results in // two beats of read data per read transaction. localparam P_D_DEPTH = 32; localparam P_D_AWIDTH = 5; //////////////////////////////////////////////////////////////////////////////// // Wire and register declarations //////////////////////////////////////////////////////////////////////////////// wire [C_ID_WIDTH+1-1:0] trans_in; wire [C_ID_WIDTH+1-1:0] trans_out; wire tr_empty; wire rhandshake; wire r_valid_i; wire [P_D_WIDTH-1:0] rd_data_fifo_in; wire [P_D_WIDTH-1:0] rd_data_fifo_out; wire rd_en; wire rd_full; wire rd_empty; wire rd_a_full; wire fifo_a_full; reg [C_ID_WIDTH-1:0] r_arid_r; reg r_rlast_r; reg r_push_r; wire fifo_full; //////////////////////////////////////////////////////////////////////////////// // BEGIN RTL //////////////////////////////////////////////////////////////////////////////// assign s_rresp = rd_data_fifo_out[P_D_WIDTH-1:C_DATA_WIDTH]; assign s_rid = trans_out[1+:C_ID_WIDTH]; assign s_rdata = rd_data_fifo_out[C_DATA_WIDTH-1:0]; assign s_rlast = trans_out[0]; assign s_rvalid = ~rd_empty & ~tr_empty; // assign MCB outputs assign rd_en = rhandshake & (~rd_empty); assign rhandshake =(s_rvalid & s_rready); // register for timing always @(posedge clk) begin r_arid_r <= r_arid; r_rlast_r <= r_rlast; r_push_r <= r_push; end assign trans_in[0] = r_rlast_r; assign trans_in[1+:C_ID_WIDTH] = r_arid_r; // rd data fifo axi_protocol_converter_v2_1_b2s_simple_fifo #( .C_WIDTH (P_D_WIDTH), .C_AWIDTH (P_D_AWIDTH), .C_DEPTH (P_D_DEPTH) ) rd_data_fifo_0 ( .clk ( clk ) , .rst ( reset ) , .wr_en ( m_rvalid & m_rready ) , .rd_en ( rd_en ) , .din ( rd_data_fifo_in ) , .dout ( rd_data_fifo_out ) , .a_full ( rd_a_full ) , .full ( rd_full ) , .a_empty ( ) , .empty ( rd_empty ) ); assign rd_data_fifo_in = {m_rresp, m_rdata}; axi_protocol_converter_v2_1_b2s_simple_fifo #( .C_WIDTH (P_WIDTH), .C_AWIDTH (P_AWIDTH), .C_DEPTH (P_DEPTH) ) transaction_fifo_0 ( .clk ( clk ) , .rst ( reset ) , .wr_en ( r_push_r ) , .rd_en ( rd_en ) , .din ( trans_in ) , .dout ( trans_out ) , .a_full ( fifo_a_full ) , .full ( ) , .a_empty ( ) , .empty ( tr_empty ) ); assign fifo_full = fifo_a_full | rd_a_full ; assign r_full = fifo_full ; assign m_rready = ~rd_a_full; endmodule `default_nettype wire
/////////////////////////////////////////////////////////////////////////////// // // File name: axi_protocol_converter_v2_1_b2s_r_channel.v // // Description: // Read data channel module to buffer read data from MC, ignore // extra data in case of BL8 and send the data to AXI. // The MC will send out the read data as it is ready and it has to be // accepted. The read data FIFO in the axi_protocol_converter_v2_1_b2s_r_channel module will buffer // the data before being sent to AXI. The address channel module will // send the transaction information for every command that is sent to the // MC. The transaction information will be buffered in a transaction FIFO. // Based on the transaction FIFO information data will be ignored in // BL8 mode and the last signal to the AXI will be asserted. /////////////////////////////////////////////////////////////////////////////// `timescale 1ps/1ps `default_nettype none (* DowngradeIPIdentifiedWarnings="yes" *) module axi_protocol_converter_v2_1_b2s_r_channel # ( /////////////////////////////////////////////////////////////////////////////// // Parameter Definitions /////////////////////////////////////////////////////////////////////////////// // Width of ID signals. // Range: >= 1. parameter integer C_ID_WIDTH = 4, // Width of AXI xDATA and MCB xx_data // Range: 32, 64, 128. parameter integer C_DATA_WIDTH = 32 ) ( /////////////////////////////////////////////////////////////////////////////// // Port Declarations /////////////////////////////////////////////////////////////////////////////// input wire clk , input wire reset , output wire [C_ID_WIDTH-1:0] s_rid , output wire [C_DATA_WIDTH-1:0] s_rdata , output wire [1:0] s_rresp , output wire s_rlast , output wire s_rvalid , input wire s_rready , input wire [C_DATA_WIDTH-1:0] m_rdata , input wire [1:0] m_rresp , input wire m_rvalid , output wire m_rready , // Connections to/from axi_protocol_converter_v2_1_b2s_ar_channel module input wire r_push , output wire r_full , // length not needed. Can be removed. input wire [C_ID_WIDTH-1:0] r_arid , input wire r_rlast ); //////////////////////////////////////////////////////////////////////////////// // Local parameters //////////////////////////////////////////////////////////////////////////////// localparam P_WIDTH = 1+C_ID_WIDTH; localparam P_DEPTH = 32; localparam P_AWIDTH = 5; localparam P_D_WIDTH = C_DATA_WIDTH + 2; // rd data FIFO depth varies based on burst length. // For Bl8 it is two times the size of transaction FIFO. // Only in 2:1 mode BL8 transactions will happen which results in // two beats of read data per read transaction. localparam P_D_DEPTH = 32; localparam P_D_AWIDTH = 5; //////////////////////////////////////////////////////////////////////////////// // Wire and register declarations //////////////////////////////////////////////////////////////////////////////// wire [C_ID_WIDTH+1-1:0] trans_in; wire [C_ID_WIDTH+1-1:0] trans_out; wire tr_empty; wire rhandshake; wire r_valid_i; wire [P_D_WIDTH-1:0] rd_data_fifo_in; wire [P_D_WIDTH-1:0] rd_data_fifo_out; wire rd_en; wire rd_full; wire rd_empty; wire rd_a_full; wire fifo_a_full; reg [C_ID_WIDTH-1:0] r_arid_r; reg r_rlast_r; reg r_push_r; wire fifo_full; //////////////////////////////////////////////////////////////////////////////// // BEGIN RTL //////////////////////////////////////////////////////////////////////////////// assign s_rresp = rd_data_fifo_out[P_D_WIDTH-1:C_DATA_WIDTH]; assign s_rid = trans_out[1+:C_ID_WIDTH]; assign s_rdata = rd_data_fifo_out[C_DATA_WIDTH-1:0]; assign s_rlast = trans_out[0]; assign s_rvalid = ~rd_empty & ~tr_empty; // assign MCB outputs assign rd_en = rhandshake & (~rd_empty); assign rhandshake =(s_rvalid & s_rready); // register for timing always @(posedge clk) begin r_arid_r <= r_arid; r_rlast_r <= r_rlast; r_push_r <= r_push; end assign trans_in[0] = r_rlast_r; assign trans_in[1+:C_ID_WIDTH] = r_arid_r; // rd data fifo axi_protocol_converter_v2_1_b2s_simple_fifo #( .C_WIDTH (P_D_WIDTH), .C_AWIDTH (P_D_AWIDTH), .C_DEPTH (P_D_DEPTH) ) rd_data_fifo_0 ( .clk ( clk ) , .rst ( reset ) , .wr_en ( m_rvalid & m_rready ) , .rd_en ( rd_en ) , .din ( rd_data_fifo_in ) , .dout ( rd_data_fifo_out ) , .a_full ( rd_a_full ) , .full ( rd_full ) , .a_empty ( ) , .empty ( rd_empty ) ); assign rd_data_fifo_in = {m_rresp, m_rdata}; axi_protocol_converter_v2_1_b2s_simple_fifo #( .C_WIDTH (P_WIDTH), .C_AWIDTH (P_AWIDTH), .C_DEPTH (P_DEPTH) ) transaction_fifo_0 ( .clk ( clk ) , .rst ( reset ) , .wr_en ( r_push_r ) , .rd_en ( rd_en ) , .din ( trans_in ) , .dout ( trans_out ) , .a_full ( fifo_a_full ) , .full ( ) , .a_empty ( ) , .empty ( tr_empty ) ); assign fifo_full = fifo_a_full | rd_a_full ; assign r_full = fifo_full ; assign m_rready = ~rd_a_full; endmodule `default_nettype wire
// -- (c) Copyright 1995 - 2012 Xilinx, Inc. All rights reserved. // -- // -- This file contains confidential and proprietary information // -- of Xilinx, Inc. and is protected under U.S. and // -- international copyright and other intellectual property // -- laws. // -- // -- DISCLAIMER // -- This disclaimer is not a license and does not grant any // -- rights to the materials distributed herewith. Except as // -- otherwise provided in a valid license issued to you by // -- Xilinx, and to the maximum extent permitted by applicable // -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND // -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES // -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING // -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- // -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and // -- (2) Xilinx shall not be liable (whether in contract or tort, // -- including negligence, or under any other theory of // -- liability) for any loss or damage of any kind or nature // -- related to, arising under or in connection with these // -- materials, including for any direct, or any indirect, // -- special, incidental, or consequential loss or damage // -- (including loss of data, profits, goodwill, or any type of // -- loss or damage suffered as a result of any action brought // -- by a third party) even if such damage or loss was // -- reasonably foreseeable or Xilinx had been advised of the // -- possibility of the same. // -- // -- CRITICAL APPLICATIONS // -- Xilinx products are not designed or intended to be fail- // -- safe, or for use in any application requiring fail-safe // -- performance, such as life-support or safety devices or // -- systems, Class III medical devices, nuclear facilities, // -- applications related to the deployment of airbags, or any // -- other applications that could lead to death, personal // -- injury, or severe property or environmental damage // -- (individually and collectively, "Critical // -- Applications"). Customer assumes the sole risk and // -- liability of any use of Xilinx products in Critical // -- Applications, subject only to applicable laws and // -- regulations governing limitations on product liability. // -- // -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS // -- PART OF THIS FILE AT ALL TIMES. //----------------------------------------------------------------------- // The synthesis directives "translate_off/translate_on" specified below are // supported by Xilinx, Mentor Graphics and Synplicity synthesis // tools. Ensure they are correct for your synthesis tool(s). // You must compile the fifo_generator wrapper file when simulating // the core. When compiling the wrapper file, be sure to // reference the XilinxCoreLib Verilog simulation library. For detailed // instructions, please refer to the "CORE Generator Help". `timescale 1ps/1ps (* DowngradeIPIdentifiedWarnings="yes" *) module axi_data_fifo_v2_1_fifo_gen #( parameter C_FAMILY = "virtex7", parameter integer C_COMMON_CLOCK = 1, parameter integer C_SYNCHRONIZER_STAGE = 3, parameter integer C_FIFO_DEPTH_LOG = 5, parameter integer C_FIFO_WIDTH = 64, parameter C_FIFO_TYPE = "lut" )( clk, rst, wr_clk, wr_en, wr_ready, wr_data, rd_clk, rd_en, rd_valid, rd_data); input clk; input wr_clk; input rd_clk; input rst; input [C_FIFO_WIDTH-1 : 0] wr_data; input wr_en; input rd_en; output [C_FIFO_WIDTH-1 : 0] rd_data; output wr_ready; output rd_valid; wire full; wire empty; wire rd_valid = ~empty; wire wr_ready = ~full; localparam C_MEMORY_TYPE = (C_FIFO_TYPE == "bram")? 1 : 2; localparam C_IMPLEMENTATION_TYPE = (C_COMMON_CLOCK == 1)? 0 : 2; fifo_generator_v12_0 #( .C_COMMON_CLOCK(C_COMMON_CLOCK), .C_DIN_WIDTH(C_FIFO_WIDTH), .C_DOUT_WIDTH(C_FIFO_WIDTH), .C_FAMILY(C_FAMILY), .C_IMPLEMENTATION_TYPE(C_IMPLEMENTATION_TYPE), .C_MEMORY_TYPE(C_MEMORY_TYPE), .C_RD_DEPTH(1<<C_FIFO_DEPTH_LOG), .C_RD_PNTR_WIDTH(C_FIFO_DEPTH_LOG), .C_WR_DEPTH(1<<C_FIFO_DEPTH_LOG), .C_WR_PNTR_WIDTH(C_FIFO_DEPTH_LOG), .C_ADD_NGC_CONSTRAINT(0), .C_APPLICATION_TYPE_AXIS(0), .C_APPLICATION_TYPE_RACH(0), .C_APPLICATION_TYPE_RDCH(0), .C_APPLICATION_TYPE_WACH(0), .C_APPLICATION_TYPE_WDCH(0), .C_APPLICATION_TYPE_WRCH(0), .C_AXIS_TDATA_WIDTH(64), .C_AXIS_TDEST_WIDTH(4), .C_AXIS_TID_WIDTH(8), .C_AXIS_TKEEP_WIDTH(4), .C_AXIS_TSTRB_WIDTH(4), .C_AXIS_TUSER_WIDTH(4), .C_AXIS_TYPE(0), .C_AXI_ADDR_WIDTH(32), .C_AXI_ARUSER_WIDTH(1), .C_AXI_AWUSER_WIDTH(1), .C_AXI_BUSER_WIDTH(1), .C_AXI_DATA_WIDTH(64), .C_AXI_ID_WIDTH(4), .C_AXI_LEN_WIDTH(8), .C_AXI_LOCK_WIDTH(2), .C_AXI_RUSER_WIDTH(1), .C_AXI_TYPE(0), .C_AXI_WUSER_WIDTH(1), .C_COUNT_TYPE(0), .C_DATA_COUNT_WIDTH(6), .C_DEFAULT_VALUE("BlankString"), .C_DIN_WIDTH_AXIS(1), .C_DIN_WIDTH_RACH(32), .C_DIN_WIDTH_RDCH(64), .C_DIN_WIDTH_WACH(32), .C_DIN_WIDTH_WDCH(64), .C_DIN_WIDTH_WRCH(2), .C_DOUT_RST_VAL("0"), .C_ENABLE_RLOCS(0), .C_ENABLE_RST_SYNC(1), .C_ERROR_INJECTION_TYPE(0), .C_ERROR_INJECTION_TYPE_AXIS(0), .C_ERROR_INJECTION_TYPE_RACH(0), .C_ERROR_INJECTION_TYPE_RDCH(0), .C_ERROR_INJECTION_TYPE_WACH(0), .C_ERROR_INJECTION_TYPE_WDCH(0), .C_ERROR_INJECTION_TYPE_WRCH(0), .C_FULL_FLAGS_RST_VAL(0), .C_HAS_ALMOST_EMPTY(0), .C_HAS_ALMOST_FULL(0), .C_HAS_AXIS_TDATA(0), .C_HAS_AXIS_TDEST(0), .C_HAS_AXIS_TID(0), .C_HAS_AXIS_TKEEP(0), .C_HAS_AXIS_TLAST(0), .C_HAS_AXIS_TREADY(1), .C_HAS_AXIS_TSTRB(0), .C_HAS_AXIS_TUSER(0), .C_HAS_AXI_ARUSER(0), .C_HAS_AXI_AWUSER(0), .C_HAS_AXI_BUSER(0), .C_HAS_AXI_RD_CHANNEL(0), .C_HAS_AXI_RUSER(0), .C_HAS_AXI_WR_CHANNEL(0), .C_HAS_AXI_WUSER(0), .C_HAS_BACKUP(0), .C_HAS_DATA_COUNT(0), .C_HAS_DATA_COUNTS_AXIS(0), .C_HAS_DATA_COUNTS_RACH(0), .C_HAS_DATA_COUNTS_RDCH(0), .C_HAS_DATA_COUNTS_WACH(0), .C_HAS_DATA_COUNTS_WDCH(0), .C_HAS_DATA_COUNTS_WRCH(0), .C_HAS_INT_CLK(0), .C_HAS_MASTER_CE(0), .C_HAS_MEMINIT_FILE(0), .C_HAS_OVERFLOW(0), .C_HAS_PROG_FLAGS_AXIS(0), .C_HAS_PROG_FLAGS_RACH(0), .C_HAS_PROG_FLAGS_RDCH(0), .C_HAS_PROG_FLAGS_WACH(0), .C_HAS_PROG_FLAGS_WDCH(0), .C_HAS_PROG_FLAGS_WRCH(0), .C_HAS_RD_DATA_COUNT(0), .C_HAS_RD_RST(0), .C_HAS_RST(1), .C_HAS_SLAVE_CE(0), .C_HAS_SRST(0), .C_HAS_UNDERFLOW(0), .C_HAS_VALID(0), .C_HAS_WR_ACK(0), .C_HAS_WR_DATA_COUNT(0), .C_HAS_WR_RST(0), .C_IMPLEMENTATION_TYPE_AXIS(1), .C_IMPLEMENTATION_TYPE_RACH(1), .C_IMPLEMENTATION_TYPE_RDCH(1), .C_IMPLEMENTATION_TYPE_WACH(1), .C_IMPLEMENTATION_TYPE_WDCH(1), .C_IMPLEMENTATION_TYPE_WRCH(1), .C_INIT_WR_PNTR_VAL(0), .C_INTERFACE_TYPE(0), .C_MIF_FILE_NAME("BlankString"), .C_MSGON_VAL(1), .C_OPTIMIZATION_MODE(0), .C_OVERFLOW_LOW(0), .C_PRELOAD_LATENCY(0), .C_PRELOAD_REGS(1), .C_PRIM_FIFO_TYPE("512x36"), .C_PROG_EMPTY_THRESH_ASSERT_VAL(4), .C_PROG_EMPTY_THRESH_ASSERT_VAL_AXIS(1022), .C_PROG_EMPTY_THRESH_ASSERT_VAL_RACH(1022), .C_PROG_EMPTY_THRESH_ASSERT_VAL_RDCH(1022), .C_PROG_EMPTY_THRESH_ASSERT_VAL_WACH(1022), .C_PROG_EMPTY_THRESH_ASSERT_VAL_WDCH(1022), .C_PROG_EMPTY_THRESH_ASSERT_VAL_WRCH(1022), .C_PROG_EMPTY_THRESH_NEGATE_VAL(5), .C_PROG_EMPTY_TYPE(0), .C_PROG_EMPTY_TYPE_AXIS(0), .C_PROG_EMPTY_TYPE_RACH(0), .C_PROG_EMPTY_TYPE_RDCH(0), .C_PROG_EMPTY_TYPE_WACH(0), .C_PROG_EMPTY_TYPE_WDCH(0), .C_PROG_EMPTY_TYPE_WRCH(0), .C_PROG_FULL_THRESH_ASSERT_VAL(31), .C_PROG_FULL_THRESH_ASSERT_VAL_AXIS(1023), .C_PROG_FULL_THRESH_ASSERT_VAL_RACH(1023), .C_PROG_FULL_THRESH_ASSERT_VAL_RDCH(1023), .C_PROG_FULL_THRESH_ASSERT_VAL_WACH(1023), .C_PROG_FULL_THRESH_ASSERT_VAL_WDCH(1023), .C_PROG_FULL_THRESH_ASSERT_VAL_WRCH(1023), .C_PROG_FULL_THRESH_NEGATE_VAL(30), .C_PROG_FULL_TYPE(0), .C_PROG_FULL_TYPE_AXIS(0), .C_PROG_FULL_TYPE_RACH(0), .C_PROG_FULL_TYPE_RDCH(0), .C_PROG_FULL_TYPE_WACH(0), .C_PROG_FULL_TYPE_WDCH(0), .C_PROG_FULL_TYPE_WRCH(0), .C_RACH_TYPE(0), .C_RDCH_TYPE(0), .C_RD_DATA_COUNT_WIDTH(6), .C_RD_FREQ(1), .C_REG_SLICE_MODE_AXIS(0), .C_REG_SLICE_MODE_RACH(0), .C_REG_SLICE_MODE_RDCH(0), .C_REG_SLICE_MODE_WACH(0), .C_REG_SLICE_MODE_WDCH(0), .C_REG_SLICE_MODE_WRCH(0), .C_SYNCHRONIZER_STAGE(C_SYNCHRONIZER_STAGE), .C_UNDERFLOW_LOW(0), .C_USE_COMMON_OVERFLOW(0), .C_USE_COMMON_UNDERFLOW(0), .C_USE_DEFAULT_SETTINGS(0), .C_USE_DOUT_RST(0), .C_USE_ECC(0), .C_USE_ECC_AXIS(0), .C_USE_ECC_RACH(0), .C_USE_ECC_RDCH(0), .C_USE_ECC_WACH(0), .C_USE_ECC_WDCH(0), .C_USE_ECC_WRCH(0), .C_USE_EMBEDDED_REG(0), .C_USE_FIFO16_FLAGS(0), .C_USE_FWFT_DATA_COUNT(1), .C_VALID_LOW(0), .C_WACH_TYPE(0), .C_WDCH_TYPE(0), .C_WRCH_TYPE(0), .C_WR_ACK_LOW(0), .C_WR_DATA_COUNT_WIDTH(6), .C_WR_DEPTH_AXIS(1024), .C_WR_DEPTH_RACH(16), .C_WR_DEPTH_RDCH(1024), .C_WR_DEPTH_WACH(16), .C_WR_DEPTH_WDCH(1024), .C_WR_DEPTH_WRCH(16), .C_WR_FREQ(1), .C_WR_PNTR_WIDTH_AXIS(10), .C_WR_PNTR_WIDTH_RACH(4), .C_WR_PNTR_WIDTH_RDCH(10), .C_WR_PNTR_WIDTH_WACH(4), .C_WR_PNTR_WIDTH_WDCH(10), .C_WR_PNTR_WIDTH_WRCH(4), .C_WR_RESPONSE_LATENCY(1) ) fifo_gen_inst ( .clk(clk), .din(wr_data), .dout(rd_data), .empty(empty), .full(full), .rd_clk(rd_clk), .rd_en(rd_en), .rst(rst), .wr_clk(wr_clk), .wr_en(wr_en), .almost_empty(), .almost_full(), .axi_ar_data_count(), .axi_ar_dbiterr(), .axi_ar_injectdbiterr(1'b0), .axi_ar_injectsbiterr(1'b0), .axi_ar_overflow(), .axi_ar_prog_empty(), .axi_ar_prog_empty_thresh(4'b0), .axi_ar_prog_full(), .axi_ar_prog_full_thresh(4'b0), .axi_ar_rd_data_count(), .axi_ar_sbiterr(), .axi_ar_underflow(), .axi_ar_wr_data_count(), .axi_aw_data_count(), .axi_aw_dbiterr(), .axi_aw_injectdbiterr(1'b0), .axi_aw_injectsbiterr(1'b0), .axi_aw_overflow(), .axi_aw_prog_empty(), .axi_aw_prog_empty_thresh(4'b0), .axi_aw_prog_full(), .axi_aw_prog_full_thresh(4'b0), .axi_aw_rd_data_count(), .axi_aw_sbiterr(), .axi_aw_underflow(), .axi_aw_wr_data_count(), .axi_b_data_count(), .axi_b_dbiterr(), .axi_b_injectdbiterr(1'b0), .axi_b_injectsbiterr(1'b0), .axi_b_overflow(), .axi_b_prog_empty(), .axi_b_prog_empty_thresh(4'b0), .axi_b_prog_full(), .axi_b_prog_full_thresh(4'b0), .axi_b_rd_data_count(), .axi_b_sbiterr(), .axi_b_underflow(), .axi_b_wr_data_count(), .axi_r_data_count(), .axi_r_dbiterr(), .axi_r_injectdbiterr(1'b0), .axi_r_injectsbiterr(1'b0), .axi_r_overflow(), .axi_r_prog_empty(), .axi_r_prog_empty_thresh(10'b0), .axi_r_prog_full(), .axi_r_prog_full_thresh(10'b0), .axi_r_rd_data_count(), .axi_r_sbiterr(), .axi_r_underflow(), .axi_r_wr_data_count(), .axi_w_data_count(), .axi_w_dbiterr(), .axi_w_injectdbiterr(1'b0), .axi_w_injectsbiterr(1'b0), .axi_w_overflow(), .axi_w_prog_empty(), .axi_w_prog_empty_thresh(10'b0), .axi_w_prog_full(), .axi_w_prog_full_thresh(10'b0), .axi_w_rd_data_count(), .axi_w_sbiterr(), .axi_w_underflow(), .axi_w_wr_data_count(), .axis_data_count(), .axis_dbiterr(), .axis_injectdbiterr(1'b0), .axis_injectsbiterr(1'b0), .axis_overflow(), .axis_prog_empty(), .axis_prog_empty_thresh(10'b0), .axis_prog_full(), .axis_prog_full_thresh(10'b0), .axis_rd_data_count(), .axis_sbiterr(), .axis_underflow(), .axis_wr_data_count(), .backup(1'b0), .backup_marker(1'b0), .data_count(), .dbiterr(), .injectdbiterr(1'b0), .injectsbiterr(1'b0), .int_clk(1'b0), .m_aclk(1'b0), .m_aclk_en(1'b0), .m_axi_araddr(), .m_axi_arburst(), .m_axi_arcache(), .m_axi_arid(), .m_axi_arlen(), .m_axi_arlock(), .m_axi_arprot(), .m_axi_arqos(), .m_axi_arready(1'b0), .m_axi_arregion(), .m_axi_arsize(), .m_axi_aruser(), .m_axi_arvalid(), .m_axi_awaddr(), .m_axi_awburst(), .m_axi_awcache(), .m_axi_awid(), .m_axi_awlen(), .m_axi_awlock(), .m_axi_awprot(), .m_axi_awqos(), .m_axi_awready(1'b0), .m_axi_awregion(), .m_axi_awsize(), .m_axi_awuser(), .m_axi_awvalid(), .m_axi_bid(4'b0), .m_axi_bready(), .m_axi_bresp(2'b0), .m_axi_buser(1'b0), .m_axi_bvalid(1'b0), .m_axi_rdata(64'b0), .m_axi_rid(4'b0), .m_axi_rlast(1'b0), .m_axi_rready(), .m_axi_rresp(2'b0), .m_axi_ruser(1'b0), .m_axi_rvalid(1'b0), .m_axi_wdata(), .m_axi_wid(), .m_axi_wlast(), .m_axi_wready(1'b0), .m_axi_wstrb(), .m_axi_wuser(), .m_axi_wvalid(), .m_axis_tdata(), .m_axis_tdest(), .m_axis_tid(), .m_axis_tkeep(), .m_axis_tlast(), .m_axis_tready(1'b0), .m_axis_tstrb(), .m_axis_tuser(), .m_axis_tvalid(), .overflow(), .prog_empty(), .prog_empty_thresh(5'b0), .prog_empty_thresh_assert(5'b0), .prog_empty_thresh_negate(5'b0), .prog_full(), .prog_full_thresh(5'b0), .prog_full_thresh_assert(5'b0), .prog_full_thresh_negate(5'b0), .rd_data_count(), .rd_rst(1'b0), .s_aclk(1'b0), .s_aclk_en(1'b0), .s_aresetn(1'b0), .s_axi_araddr(32'b0), .s_axi_arburst(2'b0), .s_axi_arcache(4'b0), .s_axi_arid(4'b0), .s_axi_arlen(8'b0), .s_axi_arlock(2'b0), .s_axi_arprot(3'b0), .s_axi_arqos(4'b0), .s_axi_arready(), .s_axi_arregion(4'b0), .s_axi_arsize(3'b0), .s_axi_aruser(1'b0), .s_axi_arvalid(1'b0), .s_axi_awaddr(32'b0), .s_axi_awburst(2'b0), .s_axi_awcache(4'b0), .s_axi_awid(4'b0), .s_axi_awlen(8'b0), .s_axi_awlock(2'b0), .s_axi_awprot(3'b0), .s_axi_awqos(4'b0), .s_axi_awready(), .s_axi_awregion(4'b0), .s_axi_awsize(3'b0), .s_axi_awuser(1'b0), .s_axi_awvalid(1'b0), .s_axi_bid(), .s_axi_bready(1'b0), .s_axi_bresp(), .s_axi_buser(), .s_axi_bvalid(), .s_axi_rdata(), .s_axi_rid(), .s_axi_rlast(), .s_axi_rready(1'b0), .s_axi_rresp(), .s_axi_ruser(), .s_axi_rvalid(), .s_axi_wdata(64'b0), .s_axi_wid(4'b0), .s_axi_wlast(1'b0), .s_axi_wready(), .s_axi_wstrb(8'b0), .s_axi_wuser(1'b0), .s_axi_wvalid(1'b0), .s_axis_tdata(64'b0), .s_axis_tdest(4'b0), .s_axis_tid(8'b0), .s_axis_tkeep(4'b0), .s_axis_tlast(1'b0), .s_axis_tready(), .s_axis_tstrb(4'b0), .s_axis_tuser(4'b0), .s_axis_tvalid(1'b0), .sbiterr(), .srst(1'b0), .underflow(), .valid(), .wr_ack(), .wr_data_count(), .wr_rst(1'b0), .wr_rst_busy(), .rd_rst_busy(), .sleep(1'b0) ); endmodule
// -- (c) Copyright 1995 - 2012 Xilinx, Inc. All rights reserved. // -- // -- This file contains confidential and proprietary information // -- of Xilinx, Inc. and is protected under U.S. and // -- international copyright and other intellectual property // -- laws. // -- // -- DISCLAIMER // -- This disclaimer is not a license and does not grant any // -- rights to the materials distributed herewith. Except as // -- otherwise provided in a valid license issued to you by // -- Xilinx, and to the maximum extent permitted by applicable // -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND // -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES // -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING // -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- // -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and // -- (2) Xilinx shall not be liable (whether in contract or tort, // -- including negligence, or under any other theory of // -- liability) for any loss or damage of any kind or nature // -- related to, arising under or in connection with these // -- materials, including for any direct, or any indirect, // -- special, incidental, or consequential loss or damage // -- (including loss of data, profits, goodwill, or any type of // -- loss or damage suffered as a result of any action brought // -- by a third party) even if such damage or loss was // -- reasonably foreseeable or Xilinx had been advised of the // -- possibility of the same. // -- // -- CRITICAL APPLICATIONS // -- Xilinx products are not designed or intended to be fail- // -- safe, or for use in any application requiring fail-safe // -- performance, such as life-support or safety devices or // -- systems, Class III medical devices, nuclear facilities, // -- applications related to the deployment of airbags, or any // -- other applications that could lead to death, personal // -- injury, or severe property or environmental damage // -- (individually and collectively, "Critical // -- Applications"). Customer assumes the sole risk and // -- liability of any use of Xilinx products in Critical // -- Applications, subject only to applicable laws and // -- regulations governing limitations on product liability. // -- // -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS // -- PART OF THIS FILE AT ALL TIMES. //----------------------------------------------------------------------- // The synthesis directives "translate_off/translate_on" specified below are // supported by Xilinx, Mentor Graphics and Synplicity synthesis // tools. Ensure they are correct for your synthesis tool(s). // You must compile the fifo_generator wrapper file when simulating // the core. When compiling the wrapper file, be sure to // reference the XilinxCoreLib Verilog simulation library. For detailed // instructions, please refer to the "CORE Generator Help". `timescale 1ps/1ps (* DowngradeIPIdentifiedWarnings="yes" *) module axi_data_fifo_v2_1_fifo_gen #( parameter C_FAMILY = "virtex7", parameter integer C_COMMON_CLOCK = 1, parameter integer C_SYNCHRONIZER_STAGE = 3, parameter integer C_FIFO_DEPTH_LOG = 5, parameter integer C_FIFO_WIDTH = 64, parameter C_FIFO_TYPE = "lut" )( clk, rst, wr_clk, wr_en, wr_ready, wr_data, rd_clk, rd_en, rd_valid, rd_data); input clk; input wr_clk; input rd_clk; input rst; input [C_FIFO_WIDTH-1 : 0] wr_data; input wr_en; input rd_en; output [C_FIFO_WIDTH-1 : 0] rd_data; output wr_ready; output rd_valid; wire full; wire empty; wire rd_valid = ~empty; wire wr_ready = ~full; localparam C_MEMORY_TYPE = (C_FIFO_TYPE == "bram")? 1 : 2; localparam C_IMPLEMENTATION_TYPE = (C_COMMON_CLOCK == 1)? 0 : 2; fifo_generator_v12_0 #( .C_COMMON_CLOCK(C_COMMON_CLOCK), .C_DIN_WIDTH(C_FIFO_WIDTH), .C_DOUT_WIDTH(C_FIFO_WIDTH), .C_FAMILY(C_FAMILY), .C_IMPLEMENTATION_TYPE(C_IMPLEMENTATION_TYPE), .C_MEMORY_TYPE(C_MEMORY_TYPE), .C_RD_DEPTH(1<<C_FIFO_DEPTH_LOG), .C_RD_PNTR_WIDTH(C_FIFO_DEPTH_LOG), .C_WR_DEPTH(1<<C_FIFO_DEPTH_LOG), .C_WR_PNTR_WIDTH(C_FIFO_DEPTH_LOG), .C_ADD_NGC_CONSTRAINT(0), .C_APPLICATION_TYPE_AXIS(0), .C_APPLICATION_TYPE_RACH(0), .C_APPLICATION_TYPE_RDCH(0), .C_APPLICATION_TYPE_WACH(0), .C_APPLICATION_TYPE_WDCH(0), .C_APPLICATION_TYPE_WRCH(0), .C_AXIS_TDATA_WIDTH(64), .C_AXIS_TDEST_WIDTH(4), .C_AXIS_TID_WIDTH(8), .C_AXIS_TKEEP_WIDTH(4), .C_AXIS_TSTRB_WIDTH(4), .C_AXIS_TUSER_WIDTH(4), .C_AXIS_TYPE(0), .C_AXI_ADDR_WIDTH(32), .C_AXI_ARUSER_WIDTH(1), .C_AXI_AWUSER_WIDTH(1), .C_AXI_BUSER_WIDTH(1), .C_AXI_DATA_WIDTH(64), .C_AXI_ID_WIDTH(4), .C_AXI_LEN_WIDTH(8), .C_AXI_LOCK_WIDTH(2), .C_AXI_RUSER_WIDTH(1), .C_AXI_TYPE(0), .C_AXI_WUSER_WIDTH(1), .C_COUNT_TYPE(0), .C_DATA_COUNT_WIDTH(6), .C_DEFAULT_VALUE("BlankString"), .C_DIN_WIDTH_AXIS(1), .C_DIN_WIDTH_RACH(32), .C_DIN_WIDTH_RDCH(64), .C_DIN_WIDTH_WACH(32), .C_DIN_WIDTH_WDCH(64), .C_DIN_WIDTH_WRCH(2), .C_DOUT_RST_VAL("0"), .C_ENABLE_RLOCS(0), .C_ENABLE_RST_SYNC(1), .C_ERROR_INJECTION_TYPE(0), .C_ERROR_INJECTION_TYPE_AXIS(0), .C_ERROR_INJECTION_TYPE_RACH(0), .C_ERROR_INJECTION_TYPE_RDCH(0), .C_ERROR_INJECTION_TYPE_WACH(0), .C_ERROR_INJECTION_TYPE_WDCH(0), .C_ERROR_INJECTION_TYPE_WRCH(0), .C_FULL_FLAGS_RST_VAL(0), .C_HAS_ALMOST_EMPTY(0), .C_HAS_ALMOST_FULL(0), .C_HAS_AXIS_TDATA(0), .C_HAS_AXIS_TDEST(0), .C_HAS_AXIS_TID(0), .C_HAS_AXIS_TKEEP(0), .C_HAS_AXIS_TLAST(0), .C_HAS_AXIS_TREADY(1), .C_HAS_AXIS_TSTRB(0), .C_HAS_AXIS_TUSER(0), .C_HAS_AXI_ARUSER(0), .C_HAS_AXI_AWUSER(0), .C_HAS_AXI_BUSER(0), .C_HAS_AXI_RD_CHANNEL(0), .C_HAS_AXI_RUSER(0), .C_HAS_AXI_WR_CHANNEL(0), .C_HAS_AXI_WUSER(0), .C_HAS_BACKUP(0), .C_HAS_DATA_COUNT(0), .C_HAS_DATA_COUNTS_AXIS(0), .C_HAS_DATA_COUNTS_RACH(0), .C_HAS_DATA_COUNTS_RDCH(0), .C_HAS_DATA_COUNTS_WACH(0), .C_HAS_DATA_COUNTS_WDCH(0), .C_HAS_DATA_COUNTS_WRCH(0), .C_HAS_INT_CLK(0), .C_HAS_MASTER_CE(0), .C_HAS_MEMINIT_FILE(0), .C_HAS_OVERFLOW(0), .C_HAS_PROG_FLAGS_AXIS(0), .C_HAS_PROG_FLAGS_RACH(0), .C_HAS_PROG_FLAGS_RDCH(0), .C_HAS_PROG_FLAGS_WACH(0), .C_HAS_PROG_FLAGS_WDCH(0), .C_HAS_PROG_FLAGS_WRCH(0), .C_HAS_RD_DATA_COUNT(0), .C_HAS_RD_RST(0), .C_HAS_RST(1), .C_HAS_SLAVE_CE(0), .C_HAS_SRST(0), .C_HAS_UNDERFLOW(0), .C_HAS_VALID(0), .C_HAS_WR_ACK(0), .C_HAS_WR_DATA_COUNT(0), .C_HAS_WR_RST(0), .C_IMPLEMENTATION_TYPE_AXIS(1), .C_IMPLEMENTATION_TYPE_RACH(1), .C_IMPLEMENTATION_TYPE_RDCH(1), .C_IMPLEMENTATION_TYPE_WACH(1), .C_IMPLEMENTATION_TYPE_WDCH(1), .C_IMPLEMENTATION_TYPE_WRCH(1), .C_INIT_WR_PNTR_VAL(0), .C_INTERFACE_TYPE(0), .C_MIF_FILE_NAME("BlankString"), .C_MSGON_VAL(1), .C_OPTIMIZATION_MODE(0), .C_OVERFLOW_LOW(0), .C_PRELOAD_LATENCY(0), .C_PRELOAD_REGS(1), .C_PRIM_FIFO_TYPE("512x36"), .C_PROG_EMPTY_THRESH_ASSERT_VAL(4), .C_PROG_EMPTY_THRESH_ASSERT_VAL_AXIS(1022), .C_PROG_EMPTY_THRESH_ASSERT_VAL_RACH(1022), .C_PROG_EMPTY_THRESH_ASSERT_VAL_RDCH(1022), .C_PROG_EMPTY_THRESH_ASSERT_VAL_WACH(1022), .C_PROG_EMPTY_THRESH_ASSERT_VAL_WDCH(1022), .C_PROG_EMPTY_THRESH_ASSERT_VAL_WRCH(1022), .C_PROG_EMPTY_THRESH_NEGATE_VAL(5), .C_PROG_EMPTY_TYPE(0), .C_PROG_EMPTY_TYPE_AXIS(0), .C_PROG_EMPTY_TYPE_RACH(0), .C_PROG_EMPTY_TYPE_RDCH(0), .C_PROG_EMPTY_TYPE_WACH(0), .C_PROG_EMPTY_TYPE_WDCH(0), .C_PROG_EMPTY_TYPE_WRCH(0), .C_PROG_FULL_THRESH_ASSERT_VAL(31), .C_PROG_FULL_THRESH_ASSERT_VAL_AXIS(1023), .C_PROG_FULL_THRESH_ASSERT_VAL_RACH(1023), .C_PROG_FULL_THRESH_ASSERT_VAL_RDCH(1023), .C_PROG_FULL_THRESH_ASSERT_VAL_WACH(1023), .C_PROG_FULL_THRESH_ASSERT_VAL_WDCH(1023), .C_PROG_FULL_THRESH_ASSERT_VAL_WRCH(1023), .C_PROG_FULL_THRESH_NEGATE_VAL(30), .C_PROG_FULL_TYPE(0), .C_PROG_FULL_TYPE_AXIS(0), .C_PROG_FULL_TYPE_RACH(0), .C_PROG_FULL_TYPE_RDCH(0), .C_PROG_FULL_TYPE_WACH(0), .C_PROG_FULL_TYPE_WDCH(0), .C_PROG_FULL_TYPE_WRCH(0), .C_RACH_TYPE(0), .C_RDCH_TYPE(0), .C_RD_DATA_COUNT_WIDTH(6), .C_RD_FREQ(1), .C_REG_SLICE_MODE_AXIS(0), .C_REG_SLICE_MODE_RACH(0), .C_REG_SLICE_MODE_RDCH(0), .C_REG_SLICE_MODE_WACH(0), .C_REG_SLICE_MODE_WDCH(0), .C_REG_SLICE_MODE_WRCH(0), .C_SYNCHRONIZER_STAGE(C_SYNCHRONIZER_STAGE), .C_UNDERFLOW_LOW(0), .C_USE_COMMON_OVERFLOW(0), .C_USE_COMMON_UNDERFLOW(0), .C_USE_DEFAULT_SETTINGS(0), .C_USE_DOUT_RST(0), .C_USE_ECC(0), .C_USE_ECC_AXIS(0), .C_USE_ECC_RACH(0), .C_USE_ECC_RDCH(0), .C_USE_ECC_WACH(0), .C_USE_ECC_WDCH(0), .C_USE_ECC_WRCH(0), .C_USE_EMBEDDED_REG(0), .C_USE_FIFO16_FLAGS(0), .C_USE_FWFT_DATA_COUNT(1), .C_VALID_LOW(0), .C_WACH_TYPE(0), .C_WDCH_TYPE(0), .C_WRCH_TYPE(0), .C_WR_ACK_LOW(0), .C_WR_DATA_COUNT_WIDTH(6), .C_WR_DEPTH_AXIS(1024), .C_WR_DEPTH_RACH(16), .C_WR_DEPTH_RDCH(1024), .C_WR_DEPTH_WACH(16), .C_WR_DEPTH_WDCH(1024), .C_WR_DEPTH_WRCH(16), .C_WR_FREQ(1), .C_WR_PNTR_WIDTH_AXIS(10), .C_WR_PNTR_WIDTH_RACH(4), .C_WR_PNTR_WIDTH_RDCH(10), .C_WR_PNTR_WIDTH_WACH(4), .C_WR_PNTR_WIDTH_WDCH(10), .C_WR_PNTR_WIDTH_WRCH(4), .C_WR_RESPONSE_LATENCY(1) ) fifo_gen_inst ( .clk(clk), .din(wr_data), .dout(rd_data), .empty(empty), .full(full), .rd_clk(rd_clk), .rd_en(rd_en), .rst(rst), .wr_clk(wr_clk), .wr_en(wr_en), .almost_empty(), .almost_full(), .axi_ar_data_count(), .axi_ar_dbiterr(), .axi_ar_injectdbiterr(1'b0), .axi_ar_injectsbiterr(1'b0), .axi_ar_overflow(), .axi_ar_prog_empty(), .axi_ar_prog_empty_thresh(4'b0), .axi_ar_prog_full(), .axi_ar_prog_full_thresh(4'b0), .axi_ar_rd_data_count(), .axi_ar_sbiterr(), .axi_ar_underflow(), .axi_ar_wr_data_count(), .axi_aw_data_count(), .axi_aw_dbiterr(), .axi_aw_injectdbiterr(1'b0), .axi_aw_injectsbiterr(1'b0), .axi_aw_overflow(), .axi_aw_prog_empty(), .axi_aw_prog_empty_thresh(4'b0), .axi_aw_prog_full(), .axi_aw_prog_full_thresh(4'b0), .axi_aw_rd_data_count(), .axi_aw_sbiterr(), .axi_aw_underflow(), .axi_aw_wr_data_count(), .axi_b_data_count(), .axi_b_dbiterr(), .axi_b_injectdbiterr(1'b0), .axi_b_injectsbiterr(1'b0), .axi_b_overflow(), .axi_b_prog_empty(), .axi_b_prog_empty_thresh(4'b0), .axi_b_prog_full(), .axi_b_prog_full_thresh(4'b0), .axi_b_rd_data_count(), .axi_b_sbiterr(), .axi_b_underflow(), .axi_b_wr_data_count(), .axi_r_data_count(), .axi_r_dbiterr(), .axi_r_injectdbiterr(1'b0), .axi_r_injectsbiterr(1'b0), .axi_r_overflow(), .axi_r_prog_empty(), .axi_r_prog_empty_thresh(10'b0), .axi_r_prog_full(), .axi_r_prog_full_thresh(10'b0), .axi_r_rd_data_count(), .axi_r_sbiterr(), .axi_r_underflow(), .axi_r_wr_data_count(), .axi_w_data_count(), .axi_w_dbiterr(), .axi_w_injectdbiterr(1'b0), .axi_w_injectsbiterr(1'b0), .axi_w_overflow(), .axi_w_prog_empty(), .axi_w_prog_empty_thresh(10'b0), .axi_w_prog_full(), .axi_w_prog_full_thresh(10'b0), .axi_w_rd_data_count(), .axi_w_sbiterr(), .axi_w_underflow(), .axi_w_wr_data_count(), .axis_data_count(), .axis_dbiterr(), .axis_injectdbiterr(1'b0), .axis_injectsbiterr(1'b0), .axis_overflow(), .axis_prog_empty(), .axis_prog_empty_thresh(10'b0), .axis_prog_full(), .axis_prog_full_thresh(10'b0), .axis_rd_data_count(), .axis_sbiterr(), .axis_underflow(), .axis_wr_data_count(), .backup(1'b0), .backup_marker(1'b0), .data_count(), .dbiterr(), .injectdbiterr(1'b0), .injectsbiterr(1'b0), .int_clk(1'b0), .m_aclk(1'b0), .m_aclk_en(1'b0), .m_axi_araddr(), .m_axi_arburst(), .m_axi_arcache(), .m_axi_arid(), .m_axi_arlen(), .m_axi_arlock(), .m_axi_arprot(), .m_axi_arqos(), .m_axi_arready(1'b0), .m_axi_arregion(), .m_axi_arsize(), .m_axi_aruser(), .m_axi_arvalid(), .m_axi_awaddr(), .m_axi_awburst(), .m_axi_awcache(), .m_axi_awid(), .m_axi_awlen(), .m_axi_awlock(), .m_axi_awprot(), .m_axi_awqos(), .m_axi_awready(1'b0), .m_axi_awregion(), .m_axi_awsize(), .m_axi_awuser(), .m_axi_awvalid(), .m_axi_bid(4'b0), .m_axi_bready(), .m_axi_bresp(2'b0), .m_axi_buser(1'b0), .m_axi_bvalid(1'b0), .m_axi_rdata(64'b0), .m_axi_rid(4'b0), .m_axi_rlast(1'b0), .m_axi_rready(), .m_axi_rresp(2'b0), .m_axi_ruser(1'b0), .m_axi_rvalid(1'b0), .m_axi_wdata(), .m_axi_wid(), .m_axi_wlast(), .m_axi_wready(1'b0), .m_axi_wstrb(), .m_axi_wuser(), .m_axi_wvalid(), .m_axis_tdata(), .m_axis_tdest(), .m_axis_tid(), .m_axis_tkeep(), .m_axis_tlast(), .m_axis_tready(1'b0), .m_axis_tstrb(), .m_axis_tuser(), .m_axis_tvalid(), .overflow(), .prog_empty(), .prog_empty_thresh(5'b0), .prog_empty_thresh_assert(5'b0), .prog_empty_thresh_negate(5'b0), .prog_full(), .prog_full_thresh(5'b0), .prog_full_thresh_assert(5'b0), .prog_full_thresh_negate(5'b0), .rd_data_count(), .rd_rst(1'b0), .s_aclk(1'b0), .s_aclk_en(1'b0), .s_aresetn(1'b0), .s_axi_araddr(32'b0), .s_axi_arburst(2'b0), .s_axi_arcache(4'b0), .s_axi_arid(4'b0), .s_axi_arlen(8'b0), .s_axi_arlock(2'b0), .s_axi_arprot(3'b0), .s_axi_arqos(4'b0), .s_axi_arready(), .s_axi_arregion(4'b0), .s_axi_arsize(3'b0), .s_axi_aruser(1'b0), .s_axi_arvalid(1'b0), .s_axi_awaddr(32'b0), .s_axi_awburst(2'b0), .s_axi_awcache(4'b0), .s_axi_awid(4'b0), .s_axi_awlen(8'b0), .s_axi_awlock(2'b0), .s_axi_awprot(3'b0), .s_axi_awqos(4'b0), .s_axi_awready(), .s_axi_awregion(4'b0), .s_axi_awsize(3'b0), .s_axi_awuser(1'b0), .s_axi_awvalid(1'b0), .s_axi_bid(), .s_axi_bready(1'b0), .s_axi_bresp(), .s_axi_buser(), .s_axi_bvalid(), .s_axi_rdata(), .s_axi_rid(), .s_axi_rlast(), .s_axi_rready(1'b0), .s_axi_rresp(), .s_axi_ruser(), .s_axi_rvalid(), .s_axi_wdata(64'b0), .s_axi_wid(4'b0), .s_axi_wlast(1'b0), .s_axi_wready(), .s_axi_wstrb(8'b0), .s_axi_wuser(1'b0), .s_axi_wvalid(1'b0), .s_axis_tdata(64'b0), .s_axis_tdest(4'b0), .s_axis_tid(8'b0), .s_axis_tkeep(4'b0), .s_axis_tlast(1'b0), .s_axis_tready(), .s_axis_tstrb(4'b0), .s_axis_tuser(4'b0), .s_axis_tvalid(1'b0), .sbiterr(), .srst(1'b0), .underflow(), .valid(), .wr_ack(), .wr_data_count(), .wr_rst(1'b0), .wr_rst_busy(), .rd_rst_busy(), .sleep(1'b0) ); endmodule
/////////////////////////////////////////////////////////////////////////////// // // File name: axi_protocol_converter_v2_1_b2s_b_channel.v // /////////////////////////////////////////////////////////////////////////////// `timescale 1ps/1ps `default_nettype none (* DowngradeIPIdentifiedWarnings="yes" *) module axi_protocol_converter_v2_1_b2s_b_channel # ( /////////////////////////////////////////////////////////////////////////////// // Parameter Definitions /////////////////////////////////////////////////////////////////////////////// // Width of ID signals. // Range: >= 1. parameter integer C_ID_WIDTH = 4 ) ( /////////////////////////////////////////////////////////////////////////////// // Port Declarations /////////////////////////////////////////////////////////////////////////////// input wire clk, input wire reset, // AXI signals output wire [C_ID_WIDTH-1:0] s_bid, output wire [1:0] s_bresp, output wire s_bvalid, input wire s_bready, input wire [1:0] m_bresp, input wire m_bvalid, output wire m_bready, // Signals to/from the axi_protocol_converter_v2_1_b2s_aw_channel modules input wire b_push, input wire [C_ID_WIDTH-1:0] b_awid, input wire [7:0] b_awlen, input wire b_resp_rdy, output wire b_full ); //////////////////////////////////////////////////////////////////////////////// // Local parameters //////////////////////////////////////////////////////////////////////////////// // AXI protocol responses: localparam [1:0] LP_RESP_OKAY = 2'b00; localparam [1:0] LP_RESP_EXOKAY = 2'b01; localparam [1:0] LP_RESP_SLVERROR = 2'b10; localparam [1:0] LP_RESP_DECERR = 2'b11; // FIFO settings localparam P_WIDTH = C_ID_WIDTH + 8; localparam P_DEPTH = 4; localparam P_AWIDTH = 2; localparam P_RWIDTH = 2; localparam P_RDEPTH = 4; localparam P_RAWIDTH = 2; //////////////////////////////////////////////////////////////////////////////// // Wire and register declarations //////////////////////////////////////////////////////////////////////////////// reg bvalid_i; wire [C_ID_WIDTH-1:0] bid_i; wire shandshake; reg shandshake_r; wire mhandshake; reg mhandshake_r; wire b_empty; wire bresp_full; wire bresp_empty; wire [7:0] b_awlen_i; reg [7:0] bresp_cnt; reg [1:0] s_bresp_acc; wire [1:0] s_bresp_acc_r; reg [1:0] s_bresp_i; wire need_to_update_bresp; wire bresp_push; //////////////////////////////////////////////////////////////////////////////// // BEGIN RTL //////////////////////////////////////////////////////////////////////////////// // assign AXI outputs assign s_bid = bid_i; assign s_bresp = s_bresp_acc_r; assign s_bvalid = bvalid_i; assign shandshake = s_bvalid & s_bready; assign mhandshake = m_bvalid & m_bready; always @(posedge clk) begin if (reset | shandshake) begin bvalid_i <= 1'b0; end else if (~b_empty & ~shandshake_r & ~bresp_empty) begin bvalid_i <= 1'b1; end end always @(posedge clk) begin shandshake_r <= shandshake; mhandshake_r <= mhandshake; end axi_protocol_converter_v2_1_b2s_simple_fifo #( .C_WIDTH (P_WIDTH), .C_AWIDTH (P_AWIDTH), .C_DEPTH (P_DEPTH) ) bid_fifo_0 ( .clk ( clk ) , .rst ( reset ) , .wr_en ( b_push ) , .rd_en ( shandshake_r ) , .din ( {b_awid, b_awlen} ) , .dout ( {bid_i, b_awlen_i}) , .a_full ( ) , .full ( b_full ) , .a_empty ( ) , .empty ( b_empty ) ); assign m_bready = ~mhandshake_r & bresp_empty; ///////////////////////////////////////////////////////////////////////////// // Update if more critical. assign need_to_update_bresp = ( m_bresp > s_bresp_acc ); // Select accumultated or direct depending on setting. always @( * ) begin if ( need_to_update_bresp ) begin s_bresp_i = m_bresp; end else begin s_bresp_i = s_bresp_acc; end end ///////////////////////////////////////////////////////////////////////////// // Accumulate MI-side BRESP. always @ (posedge clk) begin if (reset | bresp_push ) begin s_bresp_acc <= LP_RESP_OKAY; end else if ( mhandshake ) begin s_bresp_acc <= s_bresp_i; end end assign bresp_push = ( mhandshake_r ) & (bresp_cnt == b_awlen_i) & ~b_empty; always @ (posedge clk) begin if (reset | bresp_push ) begin bresp_cnt <= 8'h00; end else if ( mhandshake_r ) begin bresp_cnt <= bresp_cnt + 1'b1; end end axi_protocol_converter_v2_1_b2s_simple_fifo #( .C_WIDTH (P_RWIDTH), .C_AWIDTH (P_RAWIDTH), .C_DEPTH (P_RDEPTH) ) bresp_fifo_0 ( .clk ( clk ) , .rst ( reset ) , .wr_en ( bresp_push ) , .rd_en ( shandshake_r ) , .din ( s_bresp_acc ) , .dout ( s_bresp_acc_r) , .a_full ( ) , .full ( bresp_full ) , .a_empty ( ) , .empty ( bresp_empty ) ); endmodule `default_nettype wire
/////////////////////////////////////////////////////////////////////////////// // // File name: axi_protocol_converter_v2_1_b2s_b_channel.v // /////////////////////////////////////////////////////////////////////////////// `timescale 1ps/1ps `default_nettype none (* DowngradeIPIdentifiedWarnings="yes" *) module axi_protocol_converter_v2_1_b2s_b_channel # ( /////////////////////////////////////////////////////////////////////////////// // Parameter Definitions /////////////////////////////////////////////////////////////////////////////// // Width of ID signals. // Range: >= 1. parameter integer C_ID_WIDTH = 4 ) ( /////////////////////////////////////////////////////////////////////////////// // Port Declarations /////////////////////////////////////////////////////////////////////////////// input wire clk, input wire reset, // AXI signals output wire [C_ID_WIDTH-1:0] s_bid, output wire [1:0] s_bresp, output wire s_bvalid, input wire s_bready, input wire [1:0] m_bresp, input wire m_bvalid, output wire m_bready, // Signals to/from the axi_protocol_converter_v2_1_b2s_aw_channel modules input wire b_push, input wire [C_ID_WIDTH-1:0] b_awid, input wire [7:0] b_awlen, input wire b_resp_rdy, output wire b_full ); //////////////////////////////////////////////////////////////////////////////// // Local parameters //////////////////////////////////////////////////////////////////////////////// // AXI protocol responses: localparam [1:0] LP_RESP_OKAY = 2'b00; localparam [1:0] LP_RESP_EXOKAY = 2'b01; localparam [1:0] LP_RESP_SLVERROR = 2'b10; localparam [1:0] LP_RESP_DECERR = 2'b11; // FIFO settings localparam P_WIDTH = C_ID_WIDTH + 8; localparam P_DEPTH = 4; localparam P_AWIDTH = 2; localparam P_RWIDTH = 2; localparam P_RDEPTH = 4; localparam P_RAWIDTH = 2; //////////////////////////////////////////////////////////////////////////////// // Wire and register declarations //////////////////////////////////////////////////////////////////////////////// reg bvalid_i; wire [C_ID_WIDTH-1:0] bid_i; wire shandshake; reg shandshake_r; wire mhandshake; reg mhandshake_r; wire b_empty; wire bresp_full; wire bresp_empty; wire [7:0] b_awlen_i; reg [7:0] bresp_cnt; reg [1:0] s_bresp_acc; wire [1:0] s_bresp_acc_r; reg [1:0] s_bresp_i; wire need_to_update_bresp; wire bresp_push; //////////////////////////////////////////////////////////////////////////////// // BEGIN RTL //////////////////////////////////////////////////////////////////////////////// // assign AXI outputs assign s_bid = bid_i; assign s_bresp = s_bresp_acc_r; assign s_bvalid = bvalid_i; assign shandshake = s_bvalid & s_bready; assign mhandshake = m_bvalid & m_bready; always @(posedge clk) begin if (reset | shandshake) begin bvalid_i <= 1'b0; end else if (~b_empty & ~shandshake_r & ~bresp_empty) begin bvalid_i <= 1'b1; end end always @(posedge clk) begin shandshake_r <= shandshake; mhandshake_r <= mhandshake; end axi_protocol_converter_v2_1_b2s_simple_fifo #( .C_WIDTH (P_WIDTH), .C_AWIDTH (P_AWIDTH), .C_DEPTH (P_DEPTH) ) bid_fifo_0 ( .clk ( clk ) , .rst ( reset ) , .wr_en ( b_push ) , .rd_en ( shandshake_r ) , .din ( {b_awid, b_awlen} ) , .dout ( {bid_i, b_awlen_i}) , .a_full ( ) , .full ( b_full ) , .a_empty ( ) , .empty ( b_empty ) ); assign m_bready = ~mhandshake_r & bresp_empty; ///////////////////////////////////////////////////////////////////////////// // Update if more critical. assign need_to_update_bresp = ( m_bresp > s_bresp_acc ); // Select accumultated or direct depending on setting. always @( * ) begin if ( need_to_update_bresp ) begin s_bresp_i = m_bresp; end else begin s_bresp_i = s_bresp_acc; end end ///////////////////////////////////////////////////////////////////////////// // Accumulate MI-side BRESP. always @ (posedge clk) begin if (reset | bresp_push ) begin s_bresp_acc <= LP_RESP_OKAY; end else if ( mhandshake ) begin s_bresp_acc <= s_bresp_i; end end assign bresp_push = ( mhandshake_r ) & (bresp_cnt == b_awlen_i) & ~b_empty; always @ (posedge clk) begin if (reset | bresp_push ) begin bresp_cnt <= 8'h00; end else if ( mhandshake_r ) begin bresp_cnt <= bresp_cnt + 1'b1; end end axi_protocol_converter_v2_1_b2s_simple_fifo #( .C_WIDTH (P_RWIDTH), .C_AWIDTH (P_RAWIDTH), .C_DEPTH (P_RDEPTH) ) bresp_fifo_0 ( .clk ( clk ) , .rst ( reset ) , .wr_en ( bresp_push ) , .rd_en ( shandshake_r ) , .din ( s_bresp_acc ) , .dout ( s_bresp_acc_r) , .a_full ( ) , .full ( bresp_full ) , .a_empty ( ) , .empty ( bresp_empty ) ); endmodule `default_nettype wire
/////////////////////////////////////////////////////////////////////////////// // // File name: axi_protocol_converter_v2_1_b2s_b_channel.v // /////////////////////////////////////////////////////////////////////////////// `timescale 1ps/1ps `default_nettype none (* DowngradeIPIdentifiedWarnings="yes" *) module axi_protocol_converter_v2_1_b2s_b_channel # ( /////////////////////////////////////////////////////////////////////////////// // Parameter Definitions /////////////////////////////////////////////////////////////////////////////// // Width of ID signals. // Range: >= 1. parameter integer C_ID_WIDTH = 4 ) ( /////////////////////////////////////////////////////////////////////////////// // Port Declarations /////////////////////////////////////////////////////////////////////////////// input wire clk, input wire reset, // AXI signals output wire [C_ID_WIDTH-1:0] s_bid, output wire [1:0] s_bresp, output wire s_bvalid, input wire s_bready, input wire [1:0] m_bresp, input wire m_bvalid, output wire m_bready, // Signals to/from the axi_protocol_converter_v2_1_b2s_aw_channel modules input wire b_push, input wire [C_ID_WIDTH-1:0] b_awid, input wire [7:0] b_awlen, input wire b_resp_rdy, output wire b_full ); //////////////////////////////////////////////////////////////////////////////// // Local parameters //////////////////////////////////////////////////////////////////////////////// // AXI protocol responses: localparam [1:0] LP_RESP_OKAY = 2'b00; localparam [1:0] LP_RESP_EXOKAY = 2'b01; localparam [1:0] LP_RESP_SLVERROR = 2'b10; localparam [1:0] LP_RESP_DECERR = 2'b11; // FIFO settings localparam P_WIDTH = C_ID_WIDTH + 8; localparam P_DEPTH = 4; localparam P_AWIDTH = 2; localparam P_RWIDTH = 2; localparam P_RDEPTH = 4; localparam P_RAWIDTH = 2; //////////////////////////////////////////////////////////////////////////////// // Wire and register declarations //////////////////////////////////////////////////////////////////////////////// reg bvalid_i; wire [C_ID_WIDTH-1:0] bid_i; wire shandshake; reg shandshake_r; wire mhandshake; reg mhandshake_r; wire b_empty; wire bresp_full; wire bresp_empty; wire [7:0] b_awlen_i; reg [7:0] bresp_cnt; reg [1:0] s_bresp_acc; wire [1:0] s_bresp_acc_r; reg [1:0] s_bresp_i; wire need_to_update_bresp; wire bresp_push; //////////////////////////////////////////////////////////////////////////////// // BEGIN RTL //////////////////////////////////////////////////////////////////////////////// // assign AXI outputs assign s_bid = bid_i; assign s_bresp = s_bresp_acc_r; assign s_bvalid = bvalid_i; assign shandshake = s_bvalid & s_bready; assign mhandshake = m_bvalid & m_bready; always @(posedge clk) begin if (reset | shandshake) begin bvalid_i <= 1'b0; end else if (~b_empty & ~shandshake_r & ~bresp_empty) begin bvalid_i <= 1'b1; end end always @(posedge clk) begin shandshake_r <= shandshake; mhandshake_r <= mhandshake; end axi_protocol_converter_v2_1_b2s_simple_fifo #( .C_WIDTH (P_WIDTH), .C_AWIDTH (P_AWIDTH), .C_DEPTH (P_DEPTH) ) bid_fifo_0 ( .clk ( clk ) , .rst ( reset ) , .wr_en ( b_push ) , .rd_en ( shandshake_r ) , .din ( {b_awid, b_awlen} ) , .dout ( {bid_i, b_awlen_i}) , .a_full ( ) , .full ( b_full ) , .a_empty ( ) , .empty ( b_empty ) ); assign m_bready = ~mhandshake_r & bresp_empty; ///////////////////////////////////////////////////////////////////////////// // Update if more critical. assign need_to_update_bresp = ( m_bresp > s_bresp_acc ); // Select accumultated or direct depending on setting. always @( * ) begin if ( need_to_update_bresp ) begin s_bresp_i = m_bresp; end else begin s_bresp_i = s_bresp_acc; end end ///////////////////////////////////////////////////////////////////////////// // Accumulate MI-side BRESP. always @ (posedge clk) begin if (reset | bresp_push ) begin s_bresp_acc <= LP_RESP_OKAY; end else if ( mhandshake ) begin s_bresp_acc <= s_bresp_i; end end assign bresp_push = ( mhandshake_r ) & (bresp_cnt == b_awlen_i) & ~b_empty; always @ (posedge clk) begin if (reset | bresp_push ) begin bresp_cnt <= 8'h00; end else if ( mhandshake_r ) begin bresp_cnt <= bresp_cnt + 1'b1; end end axi_protocol_converter_v2_1_b2s_simple_fifo #( .C_WIDTH (P_RWIDTH), .C_AWIDTH (P_RAWIDTH), .C_DEPTH (P_RDEPTH) ) bresp_fifo_0 ( .clk ( clk ) , .rst ( reset ) , .wr_en ( bresp_push ) , .rd_en ( shandshake_r ) , .din ( s_bresp_acc ) , .dout ( s_bresp_acc_r) , .a_full ( ) , .full ( bresp_full ) , .a_empty ( ) , .empty ( bresp_empty ) ); endmodule `default_nettype wire
/* Copyright (c) 2014-2018 Alex Forencich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // Language: Verilog-2001 `resetall `timescale 1 ns / 1 ps `default_nettype none /* * Synchronizes an asyncronous signal to a given clock by using a pipeline of * two registers. */ module sync_signal #( parameter WIDTH=1, // width of the input and output signals parameter N=2 // depth of synchronizer )( input wire clk, input wire [WIDTH-1:0] in, output wire [WIDTH-1:0] out ); reg [WIDTH-1:0] sync_reg[N-1:0]; /* * The synchronized output is the last register in the pipeline. */ assign out = sync_reg[N-1]; integer k; always @(posedge clk) begin sync_reg[0] <= in; for (k = 1; k < N; k = k + 1) begin sync_reg[k] <= sync_reg[k-1]; end end endmodule `resetall
/* Copyright (c) 2014-2018 Alex Forencich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // Language: Verilog-2001 `resetall `timescale 1 ns / 1 ps `default_nettype none /* * Synchronizes an asyncronous signal to a given clock by using a pipeline of * two registers. */ module sync_signal #( parameter WIDTH=1, // width of the input and output signals parameter N=2 // depth of synchronizer )( input wire clk, input wire [WIDTH-1:0] in, output wire [WIDTH-1:0] out ); reg [WIDTH-1:0] sync_reg[N-1:0]; /* * The synchronized output is the last register in the pipeline. */ assign out = sync_reg[N-1]; integer k; always @(posedge clk) begin sync_reg[0] <= in; for (k = 1; k < N; k = k + 1) begin sync_reg[k] <= sync_reg[k-1]; end end endmodule `resetall
/* Copyright (c) 2014-2018 Alex Forencich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // Language: Verilog-2001 `resetall `timescale 1 ns / 1 ps `default_nettype none /* * Synchronizes an asyncronous signal to a given clock by using a pipeline of * two registers. */ module sync_signal #( parameter WIDTH=1, // width of the input and output signals parameter N=2 // depth of synchronizer )( input wire clk, input wire [WIDTH-1:0] in, output wire [WIDTH-1:0] out ); reg [WIDTH-1:0] sync_reg[N-1:0]; /* * The synchronized output is the last register in the pipeline. */ assign out = sync_reg[N-1]; integer k; always @(posedge clk) begin sync_reg[0] <= in; for (k = 1; k < N; k = k + 1) begin sync_reg[k] <= sync_reg[k-1]; end end endmodule `resetall
//***************************************************************************** // (c) Copyright 2009 - 2010 Xilinx, Inc. All rights reserved. // // This file contains confidential and proprietary information // of Xilinx, Inc. and is protected under U.S. and // international copyright and other intellectual property // laws. // // DISCLAIMER // This disclaimer is not a license and does not grant any // rights to the materials distributed herewith. Except as // otherwise provided in a valid license issued to you by // Xilinx, and to the maximum extent permitted by applicable // law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND // WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES // AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING // BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- // INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and // (2) Xilinx shall not be liable (whether in contract or tort, // including negligence, or under any other theory of // liability) for any loss or damage of any kind or nature // related to, arising under or in connection with these // materials, including for any direct, or any indirect, // special, incidental, or consequential loss or damage // (including loss of data, profits, goodwill, or any type of // loss or damage suffered as a result of any action brought // by a third party) even if such damage or loss was // reasonably foreseeable or Xilinx had been advised of the // possibility of the same. // // CRITICAL APPLICATIONS // Xilinx products are not designed or intended to be fail- // safe, or for use in any application requiring fail-safe // performance, such as life-support or safety devices or // systems, Class III medical devices, nuclear facilities, // applications related to the deployment of airbags, or any // other applications that could lead to death, personal // injury, or severe property or environmental damage // (individually and collectively, "Critical // Applications"). Customer assumes the sole risk and // liability of any use of Xilinx products in Critical // Applications, subject only to applicable laws and // regulations governing limitations on product liability. // // THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS // PART OF THIS FILE AT ALL TIMES. // //***************************************************************************** // ____ ____ // / /\/ / // /___/ \ / Vendor : Xilinx // \ \ \/ Version : 3.92 // \ \ Application : MIG // / / Filename : wiredly.v // /___/ /\ Date Last Modified : $Date: 2011/06/02 07:17:34 $ // \ \ / \ Date Created : Thu Feb 21 2008 // \___\/\___\ // // Device : Virtex-6 // Design Name : DDR3 SDRAM // Purpose : // This module provide the definition of a zero ohm component (A, B). // // The applications of this component include: // . Normal operation of a jumper wire (data flowing in both directions) // This can corrupt data from DRAM to FPGA useful for verifying ECC function. // // The component consists of 2 ports: // . Port A: One side of the pass-through switch // . Port B: The other side of the pass-through switch // The model is sensitive to transactions on all ports. Once a transaction // is detected, all other transactions are ignored for that simulation time // (i.e. further transactions in that delta time are ignored). // Model Limitations and Restrictions: // Signals asserted on the ports of the error injector should not have // transactions occuring in multiple delta times because the model // is sensitive to transactions on port A, B ONLY ONCE during // a simulation time. Thus, once fired, a process will // not refire if there are multiple transactions occuring in delta times. // This condition may occur in gate level simulations with // ZERO delays because transactions may occur in multiple delta times. // // Reference : // Revision History : //***************************************************************************** `timescale 1ns / 1ps module WireDelay # ( parameter Delay_g = 0, parameter Delay_rd = 0, parameter ERR_INSERT = "OFF" ) ( inout A, inout B, input reset, input phy_init_done ); reg A_r; reg B_r; reg B_inv ; reg line_en; reg B_nonX; assign A = A_r; assign B = B_r; always @ (*) begin if (B === 1'bx) B_nonX <= $random; else B_nonX <= B; end always @(*) begin if((B_nonX == 'b1) || (B_nonX == 'b0)) B_inv <= #0 ~B_nonX ; else B_inv <= #0 'bz ; end always @(*) begin if (!reset) begin A_r <= 1'bz; B_r <= 1'bz; line_en <= 1'b0; end else begin if (line_en) begin B_r <= 1'bz; if ((ERR_INSERT == "ON") & (phy_init_done)) A_r <= #Delay_rd B_inv; else A_r <= #Delay_rd B_nonX; end else begin B_r <= #Delay_g A; A_r <= 1'bz; end end end always @(A or B) begin if (!reset) begin line_en <= 1'b0; end else if (A !== A_r) begin line_en <= 1'b0; end else if (B_r !== B) begin line_en <= 1'b1; end else begin line_en <= line_en; end end endmodule
// (C) 2001-2015 Altera Corporation. All rights reserved. // Your use of Altera Corporation's design tools, logic functions and other // software and tools, and its AMPP partner logic functions, and any output // files any of the foregoing (including device programming or simulation // files), and any associated documentation or information are expressly subject // to the terms and conditions of the Altera Program License Subscription // Agreement, Altera MegaCore Function License Agreement, or other applicable // license agreement, including, without limitation, that your use is for the // sole purpose of programming logic devices manufactured by Altera and sold by // Altera or its authorized distributors. Please refer to the applicable // agreement for further details. // (C) 2001-2013 Altera Corporation. All rights reserved. // Your use of Altera Corporation's design tools, logic functions and other // software and tools, and its AMPP partner logic functions, and any output // files any of the foregoing (including device programming or simulation // files), and any associated documentation or information are expressly subject // to the terms and conditions of the Altera Program License Subscription // Agreement, Altera MegaCore Function License Agreement, or other applicable // license agreement, including, without limitation, that your use is for the // sole purpose of programming logic devices manufactured by Altera and sold by // Altera or its authorized distributors. Please refer to the applicable // agreement for further details. // $Id: //acds/rel/15.1/ip/merlin/altera_reset_controller/altera_reset_controller.v#1 $ // $Revision: #1 $ // $Date: 2015/08/09 $ // $Author: swbranch $ // -------------------------------------- // Reset controller // // Combines all the input resets and synchronizes // the result to the clk. // ACDS13.1 - Added reset request as part of reset sequencing // -------------------------------------- `timescale 1 ns / 1 ns module altera_reset_controller #( parameter NUM_RESET_INPUTS = 6, parameter USE_RESET_REQUEST_IN0 = 0, parameter USE_RESET_REQUEST_IN1 = 0, parameter USE_RESET_REQUEST_IN2 = 0, parameter USE_RESET_REQUEST_IN3 = 0, parameter USE_RESET_REQUEST_IN4 = 0, parameter USE_RESET_REQUEST_IN5 = 0, parameter USE_RESET_REQUEST_IN6 = 0, parameter USE_RESET_REQUEST_IN7 = 0, parameter USE_RESET_REQUEST_IN8 = 0, parameter USE_RESET_REQUEST_IN9 = 0, parameter USE_RESET_REQUEST_IN10 = 0, parameter USE_RESET_REQUEST_IN11 = 0, parameter USE_RESET_REQUEST_IN12 = 0, parameter USE_RESET_REQUEST_IN13 = 0, parameter USE_RESET_REQUEST_IN14 = 0, parameter USE_RESET_REQUEST_IN15 = 0, parameter OUTPUT_RESET_SYNC_EDGES = "deassert", parameter SYNC_DEPTH = 2, parameter RESET_REQUEST_PRESENT = 0, parameter RESET_REQ_WAIT_TIME = 3, parameter MIN_RST_ASSERTION_TIME = 11, parameter RESET_REQ_EARLY_DSRT_TIME = 4, parameter ADAPT_RESET_REQUEST = 0 ) ( // -------------------------------------- // We support up to 16 reset inputs, for now // -------------------------------------- input reset_in0, input reset_in1, input reset_in2, input reset_in3, input reset_in4, input reset_in5, input reset_in6, input reset_in7, input reset_in8, input reset_in9, input reset_in10, input reset_in11, input reset_in12, input reset_in13, input reset_in14, input reset_in15, input reset_req_in0, input reset_req_in1, input reset_req_in2, input reset_req_in3, input reset_req_in4, input reset_req_in5, input reset_req_in6, input reset_req_in7, input reset_req_in8, input reset_req_in9, input reset_req_in10, input reset_req_in11, input reset_req_in12, input reset_req_in13, input reset_req_in14, input reset_req_in15, input clk, output reg reset_out, output reg reset_req ); // Always use async reset synchronizer if reset_req is used localparam ASYNC_RESET = (OUTPUT_RESET_SYNC_EDGES == "deassert"); // -------------------------------------- // Local parameter to control the reset_req and reset_out timing when RESET_REQUEST_PRESENT==1 // -------------------------------------- localparam MIN_METASTABLE = 3; localparam RSTREQ_ASRT_SYNC_TAP = MIN_METASTABLE + RESET_REQ_WAIT_TIME; localparam LARGER = RESET_REQ_WAIT_TIME > RESET_REQ_EARLY_DSRT_TIME ? RESET_REQ_WAIT_TIME : RESET_REQ_EARLY_DSRT_TIME; localparam ASSERTION_CHAIN_LENGTH = (MIN_METASTABLE > LARGER) ? MIN_RST_ASSERTION_TIME + 1 : ( (MIN_RST_ASSERTION_TIME > LARGER)? MIN_RST_ASSERTION_TIME + (LARGER - MIN_METASTABLE + 1) + 1 : MIN_RST_ASSERTION_TIME + RESET_REQ_EARLY_DSRT_TIME + RESET_REQ_WAIT_TIME - MIN_METASTABLE + 2 ); localparam RESET_REQ_DRST_TAP = RESET_REQ_EARLY_DSRT_TIME + 1; // -------------------------------------- wire merged_reset; wire merged_reset_req_in; wire reset_out_pre; wire reset_req_pre; // Registers and Interconnect (*preserve*) reg [RSTREQ_ASRT_SYNC_TAP: 0] altera_reset_synchronizer_int_chain; reg [ASSERTION_CHAIN_LENGTH-1: 0] r_sync_rst_chain; reg r_sync_rst; reg r_early_rst; // -------------------------------------- // "Or" all the input resets together // -------------------------------------- assign merged_reset = ( reset_in0 | reset_in1 | reset_in2 | reset_in3 | reset_in4 | reset_in5 | reset_in6 | reset_in7 | reset_in8 | reset_in9 | reset_in10 | reset_in11 | reset_in12 | reset_in13 | reset_in14 | reset_in15 ); assign merged_reset_req_in = ( ( (USE_RESET_REQUEST_IN0 == 1) ? reset_req_in0 : 1'b0) | ( (USE_RESET_REQUEST_IN1 == 1) ? reset_req_in1 : 1'b0) | ( (USE_RESET_REQUEST_IN2 == 1) ? reset_req_in2 : 1'b0) | ( (USE_RESET_REQUEST_IN3 == 1) ? reset_req_in3 : 1'b0) | ( (USE_RESET_REQUEST_IN4 == 1) ? reset_req_in4 : 1'b0) | ( (USE_RESET_REQUEST_IN5 == 1) ? reset_req_in5 : 1'b0) | ( (USE_RESET_REQUEST_IN6 == 1) ? reset_req_in6 : 1'b0) | ( (USE_RESET_REQUEST_IN7 == 1) ? reset_req_in7 : 1'b0) | ( (USE_RESET_REQUEST_IN8 == 1) ? reset_req_in8 : 1'b0) | ( (USE_RESET_REQUEST_IN9 == 1) ? reset_req_in9 : 1'b0) | ( (USE_RESET_REQUEST_IN10 == 1) ? reset_req_in10 : 1'b0) | ( (USE_RESET_REQUEST_IN11 == 1) ? reset_req_in11 : 1'b0) | ( (USE_RESET_REQUEST_IN12 == 1) ? reset_req_in12 : 1'b0) | ( (USE_RESET_REQUEST_IN13 == 1) ? reset_req_in13 : 1'b0) | ( (USE_RESET_REQUEST_IN14 == 1) ? reset_req_in14 : 1'b0) | ( (USE_RESET_REQUEST_IN15 == 1) ? reset_req_in15 : 1'b0) ); // -------------------------------------- // And if required, synchronize it to the required clock domain, // with the correct synchronization type // -------------------------------------- generate if (OUTPUT_RESET_SYNC_EDGES == "none" && (RESET_REQUEST_PRESENT==0)) begin assign reset_out_pre = merged_reset; assign reset_req_pre = merged_reset_req_in; end else begin altera_reset_synchronizer #( .DEPTH (SYNC_DEPTH), .ASYNC_RESET(RESET_REQUEST_PRESENT? 1'b1 : ASYNC_RESET) ) alt_rst_sync_uq1 ( .clk (clk), .reset_in (merged_reset), .reset_out (reset_out_pre) ); altera_reset_synchronizer #( .DEPTH (SYNC_DEPTH), .ASYNC_RESET(0) ) alt_rst_req_sync_uq1 ( .clk (clk), .reset_in (merged_reset_req_in), .reset_out (reset_req_pre) ); end endgenerate generate if ( ( (RESET_REQUEST_PRESENT == 0) && (ADAPT_RESET_REQUEST==0) )| ( (ADAPT_RESET_REQUEST == 1) && (OUTPUT_RESET_SYNC_EDGES != "deassert") ) ) begin always @* begin reset_out = reset_out_pre; reset_req = reset_req_pre; end end else if ( (RESET_REQUEST_PRESENT == 0) && (ADAPT_RESET_REQUEST==1) ) begin wire reset_out_pre2; altera_reset_synchronizer #( .DEPTH (SYNC_DEPTH+1), .ASYNC_RESET(0) ) alt_rst_sync_uq2 ( .clk (clk), .reset_in (reset_out_pre), .reset_out (reset_out_pre2) ); always @* begin reset_out = reset_out_pre2; reset_req = reset_req_pre; end end else begin // 3-FF Metastability Synchronizer initial begin altera_reset_synchronizer_int_chain <= {RSTREQ_ASRT_SYNC_TAP{1'b1}}; end always @(posedge clk) begin altera_reset_synchronizer_int_chain[RSTREQ_ASRT_SYNC_TAP:0] <= {altera_reset_synchronizer_int_chain[RSTREQ_ASRT_SYNC_TAP-1:0], reset_out_pre}; end // Synchronous reset pipe initial begin r_sync_rst_chain <= {ASSERTION_CHAIN_LENGTH{1'b1}}; end always @(posedge clk) begin if (altera_reset_synchronizer_int_chain[MIN_METASTABLE-1] == 1'b1) begin r_sync_rst_chain <= {ASSERTION_CHAIN_LENGTH{1'b1}}; end else begin r_sync_rst_chain <= {1'b0, r_sync_rst_chain[ASSERTION_CHAIN_LENGTH-1:1]}; end end // Standard synchronous reset output. From 0-1, the transition lags the early output. For 1->0, the transition // matches the early input. always @(posedge clk) begin case ({altera_reset_synchronizer_int_chain[RSTREQ_ASRT_SYNC_TAP], r_sync_rst_chain[1], r_sync_rst}) 3'b000: r_sync_rst <= 1'b0; // Not reset 3'b001: r_sync_rst <= 1'b0; 3'b010: r_sync_rst <= 1'b0; 3'b011: r_sync_rst <= 1'b1; 3'b100: r_sync_rst <= 1'b1; 3'b101: r_sync_rst <= 1'b1; 3'b110: r_sync_rst <= 1'b1; 3'b111: r_sync_rst <= 1'b1; // In Reset default: r_sync_rst <= 1'b1; endcase case ({r_sync_rst_chain[1], r_sync_rst_chain[RESET_REQ_DRST_TAP] | reset_req_pre}) 2'b00: r_early_rst <= 1'b0; // Not reset 2'b01: r_early_rst <= 1'b1; // Coming out of reset 2'b10: r_early_rst <= 1'b0; // Spurious reset - should not be possible via synchronous design. 2'b11: r_early_rst <= 1'b1; // Held in reset default: r_early_rst <= 1'b1; endcase end always @* begin reset_out = r_sync_rst; reset_req = r_early_rst; end end endgenerate endmodule
// (C) 2001-2015 Altera Corporation. All rights reserved. // Your use of Altera Corporation's design tools, logic functions and other // software and tools, and its AMPP partner logic functions, and any output // files any of the foregoing (including device programming or simulation // files), and any associated documentation or information are expressly subject // to the terms and conditions of the Altera Program License Subscription // Agreement, Altera MegaCore Function License Agreement, or other applicable // license agreement, including, without limitation, that your use is for the // sole purpose of programming logic devices manufactured by Altera and sold by // Altera or its authorized distributors. Please refer to the applicable // agreement for further details. // (C) 2001-2013 Altera Corporation. All rights reserved. // Your use of Altera Corporation's design tools, logic functions and other // software and tools, and its AMPP partner logic functions, and any output // files any of the foregoing (including device programming or simulation // files), and any associated documentation or information are expressly subject // to the terms and conditions of the Altera Program License Subscription // Agreement, Altera MegaCore Function License Agreement, or other applicable // license agreement, including, without limitation, that your use is for the // sole purpose of programming logic devices manufactured by Altera and sold by // Altera or its authorized distributors. Please refer to the applicable // agreement for further details. // $Id: //acds/rel/15.1/ip/merlin/altera_reset_controller/altera_reset_controller.v#1 $ // $Revision: #1 $ // $Date: 2015/08/09 $ // $Author: swbranch $ // -------------------------------------- // Reset controller // // Combines all the input resets and synchronizes // the result to the clk. // ACDS13.1 - Added reset request as part of reset sequencing // -------------------------------------- `timescale 1 ns / 1 ns module altera_reset_controller #( parameter NUM_RESET_INPUTS = 6, parameter USE_RESET_REQUEST_IN0 = 0, parameter USE_RESET_REQUEST_IN1 = 0, parameter USE_RESET_REQUEST_IN2 = 0, parameter USE_RESET_REQUEST_IN3 = 0, parameter USE_RESET_REQUEST_IN4 = 0, parameter USE_RESET_REQUEST_IN5 = 0, parameter USE_RESET_REQUEST_IN6 = 0, parameter USE_RESET_REQUEST_IN7 = 0, parameter USE_RESET_REQUEST_IN8 = 0, parameter USE_RESET_REQUEST_IN9 = 0, parameter USE_RESET_REQUEST_IN10 = 0, parameter USE_RESET_REQUEST_IN11 = 0, parameter USE_RESET_REQUEST_IN12 = 0, parameter USE_RESET_REQUEST_IN13 = 0, parameter USE_RESET_REQUEST_IN14 = 0, parameter USE_RESET_REQUEST_IN15 = 0, parameter OUTPUT_RESET_SYNC_EDGES = "deassert", parameter SYNC_DEPTH = 2, parameter RESET_REQUEST_PRESENT = 0, parameter RESET_REQ_WAIT_TIME = 3, parameter MIN_RST_ASSERTION_TIME = 11, parameter RESET_REQ_EARLY_DSRT_TIME = 4, parameter ADAPT_RESET_REQUEST = 0 ) ( // -------------------------------------- // We support up to 16 reset inputs, for now // -------------------------------------- input reset_in0, input reset_in1, input reset_in2, input reset_in3, input reset_in4, input reset_in5, input reset_in6, input reset_in7, input reset_in8, input reset_in9, input reset_in10, input reset_in11, input reset_in12, input reset_in13, input reset_in14, input reset_in15, input reset_req_in0, input reset_req_in1, input reset_req_in2, input reset_req_in3, input reset_req_in4, input reset_req_in5, input reset_req_in6, input reset_req_in7, input reset_req_in8, input reset_req_in9, input reset_req_in10, input reset_req_in11, input reset_req_in12, input reset_req_in13, input reset_req_in14, input reset_req_in15, input clk, output reg reset_out, output reg reset_req ); // Always use async reset synchronizer if reset_req is used localparam ASYNC_RESET = (OUTPUT_RESET_SYNC_EDGES == "deassert"); // -------------------------------------- // Local parameter to control the reset_req and reset_out timing when RESET_REQUEST_PRESENT==1 // -------------------------------------- localparam MIN_METASTABLE = 3; localparam RSTREQ_ASRT_SYNC_TAP = MIN_METASTABLE + RESET_REQ_WAIT_TIME; localparam LARGER = RESET_REQ_WAIT_TIME > RESET_REQ_EARLY_DSRT_TIME ? RESET_REQ_WAIT_TIME : RESET_REQ_EARLY_DSRT_TIME; localparam ASSERTION_CHAIN_LENGTH = (MIN_METASTABLE > LARGER) ? MIN_RST_ASSERTION_TIME + 1 : ( (MIN_RST_ASSERTION_TIME > LARGER)? MIN_RST_ASSERTION_TIME + (LARGER - MIN_METASTABLE + 1) + 1 : MIN_RST_ASSERTION_TIME + RESET_REQ_EARLY_DSRT_TIME + RESET_REQ_WAIT_TIME - MIN_METASTABLE + 2 ); localparam RESET_REQ_DRST_TAP = RESET_REQ_EARLY_DSRT_TIME + 1; // -------------------------------------- wire merged_reset; wire merged_reset_req_in; wire reset_out_pre; wire reset_req_pre; // Registers and Interconnect (*preserve*) reg [RSTREQ_ASRT_SYNC_TAP: 0] altera_reset_synchronizer_int_chain; reg [ASSERTION_CHAIN_LENGTH-1: 0] r_sync_rst_chain; reg r_sync_rst; reg r_early_rst; // -------------------------------------- // "Or" all the input resets together // -------------------------------------- assign merged_reset = ( reset_in0 | reset_in1 | reset_in2 | reset_in3 | reset_in4 | reset_in5 | reset_in6 | reset_in7 | reset_in8 | reset_in9 | reset_in10 | reset_in11 | reset_in12 | reset_in13 | reset_in14 | reset_in15 ); assign merged_reset_req_in = ( ( (USE_RESET_REQUEST_IN0 == 1) ? reset_req_in0 : 1'b0) | ( (USE_RESET_REQUEST_IN1 == 1) ? reset_req_in1 : 1'b0) | ( (USE_RESET_REQUEST_IN2 == 1) ? reset_req_in2 : 1'b0) | ( (USE_RESET_REQUEST_IN3 == 1) ? reset_req_in3 : 1'b0) | ( (USE_RESET_REQUEST_IN4 == 1) ? reset_req_in4 : 1'b0) | ( (USE_RESET_REQUEST_IN5 == 1) ? reset_req_in5 : 1'b0) | ( (USE_RESET_REQUEST_IN6 == 1) ? reset_req_in6 : 1'b0) | ( (USE_RESET_REQUEST_IN7 == 1) ? reset_req_in7 : 1'b0) | ( (USE_RESET_REQUEST_IN8 == 1) ? reset_req_in8 : 1'b0) | ( (USE_RESET_REQUEST_IN9 == 1) ? reset_req_in9 : 1'b0) | ( (USE_RESET_REQUEST_IN10 == 1) ? reset_req_in10 : 1'b0) | ( (USE_RESET_REQUEST_IN11 == 1) ? reset_req_in11 : 1'b0) | ( (USE_RESET_REQUEST_IN12 == 1) ? reset_req_in12 : 1'b0) | ( (USE_RESET_REQUEST_IN13 == 1) ? reset_req_in13 : 1'b0) | ( (USE_RESET_REQUEST_IN14 == 1) ? reset_req_in14 : 1'b0) | ( (USE_RESET_REQUEST_IN15 == 1) ? reset_req_in15 : 1'b0) ); // -------------------------------------- // And if required, synchronize it to the required clock domain, // with the correct synchronization type // -------------------------------------- generate if (OUTPUT_RESET_SYNC_EDGES == "none" && (RESET_REQUEST_PRESENT==0)) begin assign reset_out_pre = merged_reset; assign reset_req_pre = merged_reset_req_in; end else begin altera_reset_synchronizer #( .DEPTH (SYNC_DEPTH), .ASYNC_RESET(RESET_REQUEST_PRESENT? 1'b1 : ASYNC_RESET) ) alt_rst_sync_uq1 ( .clk (clk), .reset_in (merged_reset), .reset_out (reset_out_pre) ); altera_reset_synchronizer #( .DEPTH (SYNC_DEPTH), .ASYNC_RESET(0) ) alt_rst_req_sync_uq1 ( .clk (clk), .reset_in (merged_reset_req_in), .reset_out (reset_req_pre) ); end endgenerate generate if ( ( (RESET_REQUEST_PRESENT == 0) && (ADAPT_RESET_REQUEST==0) )| ( (ADAPT_RESET_REQUEST == 1) && (OUTPUT_RESET_SYNC_EDGES != "deassert") ) ) begin always @* begin reset_out = reset_out_pre; reset_req = reset_req_pre; end end else if ( (RESET_REQUEST_PRESENT == 0) && (ADAPT_RESET_REQUEST==1) ) begin wire reset_out_pre2; altera_reset_synchronizer #( .DEPTH (SYNC_DEPTH+1), .ASYNC_RESET(0) ) alt_rst_sync_uq2 ( .clk (clk), .reset_in (reset_out_pre), .reset_out (reset_out_pre2) ); always @* begin reset_out = reset_out_pre2; reset_req = reset_req_pre; end end else begin // 3-FF Metastability Synchronizer initial begin altera_reset_synchronizer_int_chain <= {RSTREQ_ASRT_SYNC_TAP{1'b1}}; end always @(posedge clk) begin altera_reset_synchronizer_int_chain[RSTREQ_ASRT_SYNC_TAP:0] <= {altera_reset_synchronizer_int_chain[RSTREQ_ASRT_SYNC_TAP-1:0], reset_out_pre}; end // Synchronous reset pipe initial begin r_sync_rst_chain <= {ASSERTION_CHAIN_LENGTH{1'b1}}; end always @(posedge clk) begin if (altera_reset_synchronizer_int_chain[MIN_METASTABLE-1] == 1'b1) begin r_sync_rst_chain <= {ASSERTION_CHAIN_LENGTH{1'b1}}; end else begin r_sync_rst_chain <= {1'b0, r_sync_rst_chain[ASSERTION_CHAIN_LENGTH-1:1]}; end end // Standard synchronous reset output. From 0-1, the transition lags the early output. For 1->0, the transition // matches the early input. always @(posedge clk) begin case ({altera_reset_synchronizer_int_chain[RSTREQ_ASRT_SYNC_TAP], r_sync_rst_chain[1], r_sync_rst}) 3'b000: r_sync_rst <= 1'b0; // Not reset 3'b001: r_sync_rst <= 1'b0; 3'b010: r_sync_rst <= 1'b0; 3'b011: r_sync_rst <= 1'b1; 3'b100: r_sync_rst <= 1'b1; 3'b101: r_sync_rst <= 1'b1; 3'b110: r_sync_rst <= 1'b1; 3'b111: r_sync_rst <= 1'b1; // In Reset default: r_sync_rst <= 1'b1; endcase case ({r_sync_rst_chain[1], r_sync_rst_chain[RESET_REQ_DRST_TAP] | reset_req_pre}) 2'b00: r_early_rst <= 1'b0; // Not reset 2'b01: r_early_rst <= 1'b1; // Coming out of reset 2'b10: r_early_rst <= 1'b0; // Spurious reset - should not be possible via synchronous design. 2'b11: r_early_rst <= 1'b1; // Held in reset default: r_early_rst <= 1'b1; endcase end always @* begin reset_out = r_sync_rst; reset_req = r_early_rst; end end endgenerate endmodule
// (C) 2001-2015 Altera Corporation. All rights reserved. // Your use of Altera Corporation's design tools, logic functions and other // software and tools, and its AMPP partner logic functions, and any output // files any of the foregoing (including device programming or simulation // files), and any associated documentation or information are expressly subject // to the terms and conditions of the Altera Program License Subscription // Agreement, Altera MegaCore Function License Agreement, or other applicable // license agreement, including, without limitation, that your use is for the // sole purpose of programming logic devices manufactured by Altera and sold by // Altera or its authorized distributors. Please refer to the applicable // agreement for further details. // (C) 2001-2013 Altera Corporation. All rights reserved. // Your use of Altera Corporation's design tools, logic functions and other // software and tools, and its AMPP partner logic functions, and any output // files any of the foregoing (including device programming or simulation // files), and any associated documentation or information are expressly subject // to the terms and conditions of the Altera Program License Subscription // Agreement, Altera MegaCore Function License Agreement, or other applicable // license agreement, including, without limitation, that your use is for the // sole purpose of programming logic devices manufactured by Altera and sold by // Altera or its authorized distributors. Please refer to the applicable // agreement for further details. // $Id: //acds/rel/15.1/ip/merlin/altera_reset_controller/altera_reset_controller.v#1 $ // $Revision: #1 $ // $Date: 2015/08/09 $ // $Author: swbranch $ // -------------------------------------- // Reset controller // // Combines all the input resets and synchronizes // the result to the clk. // ACDS13.1 - Added reset request as part of reset sequencing // -------------------------------------- `timescale 1 ns / 1 ns module altera_reset_controller #( parameter NUM_RESET_INPUTS = 6, parameter USE_RESET_REQUEST_IN0 = 0, parameter USE_RESET_REQUEST_IN1 = 0, parameter USE_RESET_REQUEST_IN2 = 0, parameter USE_RESET_REQUEST_IN3 = 0, parameter USE_RESET_REQUEST_IN4 = 0, parameter USE_RESET_REQUEST_IN5 = 0, parameter USE_RESET_REQUEST_IN6 = 0, parameter USE_RESET_REQUEST_IN7 = 0, parameter USE_RESET_REQUEST_IN8 = 0, parameter USE_RESET_REQUEST_IN9 = 0, parameter USE_RESET_REQUEST_IN10 = 0, parameter USE_RESET_REQUEST_IN11 = 0, parameter USE_RESET_REQUEST_IN12 = 0, parameter USE_RESET_REQUEST_IN13 = 0, parameter USE_RESET_REQUEST_IN14 = 0, parameter USE_RESET_REQUEST_IN15 = 0, parameter OUTPUT_RESET_SYNC_EDGES = "deassert", parameter SYNC_DEPTH = 2, parameter RESET_REQUEST_PRESENT = 0, parameter RESET_REQ_WAIT_TIME = 3, parameter MIN_RST_ASSERTION_TIME = 11, parameter RESET_REQ_EARLY_DSRT_TIME = 4, parameter ADAPT_RESET_REQUEST = 0 ) ( // -------------------------------------- // We support up to 16 reset inputs, for now // -------------------------------------- input reset_in0, input reset_in1, input reset_in2, input reset_in3, input reset_in4, input reset_in5, input reset_in6, input reset_in7, input reset_in8, input reset_in9, input reset_in10, input reset_in11, input reset_in12, input reset_in13, input reset_in14, input reset_in15, input reset_req_in0, input reset_req_in1, input reset_req_in2, input reset_req_in3, input reset_req_in4, input reset_req_in5, input reset_req_in6, input reset_req_in7, input reset_req_in8, input reset_req_in9, input reset_req_in10, input reset_req_in11, input reset_req_in12, input reset_req_in13, input reset_req_in14, input reset_req_in15, input clk, output reg reset_out, output reg reset_req ); // Always use async reset synchronizer if reset_req is used localparam ASYNC_RESET = (OUTPUT_RESET_SYNC_EDGES == "deassert"); // -------------------------------------- // Local parameter to control the reset_req and reset_out timing when RESET_REQUEST_PRESENT==1 // -------------------------------------- localparam MIN_METASTABLE = 3; localparam RSTREQ_ASRT_SYNC_TAP = MIN_METASTABLE + RESET_REQ_WAIT_TIME; localparam LARGER = RESET_REQ_WAIT_TIME > RESET_REQ_EARLY_DSRT_TIME ? RESET_REQ_WAIT_TIME : RESET_REQ_EARLY_DSRT_TIME; localparam ASSERTION_CHAIN_LENGTH = (MIN_METASTABLE > LARGER) ? MIN_RST_ASSERTION_TIME + 1 : ( (MIN_RST_ASSERTION_TIME > LARGER)? MIN_RST_ASSERTION_TIME + (LARGER - MIN_METASTABLE + 1) + 1 : MIN_RST_ASSERTION_TIME + RESET_REQ_EARLY_DSRT_TIME + RESET_REQ_WAIT_TIME - MIN_METASTABLE + 2 ); localparam RESET_REQ_DRST_TAP = RESET_REQ_EARLY_DSRT_TIME + 1; // -------------------------------------- wire merged_reset; wire merged_reset_req_in; wire reset_out_pre; wire reset_req_pre; // Registers and Interconnect (*preserve*) reg [RSTREQ_ASRT_SYNC_TAP: 0] altera_reset_synchronizer_int_chain; reg [ASSERTION_CHAIN_LENGTH-1: 0] r_sync_rst_chain; reg r_sync_rst; reg r_early_rst; // -------------------------------------- // "Or" all the input resets together // -------------------------------------- assign merged_reset = ( reset_in0 | reset_in1 | reset_in2 | reset_in3 | reset_in4 | reset_in5 | reset_in6 | reset_in7 | reset_in8 | reset_in9 | reset_in10 | reset_in11 | reset_in12 | reset_in13 | reset_in14 | reset_in15 ); assign merged_reset_req_in = ( ( (USE_RESET_REQUEST_IN0 == 1) ? reset_req_in0 : 1'b0) | ( (USE_RESET_REQUEST_IN1 == 1) ? reset_req_in1 : 1'b0) | ( (USE_RESET_REQUEST_IN2 == 1) ? reset_req_in2 : 1'b0) | ( (USE_RESET_REQUEST_IN3 == 1) ? reset_req_in3 : 1'b0) | ( (USE_RESET_REQUEST_IN4 == 1) ? reset_req_in4 : 1'b0) | ( (USE_RESET_REQUEST_IN5 == 1) ? reset_req_in5 : 1'b0) | ( (USE_RESET_REQUEST_IN6 == 1) ? reset_req_in6 : 1'b0) | ( (USE_RESET_REQUEST_IN7 == 1) ? reset_req_in7 : 1'b0) | ( (USE_RESET_REQUEST_IN8 == 1) ? reset_req_in8 : 1'b0) | ( (USE_RESET_REQUEST_IN9 == 1) ? reset_req_in9 : 1'b0) | ( (USE_RESET_REQUEST_IN10 == 1) ? reset_req_in10 : 1'b0) | ( (USE_RESET_REQUEST_IN11 == 1) ? reset_req_in11 : 1'b0) | ( (USE_RESET_REQUEST_IN12 == 1) ? reset_req_in12 : 1'b0) | ( (USE_RESET_REQUEST_IN13 == 1) ? reset_req_in13 : 1'b0) | ( (USE_RESET_REQUEST_IN14 == 1) ? reset_req_in14 : 1'b0) | ( (USE_RESET_REQUEST_IN15 == 1) ? reset_req_in15 : 1'b0) ); // -------------------------------------- // And if required, synchronize it to the required clock domain, // with the correct synchronization type // -------------------------------------- generate if (OUTPUT_RESET_SYNC_EDGES == "none" && (RESET_REQUEST_PRESENT==0)) begin assign reset_out_pre = merged_reset; assign reset_req_pre = merged_reset_req_in; end else begin altera_reset_synchronizer #( .DEPTH (SYNC_DEPTH), .ASYNC_RESET(RESET_REQUEST_PRESENT? 1'b1 : ASYNC_RESET) ) alt_rst_sync_uq1 ( .clk (clk), .reset_in (merged_reset), .reset_out (reset_out_pre) ); altera_reset_synchronizer #( .DEPTH (SYNC_DEPTH), .ASYNC_RESET(0) ) alt_rst_req_sync_uq1 ( .clk (clk), .reset_in (merged_reset_req_in), .reset_out (reset_req_pre) ); end endgenerate generate if ( ( (RESET_REQUEST_PRESENT == 0) && (ADAPT_RESET_REQUEST==0) )| ( (ADAPT_RESET_REQUEST == 1) && (OUTPUT_RESET_SYNC_EDGES != "deassert") ) ) begin always @* begin reset_out = reset_out_pre; reset_req = reset_req_pre; end end else if ( (RESET_REQUEST_PRESENT == 0) && (ADAPT_RESET_REQUEST==1) ) begin wire reset_out_pre2; altera_reset_synchronizer #( .DEPTH (SYNC_DEPTH+1), .ASYNC_RESET(0) ) alt_rst_sync_uq2 ( .clk (clk), .reset_in (reset_out_pre), .reset_out (reset_out_pre2) ); always @* begin reset_out = reset_out_pre2; reset_req = reset_req_pre; end end else begin // 3-FF Metastability Synchronizer initial begin altera_reset_synchronizer_int_chain <= {RSTREQ_ASRT_SYNC_TAP{1'b1}}; end always @(posedge clk) begin altera_reset_synchronizer_int_chain[RSTREQ_ASRT_SYNC_TAP:0] <= {altera_reset_synchronizer_int_chain[RSTREQ_ASRT_SYNC_TAP-1:0], reset_out_pre}; end // Synchronous reset pipe initial begin r_sync_rst_chain <= {ASSERTION_CHAIN_LENGTH{1'b1}}; end always @(posedge clk) begin if (altera_reset_synchronizer_int_chain[MIN_METASTABLE-1] == 1'b1) begin r_sync_rst_chain <= {ASSERTION_CHAIN_LENGTH{1'b1}}; end else begin r_sync_rst_chain <= {1'b0, r_sync_rst_chain[ASSERTION_CHAIN_LENGTH-1:1]}; end end // Standard synchronous reset output. From 0-1, the transition lags the early output. For 1->0, the transition // matches the early input. always @(posedge clk) begin case ({altera_reset_synchronizer_int_chain[RSTREQ_ASRT_SYNC_TAP], r_sync_rst_chain[1], r_sync_rst}) 3'b000: r_sync_rst <= 1'b0; // Not reset 3'b001: r_sync_rst <= 1'b0; 3'b010: r_sync_rst <= 1'b0; 3'b011: r_sync_rst <= 1'b1; 3'b100: r_sync_rst <= 1'b1; 3'b101: r_sync_rst <= 1'b1; 3'b110: r_sync_rst <= 1'b1; 3'b111: r_sync_rst <= 1'b1; // In Reset default: r_sync_rst <= 1'b1; endcase case ({r_sync_rst_chain[1], r_sync_rst_chain[RESET_REQ_DRST_TAP] | reset_req_pre}) 2'b00: r_early_rst <= 1'b0; // Not reset 2'b01: r_early_rst <= 1'b1; // Coming out of reset 2'b10: r_early_rst <= 1'b0; // Spurious reset - should not be possible via synchronous design. 2'b11: r_early_rst <= 1'b1; // Held in reset default: r_early_rst <= 1'b1; endcase end always @* begin reset_out = r_sync_rst; reset_req = r_early_rst; end end endgenerate endmodule
// (C) 2001-2015 Altera Corporation. All rights reserved. // Your use of Altera Corporation's design tools, logic functions and other // software and tools, and its AMPP partner logic functions, and any output // files any of the foregoing (including device programming or simulation // files), and any associated documentation or information are expressly subject // to the terms and conditions of the Altera Program License Subscription // Agreement, Altera MegaCore Function License Agreement, or other applicable // license agreement, including, without limitation, that your use is for the // sole purpose of programming logic devices manufactured by Altera and sold by // Altera or its authorized distributors. Please refer to the applicable // agreement for further details. // (C) 2001-2013 Altera Corporation. All rights reserved. // Your use of Altera Corporation's design tools, logic functions and other // software and tools, and its AMPP partner logic functions, and any output // files any of the foregoing (including device programming or simulation // files), and any associated documentation or information are expressly subject // to the terms and conditions of the Altera Program License Subscription // Agreement, Altera MegaCore Function License Agreement, or other applicable // license agreement, including, without limitation, that your use is for the // sole purpose of programming logic devices manufactured by Altera and sold by // Altera or its authorized distributors. Please refer to the applicable // agreement for further details. // $Id: //acds/rel/15.1/ip/merlin/altera_reset_controller/altera_reset_controller.v#1 $ // $Revision: #1 $ // $Date: 2015/08/09 $ // $Author: swbranch $ // -------------------------------------- // Reset controller // // Combines all the input resets and synchronizes // the result to the clk. // ACDS13.1 - Added reset request as part of reset sequencing // -------------------------------------- `timescale 1 ns / 1 ns module altera_reset_controller #( parameter NUM_RESET_INPUTS = 6, parameter USE_RESET_REQUEST_IN0 = 0, parameter USE_RESET_REQUEST_IN1 = 0, parameter USE_RESET_REQUEST_IN2 = 0, parameter USE_RESET_REQUEST_IN3 = 0, parameter USE_RESET_REQUEST_IN4 = 0, parameter USE_RESET_REQUEST_IN5 = 0, parameter USE_RESET_REQUEST_IN6 = 0, parameter USE_RESET_REQUEST_IN7 = 0, parameter USE_RESET_REQUEST_IN8 = 0, parameter USE_RESET_REQUEST_IN9 = 0, parameter USE_RESET_REQUEST_IN10 = 0, parameter USE_RESET_REQUEST_IN11 = 0, parameter USE_RESET_REQUEST_IN12 = 0, parameter USE_RESET_REQUEST_IN13 = 0, parameter USE_RESET_REQUEST_IN14 = 0, parameter USE_RESET_REQUEST_IN15 = 0, parameter OUTPUT_RESET_SYNC_EDGES = "deassert", parameter SYNC_DEPTH = 2, parameter RESET_REQUEST_PRESENT = 0, parameter RESET_REQ_WAIT_TIME = 3, parameter MIN_RST_ASSERTION_TIME = 11, parameter RESET_REQ_EARLY_DSRT_TIME = 4, parameter ADAPT_RESET_REQUEST = 0 ) ( // -------------------------------------- // We support up to 16 reset inputs, for now // -------------------------------------- input reset_in0, input reset_in1, input reset_in2, input reset_in3, input reset_in4, input reset_in5, input reset_in6, input reset_in7, input reset_in8, input reset_in9, input reset_in10, input reset_in11, input reset_in12, input reset_in13, input reset_in14, input reset_in15, input reset_req_in0, input reset_req_in1, input reset_req_in2, input reset_req_in3, input reset_req_in4, input reset_req_in5, input reset_req_in6, input reset_req_in7, input reset_req_in8, input reset_req_in9, input reset_req_in10, input reset_req_in11, input reset_req_in12, input reset_req_in13, input reset_req_in14, input reset_req_in15, input clk, output reg reset_out, output reg reset_req ); // Always use async reset synchronizer if reset_req is used localparam ASYNC_RESET = (OUTPUT_RESET_SYNC_EDGES == "deassert"); // -------------------------------------- // Local parameter to control the reset_req and reset_out timing when RESET_REQUEST_PRESENT==1 // -------------------------------------- localparam MIN_METASTABLE = 3; localparam RSTREQ_ASRT_SYNC_TAP = MIN_METASTABLE + RESET_REQ_WAIT_TIME; localparam LARGER = RESET_REQ_WAIT_TIME > RESET_REQ_EARLY_DSRT_TIME ? RESET_REQ_WAIT_TIME : RESET_REQ_EARLY_DSRT_TIME; localparam ASSERTION_CHAIN_LENGTH = (MIN_METASTABLE > LARGER) ? MIN_RST_ASSERTION_TIME + 1 : ( (MIN_RST_ASSERTION_TIME > LARGER)? MIN_RST_ASSERTION_TIME + (LARGER - MIN_METASTABLE + 1) + 1 : MIN_RST_ASSERTION_TIME + RESET_REQ_EARLY_DSRT_TIME + RESET_REQ_WAIT_TIME - MIN_METASTABLE + 2 ); localparam RESET_REQ_DRST_TAP = RESET_REQ_EARLY_DSRT_TIME + 1; // -------------------------------------- wire merged_reset; wire merged_reset_req_in; wire reset_out_pre; wire reset_req_pre; // Registers and Interconnect (*preserve*) reg [RSTREQ_ASRT_SYNC_TAP: 0] altera_reset_synchronizer_int_chain; reg [ASSERTION_CHAIN_LENGTH-1: 0] r_sync_rst_chain; reg r_sync_rst; reg r_early_rst; // -------------------------------------- // "Or" all the input resets together // -------------------------------------- assign merged_reset = ( reset_in0 | reset_in1 | reset_in2 | reset_in3 | reset_in4 | reset_in5 | reset_in6 | reset_in7 | reset_in8 | reset_in9 | reset_in10 | reset_in11 | reset_in12 | reset_in13 | reset_in14 | reset_in15 ); assign merged_reset_req_in = ( ( (USE_RESET_REQUEST_IN0 == 1) ? reset_req_in0 : 1'b0) | ( (USE_RESET_REQUEST_IN1 == 1) ? reset_req_in1 : 1'b0) | ( (USE_RESET_REQUEST_IN2 == 1) ? reset_req_in2 : 1'b0) | ( (USE_RESET_REQUEST_IN3 == 1) ? reset_req_in3 : 1'b0) | ( (USE_RESET_REQUEST_IN4 == 1) ? reset_req_in4 : 1'b0) | ( (USE_RESET_REQUEST_IN5 == 1) ? reset_req_in5 : 1'b0) | ( (USE_RESET_REQUEST_IN6 == 1) ? reset_req_in6 : 1'b0) | ( (USE_RESET_REQUEST_IN7 == 1) ? reset_req_in7 : 1'b0) | ( (USE_RESET_REQUEST_IN8 == 1) ? reset_req_in8 : 1'b0) | ( (USE_RESET_REQUEST_IN9 == 1) ? reset_req_in9 : 1'b0) | ( (USE_RESET_REQUEST_IN10 == 1) ? reset_req_in10 : 1'b0) | ( (USE_RESET_REQUEST_IN11 == 1) ? reset_req_in11 : 1'b0) | ( (USE_RESET_REQUEST_IN12 == 1) ? reset_req_in12 : 1'b0) | ( (USE_RESET_REQUEST_IN13 == 1) ? reset_req_in13 : 1'b0) | ( (USE_RESET_REQUEST_IN14 == 1) ? reset_req_in14 : 1'b0) | ( (USE_RESET_REQUEST_IN15 == 1) ? reset_req_in15 : 1'b0) ); // -------------------------------------- // And if required, synchronize it to the required clock domain, // with the correct synchronization type // -------------------------------------- generate if (OUTPUT_RESET_SYNC_EDGES == "none" && (RESET_REQUEST_PRESENT==0)) begin assign reset_out_pre = merged_reset; assign reset_req_pre = merged_reset_req_in; end else begin altera_reset_synchronizer #( .DEPTH (SYNC_DEPTH), .ASYNC_RESET(RESET_REQUEST_PRESENT? 1'b1 : ASYNC_RESET) ) alt_rst_sync_uq1 ( .clk (clk), .reset_in (merged_reset), .reset_out (reset_out_pre) ); altera_reset_synchronizer #( .DEPTH (SYNC_DEPTH), .ASYNC_RESET(0) ) alt_rst_req_sync_uq1 ( .clk (clk), .reset_in (merged_reset_req_in), .reset_out (reset_req_pre) ); end endgenerate generate if ( ( (RESET_REQUEST_PRESENT == 0) && (ADAPT_RESET_REQUEST==0) )| ( (ADAPT_RESET_REQUEST == 1) && (OUTPUT_RESET_SYNC_EDGES != "deassert") ) ) begin always @* begin reset_out = reset_out_pre; reset_req = reset_req_pre; end end else if ( (RESET_REQUEST_PRESENT == 0) && (ADAPT_RESET_REQUEST==1) ) begin wire reset_out_pre2; altera_reset_synchronizer #( .DEPTH (SYNC_DEPTH+1), .ASYNC_RESET(0) ) alt_rst_sync_uq2 ( .clk (clk), .reset_in (reset_out_pre), .reset_out (reset_out_pre2) ); always @* begin reset_out = reset_out_pre2; reset_req = reset_req_pre; end end else begin // 3-FF Metastability Synchronizer initial begin altera_reset_synchronizer_int_chain <= {RSTREQ_ASRT_SYNC_TAP{1'b1}}; end always @(posedge clk) begin altera_reset_synchronizer_int_chain[RSTREQ_ASRT_SYNC_TAP:0] <= {altera_reset_synchronizer_int_chain[RSTREQ_ASRT_SYNC_TAP-1:0], reset_out_pre}; end // Synchronous reset pipe initial begin r_sync_rst_chain <= {ASSERTION_CHAIN_LENGTH{1'b1}}; end always @(posedge clk) begin if (altera_reset_synchronizer_int_chain[MIN_METASTABLE-1] == 1'b1) begin r_sync_rst_chain <= {ASSERTION_CHAIN_LENGTH{1'b1}}; end else begin r_sync_rst_chain <= {1'b0, r_sync_rst_chain[ASSERTION_CHAIN_LENGTH-1:1]}; end end // Standard synchronous reset output. From 0-1, the transition lags the early output. For 1->0, the transition // matches the early input. always @(posedge clk) begin case ({altera_reset_synchronizer_int_chain[RSTREQ_ASRT_SYNC_TAP], r_sync_rst_chain[1], r_sync_rst}) 3'b000: r_sync_rst <= 1'b0; // Not reset 3'b001: r_sync_rst <= 1'b0; 3'b010: r_sync_rst <= 1'b0; 3'b011: r_sync_rst <= 1'b1; 3'b100: r_sync_rst <= 1'b1; 3'b101: r_sync_rst <= 1'b1; 3'b110: r_sync_rst <= 1'b1; 3'b111: r_sync_rst <= 1'b1; // In Reset default: r_sync_rst <= 1'b1; endcase case ({r_sync_rst_chain[1], r_sync_rst_chain[RESET_REQ_DRST_TAP] | reset_req_pre}) 2'b00: r_early_rst <= 1'b0; // Not reset 2'b01: r_early_rst <= 1'b1; // Coming out of reset 2'b10: r_early_rst <= 1'b0; // Spurious reset - should not be possible via synchronous design. 2'b11: r_early_rst <= 1'b1; // Held in reset default: r_early_rst <= 1'b1; endcase end always @* begin reset_out = r_sync_rst; reset_req = r_early_rst; end end endgenerate endmodule
// (C) 2001-2015 Altera Corporation. All rights reserved. // Your use of Altera Corporation's design tools, logic functions and other // software and tools, and its AMPP partner logic functions, and any output // files any of the foregoing (including device programming or simulation // files), and any associated documentation or information are expressly subject // to the terms and conditions of the Altera Program License Subscription // Agreement, Altera MegaCore Function License Agreement, or other applicable // license agreement, including, without limitation, that your use is for the // sole purpose of programming logic devices manufactured by Altera and sold by // Altera or its authorized distributors. Please refer to the applicable // agreement for further details. // (C) 2001-2013 Altera Corporation. All rights reserved. // Your use of Altera Corporation's design tools, logic functions and other // software and tools, and its AMPP partner logic functions, and any output // files any of the foregoing (including device programming or simulation // files), and any associated documentation or information are expressly subject // to the terms and conditions of the Altera Program License Subscription // Agreement, Altera MegaCore Function License Agreement, or other applicable // license agreement, including, without limitation, that your use is for the // sole purpose of programming logic devices manufactured by Altera and sold by // Altera or its authorized distributors. Please refer to the applicable // agreement for further details. // $Id: //acds/rel/15.1/ip/merlin/altera_reset_controller/altera_reset_controller.v#1 $ // $Revision: #1 $ // $Date: 2015/08/09 $ // $Author: swbranch $ // -------------------------------------- // Reset controller // // Combines all the input resets and synchronizes // the result to the clk. // ACDS13.1 - Added reset request as part of reset sequencing // -------------------------------------- `timescale 1 ns / 1 ns module altera_reset_controller #( parameter NUM_RESET_INPUTS = 6, parameter USE_RESET_REQUEST_IN0 = 0, parameter USE_RESET_REQUEST_IN1 = 0, parameter USE_RESET_REQUEST_IN2 = 0, parameter USE_RESET_REQUEST_IN3 = 0, parameter USE_RESET_REQUEST_IN4 = 0, parameter USE_RESET_REQUEST_IN5 = 0, parameter USE_RESET_REQUEST_IN6 = 0, parameter USE_RESET_REQUEST_IN7 = 0, parameter USE_RESET_REQUEST_IN8 = 0, parameter USE_RESET_REQUEST_IN9 = 0, parameter USE_RESET_REQUEST_IN10 = 0, parameter USE_RESET_REQUEST_IN11 = 0, parameter USE_RESET_REQUEST_IN12 = 0, parameter USE_RESET_REQUEST_IN13 = 0, parameter USE_RESET_REQUEST_IN14 = 0, parameter USE_RESET_REQUEST_IN15 = 0, parameter OUTPUT_RESET_SYNC_EDGES = "deassert", parameter SYNC_DEPTH = 2, parameter RESET_REQUEST_PRESENT = 0, parameter RESET_REQ_WAIT_TIME = 3, parameter MIN_RST_ASSERTION_TIME = 11, parameter RESET_REQ_EARLY_DSRT_TIME = 4, parameter ADAPT_RESET_REQUEST = 0 ) ( // -------------------------------------- // We support up to 16 reset inputs, for now // -------------------------------------- input reset_in0, input reset_in1, input reset_in2, input reset_in3, input reset_in4, input reset_in5, input reset_in6, input reset_in7, input reset_in8, input reset_in9, input reset_in10, input reset_in11, input reset_in12, input reset_in13, input reset_in14, input reset_in15, input reset_req_in0, input reset_req_in1, input reset_req_in2, input reset_req_in3, input reset_req_in4, input reset_req_in5, input reset_req_in6, input reset_req_in7, input reset_req_in8, input reset_req_in9, input reset_req_in10, input reset_req_in11, input reset_req_in12, input reset_req_in13, input reset_req_in14, input reset_req_in15, input clk, output reg reset_out, output reg reset_req ); // Always use async reset synchronizer if reset_req is used localparam ASYNC_RESET = (OUTPUT_RESET_SYNC_EDGES == "deassert"); // -------------------------------------- // Local parameter to control the reset_req and reset_out timing when RESET_REQUEST_PRESENT==1 // -------------------------------------- localparam MIN_METASTABLE = 3; localparam RSTREQ_ASRT_SYNC_TAP = MIN_METASTABLE + RESET_REQ_WAIT_TIME; localparam LARGER = RESET_REQ_WAIT_TIME > RESET_REQ_EARLY_DSRT_TIME ? RESET_REQ_WAIT_TIME : RESET_REQ_EARLY_DSRT_TIME; localparam ASSERTION_CHAIN_LENGTH = (MIN_METASTABLE > LARGER) ? MIN_RST_ASSERTION_TIME + 1 : ( (MIN_RST_ASSERTION_TIME > LARGER)? MIN_RST_ASSERTION_TIME + (LARGER - MIN_METASTABLE + 1) + 1 : MIN_RST_ASSERTION_TIME + RESET_REQ_EARLY_DSRT_TIME + RESET_REQ_WAIT_TIME - MIN_METASTABLE + 2 ); localparam RESET_REQ_DRST_TAP = RESET_REQ_EARLY_DSRT_TIME + 1; // -------------------------------------- wire merged_reset; wire merged_reset_req_in; wire reset_out_pre; wire reset_req_pre; // Registers and Interconnect (*preserve*) reg [RSTREQ_ASRT_SYNC_TAP: 0] altera_reset_synchronizer_int_chain; reg [ASSERTION_CHAIN_LENGTH-1: 0] r_sync_rst_chain; reg r_sync_rst; reg r_early_rst; // -------------------------------------- // "Or" all the input resets together // -------------------------------------- assign merged_reset = ( reset_in0 | reset_in1 | reset_in2 | reset_in3 | reset_in4 | reset_in5 | reset_in6 | reset_in7 | reset_in8 | reset_in9 | reset_in10 | reset_in11 | reset_in12 | reset_in13 | reset_in14 | reset_in15 ); assign merged_reset_req_in = ( ( (USE_RESET_REQUEST_IN0 == 1) ? reset_req_in0 : 1'b0) | ( (USE_RESET_REQUEST_IN1 == 1) ? reset_req_in1 : 1'b0) | ( (USE_RESET_REQUEST_IN2 == 1) ? reset_req_in2 : 1'b0) | ( (USE_RESET_REQUEST_IN3 == 1) ? reset_req_in3 : 1'b0) | ( (USE_RESET_REQUEST_IN4 == 1) ? reset_req_in4 : 1'b0) | ( (USE_RESET_REQUEST_IN5 == 1) ? reset_req_in5 : 1'b0) | ( (USE_RESET_REQUEST_IN6 == 1) ? reset_req_in6 : 1'b0) | ( (USE_RESET_REQUEST_IN7 == 1) ? reset_req_in7 : 1'b0) | ( (USE_RESET_REQUEST_IN8 == 1) ? reset_req_in8 : 1'b0) | ( (USE_RESET_REQUEST_IN9 == 1) ? reset_req_in9 : 1'b0) | ( (USE_RESET_REQUEST_IN10 == 1) ? reset_req_in10 : 1'b0) | ( (USE_RESET_REQUEST_IN11 == 1) ? reset_req_in11 : 1'b0) | ( (USE_RESET_REQUEST_IN12 == 1) ? reset_req_in12 : 1'b0) | ( (USE_RESET_REQUEST_IN13 == 1) ? reset_req_in13 : 1'b0) | ( (USE_RESET_REQUEST_IN14 == 1) ? reset_req_in14 : 1'b0) | ( (USE_RESET_REQUEST_IN15 == 1) ? reset_req_in15 : 1'b0) ); // -------------------------------------- // And if required, synchronize it to the required clock domain, // with the correct synchronization type // -------------------------------------- generate if (OUTPUT_RESET_SYNC_EDGES == "none" && (RESET_REQUEST_PRESENT==0)) begin assign reset_out_pre = merged_reset; assign reset_req_pre = merged_reset_req_in; end else begin altera_reset_synchronizer #( .DEPTH (SYNC_DEPTH), .ASYNC_RESET(RESET_REQUEST_PRESENT? 1'b1 : ASYNC_RESET) ) alt_rst_sync_uq1 ( .clk (clk), .reset_in (merged_reset), .reset_out (reset_out_pre) ); altera_reset_synchronizer #( .DEPTH (SYNC_DEPTH), .ASYNC_RESET(0) ) alt_rst_req_sync_uq1 ( .clk (clk), .reset_in (merged_reset_req_in), .reset_out (reset_req_pre) ); end endgenerate generate if ( ( (RESET_REQUEST_PRESENT == 0) && (ADAPT_RESET_REQUEST==0) )| ( (ADAPT_RESET_REQUEST == 1) && (OUTPUT_RESET_SYNC_EDGES != "deassert") ) ) begin always @* begin reset_out = reset_out_pre; reset_req = reset_req_pre; end end else if ( (RESET_REQUEST_PRESENT == 0) && (ADAPT_RESET_REQUEST==1) ) begin wire reset_out_pre2; altera_reset_synchronizer #( .DEPTH (SYNC_DEPTH+1), .ASYNC_RESET(0) ) alt_rst_sync_uq2 ( .clk (clk), .reset_in (reset_out_pre), .reset_out (reset_out_pre2) ); always @* begin reset_out = reset_out_pre2; reset_req = reset_req_pre; end end else begin // 3-FF Metastability Synchronizer initial begin altera_reset_synchronizer_int_chain <= {RSTREQ_ASRT_SYNC_TAP{1'b1}}; end always @(posedge clk) begin altera_reset_synchronizer_int_chain[RSTREQ_ASRT_SYNC_TAP:0] <= {altera_reset_synchronizer_int_chain[RSTREQ_ASRT_SYNC_TAP-1:0], reset_out_pre}; end // Synchronous reset pipe initial begin r_sync_rst_chain <= {ASSERTION_CHAIN_LENGTH{1'b1}}; end always @(posedge clk) begin if (altera_reset_synchronizer_int_chain[MIN_METASTABLE-1] == 1'b1) begin r_sync_rst_chain <= {ASSERTION_CHAIN_LENGTH{1'b1}}; end else begin r_sync_rst_chain <= {1'b0, r_sync_rst_chain[ASSERTION_CHAIN_LENGTH-1:1]}; end end // Standard synchronous reset output. From 0-1, the transition lags the early output. For 1->0, the transition // matches the early input. always @(posedge clk) begin case ({altera_reset_synchronizer_int_chain[RSTREQ_ASRT_SYNC_TAP], r_sync_rst_chain[1], r_sync_rst}) 3'b000: r_sync_rst <= 1'b0; // Not reset 3'b001: r_sync_rst <= 1'b0; 3'b010: r_sync_rst <= 1'b0; 3'b011: r_sync_rst <= 1'b1; 3'b100: r_sync_rst <= 1'b1; 3'b101: r_sync_rst <= 1'b1; 3'b110: r_sync_rst <= 1'b1; 3'b111: r_sync_rst <= 1'b1; // In Reset default: r_sync_rst <= 1'b1; endcase case ({r_sync_rst_chain[1], r_sync_rst_chain[RESET_REQ_DRST_TAP] | reset_req_pre}) 2'b00: r_early_rst <= 1'b0; // Not reset 2'b01: r_early_rst <= 1'b1; // Coming out of reset 2'b10: r_early_rst <= 1'b0; // Spurious reset - should not be possible via synchronous design. 2'b11: r_early_rst <= 1'b1; // Held in reset default: r_early_rst <= 1'b1; endcase end always @* begin reset_out = r_sync_rst; reset_req = r_early_rst; end end endgenerate endmodule
// (C) 2001-2015 Altera Corporation. All rights reserved. // Your use of Altera Corporation's design tools, logic functions and other // software and tools, and its AMPP partner logic functions, and any output // files any of the foregoing (including device programming or simulation // files), and any associated documentation or information are expressly subject // to the terms and conditions of the Altera Program License Subscription // Agreement, Altera MegaCore Function License Agreement, or other applicable // license agreement, including, without limitation, that your use is for the // sole purpose of programming logic devices manufactured by Altera and sold by // Altera or its authorized distributors. Please refer to the applicable // agreement for further details. // (C) 2001-2013 Altera Corporation. All rights reserved. // Your use of Altera Corporation's design tools, logic functions and other // software and tools, and its AMPP partner logic functions, and any output // files any of the foregoing (including device programming or simulation // files), and any associated documentation or information are expressly subject // to the terms and conditions of the Altera Program License Subscription // Agreement, Altera MegaCore Function License Agreement, or other applicable // license agreement, including, without limitation, that your use is for the // sole purpose of programming logic devices manufactured by Altera and sold by // Altera or its authorized distributors. Please refer to the applicable // agreement for further details. // $Id: //acds/rel/15.1/ip/merlin/altera_reset_controller/altera_reset_controller.v#1 $ // $Revision: #1 $ // $Date: 2015/08/09 $ // $Author: swbranch $ // -------------------------------------- // Reset controller // // Combines all the input resets and synchronizes // the result to the clk. // ACDS13.1 - Added reset request as part of reset sequencing // -------------------------------------- `timescale 1 ns / 1 ns module altera_reset_controller #( parameter NUM_RESET_INPUTS = 6, parameter USE_RESET_REQUEST_IN0 = 0, parameter USE_RESET_REQUEST_IN1 = 0, parameter USE_RESET_REQUEST_IN2 = 0, parameter USE_RESET_REQUEST_IN3 = 0, parameter USE_RESET_REQUEST_IN4 = 0, parameter USE_RESET_REQUEST_IN5 = 0, parameter USE_RESET_REQUEST_IN6 = 0, parameter USE_RESET_REQUEST_IN7 = 0, parameter USE_RESET_REQUEST_IN8 = 0, parameter USE_RESET_REQUEST_IN9 = 0, parameter USE_RESET_REQUEST_IN10 = 0, parameter USE_RESET_REQUEST_IN11 = 0, parameter USE_RESET_REQUEST_IN12 = 0, parameter USE_RESET_REQUEST_IN13 = 0, parameter USE_RESET_REQUEST_IN14 = 0, parameter USE_RESET_REQUEST_IN15 = 0, parameter OUTPUT_RESET_SYNC_EDGES = "deassert", parameter SYNC_DEPTH = 2, parameter RESET_REQUEST_PRESENT = 0, parameter RESET_REQ_WAIT_TIME = 3, parameter MIN_RST_ASSERTION_TIME = 11, parameter RESET_REQ_EARLY_DSRT_TIME = 4, parameter ADAPT_RESET_REQUEST = 0 ) ( // -------------------------------------- // We support up to 16 reset inputs, for now // -------------------------------------- input reset_in0, input reset_in1, input reset_in2, input reset_in3, input reset_in4, input reset_in5, input reset_in6, input reset_in7, input reset_in8, input reset_in9, input reset_in10, input reset_in11, input reset_in12, input reset_in13, input reset_in14, input reset_in15, input reset_req_in0, input reset_req_in1, input reset_req_in2, input reset_req_in3, input reset_req_in4, input reset_req_in5, input reset_req_in6, input reset_req_in7, input reset_req_in8, input reset_req_in9, input reset_req_in10, input reset_req_in11, input reset_req_in12, input reset_req_in13, input reset_req_in14, input reset_req_in15, input clk, output reg reset_out, output reg reset_req ); // Always use async reset synchronizer if reset_req is used localparam ASYNC_RESET = (OUTPUT_RESET_SYNC_EDGES == "deassert"); // -------------------------------------- // Local parameter to control the reset_req and reset_out timing when RESET_REQUEST_PRESENT==1 // -------------------------------------- localparam MIN_METASTABLE = 3; localparam RSTREQ_ASRT_SYNC_TAP = MIN_METASTABLE + RESET_REQ_WAIT_TIME; localparam LARGER = RESET_REQ_WAIT_TIME > RESET_REQ_EARLY_DSRT_TIME ? RESET_REQ_WAIT_TIME : RESET_REQ_EARLY_DSRT_TIME; localparam ASSERTION_CHAIN_LENGTH = (MIN_METASTABLE > LARGER) ? MIN_RST_ASSERTION_TIME + 1 : ( (MIN_RST_ASSERTION_TIME > LARGER)? MIN_RST_ASSERTION_TIME + (LARGER - MIN_METASTABLE + 1) + 1 : MIN_RST_ASSERTION_TIME + RESET_REQ_EARLY_DSRT_TIME + RESET_REQ_WAIT_TIME - MIN_METASTABLE + 2 ); localparam RESET_REQ_DRST_TAP = RESET_REQ_EARLY_DSRT_TIME + 1; // -------------------------------------- wire merged_reset; wire merged_reset_req_in; wire reset_out_pre; wire reset_req_pre; // Registers and Interconnect (*preserve*) reg [RSTREQ_ASRT_SYNC_TAP: 0] altera_reset_synchronizer_int_chain; reg [ASSERTION_CHAIN_LENGTH-1: 0] r_sync_rst_chain; reg r_sync_rst; reg r_early_rst; // -------------------------------------- // "Or" all the input resets together // -------------------------------------- assign merged_reset = ( reset_in0 | reset_in1 | reset_in2 | reset_in3 | reset_in4 | reset_in5 | reset_in6 | reset_in7 | reset_in8 | reset_in9 | reset_in10 | reset_in11 | reset_in12 | reset_in13 | reset_in14 | reset_in15 ); assign merged_reset_req_in = ( ( (USE_RESET_REQUEST_IN0 == 1) ? reset_req_in0 : 1'b0) | ( (USE_RESET_REQUEST_IN1 == 1) ? reset_req_in1 : 1'b0) | ( (USE_RESET_REQUEST_IN2 == 1) ? reset_req_in2 : 1'b0) | ( (USE_RESET_REQUEST_IN3 == 1) ? reset_req_in3 : 1'b0) | ( (USE_RESET_REQUEST_IN4 == 1) ? reset_req_in4 : 1'b0) | ( (USE_RESET_REQUEST_IN5 == 1) ? reset_req_in5 : 1'b0) | ( (USE_RESET_REQUEST_IN6 == 1) ? reset_req_in6 : 1'b0) | ( (USE_RESET_REQUEST_IN7 == 1) ? reset_req_in7 : 1'b0) | ( (USE_RESET_REQUEST_IN8 == 1) ? reset_req_in8 : 1'b0) | ( (USE_RESET_REQUEST_IN9 == 1) ? reset_req_in9 : 1'b0) | ( (USE_RESET_REQUEST_IN10 == 1) ? reset_req_in10 : 1'b0) | ( (USE_RESET_REQUEST_IN11 == 1) ? reset_req_in11 : 1'b0) | ( (USE_RESET_REQUEST_IN12 == 1) ? reset_req_in12 : 1'b0) | ( (USE_RESET_REQUEST_IN13 == 1) ? reset_req_in13 : 1'b0) | ( (USE_RESET_REQUEST_IN14 == 1) ? reset_req_in14 : 1'b0) | ( (USE_RESET_REQUEST_IN15 == 1) ? reset_req_in15 : 1'b0) ); // -------------------------------------- // And if required, synchronize it to the required clock domain, // with the correct synchronization type // -------------------------------------- generate if (OUTPUT_RESET_SYNC_EDGES == "none" && (RESET_REQUEST_PRESENT==0)) begin assign reset_out_pre = merged_reset; assign reset_req_pre = merged_reset_req_in; end else begin altera_reset_synchronizer #( .DEPTH (SYNC_DEPTH), .ASYNC_RESET(RESET_REQUEST_PRESENT? 1'b1 : ASYNC_RESET) ) alt_rst_sync_uq1 ( .clk (clk), .reset_in (merged_reset), .reset_out (reset_out_pre) ); altera_reset_synchronizer #( .DEPTH (SYNC_DEPTH), .ASYNC_RESET(0) ) alt_rst_req_sync_uq1 ( .clk (clk), .reset_in (merged_reset_req_in), .reset_out (reset_req_pre) ); end endgenerate generate if ( ( (RESET_REQUEST_PRESENT == 0) && (ADAPT_RESET_REQUEST==0) )| ( (ADAPT_RESET_REQUEST == 1) && (OUTPUT_RESET_SYNC_EDGES != "deassert") ) ) begin always @* begin reset_out = reset_out_pre; reset_req = reset_req_pre; end end else if ( (RESET_REQUEST_PRESENT == 0) && (ADAPT_RESET_REQUEST==1) ) begin wire reset_out_pre2; altera_reset_synchronizer #( .DEPTH (SYNC_DEPTH+1), .ASYNC_RESET(0) ) alt_rst_sync_uq2 ( .clk (clk), .reset_in (reset_out_pre), .reset_out (reset_out_pre2) ); always @* begin reset_out = reset_out_pre2; reset_req = reset_req_pre; end end else begin // 3-FF Metastability Synchronizer initial begin altera_reset_synchronizer_int_chain <= {RSTREQ_ASRT_SYNC_TAP{1'b1}}; end always @(posedge clk) begin altera_reset_synchronizer_int_chain[RSTREQ_ASRT_SYNC_TAP:0] <= {altera_reset_synchronizer_int_chain[RSTREQ_ASRT_SYNC_TAP-1:0], reset_out_pre}; end // Synchronous reset pipe initial begin r_sync_rst_chain <= {ASSERTION_CHAIN_LENGTH{1'b1}}; end always @(posedge clk) begin if (altera_reset_synchronizer_int_chain[MIN_METASTABLE-1] == 1'b1) begin r_sync_rst_chain <= {ASSERTION_CHAIN_LENGTH{1'b1}}; end else begin r_sync_rst_chain <= {1'b0, r_sync_rst_chain[ASSERTION_CHAIN_LENGTH-1:1]}; end end // Standard synchronous reset output. From 0-1, the transition lags the early output. For 1->0, the transition // matches the early input. always @(posedge clk) begin case ({altera_reset_synchronizer_int_chain[RSTREQ_ASRT_SYNC_TAP], r_sync_rst_chain[1], r_sync_rst}) 3'b000: r_sync_rst <= 1'b0; // Not reset 3'b001: r_sync_rst <= 1'b0; 3'b010: r_sync_rst <= 1'b0; 3'b011: r_sync_rst <= 1'b1; 3'b100: r_sync_rst <= 1'b1; 3'b101: r_sync_rst <= 1'b1; 3'b110: r_sync_rst <= 1'b1; 3'b111: r_sync_rst <= 1'b1; // In Reset default: r_sync_rst <= 1'b1; endcase case ({r_sync_rst_chain[1], r_sync_rst_chain[RESET_REQ_DRST_TAP] | reset_req_pre}) 2'b00: r_early_rst <= 1'b0; // Not reset 2'b01: r_early_rst <= 1'b1; // Coming out of reset 2'b10: r_early_rst <= 1'b0; // Spurious reset - should not be possible via synchronous design. 2'b11: r_early_rst <= 1'b1; // Held in reset default: r_early_rst <= 1'b1; endcase end always @* begin reset_out = r_sync_rst; reset_req = r_early_rst; end end endgenerate endmodule
`timescale 1ns / 1ps // Copyright (C) 2008 Schuyler Eldridge, Boston University // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. module control(clk,en,dsp_sel,an); input clk, en; output [1:0]dsp_sel; output [3:0]an; wire a,b,c,d,e,f,g,h,i,j,k,l; assign an[3] = a; assign an[2] = b; assign an[1] = c; assign an[0] = d; assign dsp_sel[1] = e; assign dsp_sel[0] = i; FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF3( .Q(a), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(d), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF2( .Q(b), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(a), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF1( .Q(c), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(b), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF0( .Q(d), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(c), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF7( .Q(e), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(h), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF6( .Q(f), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(e), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF5( .Q(g), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(f), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF4( .Q(h), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(g), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF11( .Q(i), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(l), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF10( .Q(j), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(i), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF9( .Q(k), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(j), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF8( .Q(l), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(k), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); endmodule
`timescale 1ns / 1ps // Copyright (C) 2008 Schuyler Eldridge, Boston University // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. module control(clk,en,dsp_sel,an); input clk, en; output [1:0]dsp_sel; output [3:0]an; wire a,b,c,d,e,f,g,h,i,j,k,l; assign an[3] = a; assign an[2] = b; assign an[1] = c; assign an[0] = d; assign dsp_sel[1] = e; assign dsp_sel[0] = i; FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF3( .Q(a), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(d), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF2( .Q(b), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(a), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF1( .Q(c), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(b), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF0( .Q(d), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(c), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF7( .Q(e), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(h), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF6( .Q(f), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(e), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF5( .Q(g), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(f), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF4( .Q(h), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(g), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF11( .Q(i), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(l), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF10( .Q(j), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(i), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF9( .Q(k), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(j), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF8( .Q(l), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(k), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); endmodule
`timescale 1ns / 1ps // Copyright (C) 2008 Schuyler Eldridge, Boston University // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. module control(clk,en,dsp_sel,an); input clk, en; output [1:0]dsp_sel; output [3:0]an; wire a,b,c,d,e,f,g,h,i,j,k,l; assign an[3] = a; assign an[2] = b; assign an[1] = c; assign an[0] = d; assign dsp_sel[1] = e; assign dsp_sel[0] = i; FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF3( .Q(a), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(d), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF2( .Q(b), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(a), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF1( .Q(c), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(b), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF0( .Q(d), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(c), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF7( .Q(e), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(h), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF6( .Q(f), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(e), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF5( .Q(g), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(f), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF4( .Q(h), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(g), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF11( .Q(i), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(l), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF10( .Q(j), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(i), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF9( .Q(k), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(j), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF8( .Q(l), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(k), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); endmodule
`timescale 1ns / 1ps // Copyright (C) 2008 Schuyler Eldridge, Boston University // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. module control(clk,en,dsp_sel,an); input clk, en; output [1:0]dsp_sel; output [3:0]an; wire a,b,c,d,e,f,g,h,i,j,k,l; assign an[3] = a; assign an[2] = b; assign an[1] = c; assign an[0] = d; assign dsp_sel[1] = e; assign dsp_sel[0] = i; FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF3( .Q(a), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(d), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF2( .Q(b), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(a), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF1( .Q(c), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(b), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF0( .Q(d), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(c), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF7( .Q(e), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(h), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF6( .Q(f), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(e), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF5( .Q(g), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(f), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF4( .Q(h), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(g), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF11( .Q(i), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(l), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF10( .Q(j), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(i), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF9( .Q(k), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(j), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF8( .Q(l), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(k), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); endmodule
`timescale 1ns / 1ps // Copyright (C) 2008 Schuyler Eldridge, Boston University // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. module control(clk,en,dsp_sel,an); input clk, en; output [1:0]dsp_sel; output [3:0]an; wire a,b,c,d,e,f,g,h,i,j,k,l; assign an[3] = a; assign an[2] = b; assign an[1] = c; assign an[0] = d; assign dsp_sel[1] = e; assign dsp_sel[0] = i; FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF3( .Q(a), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(d), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF2( .Q(b), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(a), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF1( .Q(c), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(b), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF0( .Q(d), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(c), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF7( .Q(e), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(h), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF6( .Q(f), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(e), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF5( .Q(g), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(f), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF4( .Q(h), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(g), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF11( .Q(i), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(l), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF10( .Q(j), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(i), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF9( .Q(k), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(j), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF8( .Q(l), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(k), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); endmodule
`timescale 1ns / 1ps // Copyright (C) 2008 Schuyler Eldridge, Boston University // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. module control(clk,en,dsp_sel,an); input clk, en; output [1:0]dsp_sel; output [3:0]an; wire a,b,c,d,e,f,g,h,i,j,k,l; assign an[3] = a; assign an[2] = b; assign an[1] = c; assign an[0] = d; assign dsp_sel[1] = e; assign dsp_sel[0] = i; FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF3( .Q(a), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(d), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF2( .Q(b), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(a), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF1( .Q(c), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(b), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF0( .Q(d), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(c), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF7( .Q(e), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(h), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF6( .Q(f), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(e), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF5( .Q(g), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(f), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF4( .Q(h), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(g), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF11( .Q(i), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(l), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF10( .Q(j), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(i), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF9( .Q(k), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(j), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF8( .Q(l), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(k), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); endmodule
`timescale 1ns / 1ps // Copyright (C) 2008 Schuyler Eldridge, Boston University // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. module control(clk,en,dsp_sel,an); input clk, en; output [1:0]dsp_sel; output [3:0]an; wire a,b,c,d,e,f,g,h,i,j,k,l; assign an[3] = a; assign an[2] = b; assign an[1] = c; assign an[0] = d; assign dsp_sel[1] = e; assign dsp_sel[0] = i; FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF3( .Q(a), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(d), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF2( .Q(b), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(a), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF1( .Q(c), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(b), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF0( .Q(d), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(c), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF7( .Q(e), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(h), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF6( .Q(f), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(e), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF5( .Q(g), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(f), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF4( .Q(h), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(g), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF11( .Q(i), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(l), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF10( .Q(j), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(i), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF9( .Q(k), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(j), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF8( .Q(l), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(k), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); endmodule
`timescale 1ns / 1ps // Copyright (C) 2008 Schuyler Eldridge, Boston University // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. module control(clk,en,dsp_sel,an); input clk, en; output [1:0]dsp_sel; output [3:0]an; wire a,b,c,d,e,f,g,h,i,j,k,l; assign an[3] = a; assign an[2] = b; assign an[1] = c; assign an[0] = d; assign dsp_sel[1] = e; assign dsp_sel[0] = i; FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF3( .Q(a), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(d), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF2( .Q(b), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(a), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF1( .Q(c), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(b), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF0( .Q(d), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(c), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF7( .Q(e), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(h), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF6( .Q(f), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(e), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF5( .Q(g), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(f), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF4( .Q(h), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(g), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF11( .Q(i), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(l), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF10( .Q(j), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(i), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF9( .Q(k), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(j), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF8( .Q(l), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(k), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); endmodule
`timescale 1ns / 1ps // Copyright (C) 2008 Schuyler Eldridge, Boston University // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. module control(clk,en,dsp_sel,an); input clk, en; output [1:0]dsp_sel; output [3:0]an; wire a,b,c,d,e,f,g,h,i,j,k,l; assign an[3] = a; assign an[2] = b; assign an[1] = c; assign an[0] = d; assign dsp_sel[1] = e; assign dsp_sel[0] = i; FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF3( .Q(a), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(d), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF2( .Q(b), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(a), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF1( .Q(c), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(b), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF0( .Q(d), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(c), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF7( .Q(e), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(h), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF6( .Q(f), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(e), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF5( .Q(g), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(f), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF4( .Q(h), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(g), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF11( .Q(i), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(l), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF10( .Q(j), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(i), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b1) // Initial value of register (1'b0 or 1'b1) ) DFF9( .Q(k), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(j), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); FDRSE #( .INIT(1'b0) // Initial value of register (1'b0 or 1'b1) ) DFF8( .Q(l), // Data output .C(clk), // Clock input .CE(en), // Clock enable input .D(k), // Data input .R(1'b0), // Synchronous reset input .S(1'b0) // Synchronous set input ); endmodule
// megafunction wizard: %FIFO%VBB% // GENERATION: STANDARD // VERSION: WM1.0 // MODULE: scfifo // ============================================================ // File Name: fifo_1kx16.v // Megafunction Name(s): // scfifo // ============================================================ // ************************************************************ // THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE! // // 5.1 Build 213 01/19/2006 SP 1 SJ Web Edition // ************************************************************ //Copyright (C) 1991-2006 Altera Corporation //Your use of Altera Corporation's design tools, logic functions //and other software and tools, and its AMPP partner logic //functions, and any output files any of the foregoing //(including device programming or simulation files), and any //associated documentation or information are expressly subject //to the terms and conditions of the Altera Program License //Subscription Agreement, Altera MegaCore Function License //Agreement, or other applicable license agreement, including, //without limitation, that your use is for the sole purpose of //programming logic devices manufactured by Altera and sold by //Altera or its authorized distributors. Please refer to the //applicable agreement for further details. module fifo_1kx16 ( aclr, clock, data, rdreq, wrreq, almost_empty, empty, full, q, usedw); input aclr; input clock; input [15:0] data; input rdreq; input wrreq; output almost_empty; output empty; output full; output [15:0] q; output [9:0] usedw; endmodule // ============================================================ // CNX file retrieval info // ============================================================ // Retrieval info: PRIVATE: AlmostEmpty NUMERIC "1" // Retrieval info: PRIVATE: AlmostEmptyThr NUMERIC "504" // Retrieval info: PRIVATE: AlmostFull NUMERIC "0" // Retrieval info: PRIVATE: AlmostFullThr NUMERIC "-1" // Retrieval info: PRIVATE: CLOCKS_ARE_SYNCHRONIZED NUMERIC "0" // Retrieval info: PRIVATE: Clock NUMERIC "0" // Retrieval info: PRIVATE: Depth NUMERIC "1024" // Retrieval info: PRIVATE: Empty NUMERIC "1" // Retrieval info: PRIVATE: Full NUMERIC "1" // Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone" // Retrieval info: PRIVATE: LE_BasedFIFO NUMERIC "0" // Retrieval info: PRIVATE: LegacyRREQ NUMERIC "1" // Retrieval info: PRIVATE: MAX_DEPTH_BY_9 NUMERIC "0" // Retrieval info: PRIVATE: OVERFLOW_CHECKING NUMERIC "0" // Retrieval info: PRIVATE: Optimize NUMERIC "2" // Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "2" // Retrieval info: PRIVATE: UNDERFLOW_CHECKING NUMERIC "0" // Retrieval info: PRIVATE: UsedW NUMERIC "1" // Retrieval info: PRIVATE: Width NUMERIC "16" // Retrieval info: PRIVATE: dc_aclr NUMERIC "0" // Retrieval info: PRIVATE: rsEmpty NUMERIC "1" // Retrieval info: PRIVATE: rsFull NUMERIC "0" // Retrieval info: PRIVATE: rsUsedW NUMERIC "0" // Retrieval info: PRIVATE: sc_aclr NUMERIC "1" // Retrieval info: PRIVATE: sc_sclr NUMERIC "0" // Retrieval info: PRIVATE: wsEmpty NUMERIC "0" // Retrieval info: PRIVATE: wsFull NUMERIC "1" // Retrieval info: PRIVATE: wsUsedW NUMERIC "0" // Retrieval info: CONSTANT: ADD_RAM_OUTPUT_REGISTER STRING "OFF" // Retrieval info: CONSTANT: ALMOST_EMPTY_VALUE NUMERIC "504" // Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone" // Retrieval info: CONSTANT: LPM_HINT STRING "RAM_BLOCK_TYPE=M4K" // Retrieval info: CONSTANT: LPM_NUMWORDS NUMERIC "1024" // Retrieval info: CONSTANT: LPM_SHOWAHEAD STRING "OFF" // Retrieval info: CONSTANT: LPM_TYPE STRING "scfifo" // Retrieval info: CONSTANT: LPM_WIDTH NUMERIC "16" // Retrieval info: CONSTANT: LPM_WIDTHU NUMERIC "10" // Retrieval info: CONSTANT: OVERFLOW_CHECKING STRING "ON" // Retrieval info: CONSTANT: UNDERFLOW_CHECKING STRING "ON" // Retrieval info: CONSTANT: USE_EAB STRING "ON" // Retrieval info: USED_PORT: aclr 0 0 0 0 INPUT NODEFVAL aclr // Retrieval info: USED_PORT: almost_empty 0 0 0 0 OUTPUT NODEFVAL almost_empty // Retrieval info: USED_PORT: clock 0 0 0 0 INPUT NODEFVAL clock // Retrieval info: USED_PORT: data 0 0 16 0 INPUT NODEFVAL data[15..0] // Retrieval info: USED_PORT: empty 0 0 0 0 OUTPUT NODEFVAL empty // Retrieval info: USED_PORT: full 0 0 0 0 OUTPUT NODEFVAL full // Retrieval info: USED_PORT: q 0 0 16 0 OUTPUT NODEFVAL q[15..0] // Retrieval info: USED_PORT: rdreq 0 0 0 0 INPUT NODEFVAL rdreq // Retrieval info: USED_PORT: usedw 0 0 10 0 OUTPUT NODEFVAL usedw[9..0] // Retrieval info: USED_PORT: wrreq 0 0 0 0 INPUT NODEFVAL wrreq // Retrieval info: CONNECT: @data 0 0 16 0 data 0 0 16 0 // Retrieval info: CONNECT: q 0 0 16 0 @q 0 0 16 0 // Retrieval info: CONNECT: @wrreq 0 0 0 0 wrreq 0 0 0 0 // Retrieval info: CONNECT: @rdreq 0 0 0 0 rdreq 0 0 0 0 // Retrieval info: CONNECT: @clock 0 0 0 0 clock 0 0 0 0 // Retrieval info: CONNECT: full 0 0 0 0 @full 0 0 0 0 // Retrieval info: CONNECT: empty 0 0 0 0 @empty 0 0 0 0 // Retrieval info: CONNECT: usedw 0 0 10 0 @usedw 0 0 10 0 // Retrieval info: CONNECT: almost_empty 0 0 0 0 @almost_empty 0 0 0 0 // Retrieval info: CONNECT: @aclr 0 0 0 0 aclr 0 0 0 0 // Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1kx16.v TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1kx16.inc TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1kx16.cmp TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1kx16.bsf TRUE FALSE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1kx16_inst.v TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1kx16_bb.v TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1kx16_waveforms.html FALSE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1kx16_wave*.jpg FALSE
// megafunction wizard: %FIFO%VBB% // GENERATION: STANDARD // VERSION: WM1.0 // MODULE: scfifo // ============================================================ // File Name: fifo_1kx16.v // Megafunction Name(s): // scfifo // ============================================================ // ************************************************************ // THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE! // // 5.1 Build 213 01/19/2006 SP 1 SJ Web Edition // ************************************************************ //Copyright (C) 1991-2006 Altera Corporation //Your use of Altera Corporation's design tools, logic functions //and other software and tools, and its AMPP partner logic //functions, and any output files any of the foregoing //(including device programming or simulation files), and any //associated documentation or information are expressly subject //to the terms and conditions of the Altera Program License //Subscription Agreement, Altera MegaCore Function License //Agreement, or other applicable license agreement, including, //without limitation, that your use is for the sole purpose of //programming logic devices manufactured by Altera and sold by //Altera or its authorized distributors. Please refer to the //applicable agreement for further details. module fifo_1kx16 ( aclr, clock, data, rdreq, wrreq, almost_empty, empty, full, q, usedw); input aclr; input clock; input [15:0] data; input rdreq; input wrreq; output almost_empty; output empty; output full; output [15:0] q; output [9:0] usedw; endmodule // ============================================================ // CNX file retrieval info // ============================================================ // Retrieval info: PRIVATE: AlmostEmpty NUMERIC "1" // Retrieval info: PRIVATE: AlmostEmptyThr NUMERIC "504" // Retrieval info: PRIVATE: AlmostFull NUMERIC "0" // Retrieval info: PRIVATE: AlmostFullThr NUMERIC "-1" // Retrieval info: PRIVATE: CLOCKS_ARE_SYNCHRONIZED NUMERIC "0" // Retrieval info: PRIVATE: Clock NUMERIC "0" // Retrieval info: PRIVATE: Depth NUMERIC "1024" // Retrieval info: PRIVATE: Empty NUMERIC "1" // Retrieval info: PRIVATE: Full NUMERIC "1" // Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone" // Retrieval info: PRIVATE: LE_BasedFIFO NUMERIC "0" // Retrieval info: PRIVATE: LegacyRREQ NUMERIC "1" // Retrieval info: PRIVATE: MAX_DEPTH_BY_9 NUMERIC "0" // Retrieval info: PRIVATE: OVERFLOW_CHECKING NUMERIC "0" // Retrieval info: PRIVATE: Optimize NUMERIC "2" // Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "2" // Retrieval info: PRIVATE: UNDERFLOW_CHECKING NUMERIC "0" // Retrieval info: PRIVATE: UsedW NUMERIC "1" // Retrieval info: PRIVATE: Width NUMERIC "16" // Retrieval info: PRIVATE: dc_aclr NUMERIC "0" // Retrieval info: PRIVATE: rsEmpty NUMERIC "1" // Retrieval info: PRIVATE: rsFull NUMERIC "0" // Retrieval info: PRIVATE: rsUsedW NUMERIC "0" // Retrieval info: PRIVATE: sc_aclr NUMERIC "1" // Retrieval info: PRIVATE: sc_sclr NUMERIC "0" // Retrieval info: PRIVATE: wsEmpty NUMERIC "0" // Retrieval info: PRIVATE: wsFull NUMERIC "1" // Retrieval info: PRIVATE: wsUsedW NUMERIC "0" // Retrieval info: CONSTANT: ADD_RAM_OUTPUT_REGISTER STRING "OFF" // Retrieval info: CONSTANT: ALMOST_EMPTY_VALUE NUMERIC "504" // Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone" // Retrieval info: CONSTANT: LPM_HINT STRING "RAM_BLOCK_TYPE=M4K" // Retrieval info: CONSTANT: LPM_NUMWORDS NUMERIC "1024" // Retrieval info: CONSTANT: LPM_SHOWAHEAD STRING "OFF" // Retrieval info: CONSTANT: LPM_TYPE STRING "scfifo" // Retrieval info: CONSTANT: LPM_WIDTH NUMERIC "16" // Retrieval info: CONSTANT: LPM_WIDTHU NUMERIC "10" // Retrieval info: CONSTANT: OVERFLOW_CHECKING STRING "ON" // Retrieval info: CONSTANT: UNDERFLOW_CHECKING STRING "ON" // Retrieval info: CONSTANT: USE_EAB STRING "ON" // Retrieval info: USED_PORT: aclr 0 0 0 0 INPUT NODEFVAL aclr // Retrieval info: USED_PORT: almost_empty 0 0 0 0 OUTPUT NODEFVAL almost_empty // Retrieval info: USED_PORT: clock 0 0 0 0 INPUT NODEFVAL clock // Retrieval info: USED_PORT: data 0 0 16 0 INPUT NODEFVAL data[15..0] // Retrieval info: USED_PORT: empty 0 0 0 0 OUTPUT NODEFVAL empty // Retrieval info: USED_PORT: full 0 0 0 0 OUTPUT NODEFVAL full // Retrieval info: USED_PORT: q 0 0 16 0 OUTPUT NODEFVAL q[15..0] // Retrieval info: USED_PORT: rdreq 0 0 0 0 INPUT NODEFVAL rdreq // Retrieval info: USED_PORT: usedw 0 0 10 0 OUTPUT NODEFVAL usedw[9..0] // Retrieval info: USED_PORT: wrreq 0 0 0 0 INPUT NODEFVAL wrreq // Retrieval info: CONNECT: @data 0 0 16 0 data 0 0 16 0 // Retrieval info: CONNECT: q 0 0 16 0 @q 0 0 16 0 // Retrieval info: CONNECT: @wrreq 0 0 0 0 wrreq 0 0 0 0 // Retrieval info: CONNECT: @rdreq 0 0 0 0 rdreq 0 0 0 0 // Retrieval info: CONNECT: @clock 0 0 0 0 clock 0 0 0 0 // Retrieval info: CONNECT: full 0 0 0 0 @full 0 0 0 0 // Retrieval info: CONNECT: empty 0 0 0 0 @empty 0 0 0 0 // Retrieval info: CONNECT: usedw 0 0 10 0 @usedw 0 0 10 0 // Retrieval info: CONNECT: almost_empty 0 0 0 0 @almost_empty 0 0 0 0 // Retrieval info: CONNECT: @aclr 0 0 0 0 aclr 0 0 0 0 // Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1kx16.v TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1kx16.inc TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1kx16.cmp TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1kx16.bsf TRUE FALSE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1kx16_inst.v TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1kx16_bb.v TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1kx16_waveforms.html FALSE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1kx16_wave*.jpg FALSE
// megafunction wizard: %FIFO%VBB% // GENERATION: STANDARD // VERSION: WM1.0 // MODULE: scfifo // ============================================================ // File Name: fifo_1kx16.v // Megafunction Name(s): // scfifo // ============================================================ // ************************************************************ // THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE! // // 5.1 Build 213 01/19/2006 SP 1 SJ Web Edition // ************************************************************ //Copyright (C) 1991-2006 Altera Corporation //Your use of Altera Corporation's design tools, logic functions //and other software and tools, and its AMPP partner logic //functions, and any output files any of the foregoing //(including device programming or simulation files), and any //associated documentation or information are expressly subject //to the terms and conditions of the Altera Program License //Subscription Agreement, Altera MegaCore Function License //Agreement, or other applicable license agreement, including, //without limitation, that your use is for the sole purpose of //programming logic devices manufactured by Altera and sold by //Altera or its authorized distributors. Please refer to the //applicable agreement for further details. module fifo_1kx16 ( aclr, clock, data, rdreq, wrreq, almost_empty, empty, full, q, usedw); input aclr; input clock; input [15:0] data; input rdreq; input wrreq; output almost_empty; output empty; output full; output [15:0] q; output [9:0] usedw; endmodule // ============================================================ // CNX file retrieval info // ============================================================ // Retrieval info: PRIVATE: AlmostEmpty NUMERIC "1" // Retrieval info: PRIVATE: AlmostEmptyThr NUMERIC "504" // Retrieval info: PRIVATE: AlmostFull NUMERIC "0" // Retrieval info: PRIVATE: AlmostFullThr NUMERIC "-1" // Retrieval info: PRIVATE: CLOCKS_ARE_SYNCHRONIZED NUMERIC "0" // Retrieval info: PRIVATE: Clock NUMERIC "0" // Retrieval info: PRIVATE: Depth NUMERIC "1024" // Retrieval info: PRIVATE: Empty NUMERIC "1" // Retrieval info: PRIVATE: Full NUMERIC "1" // Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone" // Retrieval info: PRIVATE: LE_BasedFIFO NUMERIC "0" // Retrieval info: PRIVATE: LegacyRREQ NUMERIC "1" // Retrieval info: PRIVATE: MAX_DEPTH_BY_9 NUMERIC "0" // Retrieval info: PRIVATE: OVERFLOW_CHECKING NUMERIC "0" // Retrieval info: PRIVATE: Optimize NUMERIC "2" // Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "2" // Retrieval info: PRIVATE: UNDERFLOW_CHECKING NUMERIC "0" // Retrieval info: PRIVATE: UsedW NUMERIC "1" // Retrieval info: PRIVATE: Width NUMERIC "16" // Retrieval info: PRIVATE: dc_aclr NUMERIC "0" // Retrieval info: PRIVATE: rsEmpty NUMERIC "1" // Retrieval info: PRIVATE: rsFull NUMERIC "0" // Retrieval info: PRIVATE: rsUsedW NUMERIC "0" // Retrieval info: PRIVATE: sc_aclr NUMERIC "1" // Retrieval info: PRIVATE: sc_sclr NUMERIC "0" // Retrieval info: PRIVATE: wsEmpty NUMERIC "0" // Retrieval info: PRIVATE: wsFull NUMERIC "1" // Retrieval info: PRIVATE: wsUsedW NUMERIC "0" // Retrieval info: CONSTANT: ADD_RAM_OUTPUT_REGISTER STRING "OFF" // Retrieval info: CONSTANT: ALMOST_EMPTY_VALUE NUMERIC "504" // Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone" // Retrieval info: CONSTANT: LPM_HINT STRING "RAM_BLOCK_TYPE=M4K" // Retrieval info: CONSTANT: LPM_NUMWORDS NUMERIC "1024" // Retrieval info: CONSTANT: LPM_SHOWAHEAD STRING "OFF" // Retrieval info: CONSTANT: LPM_TYPE STRING "scfifo" // Retrieval info: CONSTANT: LPM_WIDTH NUMERIC "16" // Retrieval info: CONSTANT: LPM_WIDTHU NUMERIC "10" // Retrieval info: CONSTANT: OVERFLOW_CHECKING STRING "ON" // Retrieval info: CONSTANT: UNDERFLOW_CHECKING STRING "ON" // Retrieval info: CONSTANT: USE_EAB STRING "ON" // Retrieval info: USED_PORT: aclr 0 0 0 0 INPUT NODEFVAL aclr // Retrieval info: USED_PORT: almost_empty 0 0 0 0 OUTPUT NODEFVAL almost_empty // Retrieval info: USED_PORT: clock 0 0 0 0 INPUT NODEFVAL clock // Retrieval info: USED_PORT: data 0 0 16 0 INPUT NODEFVAL data[15..0] // Retrieval info: USED_PORT: empty 0 0 0 0 OUTPUT NODEFVAL empty // Retrieval info: USED_PORT: full 0 0 0 0 OUTPUT NODEFVAL full // Retrieval info: USED_PORT: q 0 0 16 0 OUTPUT NODEFVAL q[15..0] // Retrieval info: USED_PORT: rdreq 0 0 0 0 INPUT NODEFVAL rdreq // Retrieval info: USED_PORT: usedw 0 0 10 0 OUTPUT NODEFVAL usedw[9..0] // Retrieval info: USED_PORT: wrreq 0 0 0 0 INPUT NODEFVAL wrreq // Retrieval info: CONNECT: @data 0 0 16 0 data 0 0 16 0 // Retrieval info: CONNECT: q 0 0 16 0 @q 0 0 16 0 // Retrieval info: CONNECT: @wrreq 0 0 0 0 wrreq 0 0 0 0 // Retrieval info: CONNECT: @rdreq 0 0 0 0 rdreq 0 0 0 0 // Retrieval info: CONNECT: @clock 0 0 0 0 clock 0 0 0 0 // Retrieval info: CONNECT: full 0 0 0 0 @full 0 0 0 0 // Retrieval info: CONNECT: empty 0 0 0 0 @empty 0 0 0 0 // Retrieval info: CONNECT: usedw 0 0 10 0 @usedw 0 0 10 0 // Retrieval info: CONNECT: almost_empty 0 0 0 0 @almost_empty 0 0 0 0 // Retrieval info: CONNECT: @aclr 0 0 0 0 aclr 0 0 0 0 // Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1kx16.v TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1kx16.inc TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1kx16.cmp TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1kx16.bsf TRUE FALSE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1kx16_inst.v TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1kx16_bb.v TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1kx16_waveforms.html FALSE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_1kx16_wave*.jpg FALSE
//////////////////////////////////////////////////////////////////////////////// // Copyright (c) 1995-2011 Xilinx, Inc. All rights reserved. //////////////////////////////////////////////////////////////////////////////// // ____ ____ // / /\/ / // /___/ \ / Vendor: Xilinx // \ \ \/ Version : 13.1 // \ \ Application : xaw2verilog // / / Filename : main_pll.v // /___/ /\ Timestamp : 06/03/2011 01:58:13 // \ \ / \ // \___\/\___\ // //Command: xaw2verilog -st /home/teknohog/dcm2/ipcore_dir/./main_pll.xaw /home/teknohog/dcm2/ipcore_dir/./main_pll //Design Name: main_pll //Device: xc3s500e-4fg320 // // Module main_pll // Generated by Xilinx Architecture Wizard // Written for synthesis tool: XST `timescale 1ns / 1ps module dyn_pll # (parameter SPEED_MHZ = 25 ) (CLKIN_IN, CLKFX1_OUT, CLKFX2_OUT, CLKDV_OUT, DCM_SP_LOCKED_OUT, dcm_progclk, dcm_progdata, dcm_progen, dcm_reset, dcm_progdone, dcm_locked, dcm_status); input CLKIN_IN; wire CLKIN_IBUFG_OUT; wire CLK0_OUT; output CLKFX1_OUT; output CLKFX2_OUT; output CLKDV_OUT; output DCM_SP_LOCKED_OUT; input dcm_progclk; input dcm_progdata; input dcm_progen; input dcm_reset; output dcm_progdone; output dcm_locked; output [2:1] dcm_status; wire CLKFB_IN; wire CLKIN_IBUFG; wire CLK0_BUF; wire CLKFX1_BUF; wire CLKFX2_BUF; wire CLKDV_BUF; wire GND_BIT; wire dcm_progclk_buf; assign GND_BIT = 0; assign CLKIN_IBUFG_OUT = CLKIN_IBUFG; assign CLK0_OUT = CLKFB_IN; IBUFG CLKIN_IBUFG_INST (.I(CLKIN_IN), .O(CLKIN_IBUFG)); BUFG CLK0_BUFG_INST (.I(CLK0_BUF), .O(CLKFB_IN)); BUFG CLKFX1_BUFG_INST (.I(CLKFX1_BUF), .O(CLKFX1_OUT)); BUFG CLKFX2_BUFG_INST (.I(CLKFX2_BUF), .O(CLKFX2_OUT)); BUFG CLKDV_BUFG_INST (.I(CLKDV_BUF), .O(CLKDV_OUT)); BUFG DCMPROGCLK_BUFG_INST (.I(dcm_progclk), .O(dcm_progclk_buf)); // 100 MHZ osc gives fixed 50MHz CLKFX1, 12.5MHZ CLKDV DCM_SP #( .CLK_FEEDBACK("1X"), .CLKDV_DIVIDE(8.0), .CLKFX_DIVIDE(8), .CLKFX_MULTIPLY(4), .CLKIN_DIVIDE_BY_2("FALSE"), .CLKIN_PERIOD(10.000), .CLKOUT_PHASE_SHIFT("NONE"), .DESKEW_ADJUST("SYSTEM_SYNCHRONOUS"), .DFS_FREQUENCY_MODE("LOW"), .DLL_FREQUENCY_MODE("LOW"), .DUTY_CYCLE_CORRECTION("TRUE"), .FACTORY_JF(16'hC080), .PHASE_SHIFT(0), .STARTUP_WAIT("FALSE") ) DCM_SP_INST (.CLKFB(CLKFB_IN), .CLKIN(CLKIN_IBUFG), .DSSEN(GND_BIT), .PSCLK(GND_BIT), .PSEN(GND_BIT), .PSINCDEC(GND_BIT), .RST(GND_BIT), .CLKDV(CLKDV_BUF), .CLKFX(CLKFX1_BUF), .CLKFX180(), .CLK0(CLK0_BUF), .CLK2X(), .CLK2X180(), .CLK90(), .CLK180(), .CLK270(), .LOCKED(DCM_SP_LOCKED_OUT), .PSDONE(), .STATUS()); DCM_CLKGEN #( .CLKFX_DIVIDE(100), // 100Mhz osc so gives steps of 1MHz .CLKFX_MULTIPLY(SPEED_MHZ), .CLKFXDV_DIVIDE(2), // Unused .CLKIN_PERIOD(10.0), .CLKFX_MD_MAX(0.000), .SPREAD_SPECTRUM("NONE"), .STARTUP_WAIT("FALSE") ) DCM_CLKGEN_INST ( .CLKIN(CLKIN_IBUFG), .CLKFX(CLKFX2_BUF), .FREEZEDCM(1'b0), .PROGCLK(dcm_progclk_buf), .PROGDATA(dcm_progdata), .PROGEN(dcm_progen), .PROGDONE(dcm_progdone), .LOCKED(dcm_locked), .STATUS(dcm_status), .RST(dcm_reset) ); endmodule
//////////////////////////////////////////////////////////////////////////////// // Copyright (c) 1995-2011 Xilinx, Inc. All rights reserved. //////////////////////////////////////////////////////////////////////////////// // ____ ____ // / /\/ / // /___/ \ / Vendor: Xilinx // \ \ \/ Version : 13.1 // \ \ Application : xaw2verilog // / / Filename : main_pll.v // /___/ /\ Timestamp : 06/03/2011 01:58:13 // \ \ / \ // \___\/\___\ // //Command: xaw2verilog -st /home/teknohog/dcm2/ipcore_dir/./main_pll.xaw /home/teknohog/dcm2/ipcore_dir/./main_pll //Design Name: main_pll //Device: xc3s500e-4fg320 // // Module main_pll // Generated by Xilinx Architecture Wizard // Written for synthesis tool: XST `timescale 1ns / 1ps module dyn_pll # (parameter SPEED_MHZ = 25 ) (CLKIN_IN, CLKFX1_OUT, CLKFX2_OUT, CLKDV_OUT, DCM_SP_LOCKED_OUT, dcm_progclk, dcm_progdata, dcm_progen, dcm_reset, dcm_progdone, dcm_locked, dcm_status); input CLKIN_IN; wire CLKIN_IBUFG_OUT; wire CLK0_OUT; output CLKFX1_OUT; output CLKFX2_OUT; output CLKDV_OUT; output DCM_SP_LOCKED_OUT; input dcm_progclk; input dcm_progdata; input dcm_progen; input dcm_reset; output dcm_progdone; output dcm_locked; output [2:1] dcm_status; wire CLKFB_IN; wire CLKIN_IBUFG; wire CLK0_BUF; wire CLKFX1_BUF; wire CLKFX2_BUF; wire CLKDV_BUF; wire GND_BIT; wire dcm_progclk_buf; assign GND_BIT = 0; assign CLKIN_IBUFG_OUT = CLKIN_IBUFG; assign CLK0_OUT = CLKFB_IN; IBUFG CLKIN_IBUFG_INST (.I(CLKIN_IN), .O(CLKIN_IBUFG)); BUFG CLK0_BUFG_INST (.I(CLK0_BUF), .O(CLKFB_IN)); BUFG CLKFX1_BUFG_INST (.I(CLKFX1_BUF), .O(CLKFX1_OUT)); BUFG CLKFX2_BUFG_INST (.I(CLKFX2_BUF), .O(CLKFX2_OUT)); BUFG CLKDV_BUFG_INST (.I(CLKDV_BUF), .O(CLKDV_OUT)); BUFG DCMPROGCLK_BUFG_INST (.I(dcm_progclk), .O(dcm_progclk_buf)); // 100 MHZ osc gives fixed 50MHz CLKFX1, 12.5MHZ CLKDV DCM_SP #( .CLK_FEEDBACK("1X"), .CLKDV_DIVIDE(8.0), .CLKFX_DIVIDE(8), .CLKFX_MULTIPLY(4), .CLKIN_DIVIDE_BY_2("FALSE"), .CLKIN_PERIOD(10.000), .CLKOUT_PHASE_SHIFT("NONE"), .DESKEW_ADJUST("SYSTEM_SYNCHRONOUS"), .DFS_FREQUENCY_MODE("LOW"), .DLL_FREQUENCY_MODE("LOW"), .DUTY_CYCLE_CORRECTION("TRUE"), .FACTORY_JF(16'hC080), .PHASE_SHIFT(0), .STARTUP_WAIT("FALSE") ) DCM_SP_INST (.CLKFB(CLKFB_IN), .CLKIN(CLKIN_IBUFG), .DSSEN(GND_BIT), .PSCLK(GND_BIT), .PSEN(GND_BIT), .PSINCDEC(GND_BIT), .RST(GND_BIT), .CLKDV(CLKDV_BUF), .CLKFX(CLKFX1_BUF), .CLKFX180(), .CLK0(CLK0_BUF), .CLK2X(), .CLK2X180(), .CLK90(), .CLK180(), .CLK270(), .LOCKED(DCM_SP_LOCKED_OUT), .PSDONE(), .STATUS()); DCM_CLKGEN #( .CLKFX_DIVIDE(100), // 100Mhz osc so gives steps of 1MHz .CLKFX_MULTIPLY(SPEED_MHZ), .CLKFXDV_DIVIDE(2), // Unused .CLKIN_PERIOD(10.0), .CLKFX_MD_MAX(0.000), .SPREAD_SPECTRUM("NONE"), .STARTUP_WAIT("FALSE") ) DCM_CLKGEN_INST ( .CLKIN(CLKIN_IBUFG), .CLKFX(CLKFX2_BUF), .FREEZEDCM(1'b0), .PROGCLK(dcm_progclk_buf), .PROGDATA(dcm_progdata), .PROGEN(dcm_progen), .PROGDONE(dcm_progdone), .LOCKED(dcm_locked), .STATUS(dcm_status), .RST(dcm_reset) ); endmodule
// megafunction wizard: %FIFO% // GENERATION: STANDARD // VERSION: WM1.0 // MODULE: dcfifo // ============================================================ // File Name: fifo_4kx16_dc.v // Megafunction Name(s): // dcfifo // ============================================================ // ************************************************************ // THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE! // // 5.1 Build 213 01/19/2006 SP 1 SJ Web Edition // ************************************************************ //Copyright (C) 1991-2006 Altera Corporation //Your use of Altera Corporation's design tools, logic functions //and other software and tools, and its AMPP partner logic //functions, and any output files any of the foregoing //(including device programming or simulation files), and any //associated documentation or information are expressly subject //to the terms and conditions of the Altera Program License //Subscription Agreement, Altera MegaCore Function License //Agreement, or other applicable license agreement, including, //without limitation, that your use is for the sole purpose of //programming logic devices manufactured by Altera and sold by //Altera or its authorized distributors. Please refer to the //applicable agreement for further details. // synopsys translate_off `timescale 1 ps / 1 ps // synopsys translate_on module fifo_4kx16_dc ( aclr, data, rdclk, rdreq, wrclk, wrreq, q, rdempty, rdusedw, wrfull, wrusedw); input aclr; input [15:0] data; input rdclk; input rdreq; input wrclk; input wrreq; output [15:0] q; output rdempty; output [11:0] rdusedw; output wrfull; output [11:0] wrusedw; wire sub_wire0; wire [11:0] sub_wire1; wire sub_wire2; wire [15:0] sub_wire3; wire [11:0] sub_wire4; wire rdempty = sub_wire0; wire [11:0] wrusedw = sub_wire1[11:0]; wire wrfull = sub_wire2; wire [15:0] q = sub_wire3[15:0]; wire [11:0] rdusedw = sub_wire4[11:0]; dcfifo dcfifo_component ( .wrclk (wrclk), .rdreq (rdreq), .aclr (aclr), .rdclk (rdclk), .wrreq (wrreq), .data (data), .rdempty (sub_wire0), .wrusedw (sub_wire1), .wrfull (sub_wire2), .q (sub_wire3), .rdusedw (sub_wire4) // synopsys translate_off , .wrempty (), .rdfull () // synopsys translate_on ); defparam dcfifo_component.add_ram_output_register = "OFF", dcfifo_component.clocks_are_synchronized = "FALSE", dcfifo_component.intended_device_family = "Cyclone", dcfifo_component.lpm_numwords = 4096, dcfifo_component.lpm_showahead = "ON", dcfifo_component.lpm_type = "dcfifo", dcfifo_component.lpm_width = 16, dcfifo_component.lpm_widthu = 12, dcfifo_component.overflow_checking = "OFF", dcfifo_component.underflow_checking = "OFF", dcfifo_component.use_eab = "ON"; endmodule // ============================================================ // CNX file retrieval info // ============================================================ // Retrieval info: PRIVATE: AlmostEmpty NUMERIC "0" // Retrieval info: PRIVATE: AlmostEmptyThr NUMERIC "-1" // Retrieval info: PRIVATE: AlmostFull NUMERIC "0" // Retrieval info: PRIVATE: AlmostFullThr NUMERIC "-1" // Retrieval info: PRIVATE: CLOCKS_ARE_SYNCHRONIZED NUMERIC "0" // Retrieval info: PRIVATE: Clock NUMERIC "4" // Retrieval info: PRIVATE: Depth NUMERIC "4096" // Retrieval info: PRIVATE: Empty NUMERIC "1" // Retrieval info: PRIVATE: Full NUMERIC "1" // Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone" // Retrieval info: PRIVATE: LE_BasedFIFO NUMERIC "0" // Retrieval info: PRIVATE: LegacyRREQ NUMERIC "0" // Retrieval info: PRIVATE: MAX_DEPTH_BY_9 NUMERIC "0" // Retrieval info: PRIVATE: OVERFLOW_CHECKING NUMERIC "1" // Retrieval info: PRIVATE: Optimize NUMERIC "2" // Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0" // Retrieval info: PRIVATE: UNDERFLOW_CHECKING NUMERIC "1" // Retrieval info: PRIVATE: UsedW NUMERIC "1" // Retrieval info: PRIVATE: Width NUMERIC "16" // Retrieval info: PRIVATE: dc_aclr NUMERIC "1" // Retrieval info: PRIVATE: rsEmpty NUMERIC "1" // Retrieval info: PRIVATE: rsFull NUMERIC "0" // Retrieval info: PRIVATE: rsUsedW NUMERIC "1" // Retrieval info: PRIVATE: sc_aclr NUMERIC "0" // Retrieval info: PRIVATE: sc_sclr NUMERIC "0" // Retrieval info: PRIVATE: wsEmpty NUMERIC "0" // Retrieval info: PRIVATE: wsFull NUMERIC "1" // Retrieval info: PRIVATE: wsUsedW NUMERIC "1" // Retrieval info: CONSTANT: ADD_RAM_OUTPUT_REGISTER STRING "OFF" // Retrieval info: CONSTANT: CLOCKS_ARE_SYNCHRONIZED STRING "FALSE" // Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone" // Retrieval info: CONSTANT: LPM_NUMWORDS NUMERIC "4096" // Retrieval info: CONSTANT: LPM_SHOWAHEAD STRING "ON" // Retrieval info: CONSTANT: LPM_TYPE STRING "dcfifo" // Retrieval info: CONSTANT: LPM_WIDTH NUMERIC "16" // Retrieval info: CONSTANT: LPM_WIDTHU NUMERIC "12" // Retrieval info: CONSTANT: OVERFLOW_CHECKING STRING "OFF" // Retrieval info: CONSTANT: UNDERFLOW_CHECKING STRING "OFF" // Retrieval info: CONSTANT: USE_EAB STRING "ON" // Retrieval info: USED_PORT: aclr 0 0 0 0 INPUT GND aclr // Retrieval info: USED_PORT: data 0 0 16 0 INPUT NODEFVAL data[15..0] // Retrieval info: USED_PORT: q 0 0 16 0 OUTPUT NODEFVAL q[15..0] // Retrieval info: USED_PORT: rdclk 0 0 0 0 INPUT NODEFVAL rdclk // Retrieval info: USED_PORT: rdempty 0 0 0 0 OUTPUT NODEFVAL rdempty // Retrieval info: USED_PORT: rdreq 0 0 0 0 INPUT NODEFVAL rdreq // Retrieval info: USED_PORT: rdusedw 0 0 12 0 OUTPUT NODEFVAL rdusedw[11..0] // Retrieval info: USED_PORT: wrclk 0 0 0 0 INPUT NODEFVAL wrclk // Retrieval info: USED_PORT: wrfull 0 0 0 0 OUTPUT NODEFVAL wrfull // Retrieval info: USED_PORT: wrreq 0 0 0 0 INPUT NODEFVAL wrreq // Retrieval info: USED_PORT: wrusedw 0 0 12 0 OUTPUT NODEFVAL wrusedw[11..0] // Retrieval info: CONNECT: @data 0 0 16 0 data 0 0 16 0 // Retrieval info: CONNECT: q 0 0 16 0 @q 0 0 16 0 // Retrieval info: CONNECT: @wrreq 0 0 0 0 wrreq 0 0 0 0 // Retrieval info: CONNECT: @rdreq 0 0 0 0 rdreq 0 0 0 0 // Retrieval info: CONNECT: @rdclk 0 0 0 0 rdclk 0 0 0 0 // Retrieval info: CONNECT: @wrclk 0 0 0 0 wrclk 0 0 0 0 // Retrieval info: CONNECT: rdempty 0 0 0 0 @rdempty 0 0 0 0 // Retrieval info: CONNECT: rdusedw 0 0 12 0 @rdusedw 0 0 12 0 // Retrieval info: CONNECT: wrfull 0 0 0 0 @wrfull 0 0 0 0 // Retrieval info: CONNECT: wrusedw 0 0 12 0 @wrusedw 0 0 12 0 // Retrieval info: CONNECT: @aclr 0 0 0 0 aclr 0 0 0 0 // Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc.v TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc.inc TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc.cmp TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc.bsf TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc_inst.v TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc_bb.v TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc_waveforms.html FALSE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc_wave*.jpg FALSE
// megafunction wizard: %FIFO% // GENERATION: STANDARD // VERSION: WM1.0 // MODULE: dcfifo // ============================================================ // File Name: fifo_4kx16_dc.v // Megafunction Name(s): // dcfifo // ============================================================ // ************************************************************ // THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE! // // 5.1 Build 213 01/19/2006 SP 1 SJ Web Edition // ************************************************************ //Copyright (C) 1991-2006 Altera Corporation //Your use of Altera Corporation's design tools, logic functions //and other software and tools, and its AMPP partner logic //functions, and any output files any of the foregoing //(including device programming or simulation files), and any //associated documentation or information are expressly subject //to the terms and conditions of the Altera Program License //Subscription Agreement, Altera MegaCore Function License //Agreement, or other applicable license agreement, including, //without limitation, that your use is for the sole purpose of //programming logic devices manufactured by Altera and sold by //Altera or its authorized distributors. Please refer to the //applicable agreement for further details. // synopsys translate_off `timescale 1 ps / 1 ps // synopsys translate_on module fifo_4kx16_dc ( aclr, data, rdclk, rdreq, wrclk, wrreq, q, rdempty, rdusedw, wrfull, wrusedw); input aclr; input [15:0] data; input rdclk; input rdreq; input wrclk; input wrreq; output [15:0] q; output rdempty; output [11:0] rdusedw; output wrfull; output [11:0] wrusedw; wire sub_wire0; wire [11:0] sub_wire1; wire sub_wire2; wire [15:0] sub_wire3; wire [11:0] sub_wire4; wire rdempty = sub_wire0; wire [11:0] wrusedw = sub_wire1[11:0]; wire wrfull = sub_wire2; wire [15:0] q = sub_wire3[15:0]; wire [11:0] rdusedw = sub_wire4[11:0]; dcfifo dcfifo_component ( .wrclk (wrclk), .rdreq (rdreq), .aclr (aclr), .rdclk (rdclk), .wrreq (wrreq), .data (data), .rdempty (sub_wire0), .wrusedw (sub_wire1), .wrfull (sub_wire2), .q (sub_wire3), .rdusedw (sub_wire4) // synopsys translate_off , .wrempty (), .rdfull () // synopsys translate_on ); defparam dcfifo_component.add_ram_output_register = "OFF", dcfifo_component.clocks_are_synchronized = "FALSE", dcfifo_component.intended_device_family = "Cyclone", dcfifo_component.lpm_numwords = 4096, dcfifo_component.lpm_showahead = "ON", dcfifo_component.lpm_type = "dcfifo", dcfifo_component.lpm_width = 16, dcfifo_component.lpm_widthu = 12, dcfifo_component.overflow_checking = "OFF", dcfifo_component.underflow_checking = "OFF", dcfifo_component.use_eab = "ON"; endmodule // ============================================================ // CNX file retrieval info // ============================================================ // Retrieval info: PRIVATE: AlmostEmpty NUMERIC "0" // Retrieval info: PRIVATE: AlmostEmptyThr NUMERIC "-1" // Retrieval info: PRIVATE: AlmostFull NUMERIC "0" // Retrieval info: PRIVATE: AlmostFullThr NUMERIC "-1" // Retrieval info: PRIVATE: CLOCKS_ARE_SYNCHRONIZED NUMERIC "0" // Retrieval info: PRIVATE: Clock NUMERIC "4" // Retrieval info: PRIVATE: Depth NUMERIC "4096" // Retrieval info: PRIVATE: Empty NUMERIC "1" // Retrieval info: PRIVATE: Full NUMERIC "1" // Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone" // Retrieval info: PRIVATE: LE_BasedFIFO NUMERIC "0" // Retrieval info: PRIVATE: LegacyRREQ NUMERIC "0" // Retrieval info: PRIVATE: MAX_DEPTH_BY_9 NUMERIC "0" // Retrieval info: PRIVATE: OVERFLOW_CHECKING NUMERIC "1" // Retrieval info: PRIVATE: Optimize NUMERIC "2" // Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0" // Retrieval info: PRIVATE: UNDERFLOW_CHECKING NUMERIC "1" // Retrieval info: PRIVATE: UsedW NUMERIC "1" // Retrieval info: PRIVATE: Width NUMERIC "16" // Retrieval info: PRIVATE: dc_aclr NUMERIC "1" // Retrieval info: PRIVATE: rsEmpty NUMERIC "1" // Retrieval info: PRIVATE: rsFull NUMERIC "0" // Retrieval info: PRIVATE: rsUsedW NUMERIC "1" // Retrieval info: PRIVATE: sc_aclr NUMERIC "0" // Retrieval info: PRIVATE: sc_sclr NUMERIC "0" // Retrieval info: PRIVATE: wsEmpty NUMERIC "0" // Retrieval info: PRIVATE: wsFull NUMERIC "1" // Retrieval info: PRIVATE: wsUsedW NUMERIC "1" // Retrieval info: CONSTANT: ADD_RAM_OUTPUT_REGISTER STRING "OFF" // Retrieval info: CONSTANT: CLOCKS_ARE_SYNCHRONIZED STRING "FALSE" // Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone" // Retrieval info: CONSTANT: LPM_NUMWORDS NUMERIC "4096" // Retrieval info: CONSTANT: LPM_SHOWAHEAD STRING "ON" // Retrieval info: CONSTANT: LPM_TYPE STRING "dcfifo" // Retrieval info: CONSTANT: LPM_WIDTH NUMERIC "16" // Retrieval info: CONSTANT: LPM_WIDTHU NUMERIC "12" // Retrieval info: CONSTANT: OVERFLOW_CHECKING STRING "OFF" // Retrieval info: CONSTANT: UNDERFLOW_CHECKING STRING "OFF" // Retrieval info: CONSTANT: USE_EAB STRING "ON" // Retrieval info: USED_PORT: aclr 0 0 0 0 INPUT GND aclr // Retrieval info: USED_PORT: data 0 0 16 0 INPUT NODEFVAL data[15..0] // Retrieval info: USED_PORT: q 0 0 16 0 OUTPUT NODEFVAL q[15..0] // Retrieval info: USED_PORT: rdclk 0 0 0 0 INPUT NODEFVAL rdclk // Retrieval info: USED_PORT: rdempty 0 0 0 0 OUTPUT NODEFVAL rdempty // Retrieval info: USED_PORT: rdreq 0 0 0 0 INPUT NODEFVAL rdreq // Retrieval info: USED_PORT: rdusedw 0 0 12 0 OUTPUT NODEFVAL rdusedw[11..0] // Retrieval info: USED_PORT: wrclk 0 0 0 0 INPUT NODEFVAL wrclk // Retrieval info: USED_PORT: wrfull 0 0 0 0 OUTPUT NODEFVAL wrfull // Retrieval info: USED_PORT: wrreq 0 0 0 0 INPUT NODEFVAL wrreq // Retrieval info: USED_PORT: wrusedw 0 0 12 0 OUTPUT NODEFVAL wrusedw[11..0] // Retrieval info: CONNECT: @data 0 0 16 0 data 0 0 16 0 // Retrieval info: CONNECT: q 0 0 16 0 @q 0 0 16 0 // Retrieval info: CONNECT: @wrreq 0 0 0 0 wrreq 0 0 0 0 // Retrieval info: CONNECT: @rdreq 0 0 0 0 rdreq 0 0 0 0 // Retrieval info: CONNECT: @rdclk 0 0 0 0 rdclk 0 0 0 0 // Retrieval info: CONNECT: @wrclk 0 0 0 0 wrclk 0 0 0 0 // Retrieval info: CONNECT: rdempty 0 0 0 0 @rdempty 0 0 0 0 // Retrieval info: CONNECT: rdusedw 0 0 12 0 @rdusedw 0 0 12 0 // Retrieval info: CONNECT: wrfull 0 0 0 0 @wrfull 0 0 0 0 // Retrieval info: CONNECT: wrusedw 0 0 12 0 @wrusedw 0 0 12 0 // Retrieval info: CONNECT: @aclr 0 0 0 0 aclr 0 0 0 0 // Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc.v TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc.inc TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc.cmp TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc.bsf TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc_inst.v TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc_bb.v TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc_waveforms.html FALSE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc_wave*.jpg FALSE
// megafunction wizard: %FIFO% // GENERATION: STANDARD // VERSION: WM1.0 // MODULE: dcfifo // ============================================================ // File Name: fifo_4kx16_dc.v // Megafunction Name(s): // dcfifo // ============================================================ // ************************************************************ // THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE! // // 5.1 Build 213 01/19/2006 SP 1 SJ Web Edition // ************************************************************ //Copyright (C) 1991-2006 Altera Corporation //Your use of Altera Corporation's design tools, logic functions //and other software and tools, and its AMPP partner logic //functions, and any output files any of the foregoing //(including device programming or simulation files), and any //associated documentation or information are expressly subject //to the terms and conditions of the Altera Program License //Subscription Agreement, Altera MegaCore Function License //Agreement, or other applicable license agreement, including, //without limitation, that your use is for the sole purpose of //programming logic devices manufactured by Altera and sold by //Altera or its authorized distributors. Please refer to the //applicable agreement for further details. // synopsys translate_off `timescale 1 ps / 1 ps // synopsys translate_on module fifo_4kx16_dc ( aclr, data, rdclk, rdreq, wrclk, wrreq, q, rdempty, rdusedw, wrfull, wrusedw); input aclr; input [15:0] data; input rdclk; input rdreq; input wrclk; input wrreq; output [15:0] q; output rdempty; output [11:0] rdusedw; output wrfull; output [11:0] wrusedw; wire sub_wire0; wire [11:0] sub_wire1; wire sub_wire2; wire [15:0] sub_wire3; wire [11:0] sub_wire4; wire rdempty = sub_wire0; wire [11:0] wrusedw = sub_wire1[11:0]; wire wrfull = sub_wire2; wire [15:0] q = sub_wire3[15:0]; wire [11:0] rdusedw = sub_wire4[11:0]; dcfifo dcfifo_component ( .wrclk (wrclk), .rdreq (rdreq), .aclr (aclr), .rdclk (rdclk), .wrreq (wrreq), .data (data), .rdempty (sub_wire0), .wrusedw (sub_wire1), .wrfull (sub_wire2), .q (sub_wire3), .rdusedw (sub_wire4) // synopsys translate_off , .wrempty (), .rdfull () // synopsys translate_on ); defparam dcfifo_component.add_ram_output_register = "OFF", dcfifo_component.clocks_are_synchronized = "FALSE", dcfifo_component.intended_device_family = "Cyclone", dcfifo_component.lpm_numwords = 4096, dcfifo_component.lpm_showahead = "ON", dcfifo_component.lpm_type = "dcfifo", dcfifo_component.lpm_width = 16, dcfifo_component.lpm_widthu = 12, dcfifo_component.overflow_checking = "OFF", dcfifo_component.underflow_checking = "OFF", dcfifo_component.use_eab = "ON"; endmodule // ============================================================ // CNX file retrieval info // ============================================================ // Retrieval info: PRIVATE: AlmostEmpty NUMERIC "0" // Retrieval info: PRIVATE: AlmostEmptyThr NUMERIC "-1" // Retrieval info: PRIVATE: AlmostFull NUMERIC "0" // Retrieval info: PRIVATE: AlmostFullThr NUMERIC "-1" // Retrieval info: PRIVATE: CLOCKS_ARE_SYNCHRONIZED NUMERIC "0" // Retrieval info: PRIVATE: Clock NUMERIC "4" // Retrieval info: PRIVATE: Depth NUMERIC "4096" // Retrieval info: PRIVATE: Empty NUMERIC "1" // Retrieval info: PRIVATE: Full NUMERIC "1" // Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone" // Retrieval info: PRIVATE: LE_BasedFIFO NUMERIC "0" // Retrieval info: PRIVATE: LegacyRREQ NUMERIC "0" // Retrieval info: PRIVATE: MAX_DEPTH_BY_9 NUMERIC "0" // Retrieval info: PRIVATE: OVERFLOW_CHECKING NUMERIC "1" // Retrieval info: PRIVATE: Optimize NUMERIC "2" // Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0" // Retrieval info: PRIVATE: UNDERFLOW_CHECKING NUMERIC "1" // Retrieval info: PRIVATE: UsedW NUMERIC "1" // Retrieval info: PRIVATE: Width NUMERIC "16" // Retrieval info: PRIVATE: dc_aclr NUMERIC "1" // Retrieval info: PRIVATE: rsEmpty NUMERIC "1" // Retrieval info: PRIVATE: rsFull NUMERIC "0" // Retrieval info: PRIVATE: rsUsedW NUMERIC "1" // Retrieval info: PRIVATE: sc_aclr NUMERIC "0" // Retrieval info: PRIVATE: sc_sclr NUMERIC "0" // Retrieval info: PRIVATE: wsEmpty NUMERIC "0" // Retrieval info: PRIVATE: wsFull NUMERIC "1" // Retrieval info: PRIVATE: wsUsedW NUMERIC "1" // Retrieval info: CONSTANT: ADD_RAM_OUTPUT_REGISTER STRING "OFF" // Retrieval info: CONSTANT: CLOCKS_ARE_SYNCHRONIZED STRING "FALSE" // Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone" // Retrieval info: CONSTANT: LPM_NUMWORDS NUMERIC "4096" // Retrieval info: CONSTANT: LPM_SHOWAHEAD STRING "ON" // Retrieval info: CONSTANT: LPM_TYPE STRING "dcfifo" // Retrieval info: CONSTANT: LPM_WIDTH NUMERIC "16" // Retrieval info: CONSTANT: LPM_WIDTHU NUMERIC "12" // Retrieval info: CONSTANT: OVERFLOW_CHECKING STRING "OFF" // Retrieval info: CONSTANT: UNDERFLOW_CHECKING STRING "OFF" // Retrieval info: CONSTANT: USE_EAB STRING "ON" // Retrieval info: USED_PORT: aclr 0 0 0 0 INPUT GND aclr // Retrieval info: USED_PORT: data 0 0 16 0 INPUT NODEFVAL data[15..0] // Retrieval info: USED_PORT: q 0 0 16 0 OUTPUT NODEFVAL q[15..0] // Retrieval info: USED_PORT: rdclk 0 0 0 0 INPUT NODEFVAL rdclk // Retrieval info: USED_PORT: rdempty 0 0 0 0 OUTPUT NODEFVAL rdempty // Retrieval info: USED_PORT: rdreq 0 0 0 0 INPUT NODEFVAL rdreq // Retrieval info: USED_PORT: rdusedw 0 0 12 0 OUTPUT NODEFVAL rdusedw[11..0] // Retrieval info: USED_PORT: wrclk 0 0 0 0 INPUT NODEFVAL wrclk // Retrieval info: USED_PORT: wrfull 0 0 0 0 OUTPUT NODEFVAL wrfull // Retrieval info: USED_PORT: wrreq 0 0 0 0 INPUT NODEFVAL wrreq // Retrieval info: USED_PORT: wrusedw 0 0 12 0 OUTPUT NODEFVAL wrusedw[11..0] // Retrieval info: CONNECT: @data 0 0 16 0 data 0 0 16 0 // Retrieval info: CONNECT: q 0 0 16 0 @q 0 0 16 0 // Retrieval info: CONNECT: @wrreq 0 0 0 0 wrreq 0 0 0 0 // Retrieval info: CONNECT: @rdreq 0 0 0 0 rdreq 0 0 0 0 // Retrieval info: CONNECT: @rdclk 0 0 0 0 rdclk 0 0 0 0 // Retrieval info: CONNECT: @wrclk 0 0 0 0 wrclk 0 0 0 0 // Retrieval info: CONNECT: rdempty 0 0 0 0 @rdempty 0 0 0 0 // Retrieval info: CONNECT: rdusedw 0 0 12 0 @rdusedw 0 0 12 0 // Retrieval info: CONNECT: wrfull 0 0 0 0 @wrfull 0 0 0 0 // Retrieval info: CONNECT: wrusedw 0 0 12 0 @wrusedw 0 0 12 0 // Retrieval info: CONNECT: @aclr 0 0 0 0 aclr 0 0 0 0 // Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc.v TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc.inc TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc.cmp TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc.bsf TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc_inst.v TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc_bb.v TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc_waveforms.html FALSE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc_wave*.jpg FALSE
// megafunction wizard: %FIFO% // GENERATION: STANDARD // VERSION: WM1.0 // MODULE: dcfifo // ============================================================ // File Name: fifo_4kx16_dc.v // Megafunction Name(s): // dcfifo // ============================================================ // ************************************************************ // THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE! // // 5.1 Build 213 01/19/2006 SP 1 SJ Web Edition // ************************************************************ //Copyright (C) 1991-2006 Altera Corporation //Your use of Altera Corporation's design tools, logic functions //and other software and tools, and its AMPP partner logic //functions, and any output files any of the foregoing //(including device programming or simulation files), and any //associated documentation or information are expressly subject //to the terms and conditions of the Altera Program License //Subscription Agreement, Altera MegaCore Function License //Agreement, or other applicable license agreement, including, //without limitation, that your use is for the sole purpose of //programming logic devices manufactured by Altera and sold by //Altera or its authorized distributors. Please refer to the //applicable agreement for further details. // synopsys translate_off `timescale 1 ps / 1 ps // synopsys translate_on module fifo_4kx16_dc ( aclr, data, rdclk, rdreq, wrclk, wrreq, q, rdempty, rdusedw, wrfull, wrusedw); input aclr; input [15:0] data; input rdclk; input rdreq; input wrclk; input wrreq; output [15:0] q; output rdempty; output [11:0] rdusedw; output wrfull; output [11:0] wrusedw; wire sub_wire0; wire [11:0] sub_wire1; wire sub_wire2; wire [15:0] sub_wire3; wire [11:0] sub_wire4; wire rdempty = sub_wire0; wire [11:0] wrusedw = sub_wire1[11:0]; wire wrfull = sub_wire2; wire [15:0] q = sub_wire3[15:0]; wire [11:0] rdusedw = sub_wire4[11:0]; dcfifo dcfifo_component ( .wrclk (wrclk), .rdreq (rdreq), .aclr (aclr), .rdclk (rdclk), .wrreq (wrreq), .data (data), .rdempty (sub_wire0), .wrusedw (sub_wire1), .wrfull (sub_wire2), .q (sub_wire3), .rdusedw (sub_wire4) // synopsys translate_off , .wrempty (), .rdfull () // synopsys translate_on ); defparam dcfifo_component.add_ram_output_register = "OFF", dcfifo_component.clocks_are_synchronized = "FALSE", dcfifo_component.intended_device_family = "Cyclone", dcfifo_component.lpm_numwords = 4096, dcfifo_component.lpm_showahead = "ON", dcfifo_component.lpm_type = "dcfifo", dcfifo_component.lpm_width = 16, dcfifo_component.lpm_widthu = 12, dcfifo_component.overflow_checking = "OFF", dcfifo_component.underflow_checking = "OFF", dcfifo_component.use_eab = "ON"; endmodule // ============================================================ // CNX file retrieval info // ============================================================ // Retrieval info: PRIVATE: AlmostEmpty NUMERIC "0" // Retrieval info: PRIVATE: AlmostEmptyThr NUMERIC "-1" // Retrieval info: PRIVATE: AlmostFull NUMERIC "0" // Retrieval info: PRIVATE: AlmostFullThr NUMERIC "-1" // Retrieval info: PRIVATE: CLOCKS_ARE_SYNCHRONIZED NUMERIC "0" // Retrieval info: PRIVATE: Clock NUMERIC "4" // Retrieval info: PRIVATE: Depth NUMERIC "4096" // Retrieval info: PRIVATE: Empty NUMERIC "1" // Retrieval info: PRIVATE: Full NUMERIC "1" // Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone" // Retrieval info: PRIVATE: LE_BasedFIFO NUMERIC "0" // Retrieval info: PRIVATE: LegacyRREQ NUMERIC "0" // Retrieval info: PRIVATE: MAX_DEPTH_BY_9 NUMERIC "0" // Retrieval info: PRIVATE: OVERFLOW_CHECKING NUMERIC "1" // Retrieval info: PRIVATE: Optimize NUMERIC "2" // Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0" // Retrieval info: PRIVATE: UNDERFLOW_CHECKING NUMERIC "1" // Retrieval info: PRIVATE: UsedW NUMERIC "1" // Retrieval info: PRIVATE: Width NUMERIC "16" // Retrieval info: PRIVATE: dc_aclr NUMERIC "1" // Retrieval info: PRIVATE: rsEmpty NUMERIC "1" // Retrieval info: PRIVATE: rsFull NUMERIC "0" // Retrieval info: PRIVATE: rsUsedW NUMERIC "1" // Retrieval info: PRIVATE: sc_aclr NUMERIC "0" // Retrieval info: PRIVATE: sc_sclr NUMERIC "0" // Retrieval info: PRIVATE: wsEmpty NUMERIC "0" // Retrieval info: PRIVATE: wsFull NUMERIC "1" // Retrieval info: PRIVATE: wsUsedW NUMERIC "1" // Retrieval info: CONSTANT: ADD_RAM_OUTPUT_REGISTER STRING "OFF" // Retrieval info: CONSTANT: CLOCKS_ARE_SYNCHRONIZED STRING "FALSE" // Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone" // Retrieval info: CONSTANT: LPM_NUMWORDS NUMERIC "4096" // Retrieval info: CONSTANT: LPM_SHOWAHEAD STRING "ON" // Retrieval info: CONSTANT: LPM_TYPE STRING "dcfifo" // Retrieval info: CONSTANT: LPM_WIDTH NUMERIC "16" // Retrieval info: CONSTANT: LPM_WIDTHU NUMERIC "12" // Retrieval info: CONSTANT: OVERFLOW_CHECKING STRING "OFF" // Retrieval info: CONSTANT: UNDERFLOW_CHECKING STRING "OFF" // Retrieval info: CONSTANT: USE_EAB STRING "ON" // Retrieval info: USED_PORT: aclr 0 0 0 0 INPUT GND aclr // Retrieval info: USED_PORT: data 0 0 16 0 INPUT NODEFVAL data[15..0] // Retrieval info: USED_PORT: q 0 0 16 0 OUTPUT NODEFVAL q[15..0] // Retrieval info: USED_PORT: rdclk 0 0 0 0 INPUT NODEFVAL rdclk // Retrieval info: USED_PORT: rdempty 0 0 0 0 OUTPUT NODEFVAL rdempty // Retrieval info: USED_PORT: rdreq 0 0 0 0 INPUT NODEFVAL rdreq // Retrieval info: USED_PORT: rdusedw 0 0 12 0 OUTPUT NODEFVAL rdusedw[11..0] // Retrieval info: USED_PORT: wrclk 0 0 0 0 INPUT NODEFVAL wrclk // Retrieval info: USED_PORT: wrfull 0 0 0 0 OUTPUT NODEFVAL wrfull // Retrieval info: USED_PORT: wrreq 0 0 0 0 INPUT NODEFVAL wrreq // Retrieval info: USED_PORT: wrusedw 0 0 12 0 OUTPUT NODEFVAL wrusedw[11..0] // Retrieval info: CONNECT: @data 0 0 16 0 data 0 0 16 0 // Retrieval info: CONNECT: q 0 0 16 0 @q 0 0 16 0 // Retrieval info: CONNECT: @wrreq 0 0 0 0 wrreq 0 0 0 0 // Retrieval info: CONNECT: @rdreq 0 0 0 0 rdreq 0 0 0 0 // Retrieval info: CONNECT: @rdclk 0 0 0 0 rdclk 0 0 0 0 // Retrieval info: CONNECT: @wrclk 0 0 0 0 wrclk 0 0 0 0 // Retrieval info: CONNECT: rdempty 0 0 0 0 @rdempty 0 0 0 0 // Retrieval info: CONNECT: rdusedw 0 0 12 0 @rdusedw 0 0 12 0 // Retrieval info: CONNECT: wrfull 0 0 0 0 @wrfull 0 0 0 0 // Retrieval info: CONNECT: wrusedw 0 0 12 0 @wrusedw 0 0 12 0 // Retrieval info: CONNECT: @aclr 0 0 0 0 aclr 0 0 0 0 // Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc.v TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc.inc TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc.cmp TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc.bsf TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc_inst.v TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc_bb.v TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc_waveforms.html FALSE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc_wave*.jpg FALSE
// megafunction wizard: %FIFO% // GENERATION: STANDARD // VERSION: WM1.0 // MODULE: dcfifo // ============================================================ // File Name: fifo_4kx16_dc.v // Megafunction Name(s): // dcfifo // ============================================================ // ************************************************************ // THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE! // // 5.1 Build 213 01/19/2006 SP 1 SJ Web Edition // ************************************************************ //Copyright (C) 1991-2006 Altera Corporation //Your use of Altera Corporation's design tools, logic functions //and other software and tools, and its AMPP partner logic //functions, and any output files any of the foregoing //(including device programming or simulation files), and any //associated documentation or information are expressly subject //to the terms and conditions of the Altera Program License //Subscription Agreement, Altera MegaCore Function License //Agreement, or other applicable license agreement, including, //without limitation, that your use is for the sole purpose of //programming logic devices manufactured by Altera and sold by //Altera or its authorized distributors. Please refer to the //applicable agreement for further details. // synopsys translate_off `timescale 1 ps / 1 ps // synopsys translate_on module fifo_4kx16_dc ( aclr, data, rdclk, rdreq, wrclk, wrreq, q, rdempty, rdusedw, wrfull, wrusedw); input aclr; input [15:0] data; input rdclk; input rdreq; input wrclk; input wrreq; output [15:0] q; output rdempty; output [11:0] rdusedw; output wrfull; output [11:0] wrusedw; wire sub_wire0; wire [11:0] sub_wire1; wire sub_wire2; wire [15:0] sub_wire3; wire [11:0] sub_wire4; wire rdempty = sub_wire0; wire [11:0] wrusedw = sub_wire1[11:0]; wire wrfull = sub_wire2; wire [15:0] q = sub_wire3[15:0]; wire [11:0] rdusedw = sub_wire4[11:0]; dcfifo dcfifo_component ( .wrclk (wrclk), .rdreq (rdreq), .aclr (aclr), .rdclk (rdclk), .wrreq (wrreq), .data (data), .rdempty (sub_wire0), .wrusedw (sub_wire1), .wrfull (sub_wire2), .q (sub_wire3), .rdusedw (sub_wire4) // synopsys translate_off , .wrempty (), .rdfull () // synopsys translate_on ); defparam dcfifo_component.add_ram_output_register = "OFF", dcfifo_component.clocks_are_synchronized = "FALSE", dcfifo_component.intended_device_family = "Cyclone", dcfifo_component.lpm_numwords = 4096, dcfifo_component.lpm_showahead = "ON", dcfifo_component.lpm_type = "dcfifo", dcfifo_component.lpm_width = 16, dcfifo_component.lpm_widthu = 12, dcfifo_component.overflow_checking = "OFF", dcfifo_component.underflow_checking = "OFF", dcfifo_component.use_eab = "ON"; endmodule // ============================================================ // CNX file retrieval info // ============================================================ // Retrieval info: PRIVATE: AlmostEmpty NUMERIC "0" // Retrieval info: PRIVATE: AlmostEmptyThr NUMERIC "-1" // Retrieval info: PRIVATE: AlmostFull NUMERIC "0" // Retrieval info: PRIVATE: AlmostFullThr NUMERIC "-1" // Retrieval info: PRIVATE: CLOCKS_ARE_SYNCHRONIZED NUMERIC "0" // Retrieval info: PRIVATE: Clock NUMERIC "4" // Retrieval info: PRIVATE: Depth NUMERIC "4096" // Retrieval info: PRIVATE: Empty NUMERIC "1" // Retrieval info: PRIVATE: Full NUMERIC "1" // Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone" // Retrieval info: PRIVATE: LE_BasedFIFO NUMERIC "0" // Retrieval info: PRIVATE: LegacyRREQ NUMERIC "0" // Retrieval info: PRIVATE: MAX_DEPTH_BY_9 NUMERIC "0" // Retrieval info: PRIVATE: OVERFLOW_CHECKING NUMERIC "1" // Retrieval info: PRIVATE: Optimize NUMERIC "2" // Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0" // Retrieval info: PRIVATE: UNDERFLOW_CHECKING NUMERIC "1" // Retrieval info: PRIVATE: UsedW NUMERIC "1" // Retrieval info: PRIVATE: Width NUMERIC "16" // Retrieval info: PRIVATE: dc_aclr NUMERIC "1" // Retrieval info: PRIVATE: rsEmpty NUMERIC "1" // Retrieval info: PRIVATE: rsFull NUMERIC "0" // Retrieval info: PRIVATE: rsUsedW NUMERIC "1" // Retrieval info: PRIVATE: sc_aclr NUMERIC "0" // Retrieval info: PRIVATE: sc_sclr NUMERIC "0" // Retrieval info: PRIVATE: wsEmpty NUMERIC "0" // Retrieval info: PRIVATE: wsFull NUMERIC "1" // Retrieval info: PRIVATE: wsUsedW NUMERIC "1" // Retrieval info: CONSTANT: ADD_RAM_OUTPUT_REGISTER STRING "OFF" // Retrieval info: CONSTANT: CLOCKS_ARE_SYNCHRONIZED STRING "FALSE" // Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone" // Retrieval info: CONSTANT: LPM_NUMWORDS NUMERIC "4096" // Retrieval info: CONSTANT: LPM_SHOWAHEAD STRING "ON" // Retrieval info: CONSTANT: LPM_TYPE STRING "dcfifo" // Retrieval info: CONSTANT: LPM_WIDTH NUMERIC "16" // Retrieval info: CONSTANT: LPM_WIDTHU NUMERIC "12" // Retrieval info: CONSTANT: OVERFLOW_CHECKING STRING "OFF" // Retrieval info: CONSTANT: UNDERFLOW_CHECKING STRING "OFF" // Retrieval info: CONSTANT: USE_EAB STRING "ON" // Retrieval info: USED_PORT: aclr 0 0 0 0 INPUT GND aclr // Retrieval info: USED_PORT: data 0 0 16 0 INPUT NODEFVAL data[15..0] // Retrieval info: USED_PORT: q 0 0 16 0 OUTPUT NODEFVAL q[15..0] // Retrieval info: USED_PORT: rdclk 0 0 0 0 INPUT NODEFVAL rdclk // Retrieval info: USED_PORT: rdempty 0 0 0 0 OUTPUT NODEFVAL rdempty // Retrieval info: USED_PORT: rdreq 0 0 0 0 INPUT NODEFVAL rdreq // Retrieval info: USED_PORT: rdusedw 0 0 12 0 OUTPUT NODEFVAL rdusedw[11..0] // Retrieval info: USED_PORT: wrclk 0 0 0 0 INPUT NODEFVAL wrclk // Retrieval info: USED_PORT: wrfull 0 0 0 0 OUTPUT NODEFVAL wrfull // Retrieval info: USED_PORT: wrreq 0 0 0 0 INPUT NODEFVAL wrreq // Retrieval info: USED_PORT: wrusedw 0 0 12 0 OUTPUT NODEFVAL wrusedw[11..0] // Retrieval info: CONNECT: @data 0 0 16 0 data 0 0 16 0 // Retrieval info: CONNECT: q 0 0 16 0 @q 0 0 16 0 // Retrieval info: CONNECT: @wrreq 0 0 0 0 wrreq 0 0 0 0 // Retrieval info: CONNECT: @rdreq 0 0 0 0 rdreq 0 0 0 0 // Retrieval info: CONNECT: @rdclk 0 0 0 0 rdclk 0 0 0 0 // Retrieval info: CONNECT: @wrclk 0 0 0 0 wrclk 0 0 0 0 // Retrieval info: CONNECT: rdempty 0 0 0 0 @rdempty 0 0 0 0 // Retrieval info: CONNECT: rdusedw 0 0 12 0 @rdusedw 0 0 12 0 // Retrieval info: CONNECT: wrfull 0 0 0 0 @wrfull 0 0 0 0 // Retrieval info: CONNECT: wrusedw 0 0 12 0 @wrusedw 0 0 12 0 // Retrieval info: CONNECT: @aclr 0 0 0 0 aclr 0 0 0 0 // Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc.v TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc.inc TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc.cmp TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc.bsf TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc_inst.v TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc_bb.v TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc_waveforms.html FALSE // Retrieval info: GEN_FILE: TYPE_NORMAL fifo_4kx16_dc_wave*.jpg FALSE
// (c) Copyright 2010-2012 Xilinx, Inc. All rights reserved. // // This file contains confidential and proprietary information // of Xilinx, Inc. and is protected under U.S. and // international copyright and other intellectual property // laws. // // DISCLAIMER // This disclaimer is not a license and does not grant any // rights to the materials distributed herewith. Except as // otherwise provided in a valid license issued to you by // Xilinx, and to the maximum extent permitted by applicable // law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND // WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES // AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING // BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- // INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and // (2) Xilinx shall not be liable (whether in contract or tort, // including negligence, or under any other theory of // liability) for any loss or damage of any kind or nature // related to, arising under or in connection with these // materials, including for any direct, or any indirect, // special, incidental, or consequential loss or damage // (including loss of data, profits, goodwill, or any type of // loss or damage suffered as a result of any action brought // by a third party) even if such damage or loss was // reasonably foreseeable or Xilinx had been advised of the // possibility of the same. // // CRITICAL APPLICATIONS // Xilinx products are not designed or intended to be fail- // safe, or for use in any application requiring fail-safe // performance, such as life-support or safety devices or // systems, Class III medical devices, nuclear facilities, // applications related to the deployment of airbags, or any // other applications that could lead to death, personal // injury, or severe property or environmental damage // (individually and collectively, "Critical // Applications"). Customer assumes the sole risk and // liability of any use of Xilinx products in Critical // Applications, subject only to applicable laws and // regulations governing limitations on product liability. // // THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS // PART OF THIS FILE AT ALL TIMES. //----------------------------------------------------------------------------- // // AXI Register Slice // Register selected channels on the forward and/or reverse signal paths. // 5-channel memory-mapped AXI4 interfaces. // // Verilog-standard: Verilog 2001 //-------------------------------------------------------------------------- // // Structure: // axi_register_slice // axic_register_slice // //-------------------------------------------------------------------------- `timescale 1ps/1ps (* DowngradeIPIdentifiedWarnings="yes" *) module axi_register_slice_v2_1_axi_register_slice # ( parameter C_FAMILY = "virtex6", parameter C_AXI_PROTOCOL = 0, parameter integer C_AXI_ID_WIDTH = 4, parameter integer C_AXI_ADDR_WIDTH = 32, parameter integer C_AXI_DATA_WIDTH = 32, parameter integer C_AXI_SUPPORTS_USER_SIGNALS = 0, parameter integer C_AXI_AWUSER_WIDTH = 1, parameter integer C_AXI_ARUSER_WIDTH = 1, parameter integer C_AXI_WUSER_WIDTH = 1, parameter integer C_AXI_RUSER_WIDTH = 1, parameter integer C_AXI_BUSER_WIDTH = 1, // C_REG_CONFIG_*: // 0 => BYPASS = The channel is just wired through the module. // 1 => FWD_REV = Both FWD and REV (fully-registered) // 2 => FWD = The master VALID and payload signals are registrated. // 3 => REV = The slave ready signal is registrated // 4 => SLAVE_FWD = All slave side signals and master VALID and payload are registrated. // 5 => SLAVE_RDY = All slave side signals and master READY are registrated. // 6 => INPUTS = Slave and Master side inputs are registrated. // 7 => LIGHT_WT = 1-stage pipeline register with bubble cycle, both FWD and REV pipelining parameter integer C_REG_CONFIG_AW = 0, parameter integer C_REG_CONFIG_W = 0, parameter integer C_REG_CONFIG_B = 0, parameter integer C_REG_CONFIG_AR = 0, parameter integer C_REG_CONFIG_R = 0 ) ( // System Signals input wire aclk, input wire aresetn, // Slave Interface Write Address Ports input wire [C_AXI_ID_WIDTH-1:0] s_axi_awid, input wire [C_AXI_ADDR_WIDTH-1:0] s_axi_awaddr, input wire [((C_AXI_PROTOCOL == 1) ? 4 : 8)-1:0] s_axi_awlen, input wire [3-1:0] s_axi_awsize, input wire [2-1:0] s_axi_awburst, input wire [((C_AXI_PROTOCOL == 1) ? 2 : 1)-1:0] s_axi_awlock, input wire [4-1:0] s_axi_awcache, input wire [3-1:0] s_axi_awprot, input wire [4-1:0] s_axi_awregion, input wire [4-1:0] s_axi_awqos, input wire [C_AXI_AWUSER_WIDTH-1:0] s_axi_awuser, input wire s_axi_awvalid, output wire s_axi_awready, // Slave Interface Write Data Ports input wire [C_AXI_ID_WIDTH-1:0] s_axi_wid, input wire [C_AXI_DATA_WIDTH-1:0] s_axi_wdata, input wire [C_AXI_DATA_WIDTH/8-1:0] s_axi_wstrb, input wire s_axi_wlast, input wire [C_AXI_WUSER_WIDTH-1:0] s_axi_wuser, input wire s_axi_wvalid, output wire s_axi_wready, // Slave Interface Write Response Ports output wire [C_AXI_ID_WIDTH-1:0] s_axi_bid, output wire [2-1:0] s_axi_bresp, output wire [C_AXI_BUSER_WIDTH-1:0] s_axi_buser, output wire s_axi_bvalid, input wire s_axi_bready, // Slave Interface Read Address Ports input wire [C_AXI_ID_WIDTH-1:0] s_axi_arid, input wire [C_AXI_ADDR_WIDTH-1:0] s_axi_araddr, input wire [((C_AXI_PROTOCOL == 1) ? 4 : 8)-1:0] s_axi_arlen, input wire [3-1:0] s_axi_arsize, input wire [2-1:0] s_axi_arburst, input wire [((C_AXI_PROTOCOL == 1) ? 2 : 1)-1:0] s_axi_arlock, input wire [4-1:0] s_axi_arcache, input wire [3-1:0] s_axi_arprot, input wire [4-1:0] s_axi_arregion, input wire [4-1:0] s_axi_arqos, input wire [C_AXI_ARUSER_WIDTH-1:0] s_axi_aruser, input wire s_axi_arvalid, output wire s_axi_arready, // Slave Interface Read Data Ports output wire [C_AXI_ID_WIDTH-1:0] s_axi_rid, output wire [C_AXI_DATA_WIDTH-1:0] s_axi_rdata, output wire [2-1:0] s_axi_rresp, output wire s_axi_rlast, output wire [C_AXI_RUSER_WIDTH-1:0] s_axi_ruser, output wire s_axi_rvalid, input wire s_axi_rready, // Master Interface Write Address Port output wire [C_AXI_ID_WIDTH-1:0] m_axi_awid, output wire [C_AXI_ADDR_WIDTH-1:0] m_axi_awaddr, output wire [((C_AXI_PROTOCOL == 1) ? 4 : 8)-1:0] m_axi_awlen, output wire [3-1:0] m_axi_awsize, output wire [2-1:0] m_axi_awburst, output wire [((C_AXI_PROTOCOL == 1) ? 2 : 1)-1:0] m_axi_awlock, output wire [4-1:0] m_axi_awcache, output wire [3-1:0] m_axi_awprot, output wire [4-1:0] m_axi_awregion, output wire [4-1:0] m_axi_awqos, output wire [C_AXI_AWUSER_WIDTH-1:0] m_axi_awuser, output wire m_axi_awvalid, input wire m_axi_awready, // Master Interface Write Data Ports output wire [C_AXI_ID_WIDTH-1:0] m_axi_wid, output wire [C_AXI_DATA_WIDTH-1:0] m_axi_wdata, output wire [C_AXI_DATA_WIDTH/8-1:0] m_axi_wstrb, output wire m_axi_wlast, output wire [C_AXI_WUSER_WIDTH-1:0] m_axi_wuser, output wire m_axi_wvalid, input wire m_axi_wready, // Master Interface Write Response Ports input wire [C_AXI_ID_WIDTH-1:0] m_axi_bid, input wire [2-1:0] m_axi_bresp, input wire [C_AXI_BUSER_WIDTH-1:0] m_axi_buser, input wire m_axi_bvalid, output wire m_axi_bready, // Master Interface Read Address Port output wire [C_AXI_ID_WIDTH-1:0] m_axi_arid, output wire [C_AXI_ADDR_WIDTH-1:0] m_axi_araddr, output wire [((C_AXI_PROTOCOL == 1) ? 4 : 8)-1:0] m_axi_arlen, output wire [3-1:0] m_axi_arsize, output wire [2-1:0] m_axi_arburst, output wire [((C_AXI_PROTOCOL == 1) ? 2 : 1)-1:0] m_axi_arlock, output wire [4-1:0] m_axi_arcache, output wire [3-1:0] m_axi_arprot, output wire [4-1:0] m_axi_arregion, output wire [4-1:0] m_axi_arqos, output wire [C_AXI_ARUSER_WIDTH-1:0] m_axi_aruser, output wire m_axi_arvalid, input wire m_axi_arready, // Master Interface Read Data Ports input wire [C_AXI_ID_WIDTH-1:0] m_axi_rid, input wire [C_AXI_DATA_WIDTH-1:0] m_axi_rdata, input wire [2-1:0] m_axi_rresp, input wire m_axi_rlast, input wire [C_AXI_RUSER_WIDTH-1:0] m_axi_ruser, input wire m_axi_rvalid, output wire m_axi_rready ); wire reset; localparam C_AXI_SUPPORTS_REGION_SIGNALS = (C_AXI_PROTOCOL == 0) ? 1 : 0; `include "axi_infrastructure_v1_1_header.vh" wire [G_AXI_AWPAYLOAD_WIDTH-1:0] s_awpayload; wire [G_AXI_AWPAYLOAD_WIDTH-1:0] m_awpayload; wire [G_AXI_WPAYLOAD_WIDTH-1:0] s_wpayload; wire [G_AXI_WPAYLOAD_WIDTH-1:0] m_wpayload; wire [G_AXI_BPAYLOAD_WIDTH-1:0] s_bpayload; wire [G_AXI_BPAYLOAD_WIDTH-1:0] m_bpayload; wire [G_AXI_ARPAYLOAD_WIDTH-1:0] s_arpayload; wire [G_AXI_ARPAYLOAD_WIDTH-1:0] m_arpayload; wire [G_AXI_RPAYLOAD_WIDTH-1:0] s_rpayload; wire [G_AXI_RPAYLOAD_WIDTH-1:0] m_rpayload; assign reset = ~aresetn; axi_infrastructure_v1_1_axi2vector #( .C_AXI_PROTOCOL ( C_AXI_PROTOCOL ) , .C_AXI_ID_WIDTH ( C_AXI_ID_WIDTH ) , .C_AXI_ADDR_WIDTH ( C_AXI_ADDR_WIDTH ) , .C_AXI_DATA_WIDTH ( C_AXI_DATA_WIDTH ) , .C_AXI_SUPPORTS_USER_SIGNALS ( C_AXI_SUPPORTS_USER_SIGNALS ) , .C_AXI_SUPPORTS_REGION_SIGNALS ( C_AXI_SUPPORTS_REGION_SIGNALS ) , .C_AXI_AWUSER_WIDTH ( C_AXI_AWUSER_WIDTH ) , .C_AXI_ARUSER_WIDTH ( C_AXI_ARUSER_WIDTH ) , .C_AXI_WUSER_WIDTH ( C_AXI_WUSER_WIDTH ) , .C_AXI_RUSER_WIDTH ( C_AXI_RUSER_WIDTH ) , .C_AXI_BUSER_WIDTH ( C_AXI_BUSER_WIDTH ) , .C_AWPAYLOAD_WIDTH ( G_AXI_AWPAYLOAD_WIDTH ) , .C_WPAYLOAD_WIDTH ( G_AXI_WPAYLOAD_WIDTH ) , .C_BPAYLOAD_WIDTH ( G_AXI_BPAYLOAD_WIDTH ) , .C_ARPAYLOAD_WIDTH ( G_AXI_ARPAYLOAD_WIDTH ) , .C_RPAYLOAD_WIDTH ( G_AXI_RPAYLOAD_WIDTH ) ) axi_infrastructure_v1_1_axi2vector_0 ( .s_axi_awid ( s_axi_awid ) , .s_axi_awaddr ( s_axi_awaddr ) , .s_axi_awlen ( s_axi_awlen ) , .s_axi_awsize ( s_axi_awsize ) , .s_axi_awburst ( s_axi_awburst ) , .s_axi_awlock ( s_axi_awlock ) , .s_axi_awcache ( s_axi_awcache ) , .s_axi_awprot ( s_axi_awprot ) , .s_axi_awqos ( s_axi_awqos ) , .s_axi_awuser ( s_axi_awuser ) , .s_axi_awregion ( s_axi_awregion ) , .s_axi_wid ( s_axi_wid ) , .s_axi_wdata ( s_axi_wdata ) , .s_axi_wstrb ( s_axi_wstrb ) , .s_axi_wlast ( s_axi_wlast ) , .s_axi_wuser ( s_axi_wuser ) , .s_axi_bid ( s_axi_bid ) , .s_axi_bresp ( s_axi_bresp ) , .s_axi_buser ( s_axi_buser ) , .s_axi_arid ( s_axi_arid ) , .s_axi_araddr ( s_axi_araddr ) , .s_axi_arlen ( s_axi_arlen ) , .s_axi_arsize ( s_axi_arsize ) , .s_axi_arburst ( s_axi_arburst ) , .s_axi_arlock ( s_axi_arlock ) , .s_axi_arcache ( s_axi_arcache ) , .s_axi_arprot ( s_axi_arprot ) , .s_axi_arqos ( s_axi_arqos ) , .s_axi_aruser ( s_axi_aruser ) , .s_axi_arregion ( s_axi_arregion ) , .s_axi_rid ( s_axi_rid ) , .s_axi_rdata ( s_axi_rdata ) , .s_axi_rresp ( s_axi_rresp ) , .s_axi_rlast ( s_axi_rlast ) , .s_axi_ruser ( s_axi_ruser ) , .s_awpayload ( s_awpayload ) , .s_wpayload ( s_wpayload ) , .s_bpayload ( s_bpayload ) , .s_arpayload ( s_arpayload ) , .s_rpayload ( s_rpayload ) ); axi_register_slice_v2_1_axic_register_slice # ( .C_FAMILY ( C_FAMILY ) , .C_DATA_WIDTH ( G_AXI_AWPAYLOAD_WIDTH ) , .C_REG_CONFIG ( C_REG_CONFIG_AW ) ) aw_pipe ( // System Signals .ACLK(aclk), .ARESET(reset), // Slave side .S_PAYLOAD_DATA(s_awpayload), .S_VALID(s_axi_awvalid), .S_READY(s_axi_awready), // Master side .M_PAYLOAD_DATA(m_awpayload), .M_VALID(m_axi_awvalid), .M_READY(m_axi_awready) ); axi_register_slice_v2_1_axic_register_slice # ( .C_FAMILY ( C_FAMILY ) , .C_DATA_WIDTH ( G_AXI_WPAYLOAD_WIDTH ) , .C_REG_CONFIG ( C_REG_CONFIG_W ) ) w_pipe ( // System Signals .ACLK(aclk), .ARESET(reset), // Slave side .S_PAYLOAD_DATA(s_wpayload), .S_VALID(s_axi_wvalid), .S_READY(s_axi_wready), // Master side .M_PAYLOAD_DATA(m_wpayload), .M_VALID(m_axi_wvalid), .M_READY(m_axi_wready) ); axi_register_slice_v2_1_axic_register_slice # ( .C_FAMILY ( C_FAMILY ) , .C_DATA_WIDTH ( G_AXI_BPAYLOAD_WIDTH ) , .C_REG_CONFIG ( C_REG_CONFIG_B ) ) b_pipe ( // System Signals .ACLK(aclk), .ARESET(reset), // Slave side .S_PAYLOAD_DATA(m_bpayload), .S_VALID(m_axi_bvalid), .S_READY(m_axi_bready), // Master side .M_PAYLOAD_DATA(s_bpayload), .M_VALID(s_axi_bvalid), .M_READY(s_axi_bready) ); axi_register_slice_v2_1_axic_register_slice # ( .C_FAMILY ( C_FAMILY ) , .C_DATA_WIDTH ( G_AXI_ARPAYLOAD_WIDTH ) , .C_REG_CONFIG ( C_REG_CONFIG_AR ) ) ar_pipe ( // System Signals .ACLK(aclk), .ARESET(reset), // Slave side .S_PAYLOAD_DATA(s_arpayload), .S_VALID(s_axi_arvalid), .S_READY(s_axi_arready), // Master side .M_PAYLOAD_DATA(m_arpayload), .M_VALID(m_axi_arvalid), .M_READY(m_axi_arready) ); axi_register_slice_v2_1_axic_register_slice # ( .C_FAMILY ( C_FAMILY ) , .C_DATA_WIDTH ( G_AXI_RPAYLOAD_WIDTH ) , .C_REG_CONFIG ( C_REG_CONFIG_R ) ) r_pipe ( // System Signals .ACLK(aclk), .ARESET(reset), // Slave side .S_PAYLOAD_DATA(m_rpayload), .S_VALID(m_axi_rvalid), .S_READY(m_axi_rready), // Master side .M_PAYLOAD_DATA(s_rpayload), .M_VALID(s_axi_rvalid), .M_READY(s_axi_rready) ); axi_infrastructure_v1_1_vector2axi #( .C_AXI_PROTOCOL ( C_AXI_PROTOCOL ) , .C_AXI_ID_WIDTH ( C_AXI_ID_WIDTH ) , .C_AXI_ADDR_WIDTH ( C_AXI_ADDR_WIDTH ) , .C_AXI_DATA_WIDTH ( C_AXI_DATA_WIDTH ) , .C_AXI_SUPPORTS_USER_SIGNALS ( C_AXI_SUPPORTS_USER_SIGNALS ) , .C_AXI_SUPPORTS_REGION_SIGNALS ( C_AXI_SUPPORTS_REGION_SIGNALS ) , .C_AXI_AWUSER_WIDTH ( C_AXI_AWUSER_WIDTH ) , .C_AXI_ARUSER_WIDTH ( C_AXI_ARUSER_WIDTH ) , .C_AXI_WUSER_WIDTH ( C_AXI_WUSER_WIDTH ) , .C_AXI_RUSER_WIDTH ( C_AXI_RUSER_WIDTH ) , .C_AXI_BUSER_WIDTH ( C_AXI_BUSER_WIDTH ) , .C_AWPAYLOAD_WIDTH ( G_AXI_AWPAYLOAD_WIDTH ) , .C_WPAYLOAD_WIDTH ( G_AXI_WPAYLOAD_WIDTH ) , .C_BPAYLOAD_WIDTH ( G_AXI_BPAYLOAD_WIDTH ) , .C_ARPAYLOAD_WIDTH ( G_AXI_ARPAYLOAD_WIDTH ) , .C_RPAYLOAD_WIDTH ( G_AXI_RPAYLOAD_WIDTH ) ) axi_infrastructure_v1_1_vector2axi_0 ( .m_awpayload ( m_awpayload ) , .m_wpayload ( m_wpayload ) , .m_bpayload ( m_bpayload ) , .m_arpayload ( m_arpayload ) , .m_rpayload ( m_rpayload ) , .m_axi_awid ( m_axi_awid ) , .m_axi_awaddr ( m_axi_awaddr ) , .m_axi_awlen ( m_axi_awlen ) , .m_axi_awsize ( m_axi_awsize ) , .m_axi_awburst ( m_axi_awburst ) , .m_axi_awlock ( m_axi_awlock ) , .m_axi_awcache ( m_axi_awcache ) , .m_axi_awprot ( m_axi_awprot ) , .m_axi_awqos ( m_axi_awqos ) , .m_axi_awuser ( m_axi_awuser ) , .m_axi_awregion ( m_axi_awregion ) , .m_axi_wid ( m_axi_wid ) , .m_axi_wdata ( m_axi_wdata ) , .m_axi_wstrb ( m_axi_wstrb ) , .m_axi_wlast ( m_axi_wlast ) , .m_axi_wuser ( m_axi_wuser ) , .m_axi_bid ( m_axi_bid ) , .m_axi_bresp ( m_axi_bresp ) , .m_axi_buser ( m_axi_buser ) , .m_axi_arid ( m_axi_arid ) , .m_axi_araddr ( m_axi_araddr ) , .m_axi_arlen ( m_axi_arlen ) , .m_axi_arsize ( m_axi_arsize ) , .m_axi_arburst ( m_axi_arburst ) , .m_axi_arlock ( m_axi_arlock ) , .m_axi_arcache ( m_axi_arcache ) , .m_axi_arprot ( m_axi_arprot ) , .m_axi_arqos ( m_axi_arqos ) , .m_axi_aruser ( m_axi_aruser ) , .m_axi_arregion ( m_axi_arregion ) , .m_axi_rid ( m_axi_rid ) , .m_axi_rdata ( m_axi_rdata ) , .m_axi_rresp ( m_axi_rresp ) , .m_axi_rlast ( m_axi_rlast ) , .m_axi_ruser ( m_axi_ruser ) ); endmodule // axi_register_slice
// (c) Copyright 2010-2012 Xilinx, Inc. All rights reserved. // // This file contains confidential and proprietary information // of Xilinx, Inc. and is protected under U.S. and // international copyright and other intellectual property // laws. // // DISCLAIMER // This disclaimer is not a license and does not grant any // rights to the materials distributed herewith. Except as // otherwise provided in a valid license issued to you by // Xilinx, and to the maximum extent permitted by applicable // law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND // WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES // AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING // BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- // INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and // (2) Xilinx shall not be liable (whether in contract or tort, // including negligence, or under any other theory of // liability) for any loss or damage of any kind or nature // related to, arising under or in connection with these // materials, including for any direct, or any indirect, // special, incidental, or consequential loss or damage // (including loss of data, profits, goodwill, or any type of // loss or damage suffered as a result of any action brought // by a third party) even if such damage or loss was // reasonably foreseeable or Xilinx had been advised of the // possibility of the same. // // CRITICAL APPLICATIONS // Xilinx products are not designed or intended to be fail- // safe, or for use in any application requiring fail-safe // performance, such as life-support or safety devices or // systems, Class III medical devices, nuclear facilities, // applications related to the deployment of airbags, or any // other applications that could lead to death, personal // injury, or severe property or environmental damage // (individually and collectively, "Critical // Applications"). Customer assumes the sole risk and // liability of any use of Xilinx products in Critical // Applications, subject only to applicable laws and // regulations governing limitations on product liability. // // THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS // PART OF THIS FILE AT ALL TIMES. //----------------------------------------------------------------------------- // // AXI Register Slice // Register selected channels on the forward and/or reverse signal paths. // 5-channel memory-mapped AXI4 interfaces. // // Verilog-standard: Verilog 2001 //-------------------------------------------------------------------------- // // Structure: // axi_register_slice // axic_register_slice // //-------------------------------------------------------------------------- `timescale 1ps/1ps (* DowngradeIPIdentifiedWarnings="yes" *) module axi_register_slice_v2_1_axi_register_slice # ( parameter C_FAMILY = "virtex6", parameter C_AXI_PROTOCOL = 0, parameter integer C_AXI_ID_WIDTH = 4, parameter integer C_AXI_ADDR_WIDTH = 32, parameter integer C_AXI_DATA_WIDTH = 32, parameter integer C_AXI_SUPPORTS_USER_SIGNALS = 0, parameter integer C_AXI_AWUSER_WIDTH = 1, parameter integer C_AXI_ARUSER_WIDTH = 1, parameter integer C_AXI_WUSER_WIDTH = 1, parameter integer C_AXI_RUSER_WIDTH = 1, parameter integer C_AXI_BUSER_WIDTH = 1, // C_REG_CONFIG_*: // 0 => BYPASS = The channel is just wired through the module. // 1 => FWD_REV = Both FWD and REV (fully-registered) // 2 => FWD = The master VALID and payload signals are registrated. // 3 => REV = The slave ready signal is registrated // 4 => SLAVE_FWD = All slave side signals and master VALID and payload are registrated. // 5 => SLAVE_RDY = All slave side signals and master READY are registrated. // 6 => INPUTS = Slave and Master side inputs are registrated. // 7 => LIGHT_WT = 1-stage pipeline register with bubble cycle, both FWD and REV pipelining parameter integer C_REG_CONFIG_AW = 0, parameter integer C_REG_CONFIG_W = 0, parameter integer C_REG_CONFIG_B = 0, parameter integer C_REG_CONFIG_AR = 0, parameter integer C_REG_CONFIG_R = 0 ) ( // System Signals input wire aclk, input wire aresetn, // Slave Interface Write Address Ports input wire [C_AXI_ID_WIDTH-1:0] s_axi_awid, input wire [C_AXI_ADDR_WIDTH-1:0] s_axi_awaddr, input wire [((C_AXI_PROTOCOL == 1) ? 4 : 8)-1:0] s_axi_awlen, input wire [3-1:0] s_axi_awsize, input wire [2-1:0] s_axi_awburst, input wire [((C_AXI_PROTOCOL == 1) ? 2 : 1)-1:0] s_axi_awlock, input wire [4-1:0] s_axi_awcache, input wire [3-1:0] s_axi_awprot, input wire [4-1:0] s_axi_awregion, input wire [4-1:0] s_axi_awqos, input wire [C_AXI_AWUSER_WIDTH-1:0] s_axi_awuser, input wire s_axi_awvalid, output wire s_axi_awready, // Slave Interface Write Data Ports input wire [C_AXI_ID_WIDTH-1:0] s_axi_wid, input wire [C_AXI_DATA_WIDTH-1:0] s_axi_wdata, input wire [C_AXI_DATA_WIDTH/8-1:0] s_axi_wstrb, input wire s_axi_wlast, input wire [C_AXI_WUSER_WIDTH-1:0] s_axi_wuser, input wire s_axi_wvalid, output wire s_axi_wready, // Slave Interface Write Response Ports output wire [C_AXI_ID_WIDTH-1:0] s_axi_bid, output wire [2-1:0] s_axi_bresp, output wire [C_AXI_BUSER_WIDTH-1:0] s_axi_buser, output wire s_axi_bvalid, input wire s_axi_bready, // Slave Interface Read Address Ports input wire [C_AXI_ID_WIDTH-1:0] s_axi_arid, input wire [C_AXI_ADDR_WIDTH-1:0] s_axi_araddr, input wire [((C_AXI_PROTOCOL == 1) ? 4 : 8)-1:0] s_axi_arlen, input wire [3-1:0] s_axi_arsize, input wire [2-1:0] s_axi_arburst, input wire [((C_AXI_PROTOCOL == 1) ? 2 : 1)-1:0] s_axi_arlock, input wire [4-1:0] s_axi_arcache, input wire [3-1:0] s_axi_arprot, input wire [4-1:0] s_axi_arregion, input wire [4-1:0] s_axi_arqos, input wire [C_AXI_ARUSER_WIDTH-1:0] s_axi_aruser, input wire s_axi_arvalid, output wire s_axi_arready, // Slave Interface Read Data Ports output wire [C_AXI_ID_WIDTH-1:0] s_axi_rid, output wire [C_AXI_DATA_WIDTH-1:0] s_axi_rdata, output wire [2-1:0] s_axi_rresp, output wire s_axi_rlast, output wire [C_AXI_RUSER_WIDTH-1:0] s_axi_ruser, output wire s_axi_rvalid, input wire s_axi_rready, // Master Interface Write Address Port output wire [C_AXI_ID_WIDTH-1:0] m_axi_awid, output wire [C_AXI_ADDR_WIDTH-1:0] m_axi_awaddr, output wire [((C_AXI_PROTOCOL == 1) ? 4 : 8)-1:0] m_axi_awlen, output wire [3-1:0] m_axi_awsize, output wire [2-1:0] m_axi_awburst, output wire [((C_AXI_PROTOCOL == 1) ? 2 : 1)-1:0] m_axi_awlock, output wire [4-1:0] m_axi_awcache, output wire [3-1:0] m_axi_awprot, output wire [4-1:0] m_axi_awregion, output wire [4-1:0] m_axi_awqos, output wire [C_AXI_AWUSER_WIDTH-1:0] m_axi_awuser, output wire m_axi_awvalid, input wire m_axi_awready, // Master Interface Write Data Ports output wire [C_AXI_ID_WIDTH-1:0] m_axi_wid, output wire [C_AXI_DATA_WIDTH-1:0] m_axi_wdata, output wire [C_AXI_DATA_WIDTH/8-1:0] m_axi_wstrb, output wire m_axi_wlast, output wire [C_AXI_WUSER_WIDTH-1:0] m_axi_wuser, output wire m_axi_wvalid, input wire m_axi_wready, // Master Interface Write Response Ports input wire [C_AXI_ID_WIDTH-1:0] m_axi_bid, input wire [2-1:0] m_axi_bresp, input wire [C_AXI_BUSER_WIDTH-1:0] m_axi_buser, input wire m_axi_bvalid, output wire m_axi_bready, // Master Interface Read Address Port output wire [C_AXI_ID_WIDTH-1:0] m_axi_arid, output wire [C_AXI_ADDR_WIDTH-1:0] m_axi_araddr, output wire [((C_AXI_PROTOCOL == 1) ? 4 : 8)-1:0] m_axi_arlen, output wire [3-1:0] m_axi_arsize, output wire [2-1:0] m_axi_arburst, output wire [((C_AXI_PROTOCOL == 1) ? 2 : 1)-1:0] m_axi_arlock, output wire [4-1:0] m_axi_arcache, output wire [3-1:0] m_axi_arprot, output wire [4-1:0] m_axi_arregion, output wire [4-1:0] m_axi_arqos, output wire [C_AXI_ARUSER_WIDTH-1:0] m_axi_aruser, output wire m_axi_arvalid, input wire m_axi_arready, // Master Interface Read Data Ports input wire [C_AXI_ID_WIDTH-1:0] m_axi_rid, input wire [C_AXI_DATA_WIDTH-1:0] m_axi_rdata, input wire [2-1:0] m_axi_rresp, input wire m_axi_rlast, input wire [C_AXI_RUSER_WIDTH-1:0] m_axi_ruser, input wire m_axi_rvalid, output wire m_axi_rready ); wire reset; localparam C_AXI_SUPPORTS_REGION_SIGNALS = (C_AXI_PROTOCOL == 0) ? 1 : 0; `include "axi_infrastructure_v1_1_header.vh" wire [G_AXI_AWPAYLOAD_WIDTH-1:0] s_awpayload; wire [G_AXI_AWPAYLOAD_WIDTH-1:0] m_awpayload; wire [G_AXI_WPAYLOAD_WIDTH-1:0] s_wpayload; wire [G_AXI_WPAYLOAD_WIDTH-1:0] m_wpayload; wire [G_AXI_BPAYLOAD_WIDTH-1:0] s_bpayload; wire [G_AXI_BPAYLOAD_WIDTH-1:0] m_bpayload; wire [G_AXI_ARPAYLOAD_WIDTH-1:0] s_arpayload; wire [G_AXI_ARPAYLOAD_WIDTH-1:0] m_arpayload; wire [G_AXI_RPAYLOAD_WIDTH-1:0] s_rpayload; wire [G_AXI_RPAYLOAD_WIDTH-1:0] m_rpayload; assign reset = ~aresetn; axi_infrastructure_v1_1_axi2vector #( .C_AXI_PROTOCOL ( C_AXI_PROTOCOL ) , .C_AXI_ID_WIDTH ( C_AXI_ID_WIDTH ) , .C_AXI_ADDR_WIDTH ( C_AXI_ADDR_WIDTH ) , .C_AXI_DATA_WIDTH ( C_AXI_DATA_WIDTH ) , .C_AXI_SUPPORTS_USER_SIGNALS ( C_AXI_SUPPORTS_USER_SIGNALS ) , .C_AXI_SUPPORTS_REGION_SIGNALS ( C_AXI_SUPPORTS_REGION_SIGNALS ) , .C_AXI_AWUSER_WIDTH ( C_AXI_AWUSER_WIDTH ) , .C_AXI_ARUSER_WIDTH ( C_AXI_ARUSER_WIDTH ) , .C_AXI_WUSER_WIDTH ( C_AXI_WUSER_WIDTH ) , .C_AXI_RUSER_WIDTH ( C_AXI_RUSER_WIDTH ) , .C_AXI_BUSER_WIDTH ( C_AXI_BUSER_WIDTH ) , .C_AWPAYLOAD_WIDTH ( G_AXI_AWPAYLOAD_WIDTH ) , .C_WPAYLOAD_WIDTH ( G_AXI_WPAYLOAD_WIDTH ) , .C_BPAYLOAD_WIDTH ( G_AXI_BPAYLOAD_WIDTH ) , .C_ARPAYLOAD_WIDTH ( G_AXI_ARPAYLOAD_WIDTH ) , .C_RPAYLOAD_WIDTH ( G_AXI_RPAYLOAD_WIDTH ) ) axi_infrastructure_v1_1_axi2vector_0 ( .s_axi_awid ( s_axi_awid ) , .s_axi_awaddr ( s_axi_awaddr ) , .s_axi_awlen ( s_axi_awlen ) , .s_axi_awsize ( s_axi_awsize ) , .s_axi_awburst ( s_axi_awburst ) , .s_axi_awlock ( s_axi_awlock ) , .s_axi_awcache ( s_axi_awcache ) , .s_axi_awprot ( s_axi_awprot ) , .s_axi_awqos ( s_axi_awqos ) , .s_axi_awuser ( s_axi_awuser ) , .s_axi_awregion ( s_axi_awregion ) , .s_axi_wid ( s_axi_wid ) , .s_axi_wdata ( s_axi_wdata ) , .s_axi_wstrb ( s_axi_wstrb ) , .s_axi_wlast ( s_axi_wlast ) , .s_axi_wuser ( s_axi_wuser ) , .s_axi_bid ( s_axi_bid ) , .s_axi_bresp ( s_axi_bresp ) , .s_axi_buser ( s_axi_buser ) , .s_axi_arid ( s_axi_arid ) , .s_axi_araddr ( s_axi_araddr ) , .s_axi_arlen ( s_axi_arlen ) , .s_axi_arsize ( s_axi_arsize ) , .s_axi_arburst ( s_axi_arburst ) , .s_axi_arlock ( s_axi_arlock ) , .s_axi_arcache ( s_axi_arcache ) , .s_axi_arprot ( s_axi_arprot ) , .s_axi_arqos ( s_axi_arqos ) , .s_axi_aruser ( s_axi_aruser ) , .s_axi_arregion ( s_axi_arregion ) , .s_axi_rid ( s_axi_rid ) , .s_axi_rdata ( s_axi_rdata ) , .s_axi_rresp ( s_axi_rresp ) , .s_axi_rlast ( s_axi_rlast ) , .s_axi_ruser ( s_axi_ruser ) , .s_awpayload ( s_awpayload ) , .s_wpayload ( s_wpayload ) , .s_bpayload ( s_bpayload ) , .s_arpayload ( s_arpayload ) , .s_rpayload ( s_rpayload ) ); axi_register_slice_v2_1_axic_register_slice # ( .C_FAMILY ( C_FAMILY ) , .C_DATA_WIDTH ( G_AXI_AWPAYLOAD_WIDTH ) , .C_REG_CONFIG ( C_REG_CONFIG_AW ) ) aw_pipe ( // System Signals .ACLK(aclk), .ARESET(reset), // Slave side .S_PAYLOAD_DATA(s_awpayload), .S_VALID(s_axi_awvalid), .S_READY(s_axi_awready), // Master side .M_PAYLOAD_DATA(m_awpayload), .M_VALID(m_axi_awvalid), .M_READY(m_axi_awready) ); axi_register_slice_v2_1_axic_register_slice # ( .C_FAMILY ( C_FAMILY ) , .C_DATA_WIDTH ( G_AXI_WPAYLOAD_WIDTH ) , .C_REG_CONFIG ( C_REG_CONFIG_W ) ) w_pipe ( // System Signals .ACLK(aclk), .ARESET(reset), // Slave side .S_PAYLOAD_DATA(s_wpayload), .S_VALID(s_axi_wvalid), .S_READY(s_axi_wready), // Master side .M_PAYLOAD_DATA(m_wpayload), .M_VALID(m_axi_wvalid), .M_READY(m_axi_wready) ); axi_register_slice_v2_1_axic_register_slice # ( .C_FAMILY ( C_FAMILY ) , .C_DATA_WIDTH ( G_AXI_BPAYLOAD_WIDTH ) , .C_REG_CONFIG ( C_REG_CONFIG_B ) ) b_pipe ( // System Signals .ACLK(aclk), .ARESET(reset), // Slave side .S_PAYLOAD_DATA(m_bpayload), .S_VALID(m_axi_bvalid), .S_READY(m_axi_bready), // Master side .M_PAYLOAD_DATA(s_bpayload), .M_VALID(s_axi_bvalid), .M_READY(s_axi_bready) ); axi_register_slice_v2_1_axic_register_slice # ( .C_FAMILY ( C_FAMILY ) , .C_DATA_WIDTH ( G_AXI_ARPAYLOAD_WIDTH ) , .C_REG_CONFIG ( C_REG_CONFIG_AR ) ) ar_pipe ( // System Signals .ACLK(aclk), .ARESET(reset), // Slave side .S_PAYLOAD_DATA(s_arpayload), .S_VALID(s_axi_arvalid), .S_READY(s_axi_arready), // Master side .M_PAYLOAD_DATA(m_arpayload), .M_VALID(m_axi_arvalid), .M_READY(m_axi_arready) ); axi_register_slice_v2_1_axic_register_slice # ( .C_FAMILY ( C_FAMILY ) , .C_DATA_WIDTH ( G_AXI_RPAYLOAD_WIDTH ) , .C_REG_CONFIG ( C_REG_CONFIG_R ) ) r_pipe ( // System Signals .ACLK(aclk), .ARESET(reset), // Slave side .S_PAYLOAD_DATA(m_rpayload), .S_VALID(m_axi_rvalid), .S_READY(m_axi_rready), // Master side .M_PAYLOAD_DATA(s_rpayload), .M_VALID(s_axi_rvalid), .M_READY(s_axi_rready) ); axi_infrastructure_v1_1_vector2axi #( .C_AXI_PROTOCOL ( C_AXI_PROTOCOL ) , .C_AXI_ID_WIDTH ( C_AXI_ID_WIDTH ) , .C_AXI_ADDR_WIDTH ( C_AXI_ADDR_WIDTH ) , .C_AXI_DATA_WIDTH ( C_AXI_DATA_WIDTH ) , .C_AXI_SUPPORTS_USER_SIGNALS ( C_AXI_SUPPORTS_USER_SIGNALS ) , .C_AXI_SUPPORTS_REGION_SIGNALS ( C_AXI_SUPPORTS_REGION_SIGNALS ) , .C_AXI_AWUSER_WIDTH ( C_AXI_AWUSER_WIDTH ) , .C_AXI_ARUSER_WIDTH ( C_AXI_ARUSER_WIDTH ) , .C_AXI_WUSER_WIDTH ( C_AXI_WUSER_WIDTH ) , .C_AXI_RUSER_WIDTH ( C_AXI_RUSER_WIDTH ) , .C_AXI_BUSER_WIDTH ( C_AXI_BUSER_WIDTH ) , .C_AWPAYLOAD_WIDTH ( G_AXI_AWPAYLOAD_WIDTH ) , .C_WPAYLOAD_WIDTH ( G_AXI_WPAYLOAD_WIDTH ) , .C_BPAYLOAD_WIDTH ( G_AXI_BPAYLOAD_WIDTH ) , .C_ARPAYLOAD_WIDTH ( G_AXI_ARPAYLOAD_WIDTH ) , .C_RPAYLOAD_WIDTH ( G_AXI_RPAYLOAD_WIDTH ) ) axi_infrastructure_v1_1_vector2axi_0 ( .m_awpayload ( m_awpayload ) , .m_wpayload ( m_wpayload ) , .m_bpayload ( m_bpayload ) , .m_arpayload ( m_arpayload ) , .m_rpayload ( m_rpayload ) , .m_axi_awid ( m_axi_awid ) , .m_axi_awaddr ( m_axi_awaddr ) , .m_axi_awlen ( m_axi_awlen ) , .m_axi_awsize ( m_axi_awsize ) , .m_axi_awburst ( m_axi_awburst ) , .m_axi_awlock ( m_axi_awlock ) , .m_axi_awcache ( m_axi_awcache ) , .m_axi_awprot ( m_axi_awprot ) , .m_axi_awqos ( m_axi_awqos ) , .m_axi_awuser ( m_axi_awuser ) , .m_axi_awregion ( m_axi_awregion ) , .m_axi_wid ( m_axi_wid ) , .m_axi_wdata ( m_axi_wdata ) , .m_axi_wstrb ( m_axi_wstrb ) , .m_axi_wlast ( m_axi_wlast ) , .m_axi_wuser ( m_axi_wuser ) , .m_axi_bid ( m_axi_bid ) , .m_axi_bresp ( m_axi_bresp ) , .m_axi_buser ( m_axi_buser ) , .m_axi_arid ( m_axi_arid ) , .m_axi_araddr ( m_axi_araddr ) , .m_axi_arlen ( m_axi_arlen ) , .m_axi_arsize ( m_axi_arsize ) , .m_axi_arburst ( m_axi_arburst ) , .m_axi_arlock ( m_axi_arlock ) , .m_axi_arcache ( m_axi_arcache ) , .m_axi_arprot ( m_axi_arprot ) , .m_axi_arqos ( m_axi_arqos ) , .m_axi_aruser ( m_axi_aruser ) , .m_axi_arregion ( m_axi_arregion ) , .m_axi_rid ( m_axi_rid ) , .m_axi_rdata ( m_axi_rdata ) , .m_axi_rresp ( m_axi_rresp ) , .m_axi_rlast ( m_axi_rlast ) , .m_axi_ruser ( m_axi_ruser ) ); endmodule // axi_register_slice
// (c) Copyright 2010-2012 Xilinx, Inc. All rights reserved. // // This file contains confidential and proprietary information // of Xilinx, Inc. and is protected under U.S. and // international copyright and other intellectual property // laws. // // DISCLAIMER // This disclaimer is not a license and does not grant any // rights to the materials distributed herewith. Except as // otherwise provided in a valid license issued to you by // Xilinx, and to the maximum extent permitted by applicable // law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND // WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES // AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING // BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- // INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and // (2) Xilinx shall not be liable (whether in contract or tort, // including negligence, or under any other theory of // liability) for any loss or damage of any kind or nature // related to, arising under or in connection with these // materials, including for any direct, or any indirect, // special, incidental, or consequential loss or damage // (including loss of data, profits, goodwill, or any type of // loss or damage suffered as a result of any action brought // by a third party) even if such damage or loss was // reasonably foreseeable or Xilinx had been advised of the // possibility of the same. // // CRITICAL APPLICATIONS // Xilinx products are not designed or intended to be fail- // safe, or for use in any application requiring fail-safe // performance, such as life-support or safety devices or // systems, Class III medical devices, nuclear facilities, // applications related to the deployment of airbags, or any // other applications that could lead to death, personal // injury, or severe property or environmental damage // (individually and collectively, "Critical // Applications"). Customer assumes the sole risk and // liability of any use of Xilinx products in Critical // Applications, subject only to applicable laws and // regulations governing limitations on product liability. // // THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS // PART OF THIS FILE AT ALL TIMES. //----------------------------------------------------------------------------- // // AXI Register Slice // Register selected channels on the forward and/or reverse signal paths. // 5-channel memory-mapped AXI4 interfaces. // // Verilog-standard: Verilog 2001 //-------------------------------------------------------------------------- // // Structure: // axi_register_slice // axic_register_slice // //-------------------------------------------------------------------------- `timescale 1ps/1ps (* DowngradeIPIdentifiedWarnings="yes" *) module axi_register_slice_v2_1_axi_register_slice # ( parameter C_FAMILY = "virtex6", parameter C_AXI_PROTOCOL = 0, parameter integer C_AXI_ID_WIDTH = 4, parameter integer C_AXI_ADDR_WIDTH = 32, parameter integer C_AXI_DATA_WIDTH = 32, parameter integer C_AXI_SUPPORTS_USER_SIGNALS = 0, parameter integer C_AXI_AWUSER_WIDTH = 1, parameter integer C_AXI_ARUSER_WIDTH = 1, parameter integer C_AXI_WUSER_WIDTH = 1, parameter integer C_AXI_RUSER_WIDTH = 1, parameter integer C_AXI_BUSER_WIDTH = 1, // C_REG_CONFIG_*: // 0 => BYPASS = The channel is just wired through the module. // 1 => FWD_REV = Both FWD and REV (fully-registered) // 2 => FWD = The master VALID and payload signals are registrated. // 3 => REV = The slave ready signal is registrated // 4 => SLAVE_FWD = All slave side signals and master VALID and payload are registrated. // 5 => SLAVE_RDY = All slave side signals and master READY are registrated. // 6 => INPUTS = Slave and Master side inputs are registrated. // 7 => LIGHT_WT = 1-stage pipeline register with bubble cycle, both FWD and REV pipelining parameter integer C_REG_CONFIG_AW = 0, parameter integer C_REG_CONFIG_W = 0, parameter integer C_REG_CONFIG_B = 0, parameter integer C_REG_CONFIG_AR = 0, parameter integer C_REG_CONFIG_R = 0 ) ( // System Signals input wire aclk, input wire aresetn, // Slave Interface Write Address Ports input wire [C_AXI_ID_WIDTH-1:0] s_axi_awid, input wire [C_AXI_ADDR_WIDTH-1:0] s_axi_awaddr, input wire [((C_AXI_PROTOCOL == 1) ? 4 : 8)-1:0] s_axi_awlen, input wire [3-1:0] s_axi_awsize, input wire [2-1:0] s_axi_awburst, input wire [((C_AXI_PROTOCOL == 1) ? 2 : 1)-1:0] s_axi_awlock, input wire [4-1:0] s_axi_awcache, input wire [3-1:0] s_axi_awprot, input wire [4-1:0] s_axi_awregion, input wire [4-1:0] s_axi_awqos, input wire [C_AXI_AWUSER_WIDTH-1:0] s_axi_awuser, input wire s_axi_awvalid, output wire s_axi_awready, // Slave Interface Write Data Ports input wire [C_AXI_ID_WIDTH-1:0] s_axi_wid, input wire [C_AXI_DATA_WIDTH-1:0] s_axi_wdata, input wire [C_AXI_DATA_WIDTH/8-1:0] s_axi_wstrb, input wire s_axi_wlast, input wire [C_AXI_WUSER_WIDTH-1:0] s_axi_wuser, input wire s_axi_wvalid, output wire s_axi_wready, // Slave Interface Write Response Ports output wire [C_AXI_ID_WIDTH-1:0] s_axi_bid, output wire [2-1:0] s_axi_bresp, output wire [C_AXI_BUSER_WIDTH-1:0] s_axi_buser, output wire s_axi_bvalid, input wire s_axi_bready, // Slave Interface Read Address Ports input wire [C_AXI_ID_WIDTH-1:0] s_axi_arid, input wire [C_AXI_ADDR_WIDTH-1:0] s_axi_araddr, input wire [((C_AXI_PROTOCOL == 1) ? 4 : 8)-1:0] s_axi_arlen, input wire [3-1:0] s_axi_arsize, input wire [2-1:0] s_axi_arburst, input wire [((C_AXI_PROTOCOL == 1) ? 2 : 1)-1:0] s_axi_arlock, input wire [4-1:0] s_axi_arcache, input wire [3-1:0] s_axi_arprot, input wire [4-1:0] s_axi_arregion, input wire [4-1:0] s_axi_arqos, input wire [C_AXI_ARUSER_WIDTH-1:0] s_axi_aruser, input wire s_axi_arvalid, output wire s_axi_arready, // Slave Interface Read Data Ports output wire [C_AXI_ID_WIDTH-1:0] s_axi_rid, output wire [C_AXI_DATA_WIDTH-1:0] s_axi_rdata, output wire [2-1:0] s_axi_rresp, output wire s_axi_rlast, output wire [C_AXI_RUSER_WIDTH-1:0] s_axi_ruser, output wire s_axi_rvalid, input wire s_axi_rready, // Master Interface Write Address Port output wire [C_AXI_ID_WIDTH-1:0] m_axi_awid, output wire [C_AXI_ADDR_WIDTH-1:0] m_axi_awaddr, output wire [((C_AXI_PROTOCOL == 1) ? 4 : 8)-1:0] m_axi_awlen, output wire [3-1:0] m_axi_awsize, output wire [2-1:0] m_axi_awburst, output wire [((C_AXI_PROTOCOL == 1) ? 2 : 1)-1:0] m_axi_awlock, output wire [4-1:0] m_axi_awcache, output wire [3-1:0] m_axi_awprot, output wire [4-1:0] m_axi_awregion, output wire [4-1:0] m_axi_awqos, output wire [C_AXI_AWUSER_WIDTH-1:0] m_axi_awuser, output wire m_axi_awvalid, input wire m_axi_awready, // Master Interface Write Data Ports output wire [C_AXI_ID_WIDTH-1:0] m_axi_wid, output wire [C_AXI_DATA_WIDTH-1:0] m_axi_wdata, output wire [C_AXI_DATA_WIDTH/8-1:0] m_axi_wstrb, output wire m_axi_wlast, output wire [C_AXI_WUSER_WIDTH-1:0] m_axi_wuser, output wire m_axi_wvalid, input wire m_axi_wready, // Master Interface Write Response Ports input wire [C_AXI_ID_WIDTH-1:0] m_axi_bid, input wire [2-1:0] m_axi_bresp, input wire [C_AXI_BUSER_WIDTH-1:0] m_axi_buser, input wire m_axi_bvalid, output wire m_axi_bready, // Master Interface Read Address Port output wire [C_AXI_ID_WIDTH-1:0] m_axi_arid, output wire [C_AXI_ADDR_WIDTH-1:0] m_axi_araddr, output wire [((C_AXI_PROTOCOL == 1) ? 4 : 8)-1:0] m_axi_arlen, output wire [3-1:0] m_axi_arsize, output wire [2-1:0] m_axi_arburst, output wire [((C_AXI_PROTOCOL == 1) ? 2 : 1)-1:0] m_axi_arlock, output wire [4-1:0] m_axi_arcache, output wire [3-1:0] m_axi_arprot, output wire [4-1:0] m_axi_arregion, output wire [4-1:0] m_axi_arqos, output wire [C_AXI_ARUSER_WIDTH-1:0] m_axi_aruser, output wire m_axi_arvalid, input wire m_axi_arready, // Master Interface Read Data Ports input wire [C_AXI_ID_WIDTH-1:0] m_axi_rid, input wire [C_AXI_DATA_WIDTH-1:0] m_axi_rdata, input wire [2-1:0] m_axi_rresp, input wire m_axi_rlast, input wire [C_AXI_RUSER_WIDTH-1:0] m_axi_ruser, input wire m_axi_rvalid, output wire m_axi_rready ); wire reset; localparam C_AXI_SUPPORTS_REGION_SIGNALS = (C_AXI_PROTOCOL == 0) ? 1 : 0; `include "axi_infrastructure_v1_1_header.vh" wire [G_AXI_AWPAYLOAD_WIDTH-1:0] s_awpayload; wire [G_AXI_AWPAYLOAD_WIDTH-1:0] m_awpayload; wire [G_AXI_WPAYLOAD_WIDTH-1:0] s_wpayload; wire [G_AXI_WPAYLOAD_WIDTH-1:0] m_wpayload; wire [G_AXI_BPAYLOAD_WIDTH-1:0] s_bpayload; wire [G_AXI_BPAYLOAD_WIDTH-1:0] m_bpayload; wire [G_AXI_ARPAYLOAD_WIDTH-1:0] s_arpayload; wire [G_AXI_ARPAYLOAD_WIDTH-1:0] m_arpayload; wire [G_AXI_RPAYLOAD_WIDTH-1:0] s_rpayload; wire [G_AXI_RPAYLOAD_WIDTH-1:0] m_rpayload; assign reset = ~aresetn; axi_infrastructure_v1_1_axi2vector #( .C_AXI_PROTOCOL ( C_AXI_PROTOCOL ) , .C_AXI_ID_WIDTH ( C_AXI_ID_WIDTH ) , .C_AXI_ADDR_WIDTH ( C_AXI_ADDR_WIDTH ) , .C_AXI_DATA_WIDTH ( C_AXI_DATA_WIDTH ) , .C_AXI_SUPPORTS_USER_SIGNALS ( C_AXI_SUPPORTS_USER_SIGNALS ) , .C_AXI_SUPPORTS_REGION_SIGNALS ( C_AXI_SUPPORTS_REGION_SIGNALS ) , .C_AXI_AWUSER_WIDTH ( C_AXI_AWUSER_WIDTH ) , .C_AXI_ARUSER_WIDTH ( C_AXI_ARUSER_WIDTH ) , .C_AXI_WUSER_WIDTH ( C_AXI_WUSER_WIDTH ) , .C_AXI_RUSER_WIDTH ( C_AXI_RUSER_WIDTH ) , .C_AXI_BUSER_WIDTH ( C_AXI_BUSER_WIDTH ) , .C_AWPAYLOAD_WIDTH ( G_AXI_AWPAYLOAD_WIDTH ) , .C_WPAYLOAD_WIDTH ( G_AXI_WPAYLOAD_WIDTH ) , .C_BPAYLOAD_WIDTH ( G_AXI_BPAYLOAD_WIDTH ) , .C_ARPAYLOAD_WIDTH ( G_AXI_ARPAYLOAD_WIDTH ) , .C_RPAYLOAD_WIDTH ( G_AXI_RPAYLOAD_WIDTH ) ) axi_infrastructure_v1_1_axi2vector_0 ( .s_axi_awid ( s_axi_awid ) , .s_axi_awaddr ( s_axi_awaddr ) , .s_axi_awlen ( s_axi_awlen ) , .s_axi_awsize ( s_axi_awsize ) , .s_axi_awburst ( s_axi_awburst ) , .s_axi_awlock ( s_axi_awlock ) , .s_axi_awcache ( s_axi_awcache ) , .s_axi_awprot ( s_axi_awprot ) , .s_axi_awqos ( s_axi_awqos ) , .s_axi_awuser ( s_axi_awuser ) , .s_axi_awregion ( s_axi_awregion ) , .s_axi_wid ( s_axi_wid ) , .s_axi_wdata ( s_axi_wdata ) , .s_axi_wstrb ( s_axi_wstrb ) , .s_axi_wlast ( s_axi_wlast ) , .s_axi_wuser ( s_axi_wuser ) , .s_axi_bid ( s_axi_bid ) , .s_axi_bresp ( s_axi_bresp ) , .s_axi_buser ( s_axi_buser ) , .s_axi_arid ( s_axi_arid ) , .s_axi_araddr ( s_axi_araddr ) , .s_axi_arlen ( s_axi_arlen ) , .s_axi_arsize ( s_axi_arsize ) , .s_axi_arburst ( s_axi_arburst ) , .s_axi_arlock ( s_axi_arlock ) , .s_axi_arcache ( s_axi_arcache ) , .s_axi_arprot ( s_axi_arprot ) , .s_axi_arqos ( s_axi_arqos ) , .s_axi_aruser ( s_axi_aruser ) , .s_axi_arregion ( s_axi_arregion ) , .s_axi_rid ( s_axi_rid ) , .s_axi_rdata ( s_axi_rdata ) , .s_axi_rresp ( s_axi_rresp ) , .s_axi_rlast ( s_axi_rlast ) , .s_axi_ruser ( s_axi_ruser ) , .s_awpayload ( s_awpayload ) , .s_wpayload ( s_wpayload ) , .s_bpayload ( s_bpayload ) , .s_arpayload ( s_arpayload ) , .s_rpayload ( s_rpayload ) ); axi_register_slice_v2_1_axic_register_slice # ( .C_FAMILY ( C_FAMILY ) , .C_DATA_WIDTH ( G_AXI_AWPAYLOAD_WIDTH ) , .C_REG_CONFIG ( C_REG_CONFIG_AW ) ) aw_pipe ( // System Signals .ACLK(aclk), .ARESET(reset), // Slave side .S_PAYLOAD_DATA(s_awpayload), .S_VALID(s_axi_awvalid), .S_READY(s_axi_awready), // Master side .M_PAYLOAD_DATA(m_awpayload), .M_VALID(m_axi_awvalid), .M_READY(m_axi_awready) ); axi_register_slice_v2_1_axic_register_slice # ( .C_FAMILY ( C_FAMILY ) , .C_DATA_WIDTH ( G_AXI_WPAYLOAD_WIDTH ) , .C_REG_CONFIG ( C_REG_CONFIG_W ) ) w_pipe ( // System Signals .ACLK(aclk), .ARESET(reset), // Slave side .S_PAYLOAD_DATA(s_wpayload), .S_VALID(s_axi_wvalid), .S_READY(s_axi_wready), // Master side .M_PAYLOAD_DATA(m_wpayload), .M_VALID(m_axi_wvalid), .M_READY(m_axi_wready) ); axi_register_slice_v2_1_axic_register_slice # ( .C_FAMILY ( C_FAMILY ) , .C_DATA_WIDTH ( G_AXI_BPAYLOAD_WIDTH ) , .C_REG_CONFIG ( C_REG_CONFIG_B ) ) b_pipe ( // System Signals .ACLK(aclk), .ARESET(reset), // Slave side .S_PAYLOAD_DATA(m_bpayload), .S_VALID(m_axi_bvalid), .S_READY(m_axi_bready), // Master side .M_PAYLOAD_DATA(s_bpayload), .M_VALID(s_axi_bvalid), .M_READY(s_axi_bready) ); axi_register_slice_v2_1_axic_register_slice # ( .C_FAMILY ( C_FAMILY ) , .C_DATA_WIDTH ( G_AXI_ARPAYLOAD_WIDTH ) , .C_REG_CONFIG ( C_REG_CONFIG_AR ) ) ar_pipe ( // System Signals .ACLK(aclk), .ARESET(reset), // Slave side .S_PAYLOAD_DATA(s_arpayload), .S_VALID(s_axi_arvalid), .S_READY(s_axi_arready), // Master side .M_PAYLOAD_DATA(m_arpayload), .M_VALID(m_axi_arvalid), .M_READY(m_axi_arready) ); axi_register_slice_v2_1_axic_register_slice # ( .C_FAMILY ( C_FAMILY ) , .C_DATA_WIDTH ( G_AXI_RPAYLOAD_WIDTH ) , .C_REG_CONFIG ( C_REG_CONFIG_R ) ) r_pipe ( // System Signals .ACLK(aclk), .ARESET(reset), // Slave side .S_PAYLOAD_DATA(m_rpayload), .S_VALID(m_axi_rvalid), .S_READY(m_axi_rready), // Master side .M_PAYLOAD_DATA(s_rpayload), .M_VALID(s_axi_rvalid), .M_READY(s_axi_rready) ); axi_infrastructure_v1_1_vector2axi #( .C_AXI_PROTOCOL ( C_AXI_PROTOCOL ) , .C_AXI_ID_WIDTH ( C_AXI_ID_WIDTH ) , .C_AXI_ADDR_WIDTH ( C_AXI_ADDR_WIDTH ) , .C_AXI_DATA_WIDTH ( C_AXI_DATA_WIDTH ) , .C_AXI_SUPPORTS_USER_SIGNALS ( C_AXI_SUPPORTS_USER_SIGNALS ) , .C_AXI_SUPPORTS_REGION_SIGNALS ( C_AXI_SUPPORTS_REGION_SIGNALS ) , .C_AXI_AWUSER_WIDTH ( C_AXI_AWUSER_WIDTH ) , .C_AXI_ARUSER_WIDTH ( C_AXI_ARUSER_WIDTH ) , .C_AXI_WUSER_WIDTH ( C_AXI_WUSER_WIDTH ) , .C_AXI_RUSER_WIDTH ( C_AXI_RUSER_WIDTH ) , .C_AXI_BUSER_WIDTH ( C_AXI_BUSER_WIDTH ) , .C_AWPAYLOAD_WIDTH ( G_AXI_AWPAYLOAD_WIDTH ) , .C_WPAYLOAD_WIDTH ( G_AXI_WPAYLOAD_WIDTH ) , .C_BPAYLOAD_WIDTH ( G_AXI_BPAYLOAD_WIDTH ) , .C_ARPAYLOAD_WIDTH ( G_AXI_ARPAYLOAD_WIDTH ) , .C_RPAYLOAD_WIDTH ( G_AXI_RPAYLOAD_WIDTH ) ) axi_infrastructure_v1_1_vector2axi_0 ( .m_awpayload ( m_awpayload ) , .m_wpayload ( m_wpayload ) , .m_bpayload ( m_bpayload ) , .m_arpayload ( m_arpayload ) , .m_rpayload ( m_rpayload ) , .m_axi_awid ( m_axi_awid ) , .m_axi_awaddr ( m_axi_awaddr ) , .m_axi_awlen ( m_axi_awlen ) , .m_axi_awsize ( m_axi_awsize ) , .m_axi_awburst ( m_axi_awburst ) , .m_axi_awlock ( m_axi_awlock ) , .m_axi_awcache ( m_axi_awcache ) , .m_axi_awprot ( m_axi_awprot ) , .m_axi_awqos ( m_axi_awqos ) , .m_axi_awuser ( m_axi_awuser ) , .m_axi_awregion ( m_axi_awregion ) , .m_axi_wid ( m_axi_wid ) , .m_axi_wdata ( m_axi_wdata ) , .m_axi_wstrb ( m_axi_wstrb ) , .m_axi_wlast ( m_axi_wlast ) , .m_axi_wuser ( m_axi_wuser ) , .m_axi_bid ( m_axi_bid ) , .m_axi_bresp ( m_axi_bresp ) , .m_axi_buser ( m_axi_buser ) , .m_axi_arid ( m_axi_arid ) , .m_axi_araddr ( m_axi_araddr ) , .m_axi_arlen ( m_axi_arlen ) , .m_axi_arsize ( m_axi_arsize ) , .m_axi_arburst ( m_axi_arburst ) , .m_axi_arlock ( m_axi_arlock ) , .m_axi_arcache ( m_axi_arcache ) , .m_axi_arprot ( m_axi_arprot ) , .m_axi_arqos ( m_axi_arqos ) , .m_axi_aruser ( m_axi_aruser ) , .m_axi_arregion ( m_axi_arregion ) , .m_axi_rid ( m_axi_rid ) , .m_axi_rdata ( m_axi_rdata ) , .m_axi_rresp ( m_axi_rresp ) , .m_axi_rlast ( m_axi_rlast ) , .m_axi_ruser ( m_axi_ruser ) ); endmodule // axi_register_slice
// (c) Copyright 2012 Xilinx, Inc. All rights reserved. // // This file contains confidential and proprietary information // of Xilinx, Inc. and is protected under U.S. and // international copyright and other intellectual property // laws. // // DISCLAIMER // This disclaimer is not a license and does not grant any // rights to the materials distributed herewith. Except as // otherwise provided in a valid license issued to you by // Xilinx, and to the maximum extent permitted by applicable // law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND // WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES // AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING // BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- // INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and // (2) Xilinx shall not be liable (whether in contract or tort, // including negligence, or under any other theory of // liability) for any loss or damage of any kind or nature // related to, arising under or in connection with these // materials, including for any direct, or any indirect, // special, incidental, or consequential loss or damage // (including loss of data, profits, goodwill, or any type of // loss or damage suffered as a result of any action brought // by a third party) even if such damage or loss was // reasonably foreseeable or Xilinx had been advised of the // possibility of the same. // // CRITICAL APPLICATIONS // Xilinx products are not designed or intended to be fail- // safe, or for use in any application requiring fail-safe // performance, such as life-support or safety devices or // systems, Class III medical devices, nuclear facilities, // applications related to the deployment of airbags, or any // other applications that could lead to death, personal // injury, or severe property or environmental damage // (individually and collectively, "Critical // Applications"). Customer assumes the sole risk and // liability of any use of Xilinx products in Critical // Applications, subject only to applicable laws and // regulations governing limitations on product liability. // // THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS // PART OF THIS FILE AT ALL TIMES. //----------------------------------------------------------------------------- // // axis to vector // A generic module to merge all axi signals into one signal called payload. // This is strictly wires, so no clk, reset, aclken, valid/ready are required. // // Verilog-standard: Verilog 2001 //-------------------------------------------------------------------------- // `timescale 1ps/1ps `default_nettype none (* DowngradeIPIdentifiedWarnings="yes" *) module axi_infrastructure_v1_1_axi2vector # ( /////////////////////////////////////////////////////////////////////////////// // Parameter Definitions /////////////////////////////////////////////////////////////////////////////// parameter integer C_AXI_PROTOCOL = 0, parameter integer C_AXI_ID_WIDTH = 4, parameter integer C_AXI_ADDR_WIDTH = 32, parameter integer C_AXI_DATA_WIDTH = 32, parameter integer C_AXI_SUPPORTS_USER_SIGNALS = 0, parameter integer C_AXI_SUPPORTS_REGION_SIGNALS = 0, parameter integer C_AXI_AWUSER_WIDTH = 1, parameter integer C_AXI_WUSER_WIDTH = 1, parameter integer C_AXI_BUSER_WIDTH = 1, parameter integer C_AXI_ARUSER_WIDTH = 1, parameter integer C_AXI_RUSER_WIDTH = 1, parameter integer C_AWPAYLOAD_WIDTH = 61, parameter integer C_WPAYLOAD_WIDTH = 73, parameter integer C_BPAYLOAD_WIDTH = 6, parameter integer C_ARPAYLOAD_WIDTH = 61, parameter integer C_RPAYLOAD_WIDTH = 69 ) ( /////////////////////////////////////////////////////////////////////////////// // Port Declarations /////////////////////////////////////////////////////////////////////////////// // Slave Interface Write Address Ports input wire [C_AXI_ID_WIDTH-1:0] s_axi_awid, input wire [C_AXI_ADDR_WIDTH-1:0] s_axi_awaddr, input wire [((C_AXI_PROTOCOL == 1) ? 4 : 8)-1:0] s_axi_awlen, input wire [3-1:0] s_axi_awsize, input wire [2-1:0] s_axi_awburst, input wire [((C_AXI_PROTOCOL == 1) ? 2 : 1)-1:0] s_axi_awlock, input wire [4-1:0] s_axi_awcache, input wire [3-1:0] s_axi_awprot, input wire [4-1:0] s_axi_awregion, input wire [4-1:0] s_axi_awqos, input wire [C_AXI_AWUSER_WIDTH-1:0] s_axi_awuser, // Slave Interface Write Data Ports input wire [C_AXI_ID_WIDTH-1:0] s_axi_wid, input wire [C_AXI_DATA_WIDTH-1:0] s_axi_wdata, input wire [C_AXI_DATA_WIDTH/8-1:0] s_axi_wstrb, input wire s_axi_wlast, input wire [C_AXI_WUSER_WIDTH-1:0] s_axi_wuser, // Slave Interface Write Response Ports output wire [C_AXI_ID_WIDTH-1:0] s_axi_bid, output wire [2-1:0] s_axi_bresp, output wire [C_AXI_BUSER_WIDTH-1:0] s_axi_buser, // Slave Interface Read Address Ports input wire [C_AXI_ID_WIDTH-1:0] s_axi_arid, input wire [C_AXI_ADDR_WIDTH-1:0] s_axi_araddr, input wire [((C_AXI_PROTOCOL == 1) ? 4 : 8)-1:0] s_axi_arlen, input wire [3-1:0] s_axi_arsize, input wire [2-1:0] s_axi_arburst, input wire [((C_AXI_PROTOCOL == 1) ? 2 : 1)-1:0] s_axi_arlock, input wire [4-1:0] s_axi_arcache, input wire [3-1:0] s_axi_arprot, input wire [4-1:0] s_axi_arregion, input wire [4-1:0] s_axi_arqos, input wire [C_AXI_ARUSER_WIDTH-1:0] s_axi_aruser, // Slave Interface Read Data Ports output wire [C_AXI_ID_WIDTH-1:0] s_axi_rid, output wire [C_AXI_DATA_WIDTH-1:0] s_axi_rdata, output wire [2-1:0] s_axi_rresp, output wire s_axi_rlast, output wire [C_AXI_RUSER_WIDTH-1:0] s_axi_ruser, // payloads output wire [C_AWPAYLOAD_WIDTH-1:0] s_awpayload, output wire [C_WPAYLOAD_WIDTH-1:0] s_wpayload, input wire [C_BPAYLOAD_WIDTH-1:0] s_bpayload, output wire [C_ARPAYLOAD_WIDTH-1:0] s_arpayload, input wire [C_RPAYLOAD_WIDTH-1:0] s_rpayload ); //////////////////////////////////////////////////////////////////////////////// // Functions //////////////////////////////////////////////////////////////////////////////// `include "axi_infrastructure_v1_1_header.vh" //////////////////////////////////////////////////////////////////////////////// // Local parameters //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // Wires/Reg declarations //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // BEGIN RTL //////////////////////////////////////////////////////////////////////////////// // AXI4, AXI4LITE, AXI3 packing assign s_awpayload[G_AXI_AWADDR_INDEX+:G_AXI_AWADDR_WIDTH] = s_axi_awaddr; assign s_awpayload[G_AXI_AWPROT_INDEX+:G_AXI_AWPROT_WIDTH] = s_axi_awprot; assign s_wpayload[G_AXI_WDATA_INDEX+:G_AXI_WDATA_WIDTH] = s_axi_wdata; assign s_wpayload[G_AXI_WSTRB_INDEX+:G_AXI_WSTRB_WIDTH] = s_axi_wstrb; assign s_axi_bresp = s_bpayload[G_AXI_BRESP_INDEX+:G_AXI_BRESP_WIDTH]; assign s_arpayload[G_AXI_ARADDR_INDEX+:G_AXI_ARADDR_WIDTH] = s_axi_araddr; assign s_arpayload[G_AXI_ARPROT_INDEX+:G_AXI_ARPROT_WIDTH] = s_axi_arprot; assign s_axi_rdata = s_rpayload[G_AXI_RDATA_INDEX+:G_AXI_RDATA_WIDTH]; assign s_axi_rresp = s_rpayload[G_AXI_RRESP_INDEX+:G_AXI_RRESP_WIDTH]; generate if (C_AXI_PROTOCOL == 0 || C_AXI_PROTOCOL == 1) begin : gen_axi4_or_axi3_packing assign s_awpayload[G_AXI_AWSIZE_INDEX+:G_AXI_AWSIZE_WIDTH] = s_axi_awsize; assign s_awpayload[G_AXI_AWBURST_INDEX+:G_AXI_AWBURST_WIDTH] = s_axi_awburst; assign s_awpayload[G_AXI_AWCACHE_INDEX+:G_AXI_AWCACHE_WIDTH] = s_axi_awcache; assign s_awpayload[G_AXI_AWLEN_INDEX+:G_AXI_AWLEN_WIDTH] = s_axi_awlen; assign s_awpayload[G_AXI_AWLOCK_INDEX+:G_AXI_AWLOCK_WIDTH] = s_axi_awlock; assign s_awpayload[G_AXI_AWID_INDEX+:G_AXI_AWID_WIDTH] = s_axi_awid; assign s_awpayload[G_AXI_AWQOS_INDEX+:G_AXI_AWQOS_WIDTH] = s_axi_awqos; assign s_wpayload[G_AXI_WLAST_INDEX+:G_AXI_WLAST_WIDTH] = s_axi_wlast; if (C_AXI_PROTOCOL == 1) begin : gen_axi3_wid_packing assign s_wpayload[G_AXI_WID_INDEX+:G_AXI_WID_WIDTH] = s_axi_wid; end else begin : gen_no_axi3_wid_packing end assign s_axi_bid = s_bpayload[G_AXI_BID_INDEX+:G_AXI_BID_WIDTH]; assign s_arpayload[G_AXI_ARSIZE_INDEX+:G_AXI_ARSIZE_WIDTH] = s_axi_arsize; assign s_arpayload[G_AXI_ARBURST_INDEX+:G_AXI_ARBURST_WIDTH] = s_axi_arburst; assign s_arpayload[G_AXI_ARCACHE_INDEX+:G_AXI_ARCACHE_WIDTH] = s_axi_arcache; assign s_arpayload[G_AXI_ARLEN_INDEX+:G_AXI_ARLEN_WIDTH] = s_axi_arlen; assign s_arpayload[G_AXI_ARLOCK_INDEX+:G_AXI_ARLOCK_WIDTH] = s_axi_arlock; assign s_arpayload[G_AXI_ARID_INDEX+:G_AXI_ARID_WIDTH] = s_axi_arid; assign s_arpayload[G_AXI_ARQOS_INDEX+:G_AXI_ARQOS_WIDTH] = s_axi_arqos; assign s_axi_rlast = s_rpayload[G_AXI_RLAST_INDEX+:G_AXI_RLAST_WIDTH]; assign s_axi_rid = s_rpayload[G_AXI_RID_INDEX+:G_AXI_RID_WIDTH]; if (C_AXI_SUPPORTS_REGION_SIGNALS == 1 && G_AXI_AWREGION_WIDTH > 0) begin : gen_region_signals assign s_awpayload[G_AXI_AWREGION_INDEX+:G_AXI_AWREGION_WIDTH] = s_axi_awregion; assign s_arpayload[G_AXI_ARREGION_INDEX+:G_AXI_ARREGION_WIDTH] = s_axi_arregion; end else begin : gen_no_region_signals end if (C_AXI_SUPPORTS_USER_SIGNALS == 1 && C_AXI_PROTOCOL != 2) begin : gen_user_signals assign s_awpayload[G_AXI_AWUSER_INDEX+:G_AXI_AWUSER_WIDTH] = s_axi_awuser; assign s_wpayload[G_AXI_WUSER_INDEX+:G_AXI_WUSER_WIDTH] = s_axi_wuser; assign s_axi_buser = s_bpayload[G_AXI_BUSER_INDEX+:G_AXI_BUSER_WIDTH]; assign s_arpayload[G_AXI_ARUSER_INDEX+:G_AXI_ARUSER_WIDTH] = s_axi_aruser; assign s_axi_ruser = s_rpayload[G_AXI_RUSER_INDEX+:G_AXI_RUSER_WIDTH]; end else begin : gen_no_user_signals assign s_axi_buser = 'b0; assign s_axi_ruser = 'b0; end end else begin : gen_axi4lite_packing assign s_axi_bid = 'b0; assign s_axi_buser = 'b0; assign s_axi_rlast = 1'b1; assign s_axi_rid = 'b0; assign s_axi_ruser = 'b0; end endgenerate endmodule `default_nettype wire
// (c) Copyright 2012 Xilinx, Inc. All rights reserved. // // This file contains confidential and proprietary information // of Xilinx, Inc. and is protected under U.S. and // international copyright and other intellectual property // laws. // // DISCLAIMER // This disclaimer is not a license and does not grant any // rights to the materials distributed herewith. Except as // otherwise provided in a valid license issued to you by // Xilinx, and to the maximum extent permitted by applicable // law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND // WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES // AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING // BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- // INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and // (2) Xilinx shall not be liable (whether in contract or tort, // including negligence, or under any other theory of // liability) for any loss or damage of any kind or nature // related to, arising under or in connection with these // materials, including for any direct, or any indirect, // special, incidental, or consequential loss or damage // (including loss of data, profits, goodwill, or any type of // loss or damage suffered as a result of any action brought // by a third party) even if such damage or loss was // reasonably foreseeable or Xilinx had been advised of the // possibility of the same. // // CRITICAL APPLICATIONS // Xilinx products are not designed or intended to be fail- // safe, or for use in any application requiring fail-safe // performance, such as life-support or safety devices or // systems, Class III medical devices, nuclear facilities, // applications related to the deployment of airbags, or any // other applications that could lead to death, personal // injury, or severe property or environmental damage // (individually and collectively, "Critical // Applications"). Customer assumes the sole risk and // liability of any use of Xilinx products in Critical // Applications, subject only to applicable laws and // regulations governing limitations on product liability. // // THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS // PART OF THIS FILE AT ALL TIMES. //----------------------------------------------------------------------------- // // axis to vector // A generic module to merge all axi signals into one signal called payload. // This is strictly wires, so no clk, reset, aclken, valid/ready are required. // // Verilog-standard: Verilog 2001 //-------------------------------------------------------------------------- // `timescale 1ps/1ps `default_nettype none (* DowngradeIPIdentifiedWarnings="yes" *) module axi_infrastructure_v1_1_axi2vector # ( /////////////////////////////////////////////////////////////////////////////// // Parameter Definitions /////////////////////////////////////////////////////////////////////////////// parameter integer C_AXI_PROTOCOL = 0, parameter integer C_AXI_ID_WIDTH = 4, parameter integer C_AXI_ADDR_WIDTH = 32, parameter integer C_AXI_DATA_WIDTH = 32, parameter integer C_AXI_SUPPORTS_USER_SIGNALS = 0, parameter integer C_AXI_SUPPORTS_REGION_SIGNALS = 0, parameter integer C_AXI_AWUSER_WIDTH = 1, parameter integer C_AXI_WUSER_WIDTH = 1, parameter integer C_AXI_BUSER_WIDTH = 1, parameter integer C_AXI_ARUSER_WIDTH = 1, parameter integer C_AXI_RUSER_WIDTH = 1, parameter integer C_AWPAYLOAD_WIDTH = 61, parameter integer C_WPAYLOAD_WIDTH = 73, parameter integer C_BPAYLOAD_WIDTH = 6, parameter integer C_ARPAYLOAD_WIDTH = 61, parameter integer C_RPAYLOAD_WIDTH = 69 ) ( /////////////////////////////////////////////////////////////////////////////// // Port Declarations /////////////////////////////////////////////////////////////////////////////// // Slave Interface Write Address Ports input wire [C_AXI_ID_WIDTH-1:0] s_axi_awid, input wire [C_AXI_ADDR_WIDTH-1:0] s_axi_awaddr, input wire [((C_AXI_PROTOCOL == 1) ? 4 : 8)-1:0] s_axi_awlen, input wire [3-1:0] s_axi_awsize, input wire [2-1:0] s_axi_awburst, input wire [((C_AXI_PROTOCOL == 1) ? 2 : 1)-1:0] s_axi_awlock, input wire [4-1:0] s_axi_awcache, input wire [3-1:0] s_axi_awprot, input wire [4-1:0] s_axi_awregion, input wire [4-1:0] s_axi_awqos, input wire [C_AXI_AWUSER_WIDTH-1:0] s_axi_awuser, // Slave Interface Write Data Ports input wire [C_AXI_ID_WIDTH-1:0] s_axi_wid, input wire [C_AXI_DATA_WIDTH-1:0] s_axi_wdata, input wire [C_AXI_DATA_WIDTH/8-1:0] s_axi_wstrb, input wire s_axi_wlast, input wire [C_AXI_WUSER_WIDTH-1:0] s_axi_wuser, // Slave Interface Write Response Ports output wire [C_AXI_ID_WIDTH-1:0] s_axi_bid, output wire [2-1:0] s_axi_bresp, output wire [C_AXI_BUSER_WIDTH-1:0] s_axi_buser, // Slave Interface Read Address Ports input wire [C_AXI_ID_WIDTH-1:0] s_axi_arid, input wire [C_AXI_ADDR_WIDTH-1:0] s_axi_araddr, input wire [((C_AXI_PROTOCOL == 1) ? 4 : 8)-1:0] s_axi_arlen, input wire [3-1:0] s_axi_arsize, input wire [2-1:0] s_axi_arburst, input wire [((C_AXI_PROTOCOL == 1) ? 2 : 1)-1:0] s_axi_arlock, input wire [4-1:0] s_axi_arcache, input wire [3-1:0] s_axi_arprot, input wire [4-1:0] s_axi_arregion, input wire [4-1:0] s_axi_arqos, input wire [C_AXI_ARUSER_WIDTH-1:0] s_axi_aruser, // Slave Interface Read Data Ports output wire [C_AXI_ID_WIDTH-1:0] s_axi_rid, output wire [C_AXI_DATA_WIDTH-1:0] s_axi_rdata, output wire [2-1:0] s_axi_rresp, output wire s_axi_rlast, output wire [C_AXI_RUSER_WIDTH-1:0] s_axi_ruser, // payloads output wire [C_AWPAYLOAD_WIDTH-1:0] s_awpayload, output wire [C_WPAYLOAD_WIDTH-1:0] s_wpayload, input wire [C_BPAYLOAD_WIDTH-1:0] s_bpayload, output wire [C_ARPAYLOAD_WIDTH-1:0] s_arpayload, input wire [C_RPAYLOAD_WIDTH-1:0] s_rpayload ); //////////////////////////////////////////////////////////////////////////////// // Functions //////////////////////////////////////////////////////////////////////////////// `include "axi_infrastructure_v1_1_header.vh" //////////////////////////////////////////////////////////////////////////////// // Local parameters //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // Wires/Reg declarations //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // BEGIN RTL //////////////////////////////////////////////////////////////////////////////// // AXI4, AXI4LITE, AXI3 packing assign s_awpayload[G_AXI_AWADDR_INDEX+:G_AXI_AWADDR_WIDTH] = s_axi_awaddr; assign s_awpayload[G_AXI_AWPROT_INDEX+:G_AXI_AWPROT_WIDTH] = s_axi_awprot; assign s_wpayload[G_AXI_WDATA_INDEX+:G_AXI_WDATA_WIDTH] = s_axi_wdata; assign s_wpayload[G_AXI_WSTRB_INDEX+:G_AXI_WSTRB_WIDTH] = s_axi_wstrb; assign s_axi_bresp = s_bpayload[G_AXI_BRESP_INDEX+:G_AXI_BRESP_WIDTH]; assign s_arpayload[G_AXI_ARADDR_INDEX+:G_AXI_ARADDR_WIDTH] = s_axi_araddr; assign s_arpayload[G_AXI_ARPROT_INDEX+:G_AXI_ARPROT_WIDTH] = s_axi_arprot; assign s_axi_rdata = s_rpayload[G_AXI_RDATA_INDEX+:G_AXI_RDATA_WIDTH]; assign s_axi_rresp = s_rpayload[G_AXI_RRESP_INDEX+:G_AXI_RRESP_WIDTH]; generate if (C_AXI_PROTOCOL == 0 || C_AXI_PROTOCOL == 1) begin : gen_axi4_or_axi3_packing assign s_awpayload[G_AXI_AWSIZE_INDEX+:G_AXI_AWSIZE_WIDTH] = s_axi_awsize; assign s_awpayload[G_AXI_AWBURST_INDEX+:G_AXI_AWBURST_WIDTH] = s_axi_awburst; assign s_awpayload[G_AXI_AWCACHE_INDEX+:G_AXI_AWCACHE_WIDTH] = s_axi_awcache; assign s_awpayload[G_AXI_AWLEN_INDEX+:G_AXI_AWLEN_WIDTH] = s_axi_awlen; assign s_awpayload[G_AXI_AWLOCK_INDEX+:G_AXI_AWLOCK_WIDTH] = s_axi_awlock; assign s_awpayload[G_AXI_AWID_INDEX+:G_AXI_AWID_WIDTH] = s_axi_awid; assign s_awpayload[G_AXI_AWQOS_INDEX+:G_AXI_AWQOS_WIDTH] = s_axi_awqos; assign s_wpayload[G_AXI_WLAST_INDEX+:G_AXI_WLAST_WIDTH] = s_axi_wlast; if (C_AXI_PROTOCOL == 1) begin : gen_axi3_wid_packing assign s_wpayload[G_AXI_WID_INDEX+:G_AXI_WID_WIDTH] = s_axi_wid; end else begin : gen_no_axi3_wid_packing end assign s_axi_bid = s_bpayload[G_AXI_BID_INDEX+:G_AXI_BID_WIDTH]; assign s_arpayload[G_AXI_ARSIZE_INDEX+:G_AXI_ARSIZE_WIDTH] = s_axi_arsize; assign s_arpayload[G_AXI_ARBURST_INDEX+:G_AXI_ARBURST_WIDTH] = s_axi_arburst; assign s_arpayload[G_AXI_ARCACHE_INDEX+:G_AXI_ARCACHE_WIDTH] = s_axi_arcache; assign s_arpayload[G_AXI_ARLEN_INDEX+:G_AXI_ARLEN_WIDTH] = s_axi_arlen; assign s_arpayload[G_AXI_ARLOCK_INDEX+:G_AXI_ARLOCK_WIDTH] = s_axi_arlock; assign s_arpayload[G_AXI_ARID_INDEX+:G_AXI_ARID_WIDTH] = s_axi_arid; assign s_arpayload[G_AXI_ARQOS_INDEX+:G_AXI_ARQOS_WIDTH] = s_axi_arqos; assign s_axi_rlast = s_rpayload[G_AXI_RLAST_INDEX+:G_AXI_RLAST_WIDTH]; assign s_axi_rid = s_rpayload[G_AXI_RID_INDEX+:G_AXI_RID_WIDTH]; if (C_AXI_SUPPORTS_REGION_SIGNALS == 1 && G_AXI_AWREGION_WIDTH > 0) begin : gen_region_signals assign s_awpayload[G_AXI_AWREGION_INDEX+:G_AXI_AWREGION_WIDTH] = s_axi_awregion; assign s_arpayload[G_AXI_ARREGION_INDEX+:G_AXI_ARREGION_WIDTH] = s_axi_arregion; end else begin : gen_no_region_signals end if (C_AXI_SUPPORTS_USER_SIGNALS == 1 && C_AXI_PROTOCOL != 2) begin : gen_user_signals assign s_awpayload[G_AXI_AWUSER_INDEX+:G_AXI_AWUSER_WIDTH] = s_axi_awuser; assign s_wpayload[G_AXI_WUSER_INDEX+:G_AXI_WUSER_WIDTH] = s_axi_wuser; assign s_axi_buser = s_bpayload[G_AXI_BUSER_INDEX+:G_AXI_BUSER_WIDTH]; assign s_arpayload[G_AXI_ARUSER_INDEX+:G_AXI_ARUSER_WIDTH] = s_axi_aruser; assign s_axi_ruser = s_rpayload[G_AXI_RUSER_INDEX+:G_AXI_RUSER_WIDTH]; end else begin : gen_no_user_signals assign s_axi_buser = 'b0; assign s_axi_ruser = 'b0; end end else begin : gen_axi4lite_packing assign s_axi_bid = 'b0; assign s_axi_buser = 'b0; assign s_axi_rlast = 1'b1; assign s_axi_rid = 'b0; assign s_axi_ruser = 'b0; end endgenerate endmodule `default_nettype wire
/* * PS2 Mouse Interface * Copyright (C) 2010 Donna Polehn <[email protected]> * * This file is part of the Zet processor. This processor is free * hardware; you can redistribute it and/or modify it under the terms of * the GNU General Public License as published by the Free Software * Foundation; either version 3, or (at your option) any later version. * * Zet is distrubuted in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public * License for more details. * * You should have received a copy of the GNU General Public License * along with Zet; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. */ module ps2_mouse ( input clk, // Clock Input input reset, // Reset Input inout ps2_clk, // PS2 Clock, Bidirectional inout ps2_dat, // PS2 Data, Bidirectional input [7:0] the_command, // Command to send to mouse input send_command, // Signal to send output command_was_sent, // Signal command finished sending output error_communication_timed_out, output [7:0] received_data, // Received data output received_data_en, // If 1 - new data has been received output start_receiving_data, output wait_for_incoming_data ); // -------------------------------------------------------------------- // Internal wires and registers Declarations // -------------------------------------------------------------------- wire ps2_clk_posedge; // Internal Wires wire ps2_clk_negedge; reg [7:0] idle_counter; // Internal Registers reg ps2_clk_reg; reg ps2_data_reg; reg last_ps2_clk; reg [2:0] ns_ps2_transceiver; // State Machine Registers reg [2:0] s_ps2_transceiver; // -------------------------------------------------------------------- // Constant Declarations // -------------------------------------------------------------------- localparam PS2_STATE_0_IDLE = 3'h0, // states PS2_STATE_1_DATA_IN = 3'h1, PS2_STATE_2_COMMAND_OUT = 3'h2, PS2_STATE_3_END_TRANSFER = 3'h3, PS2_STATE_4_END_DELAYED = 3'h4; // -------------------------------------------------------------------- // Finite State Machine(s) // -------------------------------------------------------------------- always @(posedge clk) begin if(reset == 1'b1) s_ps2_transceiver <= PS2_STATE_0_IDLE; else s_ps2_transceiver <= ns_ps2_transceiver; end always @(*) begin ns_ps2_transceiver = PS2_STATE_0_IDLE; // Defaults case (s_ps2_transceiver) PS2_STATE_0_IDLE: begin if((idle_counter == 8'hFF) && (send_command == 1'b1)) ns_ps2_transceiver = PS2_STATE_2_COMMAND_OUT; else if ((ps2_data_reg == 1'b0) && (ps2_clk_posedge == 1'b1)) ns_ps2_transceiver = PS2_STATE_1_DATA_IN; else ns_ps2_transceiver = PS2_STATE_0_IDLE; end PS2_STATE_1_DATA_IN: begin // if((received_data_en == 1'b1) && (ps2_clk_posedge == 1'b1)) if((received_data_en == 1'b1)) ns_ps2_transceiver = PS2_STATE_0_IDLE; else ns_ps2_transceiver = PS2_STATE_1_DATA_IN; end PS2_STATE_2_COMMAND_OUT: begin if((command_was_sent == 1'b1) || (error_communication_timed_out == 1'b1)) ns_ps2_transceiver = PS2_STATE_3_END_TRANSFER; else ns_ps2_transceiver = PS2_STATE_2_COMMAND_OUT; end PS2_STATE_3_END_TRANSFER: begin if(send_command == 1'b0) ns_ps2_transceiver = PS2_STATE_0_IDLE; else if((ps2_data_reg == 1'b0) && (ps2_clk_posedge == 1'b1)) ns_ps2_transceiver = PS2_STATE_4_END_DELAYED; else ns_ps2_transceiver = PS2_STATE_3_END_TRANSFER; end PS2_STATE_4_END_DELAYED: begin if(received_data_en == 1'b1) begin if(send_command == 1'b0) ns_ps2_transceiver = PS2_STATE_0_IDLE; else ns_ps2_transceiver = PS2_STATE_3_END_TRANSFER; end else ns_ps2_transceiver = PS2_STATE_4_END_DELAYED; end default: ns_ps2_transceiver = PS2_STATE_0_IDLE; endcase end // -------------------------------------------------------------------- // Sequential logic // -------------------------------------------------------------------- always @(posedge clk) begin if(reset == 1'b1) begin last_ps2_clk <= 1'b1; ps2_clk_reg <= 1'b1; ps2_data_reg <= 1'b1; end else begin last_ps2_clk <= ps2_clk_reg; ps2_clk_reg <= ps2_clk; ps2_data_reg <= ps2_dat; end end always @(posedge clk) begin if(reset == 1'b1) idle_counter <= 6'h00; else if((s_ps2_transceiver == PS2_STATE_0_IDLE) && (idle_counter != 8'hFF)) idle_counter <= idle_counter + 6'h01; else if (s_ps2_transceiver != PS2_STATE_0_IDLE) idle_counter <= 6'h00; end // -------------------------------------------------------------------- // Combinational logic // -------------------------------------------------------------------- assign ps2_clk_posedge = ((ps2_clk_reg == 1'b1) && (last_ps2_clk == 1'b0)) ? 1'b1 : 1'b0; assign ps2_clk_negedge = ((ps2_clk_reg == 1'b0) && (last_ps2_clk == 1'b1)) ? 1'b1 : 1'b0; assign start_receiving_data = (s_ps2_transceiver == PS2_STATE_1_DATA_IN); assign wait_for_incoming_data = (s_ps2_transceiver == PS2_STATE_3_END_TRANSFER); // -------------------------------------------------------------------- // Internal Modules // -------------------------------------------------------------------- ps2_mouse_cmdout mouse_cmdout ( .clk (clk), // Inputs .reset (reset), .the_command (the_command), .send_command (send_command), .ps2_clk_posedge (ps2_clk_posedge), .ps2_clk_negedge (ps2_clk_negedge), .ps2_clk (ps2_clk), // Bidirectionals .ps2_dat (ps2_dat), .command_was_sent (command_was_sent), // Outputs .error_communication_timed_out (error_communication_timed_out) ); ps2_mouse_datain mouse_datain ( .clk (clk), // Inputs .reset (reset), .wait_for_incoming_data (wait_for_incoming_data), .start_receiving_data (start_receiving_data), .ps2_clk_posedge (ps2_clk_posedge), .ps2_clk_negedge (ps2_clk_negedge), .ps2_data (ps2_data_reg), .received_data (received_data), // Outputs .received_data_en (received_data_en) ); endmodule
/* * PS2 Mouse Interface * Copyright (C) 2010 Donna Polehn <[email protected]> * * This file is part of the Zet processor. This processor is free * hardware; you can redistribute it and/or modify it under the terms of * the GNU General Public License as published by the Free Software * Foundation; either version 3, or (at your option) any later version. * * Zet is distrubuted in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public * License for more details. * * You should have received a copy of the GNU General Public License * along with Zet; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. */ module ps2_mouse ( input clk, // Clock Input input reset, // Reset Input inout ps2_clk, // PS2 Clock, Bidirectional inout ps2_dat, // PS2 Data, Bidirectional input [7:0] the_command, // Command to send to mouse input send_command, // Signal to send output command_was_sent, // Signal command finished sending output error_communication_timed_out, output [7:0] received_data, // Received data output received_data_en, // If 1 - new data has been received output start_receiving_data, output wait_for_incoming_data ); // -------------------------------------------------------------------- // Internal wires and registers Declarations // -------------------------------------------------------------------- wire ps2_clk_posedge; // Internal Wires wire ps2_clk_negedge; reg [7:0] idle_counter; // Internal Registers reg ps2_clk_reg; reg ps2_data_reg; reg last_ps2_clk; reg [2:0] ns_ps2_transceiver; // State Machine Registers reg [2:0] s_ps2_transceiver; // -------------------------------------------------------------------- // Constant Declarations // -------------------------------------------------------------------- localparam PS2_STATE_0_IDLE = 3'h0, // states PS2_STATE_1_DATA_IN = 3'h1, PS2_STATE_2_COMMAND_OUT = 3'h2, PS2_STATE_3_END_TRANSFER = 3'h3, PS2_STATE_4_END_DELAYED = 3'h4; // -------------------------------------------------------------------- // Finite State Machine(s) // -------------------------------------------------------------------- always @(posedge clk) begin if(reset == 1'b1) s_ps2_transceiver <= PS2_STATE_0_IDLE; else s_ps2_transceiver <= ns_ps2_transceiver; end always @(*) begin ns_ps2_transceiver = PS2_STATE_0_IDLE; // Defaults case (s_ps2_transceiver) PS2_STATE_0_IDLE: begin if((idle_counter == 8'hFF) && (send_command == 1'b1)) ns_ps2_transceiver = PS2_STATE_2_COMMAND_OUT; else if ((ps2_data_reg == 1'b0) && (ps2_clk_posedge == 1'b1)) ns_ps2_transceiver = PS2_STATE_1_DATA_IN; else ns_ps2_transceiver = PS2_STATE_0_IDLE; end PS2_STATE_1_DATA_IN: begin // if((received_data_en == 1'b1) && (ps2_clk_posedge == 1'b1)) if((received_data_en == 1'b1)) ns_ps2_transceiver = PS2_STATE_0_IDLE; else ns_ps2_transceiver = PS2_STATE_1_DATA_IN; end PS2_STATE_2_COMMAND_OUT: begin if((command_was_sent == 1'b1) || (error_communication_timed_out == 1'b1)) ns_ps2_transceiver = PS2_STATE_3_END_TRANSFER; else ns_ps2_transceiver = PS2_STATE_2_COMMAND_OUT; end PS2_STATE_3_END_TRANSFER: begin if(send_command == 1'b0) ns_ps2_transceiver = PS2_STATE_0_IDLE; else if((ps2_data_reg == 1'b0) && (ps2_clk_posedge == 1'b1)) ns_ps2_transceiver = PS2_STATE_4_END_DELAYED; else ns_ps2_transceiver = PS2_STATE_3_END_TRANSFER; end PS2_STATE_4_END_DELAYED: begin if(received_data_en == 1'b1) begin if(send_command == 1'b0) ns_ps2_transceiver = PS2_STATE_0_IDLE; else ns_ps2_transceiver = PS2_STATE_3_END_TRANSFER; end else ns_ps2_transceiver = PS2_STATE_4_END_DELAYED; end default: ns_ps2_transceiver = PS2_STATE_0_IDLE; endcase end // -------------------------------------------------------------------- // Sequential logic // -------------------------------------------------------------------- always @(posedge clk) begin if(reset == 1'b1) begin last_ps2_clk <= 1'b1; ps2_clk_reg <= 1'b1; ps2_data_reg <= 1'b1; end else begin last_ps2_clk <= ps2_clk_reg; ps2_clk_reg <= ps2_clk; ps2_data_reg <= ps2_dat; end end always @(posedge clk) begin if(reset == 1'b1) idle_counter <= 6'h00; else if((s_ps2_transceiver == PS2_STATE_0_IDLE) && (idle_counter != 8'hFF)) idle_counter <= idle_counter + 6'h01; else if (s_ps2_transceiver != PS2_STATE_0_IDLE) idle_counter <= 6'h00; end // -------------------------------------------------------------------- // Combinational logic // -------------------------------------------------------------------- assign ps2_clk_posedge = ((ps2_clk_reg == 1'b1) && (last_ps2_clk == 1'b0)) ? 1'b1 : 1'b0; assign ps2_clk_negedge = ((ps2_clk_reg == 1'b0) && (last_ps2_clk == 1'b1)) ? 1'b1 : 1'b0; assign start_receiving_data = (s_ps2_transceiver == PS2_STATE_1_DATA_IN); assign wait_for_incoming_data = (s_ps2_transceiver == PS2_STATE_3_END_TRANSFER); // -------------------------------------------------------------------- // Internal Modules // -------------------------------------------------------------------- ps2_mouse_cmdout mouse_cmdout ( .clk (clk), // Inputs .reset (reset), .the_command (the_command), .send_command (send_command), .ps2_clk_posedge (ps2_clk_posedge), .ps2_clk_negedge (ps2_clk_negedge), .ps2_clk (ps2_clk), // Bidirectionals .ps2_dat (ps2_dat), .command_was_sent (command_was_sent), // Outputs .error_communication_timed_out (error_communication_timed_out) ); ps2_mouse_datain mouse_datain ( .clk (clk), // Inputs .reset (reset), .wait_for_incoming_data (wait_for_incoming_data), .start_receiving_data (start_receiving_data), .ps2_clk_posedge (ps2_clk_posedge), .ps2_clk_negedge (ps2_clk_negedge), .ps2_data (ps2_data_reg), .received_data (received_data), // Outputs .received_data_en (received_data_en) ); endmodule
/* * PS2 Mouse Interface * Copyright (C) 2010 Donna Polehn <[email protected]> * * This file is part of the Zet processor. This processor is free * hardware; you can redistribute it and/or modify it under the terms of * the GNU General Public License as published by the Free Software * Foundation; either version 3, or (at your option) any later version. * * Zet is distrubuted in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public * License for more details. * * You should have received a copy of the GNU General Public License * along with Zet; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. */ module ps2_mouse ( input clk, // Clock Input input reset, // Reset Input inout ps2_clk, // PS2 Clock, Bidirectional inout ps2_dat, // PS2 Data, Bidirectional input [7:0] the_command, // Command to send to mouse input send_command, // Signal to send output command_was_sent, // Signal command finished sending output error_communication_timed_out, output [7:0] received_data, // Received data output received_data_en, // If 1 - new data has been received output start_receiving_data, output wait_for_incoming_data ); // -------------------------------------------------------------------- // Internal wires and registers Declarations // -------------------------------------------------------------------- wire ps2_clk_posedge; // Internal Wires wire ps2_clk_negedge; reg [7:0] idle_counter; // Internal Registers reg ps2_clk_reg; reg ps2_data_reg; reg last_ps2_clk; reg [2:0] ns_ps2_transceiver; // State Machine Registers reg [2:0] s_ps2_transceiver; // -------------------------------------------------------------------- // Constant Declarations // -------------------------------------------------------------------- localparam PS2_STATE_0_IDLE = 3'h0, // states PS2_STATE_1_DATA_IN = 3'h1, PS2_STATE_2_COMMAND_OUT = 3'h2, PS2_STATE_3_END_TRANSFER = 3'h3, PS2_STATE_4_END_DELAYED = 3'h4; // -------------------------------------------------------------------- // Finite State Machine(s) // -------------------------------------------------------------------- always @(posedge clk) begin if(reset == 1'b1) s_ps2_transceiver <= PS2_STATE_0_IDLE; else s_ps2_transceiver <= ns_ps2_transceiver; end always @(*) begin ns_ps2_transceiver = PS2_STATE_0_IDLE; // Defaults case (s_ps2_transceiver) PS2_STATE_0_IDLE: begin if((idle_counter == 8'hFF) && (send_command == 1'b1)) ns_ps2_transceiver = PS2_STATE_2_COMMAND_OUT; else if ((ps2_data_reg == 1'b0) && (ps2_clk_posedge == 1'b1)) ns_ps2_transceiver = PS2_STATE_1_DATA_IN; else ns_ps2_transceiver = PS2_STATE_0_IDLE; end PS2_STATE_1_DATA_IN: begin // if((received_data_en == 1'b1) && (ps2_clk_posedge == 1'b1)) if((received_data_en == 1'b1)) ns_ps2_transceiver = PS2_STATE_0_IDLE; else ns_ps2_transceiver = PS2_STATE_1_DATA_IN; end PS2_STATE_2_COMMAND_OUT: begin if((command_was_sent == 1'b1) || (error_communication_timed_out == 1'b1)) ns_ps2_transceiver = PS2_STATE_3_END_TRANSFER; else ns_ps2_transceiver = PS2_STATE_2_COMMAND_OUT; end PS2_STATE_3_END_TRANSFER: begin if(send_command == 1'b0) ns_ps2_transceiver = PS2_STATE_0_IDLE; else if((ps2_data_reg == 1'b0) && (ps2_clk_posedge == 1'b1)) ns_ps2_transceiver = PS2_STATE_4_END_DELAYED; else ns_ps2_transceiver = PS2_STATE_3_END_TRANSFER; end PS2_STATE_4_END_DELAYED: begin if(received_data_en == 1'b1) begin if(send_command == 1'b0) ns_ps2_transceiver = PS2_STATE_0_IDLE; else ns_ps2_transceiver = PS2_STATE_3_END_TRANSFER; end else ns_ps2_transceiver = PS2_STATE_4_END_DELAYED; end default: ns_ps2_transceiver = PS2_STATE_0_IDLE; endcase end // -------------------------------------------------------------------- // Sequential logic // -------------------------------------------------------------------- always @(posedge clk) begin if(reset == 1'b1) begin last_ps2_clk <= 1'b1; ps2_clk_reg <= 1'b1; ps2_data_reg <= 1'b1; end else begin last_ps2_clk <= ps2_clk_reg; ps2_clk_reg <= ps2_clk; ps2_data_reg <= ps2_dat; end end always @(posedge clk) begin if(reset == 1'b1) idle_counter <= 6'h00; else if((s_ps2_transceiver == PS2_STATE_0_IDLE) && (idle_counter != 8'hFF)) idle_counter <= idle_counter + 6'h01; else if (s_ps2_transceiver != PS2_STATE_0_IDLE) idle_counter <= 6'h00; end // -------------------------------------------------------------------- // Combinational logic // -------------------------------------------------------------------- assign ps2_clk_posedge = ((ps2_clk_reg == 1'b1) && (last_ps2_clk == 1'b0)) ? 1'b1 : 1'b0; assign ps2_clk_negedge = ((ps2_clk_reg == 1'b0) && (last_ps2_clk == 1'b1)) ? 1'b1 : 1'b0; assign start_receiving_data = (s_ps2_transceiver == PS2_STATE_1_DATA_IN); assign wait_for_incoming_data = (s_ps2_transceiver == PS2_STATE_3_END_TRANSFER); // -------------------------------------------------------------------- // Internal Modules // -------------------------------------------------------------------- ps2_mouse_cmdout mouse_cmdout ( .clk (clk), // Inputs .reset (reset), .the_command (the_command), .send_command (send_command), .ps2_clk_posedge (ps2_clk_posedge), .ps2_clk_negedge (ps2_clk_negedge), .ps2_clk (ps2_clk), // Bidirectionals .ps2_dat (ps2_dat), .command_was_sent (command_was_sent), // Outputs .error_communication_timed_out (error_communication_timed_out) ); ps2_mouse_datain mouse_datain ( .clk (clk), // Inputs .reset (reset), .wait_for_incoming_data (wait_for_incoming_data), .start_receiving_data (start_receiving_data), .ps2_clk_posedge (ps2_clk_posedge), .ps2_clk_negedge (ps2_clk_negedge), .ps2_data (ps2_data_reg), .received_data (received_data), // Outputs .received_data_en (received_data_en) ); endmodule
/* * PS2 Mouse Interface * Copyright (C) 2010 Donna Polehn <[email protected]> * * This file is part of the Zet processor. This processor is free * hardware; you can redistribute it and/or modify it under the terms of * the GNU General Public License as published by the Free Software * Foundation; either version 3, or (at your option) any later version. * * Zet is distrubuted in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public * License for more details. * * You should have received a copy of the GNU General Public License * along with Zet; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. */ module ps2_mouse ( input clk, // Clock Input input reset, // Reset Input inout ps2_clk, // PS2 Clock, Bidirectional inout ps2_dat, // PS2 Data, Bidirectional input [7:0] the_command, // Command to send to mouse input send_command, // Signal to send output command_was_sent, // Signal command finished sending output error_communication_timed_out, output [7:0] received_data, // Received data output received_data_en, // If 1 - new data has been received output start_receiving_data, output wait_for_incoming_data ); // -------------------------------------------------------------------- // Internal wires and registers Declarations // -------------------------------------------------------------------- wire ps2_clk_posedge; // Internal Wires wire ps2_clk_negedge; reg [7:0] idle_counter; // Internal Registers reg ps2_clk_reg; reg ps2_data_reg; reg last_ps2_clk; reg [2:0] ns_ps2_transceiver; // State Machine Registers reg [2:0] s_ps2_transceiver; // -------------------------------------------------------------------- // Constant Declarations // -------------------------------------------------------------------- localparam PS2_STATE_0_IDLE = 3'h0, // states PS2_STATE_1_DATA_IN = 3'h1, PS2_STATE_2_COMMAND_OUT = 3'h2, PS2_STATE_3_END_TRANSFER = 3'h3, PS2_STATE_4_END_DELAYED = 3'h4; // -------------------------------------------------------------------- // Finite State Machine(s) // -------------------------------------------------------------------- always @(posedge clk) begin if(reset == 1'b1) s_ps2_transceiver <= PS2_STATE_0_IDLE; else s_ps2_transceiver <= ns_ps2_transceiver; end always @(*) begin ns_ps2_transceiver = PS2_STATE_0_IDLE; // Defaults case (s_ps2_transceiver) PS2_STATE_0_IDLE: begin if((idle_counter == 8'hFF) && (send_command == 1'b1)) ns_ps2_transceiver = PS2_STATE_2_COMMAND_OUT; else if ((ps2_data_reg == 1'b0) && (ps2_clk_posedge == 1'b1)) ns_ps2_transceiver = PS2_STATE_1_DATA_IN; else ns_ps2_transceiver = PS2_STATE_0_IDLE; end PS2_STATE_1_DATA_IN: begin // if((received_data_en == 1'b1) && (ps2_clk_posedge == 1'b1)) if((received_data_en == 1'b1)) ns_ps2_transceiver = PS2_STATE_0_IDLE; else ns_ps2_transceiver = PS2_STATE_1_DATA_IN; end PS2_STATE_2_COMMAND_OUT: begin if((command_was_sent == 1'b1) || (error_communication_timed_out == 1'b1)) ns_ps2_transceiver = PS2_STATE_3_END_TRANSFER; else ns_ps2_transceiver = PS2_STATE_2_COMMAND_OUT; end PS2_STATE_3_END_TRANSFER: begin if(send_command == 1'b0) ns_ps2_transceiver = PS2_STATE_0_IDLE; else if((ps2_data_reg == 1'b0) && (ps2_clk_posedge == 1'b1)) ns_ps2_transceiver = PS2_STATE_4_END_DELAYED; else ns_ps2_transceiver = PS2_STATE_3_END_TRANSFER; end PS2_STATE_4_END_DELAYED: begin if(received_data_en == 1'b1) begin if(send_command == 1'b0) ns_ps2_transceiver = PS2_STATE_0_IDLE; else ns_ps2_transceiver = PS2_STATE_3_END_TRANSFER; end else ns_ps2_transceiver = PS2_STATE_4_END_DELAYED; end default: ns_ps2_transceiver = PS2_STATE_0_IDLE; endcase end // -------------------------------------------------------------------- // Sequential logic // -------------------------------------------------------------------- always @(posedge clk) begin if(reset == 1'b1) begin last_ps2_clk <= 1'b1; ps2_clk_reg <= 1'b1; ps2_data_reg <= 1'b1; end else begin last_ps2_clk <= ps2_clk_reg; ps2_clk_reg <= ps2_clk; ps2_data_reg <= ps2_dat; end end always @(posedge clk) begin if(reset == 1'b1) idle_counter <= 6'h00; else if((s_ps2_transceiver == PS2_STATE_0_IDLE) && (idle_counter != 8'hFF)) idle_counter <= idle_counter + 6'h01; else if (s_ps2_transceiver != PS2_STATE_0_IDLE) idle_counter <= 6'h00; end // -------------------------------------------------------------------- // Combinational logic // -------------------------------------------------------------------- assign ps2_clk_posedge = ((ps2_clk_reg == 1'b1) && (last_ps2_clk == 1'b0)) ? 1'b1 : 1'b0; assign ps2_clk_negedge = ((ps2_clk_reg == 1'b0) && (last_ps2_clk == 1'b1)) ? 1'b1 : 1'b0; assign start_receiving_data = (s_ps2_transceiver == PS2_STATE_1_DATA_IN); assign wait_for_incoming_data = (s_ps2_transceiver == PS2_STATE_3_END_TRANSFER); // -------------------------------------------------------------------- // Internal Modules // -------------------------------------------------------------------- ps2_mouse_cmdout mouse_cmdout ( .clk (clk), // Inputs .reset (reset), .the_command (the_command), .send_command (send_command), .ps2_clk_posedge (ps2_clk_posedge), .ps2_clk_negedge (ps2_clk_negedge), .ps2_clk (ps2_clk), // Bidirectionals .ps2_dat (ps2_dat), .command_was_sent (command_was_sent), // Outputs .error_communication_timed_out (error_communication_timed_out) ); ps2_mouse_datain mouse_datain ( .clk (clk), // Inputs .reset (reset), .wait_for_incoming_data (wait_for_incoming_data), .start_receiving_data (start_receiving_data), .ps2_clk_posedge (ps2_clk_posedge), .ps2_clk_negedge (ps2_clk_negedge), .ps2_data (ps2_data_reg), .received_data (received_data), // Outputs .received_data_en (received_data_en) ); endmodule
/* * PS2 Mouse Interface * Copyright (C) 2010 Donna Polehn <[email protected]> * * This file is part of the Zet processor. This processor is free * hardware; you can redistribute it and/or modify it under the terms of * the GNU General Public License as published by the Free Software * Foundation; either version 3, or (at your option) any later version. * * Zet is distrubuted in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public * License for more details. * * You should have received a copy of the GNU General Public License * along with Zet; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. */ module ps2_mouse ( input clk, // Clock Input input reset, // Reset Input inout ps2_clk, // PS2 Clock, Bidirectional inout ps2_dat, // PS2 Data, Bidirectional input [7:0] the_command, // Command to send to mouse input send_command, // Signal to send output command_was_sent, // Signal command finished sending output error_communication_timed_out, output [7:0] received_data, // Received data output received_data_en, // If 1 - new data has been received output start_receiving_data, output wait_for_incoming_data ); // -------------------------------------------------------------------- // Internal wires and registers Declarations // -------------------------------------------------------------------- wire ps2_clk_posedge; // Internal Wires wire ps2_clk_negedge; reg [7:0] idle_counter; // Internal Registers reg ps2_clk_reg; reg ps2_data_reg; reg last_ps2_clk; reg [2:0] ns_ps2_transceiver; // State Machine Registers reg [2:0] s_ps2_transceiver; // -------------------------------------------------------------------- // Constant Declarations // -------------------------------------------------------------------- localparam PS2_STATE_0_IDLE = 3'h0, // states PS2_STATE_1_DATA_IN = 3'h1, PS2_STATE_2_COMMAND_OUT = 3'h2, PS2_STATE_3_END_TRANSFER = 3'h3, PS2_STATE_4_END_DELAYED = 3'h4; // -------------------------------------------------------------------- // Finite State Machine(s) // -------------------------------------------------------------------- always @(posedge clk) begin if(reset == 1'b1) s_ps2_transceiver <= PS2_STATE_0_IDLE; else s_ps2_transceiver <= ns_ps2_transceiver; end always @(*) begin ns_ps2_transceiver = PS2_STATE_0_IDLE; // Defaults case (s_ps2_transceiver) PS2_STATE_0_IDLE: begin if((idle_counter == 8'hFF) && (send_command == 1'b1)) ns_ps2_transceiver = PS2_STATE_2_COMMAND_OUT; else if ((ps2_data_reg == 1'b0) && (ps2_clk_posedge == 1'b1)) ns_ps2_transceiver = PS2_STATE_1_DATA_IN; else ns_ps2_transceiver = PS2_STATE_0_IDLE; end PS2_STATE_1_DATA_IN: begin // if((received_data_en == 1'b1) && (ps2_clk_posedge == 1'b1)) if((received_data_en == 1'b1)) ns_ps2_transceiver = PS2_STATE_0_IDLE; else ns_ps2_transceiver = PS2_STATE_1_DATA_IN; end PS2_STATE_2_COMMAND_OUT: begin if((command_was_sent == 1'b1) || (error_communication_timed_out == 1'b1)) ns_ps2_transceiver = PS2_STATE_3_END_TRANSFER; else ns_ps2_transceiver = PS2_STATE_2_COMMAND_OUT; end PS2_STATE_3_END_TRANSFER: begin if(send_command == 1'b0) ns_ps2_transceiver = PS2_STATE_0_IDLE; else if((ps2_data_reg == 1'b0) && (ps2_clk_posedge == 1'b1)) ns_ps2_transceiver = PS2_STATE_4_END_DELAYED; else ns_ps2_transceiver = PS2_STATE_3_END_TRANSFER; end PS2_STATE_4_END_DELAYED: begin if(received_data_en == 1'b1) begin if(send_command == 1'b0) ns_ps2_transceiver = PS2_STATE_0_IDLE; else ns_ps2_transceiver = PS2_STATE_3_END_TRANSFER; end else ns_ps2_transceiver = PS2_STATE_4_END_DELAYED; end default: ns_ps2_transceiver = PS2_STATE_0_IDLE; endcase end // -------------------------------------------------------------------- // Sequential logic // -------------------------------------------------------------------- always @(posedge clk) begin if(reset == 1'b1) begin last_ps2_clk <= 1'b1; ps2_clk_reg <= 1'b1; ps2_data_reg <= 1'b1; end else begin last_ps2_clk <= ps2_clk_reg; ps2_clk_reg <= ps2_clk; ps2_data_reg <= ps2_dat; end end always @(posedge clk) begin if(reset == 1'b1) idle_counter <= 6'h00; else if((s_ps2_transceiver == PS2_STATE_0_IDLE) && (idle_counter != 8'hFF)) idle_counter <= idle_counter + 6'h01; else if (s_ps2_transceiver != PS2_STATE_0_IDLE) idle_counter <= 6'h00; end // -------------------------------------------------------------------- // Combinational logic // -------------------------------------------------------------------- assign ps2_clk_posedge = ((ps2_clk_reg == 1'b1) && (last_ps2_clk == 1'b0)) ? 1'b1 : 1'b0; assign ps2_clk_negedge = ((ps2_clk_reg == 1'b0) && (last_ps2_clk == 1'b1)) ? 1'b1 : 1'b0; assign start_receiving_data = (s_ps2_transceiver == PS2_STATE_1_DATA_IN); assign wait_for_incoming_data = (s_ps2_transceiver == PS2_STATE_3_END_TRANSFER); // -------------------------------------------------------------------- // Internal Modules // -------------------------------------------------------------------- ps2_mouse_cmdout mouse_cmdout ( .clk (clk), // Inputs .reset (reset), .the_command (the_command), .send_command (send_command), .ps2_clk_posedge (ps2_clk_posedge), .ps2_clk_negedge (ps2_clk_negedge), .ps2_clk (ps2_clk), // Bidirectionals .ps2_dat (ps2_dat), .command_was_sent (command_was_sent), // Outputs .error_communication_timed_out (error_communication_timed_out) ); ps2_mouse_datain mouse_datain ( .clk (clk), // Inputs .reset (reset), .wait_for_incoming_data (wait_for_incoming_data), .start_receiving_data (start_receiving_data), .ps2_clk_posedge (ps2_clk_posedge), .ps2_clk_negedge (ps2_clk_negedge), .ps2_data (ps2_data_reg), .received_data (received_data), // Outputs .received_data_en (received_data_en) ); endmodule
/* * PS2 Mouse Interface * Copyright (C) 2010 Donna Polehn <[email protected]> * * This file is part of the Zet processor. This processor is free * hardware; you can redistribute it and/or modify it under the terms of * the GNU General Public License as published by the Free Software * Foundation; either version 3, or (at your option) any later version. * * Zet is distrubuted in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public * License for more details. * * You should have received a copy of the GNU General Public License * along with Zet; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. */ module ps2_mouse ( input clk, // Clock Input input reset, // Reset Input inout ps2_clk, // PS2 Clock, Bidirectional inout ps2_dat, // PS2 Data, Bidirectional input [7:0] the_command, // Command to send to mouse input send_command, // Signal to send output command_was_sent, // Signal command finished sending output error_communication_timed_out, output [7:0] received_data, // Received data output received_data_en, // If 1 - new data has been received output start_receiving_data, output wait_for_incoming_data ); // -------------------------------------------------------------------- // Internal wires and registers Declarations // -------------------------------------------------------------------- wire ps2_clk_posedge; // Internal Wires wire ps2_clk_negedge; reg [7:0] idle_counter; // Internal Registers reg ps2_clk_reg; reg ps2_data_reg; reg last_ps2_clk; reg [2:0] ns_ps2_transceiver; // State Machine Registers reg [2:0] s_ps2_transceiver; // -------------------------------------------------------------------- // Constant Declarations // -------------------------------------------------------------------- localparam PS2_STATE_0_IDLE = 3'h0, // states PS2_STATE_1_DATA_IN = 3'h1, PS2_STATE_2_COMMAND_OUT = 3'h2, PS2_STATE_3_END_TRANSFER = 3'h3, PS2_STATE_4_END_DELAYED = 3'h4; // -------------------------------------------------------------------- // Finite State Machine(s) // -------------------------------------------------------------------- always @(posedge clk) begin if(reset == 1'b1) s_ps2_transceiver <= PS2_STATE_0_IDLE; else s_ps2_transceiver <= ns_ps2_transceiver; end always @(*) begin ns_ps2_transceiver = PS2_STATE_0_IDLE; // Defaults case (s_ps2_transceiver) PS2_STATE_0_IDLE: begin if((idle_counter == 8'hFF) && (send_command == 1'b1)) ns_ps2_transceiver = PS2_STATE_2_COMMAND_OUT; else if ((ps2_data_reg == 1'b0) && (ps2_clk_posedge == 1'b1)) ns_ps2_transceiver = PS2_STATE_1_DATA_IN; else ns_ps2_transceiver = PS2_STATE_0_IDLE; end PS2_STATE_1_DATA_IN: begin // if((received_data_en == 1'b1) && (ps2_clk_posedge == 1'b1)) if((received_data_en == 1'b1)) ns_ps2_transceiver = PS2_STATE_0_IDLE; else ns_ps2_transceiver = PS2_STATE_1_DATA_IN; end PS2_STATE_2_COMMAND_OUT: begin if((command_was_sent == 1'b1) || (error_communication_timed_out == 1'b1)) ns_ps2_transceiver = PS2_STATE_3_END_TRANSFER; else ns_ps2_transceiver = PS2_STATE_2_COMMAND_OUT; end PS2_STATE_3_END_TRANSFER: begin if(send_command == 1'b0) ns_ps2_transceiver = PS2_STATE_0_IDLE; else if((ps2_data_reg == 1'b0) && (ps2_clk_posedge == 1'b1)) ns_ps2_transceiver = PS2_STATE_4_END_DELAYED; else ns_ps2_transceiver = PS2_STATE_3_END_TRANSFER; end PS2_STATE_4_END_DELAYED: begin if(received_data_en == 1'b1) begin if(send_command == 1'b0) ns_ps2_transceiver = PS2_STATE_0_IDLE; else ns_ps2_transceiver = PS2_STATE_3_END_TRANSFER; end else ns_ps2_transceiver = PS2_STATE_4_END_DELAYED; end default: ns_ps2_transceiver = PS2_STATE_0_IDLE; endcase end // -------------------------------------------------------------------- // Sequential logic // -------------------------------------------------------------------- always @(posedge clk) begin if(reset == 1'b1) begin last_ps2_clk <= 1'b1; ps2_clk_reg <= 1'b1; ps2_data_reg <= 1'b1; end else begin last_ps2_clk <= ps2_clk_reg; ps2_clk_reg <= ps2_clk; ps2_data_reg <= ps2_dat; end end always @(posedge clk) begin if(reset == 1'b1) idle_counter <= 6'h00; else if((s_ps2_transceiver == PS2_STATE_0_IDLE) && (idle_counter != 8'hFF)) idle_counter <= idle_counter + 6'h01; else if (s_ps2_transceiver != PS2_STATE_0_IDLE) idle_counter <= 6'h00; end // -------------------------------------------------------------------- // Combinational logic // -------------------------------------------------------------------- assign ps2_clk_posedge = ((ps2_clk_reg == 1'b1) && (last_ps2_clk == 1'b0)) ? 1'b1 : 1'b0; assign ps2_clk_negedge = ((ps2_clk_reg == 1'b0) && (last_ps2_clk == 1'b1)) ? 1'b1 : 1'b0; assign start_receiving_data = (s_ps2_transceiver == PS2_STATE_1_DATA_IN); assign wait_for_incoming_data = (s_ps2_transceiver == PS2_STATE_3_END_TRANSFER); // -------------------------------------------------------------------- // Internal Modules // -------------------------------------------------------------------- ps2_mouse_cmdout mouse_cmdout ( .clk (clk), // Inputs .reset (reset), .the_command (the_command), .send_command (send_command), .ps2_clk_posedge (ps2_clk_posedge), .ps2_clk_negedge (ps2_clk_negedge), .ps2_clk (ps2_clk), // Bidirectionals .ps2_dat (ps2_dat), .command_was_sent (command_was_sent), // Outputs .error_communication_timed_out (error_communication_timed_out) ); ps2_mouse_datain mouse_datain ( .clk (clk), // Inputs .reset (reset), .wait_for_incoming_data (wait_for_incoming_data), .start_receiving_data (start_receiving_data), .ps2_clk_posedge (ps2_clk_posedge), .ps2_clk_negedge (ps2_clk_negedge), .ps2_data (ps2_data_reg), .received_data (received_data), // Outputs .received_data_en (received_data_en) ); endmodule
/* * PS2 Mouse Interface * Copyright (C) 2010 Donna Polehn <[email protected]> * * This file is part of the Zet processor. This processor is free * hardware; you can redistribute it and/or modify it under the terms of * the GNU General Public License as published by the Free Software * Foundation; either version 3, or (at your option) any later version. * * Zet is distrubuted in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public * License for more details. * * You should have received a copy of the GNU General Public License * along with Zet; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. */ module ps2_mouse ( input clk, // Clock Input input reset, // Reset Input inout ps2_clk, // PS2 Clock, Bidirectional inout ps2_dat, // PS2 Data, Bidirectional input [7:0] the_command, // Command to send to mouse input send_command, // Signal to send output command_was_sent, // Signal command finished sending output error_communication_timed_out, output [7:0] received_data, // Received data output received_data_en, // If 1 - new data has been received output start_receiving_data, output wait_for_incoming_data ); // -------------------------------------------------------------------- // Internal wires and registers Declarations // -------------------------------------------------------------------- wire ps2_clk_posedge; // Internal Wires wire ps2_clk_negedge; reg [7:0] idle_counter; // Internal Registers reg ps2_clk_reg; reg ps2_data_reg; reg last_ps2_clk; reg [2:0] ns_ps2_transceiver; // State Machine Registers reg [2:0] s_ps2_transceiver; // -------------------------------------------------------------------- // Constant Declarations // -------------------------------------------------------------------- localparam PS2_STATE_0_IDLE = 3'h0, // states PS2_STATE_1_DATA_IN = 3'h1, PS2_STATE_2_COMMAND_OUT = 3'h2, PS2_STATE_3_END_TRANSFER = 3'h3, PS2_STATE_4_END_DELAYED = 3'h4; // -------------------------------------------------------------------- // Finite State Machine(s) // -------------------------------------------------------------------- always @(posedge clk) begin if(reset == 1'b1) s_ps2_transceiver <= PS2_STATE_0_IDLE; else s_ps2_transceiver <= ns_ps2_transceiver; end always @(*) begin ns_ps2_transceiver = PS2_STATE_0_IDLE; // Defaults case (s_ps2_transceiver) PS2_STATE_0_IDLE: begin if((idle_counter == 8'hFF) && (send_command == 1'b1)) ns_ps2_transceiver = PS2_STATE_2_COMMAND_OUT; else if ((ps2_data_reg == 1'b0) && (ps2_clk_posedge == 1'b1)) ns_ps2_transceiver = PS2_STATE_1_DATA_IN; else ns_ps2_transceiver = PS2_STATE_0_IDLE; end PS2_STATE_1_DATA_IN: begin // if((received_data_en == 1'b1) && (ps2_clk_posedge == 1'b1)) if((received_data_en == 1'b1)) ns_ps2_transceiver = PS2_STATE_0_IDLE; else ns_ps2_transceiver = PS2_STATE_1_DATA_IN; end PS2_STATE_2_COMMAND_OUT: begin if((command_was_sent == 1'b1) || (error_communication_timed_out == 1'b1)) ns_ps2_transceiver = PS2_STATE_3_END_TRANSFER; else ns_ps2_transceiver = PS2_STATE_2_COMMAND_OUT; end PS2_STATE_3_END_TRANSFER: begin if(send_command == 1'b0) ns_ps2_transceiver = PS2_STATE_0_IDLE; else if((ps2_data_reg == 1'b0) && (ps2_clk_posedge == 1'b1)) ns_ps2_transceiver = PS2_STATE_4_END_DELAYED; else ns_ps2_transceiver = PS2_STATE_3_END_TRANSFER; end PS2_STATE_4_END_DELAYED: begin if(received_data_en == 1'b1) begin if(send_command == 1'b0) ns_ps2_transceiver = PS2_STATE_0_IDLE; else ns_ps2_transceiver = PS2_STATE_3_END_TRANSFER; end else ns_ps2_transceiver = PS2_STATE_4_END_DELAYED; end default: ns_ps2_transceiver = PS2_STATE_0_IDLE; endcase end // -------------------------------------------------------------------- // Sequential logic // -------------------------------------------------------------------- always @(posedge clk) begin if(reset == 1'b1) begin last_ps2_clk <= 1'b1; ps2_clk_reg <= 1'b1; ps2_data_reg <= 1'b1; end else begin last_ps2_clk <= ps2_clk_reg; ps2_clk_reg <= ps2_clk; ps2_data_reg <= ps2_dat; end end always @(posedge clk) begin if(reset == 1'b1) idle_counter <= 6'h00; else if((s_ps2_transceiver == PS2_STATE_0_IDLE) && (idle_counter != 8'hFF)) idle_counter <= idle_counter + 6'h01; else if (s_ps2_transceiver != PS2_STATE_0_IDLE) idle_counter <= 6'h00; end // -------------------------------------------------------------------- // Combinational logic // -------------------------------------------------------------------- assign ps2_clk_posedge = ((ps2_clk_reg == 1'b1) && (last_ps2_clk == 1'b0)) ? 1'b1 : 1'b0; assign ps2_clk_negedge = ((ps2_clk_reg == 1'b0) && (last_ps2_clk == 1'b1)) ? 1'b1 : 1'b0; assign start_receiving_data = (s_ps2_transceiver == PS2_STATE_1_DATA_IN); assign wait_for_incoming_data = (s_ps2_transceiver == PS2_STATE_3_END_TRANSFER); // -------------------------------------------------------------------- // Internal Modules // -------------------------------------------------------------------- ps2_mouse_cmdout mouse_cmdout ( .clk (clk), // Inputs .reset (reset), .the_command (the_command), .send_command (send_command), .ps2_clk_posedge (ps2_clk_posedge), .ps2_clk_negedge (ps2_clk_negedge), .ps2_clk (ps2_clk), // Bidirectionals .ps2_dat (ps2_dat), .command_was_sent (command_was_sent), // Outputs .error_communication_timed_out (error_communication_timed_out) ); ps2_mouse_datain mouse_datain ( .clk (clk), // Inputs .reset (reset), .wait_for_incoming_data (wait_for_incoming_data), .start_receiving_data (start_receiving_data), .ps2_clk_posedge (ps2_clk_posedge), .ps2_clk_negedge (ps2_clk_negedge), .ps2_data (ps2_data_reg), .received_data (received_data), // Outputs .received_data_en (received_data_en) ); endmodule
/* * PS2 Mouse Interface * Copyright (C) 2010 Donna Polehn <[email protected]> * * This file is part of the Zet processor. This processor is free * hardware; you can redistribute it and/or modify it under the terms of * the GNU General Public License as published by the Free Software * Foundation; either version 3, or (at your option) any later version. * * Zet is distrubuted in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public * License for more details. * * You should have received a copy of the GNU General Public License * along with Zet; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. */ module ps2_mouse ( input clk, // Clock Input input reset, // Reset Input inout ps2_clk, // PS2 Clock, Bidirectional inout ps2_dat, // PS2 Data, Bidirectional input [7:0] the_command, // Command to send to mouse input send_command, // Signal to send output command_was_sent, // Signal command finished sending output error_communication_timed_out, output [7:0] received_data, // Received data output received_data_en, // If 1 - new data has been received output start_receiving_data, output wait_for_incoming_data ); // -------------------------------------------------------------------- // Internal wires and registers Declarations // -------------------------------------------------------------------- wire ps2_clk_posedge; // Internal Wires wire ps2_clk_negedge; reg [7:0] idle_counter; // Internal Registers reg ps2_clk_reg; reg ps2_data_reg; reg last_ps2_clk; reg [2:0] ns_ps2_transceiver; // State Machine Registers reg [2:0] s_ps2_transceiver; // -------------------------------------------------------------------- // Constant Declarations // -------------------------------------------------------------------- localparam PS2_STATE_0_IDLE = 3'h0, // states PS2_STATE_1_DATA_IN = 3'h1, PS2_STATE_2_COMMAND_OUT = 3'h2, PS2_STATE_3_END_TRANSFER = 3'h3, PS2_STATE_4_END_DELAYED = 3'h4; // -------------------------------------------------------------------- // Finite State Machine(s) // -------------------------------------------------------------------- always @(posedge clk) begin if(reset == 1'b1) s_ps2_transceiver <= PS2_STATE_0_IDLE; else s_ps2_transceiver <= ns_ps2_transceiver; end always @(*) begin ns_ps2_transceiver = PS2_STATE_0_IDLE; // Defaults case (s_ps2_transceiver) PS2_STATE_0_IDLE: begin if((idle_counter == 8'hFF) && (send_command == 1'b1)) ns_ps2_transceiver = PS2_STATE_2_COMMAND_OUT; else if ((ps2_data_reg == 1'b0) && (ps2_clk_posedge == 1'b1)) ns_ps2_transceiver = PS2_STATE_1_DATA_IN; else ns_ps2_transceiver = PS2_STATE_0_IDLE; end PS2_STATE_1_DATA_IN: begin // if((received_data_en == 1'b1) && (ps2_clk_posedge == 1'b1)) if((received_data_en == 1'b1)) ns_ps2_transceiver = PS2_STATE_0_IDLE; else ns_ps2_transceiver = PS2_STATE_1_DATA_IN; end PS2_STATE_2_COMMAND_OUT: begin if((command_was_sent == 1'b1) || (error_communication_timed_out == 1'b1)) ns_ps2_transceiver = PS2_STATE_3_END_TRANSFER; else ns_ps2_transceiver = PS2_STATE_2_COMMAND_OUT; end PS2_STATE_3_END_TRANSFER: begin if(send_command == 1'b0) ns_ps2_transceiver = PS2_STATE_0_IDLE; else if((ps2_data_reg == 1'b0) && (ps2_clk_posedge == 1'b1)) ns_ps2_transceiver = PS2_STATE_4_END_DELAYED; else ns_ps2_transceiver = PS2_STATE_3_END_TRANSFER; end PS2_STATE_4_END_DELAYED: begin if(received_data_en == 1'b1) begin if(send_command == 1'b0) ns_ps2_transceiver = PS2_STATE_0_IDLE; else ns_ps2_transceiver = PS2_STATE_3_END_TRANSFER; end else ns_ps2_transceiver = PS2_STATE_4_END_DELAYED; end default: ns_ps2_transceiver = PS2_STATE_0_IDLE; endcase end // -------------------------------------------------------------------- // Sequential logic // -------------------------------------------------------------------- always @(posedge clk) begin if(reset == 1'b1) begin last_ps2_clk <= 1'b1; ps2_clk_reg <= 1'b1; ps2_data_reg <= 1'b1; end else begin last_ps2_clk <= ps2_clk_reg; ps2_clk_reg <= ps2_clk; ps2_data_reg <= ps2_dat; end end always @(posedge clk) begin if(reset == 1'b1) idle_counter <= 6'h00; else if((s_ps2_transceiver == PS2_STATE_0_IDLE) && (idle_counter != 8'hFF)) idle_counter <= idle_counter + 6'h01; else if (s_ps2_transceiver != PS2_STATE_0_IDLE) idle_counter <= 6'h00; end // -------------------------------------------------------------------- // Combinational logic // -------------------------------------------------------------------- assign ps2_clk_posedge = ((ps2_clk_reg == 1'b1) && (last_ps2_clk == 1'b0)) ? 1'b1 : 1'b0; assign ps2_clk_negedge = ((ps2_clk_reg == 1'b0) && (last_ps2_clk == 1'b1)) ? 1'b1 : 1'b0; assign start_receiving_data = (s_ps2_transceiver == PS2_STATE_1_DATA_IN); assign wait_for_incoming_data = (s_ps2_transceiver == PS2_STATE_3_END_TRANSFER); // -------------------------------------------------------------------- // Internal Modules // -------------------------------------------------------------------- ps2_mouse_cmdout mouse_cmdout ( .clk (clk), // Inputs .reset (reset), .the_command (the_command), .send_command (send_command), .ps2_clk_posedge (ps2_clk_posedge), .ps2_clk_negedge (ps2_clk_negedge), .ps2_clk (ps2_clk), // Bidirectionals .ps2_dat (ps2_dat), .command_was_sent (command_was_sent), // Outputs .error_communication_timed_out (error_communication_timed_out) ); ps2_mouse_datain mouse_datain ( .clk (clk), // Inputs .reset (reset), .wait_for_incoming_data (wait_for_incoming_data), .start_receiving_data (start_receiving_data), .ps2_clk_posedge (ps2_clk_posedge), .ps2_clk_negedge (ps2_clk_negedge), .ps2_data (ps2_data_reg), .received_data (received_data), // Outputs .received_data_en (received_data_en) ); endmodule
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 05/26/2016 07:28:40 AM // Design Name: // Module Name: LZD // Project Name: // Target Devices: // Tool Versions: // Description: // // Dependencies: // // Revision: // Revision 0.01 - File Created // Additional Comments: // ////////////////////////////////////////////////////////////////////////////////// module LZD#(parameter SWR=26, parameter EWR=5)( //#(parameter SWR=55, parameter EWR=6)( input wire clk, input wire rst, input wire load_i, input wire [SWR-1:0] Add_subt_result_i, /////////////////////////////////////////////7 output wire [EWR-1:0] Shift_Value_o ); wire [EWR-1:0] Codec_to_Reg; generate case (SWR) 26:begin Priority_Codec_32 Codec_32( .Data_Dec_i(Add_subt_result_i), .Data_Bin_o(Codec_to_Reg) ); end 55:begin Priority_Codec_64 Codec_64( .Data_Dec_i(Add_subt_result_i), .Data_Bin_o(Codec_to_Reg) ); end endcase endgenerate RegisterAdd #(.W(EWR)) Output_Reg( .clk(clk), .rst(rst), .load(load_i), .D(Codec_to_Reg), .Q(Shift_Value_o) ); endmodule
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 05/26/2016 07:28:40 AM // Design Name: // Module Name: LZD // Project Name: // Target Devices: // Tool Versions: // Description: // // Dependencies: // // Revision: // Revision 0.01 - File Created // Additional Comments: // ////////////////////////////////////////////////////////////////////////////////// module LZD#(parameter SWR=26, parameter EWR=5)( //#(parameter SWR=55, parameter EWR=6)( input wire clk, input wire rst, input wire load_i, input wire [SWR-1:0] Add_subt_result_i, /////////////////////////////////////////////7 output wire [EWR-1:0] Shift_Value_o ); wire [EWR-1:0] Codec_to_Reg; generate case (SWR) 26:begin Priority_Codec_32 Codec_32( .Data_Dec_i(Add_subt_result_i), .Data_Bin_o(Codec_to_Reg) ); end 55:begin Priority_Codec_64 Codec_64( .Data_Dec_i(Add_subt_result_i), .Data_Bin_o(Codec_to_Reg) ); end endcase endgenerate RegisterAdd #(.W(EWR)) Output_Reg( .clk(clk), .rst(rst), .load(load_i), .D(Codec_to_Reg), .Q(Shift_Value_o) ); endmodule
/* Copyright (c) 2014-2018 Alex Forencich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // Language: Verilog-2001 `timescale 1 ns / 1 ps /* * Synchronizes an asyncronous signal to a given clock by using a pipeline of * two registers. */ module sync_signal #( parameter WIDTH=1, // width of the input and output signals parameter N=2 // depth of synchronizer )( input wire clk, input wire [WIDTH-1:0] in, output wire [WIDTH-1:0] out ); reg [WIDTH-1:0] sync_reg[N-1:0]; /* * The synchronized output is the last register in the pipeline. */ assign out = sync_reg[N-1]; integer k; always @(posedge clk) begin sync_reg[0] <= in; for (k = 1; k < N; k = k + 1) begin sync_reg[k] <= sync_reg[k-1]; end end endmodule
/* Copyright (c) 2014-2018 Alex Forencich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // Language: Verilog-2001 `timescale 1 ns / 1 ps /* * Synchronizes an asyncronous signal to a given clock by using a pipeline of * two registers. */ module sync_signal #( parameter WIDTH=1, // width of the input and output signals parameter N=2 // depth of synchronizer )( input wire clk, input wire [WIDTH-1:0] in, output wire [WIDTH-1:0] out ); reg [WIDTH-1:0] sync_reg[N-1:0]; /* * The synchronized output is the last register in the pipeline. */ assign out = sync_reg[N-1]; integer k; always @(posedge clk) begin sync_reg[0] <= in; for (k = 1; k < N; k = k + 1) begin sync_reg[k] <= sync_reg[k-1]; end end endmodule
// This is a component of pluto_servo, a PWM servo driver and quadrature // counter for emc2 // Copyright 2006 Jeff Epler <[email protected]> // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA module wdt(clk, ena, cnt, out); input clk, ena, cnt; output out; reg [6:0] timer; wire timer_top = (timer == 7'd127); reg internal_enable; wire out = internal_enable && timer_top; always @(posedge clk) begin if(ena) begin internal_enable <= 1; timer <= 0; end else if(cnt && !timer_top) timer <= timer + 7'd1; end endmodule
// This is a component of pluto_servo, a PWM servo driver and quadrature // counter for emc2 // Copyright 2006 Jeff Epler <[email protected]> // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA module wdt(clk, ena, cnt, out); input clk, ena, cnt; output out; reg [6:0] timer; wire timer_top = (timer == 7'd127); reg internal_enable; wire out = internal_enable && timer_top; always @(posedge clk) begin if(ena) begin internal_enable <= 1; timer <= 0; end else if(cnt && !timer_top) timer <= timer + 7'd1; end endmodule
// This is a component of pluto_servo, a PWM servo driver and quadrature // counter for emc2 // Copyright 2006 Jeff Epler <[email protected]> // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA module wdt(clk, ena, cnt, out); input clk, ena, cnt; output out; reg [6:0] timer; wire timer_top = (timer == 7'd127); reg internal_enable; wire out = internal_enable && timer_top; always @(posedge clk) begin if(ena) begin internal_enable <= 1; timer <= 0; end else if(cnt && !timer_top) timer <= timer + 7'd1; end endmodule
// This is a component of pluto_servo, a PWM servo driver and quadrature // counter for emc2 // Copyright 2006 Jeff Epler <[email protected]> // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA module wdt(clk, ena, cnt, out); input clk, ena, cnt; output out; reg [6:0] timer; wire timer_top = (timer == 7'd127); reg internal_enable; wire out = internal_enable && timer_top; always @(posedge clk) begin if(ena) begin internal_enable <= 1; timer <= 0; end else if(cnt && !timer_top) timer <= timer + 7'd1; end endmodule
`timescale 1ps/1ps `default_nettype none (* DowngradeIPIdentifiedWarnings="yes" *) module axi_protocol_converter_v2_1_b2s_ar_channel # ( /////////////////////////////////////////////////////////////////////////////// // Parameter Definitions /////////////////////////////////////////////////////////////////////////////// // Width of ID signals. // Range: >= 1. parameter integer C_ID_WIDTH = 4, // Width of AxADDR // Range: 32. parameter integer C_AXI_ADDR_WIDTH = 32 ) ( /////////////////////////////////////////////////////////////////////////////// // Port Declarations /////////////////////////////////////////////////////////////////////////////// // AXI Slave Interface // Slave Interface System Signals input wire clk , input wire reset , // Slave Interface Read Address Ports input wire [C_ID_WIDTH-1:0] s_arid , input wire [C_AXI_ADDR_WIDTH-1:0] s_araddr , input wire [7:0] s_arlen , input wire [2:0] s_arsize , input wire [1:0] s_arburst , input wire s_arvalid , output wire s_arready , output wire m_arvalid , output wire [C_AXI_ADDR_WIDTH-1:0] m_araddr , input wire m_arready , // Connections to/from axi_protocol_converter_v2_1_b2s_r_channel module output wire [C_ID_WIDTH-1:0] r_arid , output wire r_push , output wire r_rlast , input wire r_full ); //////////////////////////////////////////////////////////////////////////////// // Wires/Reg declarations //////////////////////////////////////////////////////////////////////////////// wire next ; wire next_pending ; wire a_push; wire incr_burst; reg [C_ID_WIDTH-1:0] s_arid_r; //////////////////////////////////////////////////////////////////////////////// // BEGIN RTL //////////////////////////////////////////////////////////////////////////////// // Translate the AXI transaction to the MC transaction(s) axi_protocol_converter_v2_1_b2s_cmd_translator # ( .C_AXI_ADDR_WIDTH ( C_AXI_ADDR_WIDTH ) ) cmd_translator_0 ( .clk ( clk ) , .reset ( reset ) , .s_axaddr ( s_araddr ) , .s_axlen ( s_arlen ) , .s_axsize ( s_arsize ) , .s_axburst ( s_arburst ) , .s_axhandshake ( s_arvalid & a_push ) , .incr_burst ( incr_burst ) , .m_axaddr ( m_araddr ) , .next ( next ) , .next_pending ( next_pending ) ); axi_protocol_converter_v2_1_b2s_rd_cmd_fsm ar_cmd_fsm_0 ( .clk ( clk ) , .reset ( reset ) , .s_arready ( s_arready ) , .s_arvalid ( s_arvalid ) , .s_arlen ( s_arlen ) , .m_arvalid ( m_arvalid ) , .m_arready ( m_arready ) , .next ( next ) , .next_pending ( next_pending ) , .data_ready ( ~r_full ) , .a_push ( a_push ) , .r_push ( r_push ) ); // these signals can be moved out of this block to the top level. assign r_arid = s_arid_r; assign r_rlast = ~next_pending; always @(posedge clk) begin s_arid_r <= s_arid ; end endmodule `default_nettype wire
`timescale 1ps/1ps `default_nettype none (* DowngradeIPIdentifiedWarnings="yes" *) module axi_protocol_converter_v2_1_b2s_ar_channel # ( /////////////////////////////////////////////////////////////////////////////// // Parameter Definitions /////////////////////////////////////////////////////////////////////////////// // Width of ID signals. // Range: >= 1. parameter integer C_ID_WIDTH = 4, // Width of AxADDR // Range: 32. parameter integer C_AXI_ADDR_WIDTH = 32 ) ( /////////////////////////////////////////////////////////////////////////////// // Port Declarations /////////////////////////////////////////////////////////////////////////////// // AXI Slave Interface // Slave Interface System Signals input wire clk , input wire reset , // Slave Interface Read Address Ports input wire [C_ID_WIDTH-1:0] s_arid , input wire [C_AXI_ADDR_WIDTH-1:0] s_araddr , input wire [7:0] s_arlen , input wire [2:0] s_arsize , input wire [1:0] s_arburst , input wire s_arvalid , output wire s_arready , output wire m_arvalid , output wire [C_AXI_ADDR_WIDTH-1:0] m_araddr , input wire m_arready , // Connections to/from axi_protocol_converter_v2_1_b2s_r_channel module output wire [C_ID_WIDTH-1:0] r_arid , output wire r_push , output wire r_rlast , input wire r_full ); //////////////////////////////////////////////////////////////////////////////// // Wires/Reg declarations //////////////////////////////////////////////////////////////////////////////// wire next ; wire next_pending ; wire a_push; wire incr_burst; reg [C_ID_WIDTH-1:0] s_arid_r; //////////////////////////////////////////////////////////////////////////////// // BEGIN RTL //////////////////////////////////////////////////////////////////////////////// // Translate the AXI transaction to the MC transaction(s) axi_protocol_converter_v2_1_b2s_cmd_translator # ( .C_AXI_ADDR_WIDTH ( C_AXI_ADDR_WIDTH ) ) cmd_translator_0 ( .clk ( clk ) , .reset ( reset ) , .s_axaddr ( s_araddr ) , .s_axlen ( s_arlen ) , .s_axsize ( s_arsize ) , .s_axburst ( s_arburst ) , .s_axhandshake ( s_arvalid & a_push ) , .incr_burst ( incr_burst ) , .m_axaddr ( m_araddr ) , .next ( next ) , .next_pending ( next_pending ) ); axi_protocol_converter_v2_1_b2s_rd_cmd_fsm ar_cmd_fsm_0 ( .clk ( clk ) , .reset ( reset ) , .s_arready ( s_arready ) , .s_arvalid ( s_arvalid ) , .s_arlen ( s_arlen ) , .m_arvalid ( m_arvalid ) , .m_arready ( m_arready ) , .next ( next ) , .next_pending ( next_pending ) , .data_ready ( ~r_full ) , .a_push ( a_push ) , .r_push ( r_push ) ); // these signals can be moved out of this block to the top level. assign r_arid = s_arid_r; assign r_rlast = ~next_pending; always @(posedge clk) begin s_arid_r <= s_arid ; end endmodule `default_nettype wire
`timescale 1ps/1ps `default_nettype none (* DowngradeIPIdentifiedWarnings="yes" *) module axi_protocol_converter_v2_1_b2s_ar_channel # ( /////////////////////////////////////////////////////////////////////////////// // Parameter Definitions /////////////////////////////////////////////////////////////////////////////// // Width of ID signals. // Range: >= 1. parameter integer C_ID_WIDTH = 4, // Width of AxADDR // Range: 32. parameter integer C_AXI_ADDR_WIDTH = 32 ) ( /////////////////////////////////////////////////////////////////////////////// // Port Declarations /////////////////////////////////////////////////////////////////////////////// // AXI Slave Interface // Slave Interface System Signals input wire clk , input wire reset , // Slave Interface Read Address Ports input wire [C_ID_WIDTH-1:0] s_arid , input wire [C_AXI_ADDR_WIDTH-1:0] s_araddr , input wire [7:0] s_arlen , input wire [2:0] s_arsize , input wire [1:0] s_arburst , input wire s_arvalid , output wire s_arready , output wire m_arvalid , output wire [C_AXI_ADDR_WIDTH-1:0] m_araddr , input wire m_arready , // Connections to/from axi_protocol_converter_v2_1_b2s_r_channel module output wire [C_ID_WIDTH-1:0] r_arid , output wire r_push , output wire r_rlast , input wire r_full ); //////////////////////////////////////////////////////////////////////////////// // Wires/Reg declarations //////////////////////////////////////////////////////////////////////////////// wire next ; wire next_pending ; wire a_push; wire incr_burst; reg [C_ID_WIDTH-1:0] s_arid_r; //////////////////////////////////////////////////////////////////////////////// // BEGIN RTL //////////////////////////////////////////////////////////////////////////////// // Translate the AXI transaction to the MC transaction(s) axi_protocol_converter_v2_1_b2s_cmd_translator # ( .C_AXI_ADDR_WIDTH ( C_AXI_ADDR_WIDTH ) ) cmd_translator_0 ( .clk ( clk ) , .reset ( reset ) , .s_axaddr ( s_araddr ) , .s_axlen ( s_arlen ) , .s_axsize ( s_arsize ) , .s_axburst ( s_arburst ) , .s_axhandshake ( s_arvalid & a_push ) , .incr_burst ( incr_burst ) , .m_axaddr ( m_araddr ) , .next ( next ) , .next_pending ( next_pending ) ); axi_protocol_converter_v2_1_b2s_rd_cmd_fsm ar_cmd_fsm_0 ( .clk ( clk ) , .reset ( reset ) , .s_arready ( s_arready ) , .s_arvalid ( s_arvalid ) , .s_arlen ( s_arlen ) , .m_arvalid ( m_arvalid ) , .m_arready ( m_arready ) , .next ( next ) , .next_pending ( next_pending ) , .data_ready ( ~r_full ) , .a_push ( a_push ) , .r_push ( r_push ) ); // these signals can be moved out of this block to the top level. assign r_arid = s_arid_r; assign r_rlast = ~next_pending; always @(posedge clk) begin s_arid_r <= s_arid ; end endmodule `default_nettype wire
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 03/10/2016 11:52:43 AM // Design Name: // Module Name: Oper_Start_In // Project Name: // Target Devices: // Tool Versions: // Description: // // Dependencies: // // Revision: // Revision 0.01 - File Created // Additional Comments: // ////////////////////////////////////////////////////////////////////////////////// module Oper_Start_In # (parameter W = 32 ) // This parameter could be adjust based //on the desire precision format //W = 64 indicates the double precision format //W = 32 indicates the single precision format ( input wire clk, //system clock input wire rst, //reset of the module input wire load_a_i,//The ctrl_x signals are used to load certain registers within the module input wire load_b_i, input wire add_subt_i, //This signal selects if the operations is an add o subtract operation input wire [W-1:0] Data_X_i, //Data_X and Data_y are both operands of the module //they are expected in ieee 754 format input wire [W-1:0] Data_Y_i, ////////////////////////////////////////////////////////////////////// output wire [W-2:0] DMP_o, //Because the algorithm these outputs contain the largest and smallest operand output wire [W-2:0] DmP_o, output wire zero_flag_o, //Flag for FSM when the subt result is zero output wire real_op_o, //bit for real add/subt operation in case for -DataY output wire sign_final_result_o //bit for sign result ); //Wire Signals useful to interconnect the components of the module wire [W-1:0] intDX; //Output of register DATA_X wire [W-1:0] intDY; //Output of register DATA_Y wire intAS; //Output of register add_subt wire gtXY; //Output for magntiude_comparator (X>Y) wire eqXY; //Output for magntiude_comparator (X=Y) wire [W-2:0] intM; //Output of MuxXY for bigger value wire [W-2:0] intm; //Output of MuxXY for small value /////////////////////////////////////////////////////////////////// RegisterAdd #(.W(W)) XRegister ( //Data X input register .clk(clk), .rst(rst), .load(load_a_i), .D(Data_X_i), .Q(intDX) ); RegisterAdd #(.W(W)) YRegister ( //Data Y input register .clk(clk), .rst(rst), .load(load_a_i), .D(Data_Y_i), .Q(intDY) ); RegisterAdd #(.W(1)) ASRegister ( //Data Add_Subtract input register .clk(clk), .rst(rst), .load(load_a_i), .D(add_subt_i), .Q(intAS) ); Comparator #(.W(W-1)) Magnitude_Comparator ( //Compare between magnitude for DATA_X and DATA_Y and select whos bigger and if there's a equality .Data_X_i(intDX[W-2:0]), .Data_Y_i(intDY[W-2:0]), .gtXY_o(gtXY), .eqXY_o(eqXY) ); xor_tri #(.W(W)) Op_verification ( //Operation between the DATA_X & Y's sign bit and the operation bit to find the real operation for ADDER/SUBTRACT .A_i(intDX[W-1]), .B_i(intDY[W-1]), .C_i(intAS), .Z_o(real_op_o) ); sgn_result result_sign_bit (//Calculate the sign bit for the final result .Add_Subt_i(intAS), .sgn_X_i(intDX[W-1]), .sgn_Y_i(intDY[W-1]), .gtXY_i(gtXY), .eqXY_i(eqXY), .sgn_result_o(sign_result) ); MultiplexTxT #(.W(W-1)) MuxXY (//Classify in the registers the bigger value (M) and the smaller value (m) .select(gtXY), .D0_i(intDX[W-2:0]), .D1_i(intDY[W-2:0]), .S0_o(intM), .S1_o(intm) ); RegisterAdd #(.W(W-1)) MRegister ( //Data_M register .clk(clk), .rst(rst), .load(load_b_i), .D(intM), .Q(DMP_o) ); RegisterAdd #(.W(W-1)) mRegister ( //Data_m register .clk(clk), .rst(rst), .load(load_b_i), .D(intm), .Q(DmP_o) ); RegisterAdd #(.W(1)) SignRegister ( .clk(clk), .rst(rst), .load(load_b_i), .D(sign_result), .Q(sign_final_result_o) ); assign zero_flag_o = real_op_o & eqXY; endmodule
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 03/10/2016 11:52:43 AM // Design Name: // Module Name: Oper_Start_In // Project Name: // Target Devices: // Tool Versions: // Description: // // Dependencies: // // Revision: // Revision 0.01 - File Created // Additional Comments: // ////////////////////////////////////////////////////////////////////////////////// module Oper_Start_In # (parameter W = 32 ) // This parameter could be adjust based //on the desire precision format //W = 64 indicates the double precision format //W = 32 indicates the single precision format ( input wire clk, //system clock input wire rst, //reset of the module input wire load_a_i,//The ctrl_x signals are used to load certain registers within the module input wire load_b_i, input wire add_subt_i, //This signal selects if the operations is an add o subtract operation input wire [W-1:0] Data_X_i, //Data_X and Data_y are both operands of the module //they are expected in ieee 754 format input wire [W-1:0] Data_Y_i, ////////////////////////////////////////////////////////////////////// output wire [W-2:0] DMP_o, //Because the algorithm these outputs contain the largest and smallest operand output wire [W-2:0] DmP_o, output wire zero_flag_o, //Flag for FSM when the subt result is zero output wire real_op_o, //bit for real add/subt operation in case for -DataY output wire sign_final_result_o //bit for sign result ); //Wire Signals useful to interconnect the components of the module wire [W-1:0] intDX; //Output of register DATA_X wire [W-1:0] intDY; //Output of register DATA_Y wire intAS; //Output of register add_subt wire gtXY; //Output for magntiude_comparator (X>Y) wire eqXY; //Output for magntiude_comparator (X=Y) wire [W-2:0] intM; //Output of MuxXY for bigger value wire [W-2:0] intm; //Output of MuxXY for small value /////////////////////////////////////////////////////////////////// RegisterAdd #(.W(W)) XRegister ( //Data X input register .clk(clk), .rst(rst), .load(load_a_i), .D(Data_X_i), .Q(intDX) ); RegisterAdd #(.W(W)) YRegister ( //Data Y input register .clk(clk), .rst(rst), .load(load_a_i), .D(Data_Y_i), .Q(intDY) ); RegisterAdd #(.W(1)) ASRegister ( //Data Add_Subtract input register .clk(clk), .rst(rst), .load(load_a_i), .D(add_subt_i), .Q(intAS) ); Comparator #(.W(W-1)) Magnitude_Comparator ( //Compare between magnitude for DATA_X and DATA_Y and select whos bigger and if there's a equality .Data_X_i(intDX[W-2:0]), .Data_Y_i(intDY[W-2:0]), .gtXY_o(gtXY), .eqXY_o(eqXY) ); xor_tri #(.W(W)) Op_verification ( //Operation between the DATA_X & Y's sign bit and the operation bit to find the real operation for ADDER/SUBTRACT .A_i(intDX[W-1]), .B_i(intDY[W-1]), .C_i(intAS), .Z_o(real_op_o) ); sgn_result result_sign_bit (//Calculate the sign bit for the final result .Add_Subt_i(intAS), .sgn_X_i(intDX[W-1]), .sgn_Y_i(intDY[W-1]), .gtXY_i(gtXY), .eqXY_i(eqXY), .sgn_result_o(sign_result) ); MultiplexTxT #(.W(W-1)) MuxXY (//Classify in the registers the bigger value (M) and the smaller value (m) .select(gtXY), .D0_i(intDX[W-2:0]), .D1_i(intDY[W-2:0]), .S0_o(intM), .S1_o(intm) ); RegisterAdd #(.W(W-1)) MRegister ( //Data_M register .clk(clk), .rst(rst), .load(load_b_i), .D(intM), .Q(DMP_o) ); RegisterAdd #(.W(W-1)) mRegister ( //Data_m register .clk(clk), .rst(rst), .load(load_b_i), .D(intm), .Q(DmP_o) ); RegisterAdd #(.W(1)) SignRegister ( .clk(clk), .rst(rst), .load(load_b_i), .D(sign_result), .Q(sign_final_result_o) ); assign zero_flag_o = real_op_o & eqXY; endmodule
(* An example showing that prop-extensionality is incompatible with powerful extensions of the guard condition. Unlike the example in guard2, it is not exploiting the fact that the elimination of False always produces a subterm. Example due to Cristobal Camarero on Coq-Club. Adapted to nested types by Bruno Barras. *) Axiom prop_ext: forall P Q, (P<->Q)->P=Q. Module Unboxed. Inductive True2:Prop:= I2: (False->True2)->True2. Theorem Heq: (False->True2)=True2. Proof. apply prop_ext. split. - intros. constructor. exact H. - intros. exact H. Qed. Fail Fixpoint con (x:True2) :False := match x with I2 f => con (match Heq in _=T return T with eq_refl => f end) end. End Unboxed. (* This boxed example shows that it is not enough to just require that the return type of the match on Heq is an inductive type *) Module Boxed. Inductive box (T:Type) := Box (_:T). Definition unbox {T} (b:box T) : T := let (x) := b in x. Inductive True2:Prop:= I2: box(False->True2)->True2. Definition Heq: (False->True2) <-> True2 := conj (fun f => I2 (Box _ f)) (fun x _ => x). Fail Fixpoint con (x:True2) :False := match x with I2 f => con (unbox(match prop_ext _ _ Heq in _=T return box T with eq_refl => f end)) end. End Boxed.
(* An example showing that prop-extensionality is incompatible with powerful extensions of the guard condition. Unlike the example in guard2, it is not exploiting the fact that the elimination of False always produces a subterm. Example due to Cristobal Camarero on Coq-Club. Adapted to nested types by Bruno Barras. *) Axiom prop_ext: forall P Q, (P<->Q)->P=Q. Module Unboxed. Inductive True2:Prop:= I2: (False->True2)->True2. Theorem Heq: (False->True2)=True2. Proof. apply prop_ext. split. - intros. constructor. exact H. - intros. exact H. Qed. Fail Fixpoint con (x:True2) :False := match x with I2 f => con (match Heq in _=T return T with eq_refl => f end) end. End Unboxed. (* This boxed example shows that it is not enough to just require that the return type of the match on Heq is an inductive type *) Module Boxed. Inductive box (T:Type) := Box (_:T). Definition unbox {T} (b:box T) : T := let (x) := b in x. Inductive True2:Prop:= I2: box(False->True2)->True2. Definition Heq: (False->True2) <-> True2 := conj (fun f => I2 (Box _ f)) (fun x _ => x). Fail Fixpoint con (x:True2) :False := match x with I2 f => con (unbox(match prop_ext _ _ Heq in _=T return box T with eq_refl => f end)) end. End Boxed.
(* An example showing that prop-extensionality is incompatible with powerful extensions of the guard condition. Unlike the example in guard2, it is not exploiting the fact that the elimination of False always produces a subterm. Example due to Cristobal Camarero on Coq-Club. Adapted to nested types by Bruno Barras. *) Axiom prop_ext: forall P Q, (P<->Q)->P=Q. Module Unboxed. Inductive True2:Prop:= I2: (False->True2)->True2. Theorem Heq: (False->True2)=True2. Proof. apply prop_ext. split. - intros. constructor. exact H. - intros. exact H. Qed. Fail Fixpoint con (x:True2) :False := match x with I2 f => con (match Heq in _=T return T with eq_refl => f end) end. End Unboxed. (* This boxed example shows that it is not enough to just require that the return type of the match on Heq is an inductive type *) Module Boxed. Inductive box (T:Type) := Box (_:T). Definition unbox {T} (b:box T) : T := let (x) := b in x. Inductive True2:Prop:= I2: box(False->True2)->True2. Definition Heq: (False->True2) <-> True2 := conj (fun f => I2 (Box _ f)) (fun x _ => x). Fail Fixpoint con (x:True2) :False := match x with I2 f => con (unbox(match prop_ext _ _ Heq in _=T return box T with eq_refl => f end)) end. End Boxed.
(* An example showing that prop-extensionality is incompatible with powerful extensions of the guard condition. Unlike the example in guard2, it is not exploiting the fact that the elimination of False always produces a subterm. Example due to Cristobal Camarero on Coq-Club. Adapted to nested types by Bruno Barras. *) Axiom prop_ext: forall P Q, (P<->Q)->P=Q. Module Unboxed. Inductive True2:Prop:= I2: (False->True2)->True2. Theorem Heq: (False->True2)=True2. Proof. apply prop_ext. split. - intros. constructor. exact H. - intros. exact H. Qed. Fail Fixpoint con (x:True2) :False := match x with I2 f => con (match Heq in _=T return T with eq_refl => f end) end. End Unboxed. (* This boxed example shows that it is not enough to just require that the return type of the match on Heq is an inductive type *) Module Boxed. Inductive box (T:Type) := Box (_:T). Definition unbox {T} (b:box T) : T := let (x) := b in x. Inductive True2:Prop:= I2: box(False->True2)->True2. Definition Heq: (False->True2) <-> True2 := conj (fun f => I2 (Box _ f)) (fun x _ => x). Fail Fixpoint con (x:True2) :False := match x with I2 f => con (unbox(match prop_ext _ _ Heq in _=T return box T with eq_refl => f end)) end. End Boxed.
(* An example showing that prop-extensionality is incompatible with powerful extensions of the guard condition. Unlike the example in guard2, it is not exploiting the fact that the elimination of False always produces a subterm. Example due to Cristobal Camarero on Coq-Club. Adapted to nested types by Bruno Barras. *) Axiom prop_ext: forall P Q, (P<->Q)->P=Q. Module Unboxed. Inductive True2:Prop:= I2: (False->True2)->True2. Theorem Heq: (False->True2)=True2. Proof. apply prop_ext. split. - intros. constructor. exact H. - intros. exact H. Qed. Fail Fixpoint con (x:True2) :False := match x with I2 f => con (match Heq in _=T return T with eq_refl => f end) end. End Unboxed. (* This boxed example shows that it is not enough to just require that the return type of the match on Heq is an inductive type *) Module Boxed. Inductive box (T:Type) := Box (_:T). Definition unbox {T} (b:box T) : T := let (x) := b in x. Inductive True2:Prop:= I2: box(False->True2)->True2. Definition Heq: (False->True2) <-> True2 := conj (fun f => I2 (Box _ f)) (fun x _ => x). Fail Fixpoint con (x:True2) :False := match x with I2 f => con (unbox(match prop_ext _ _ Heq in _=T return box T with eq_refl => f end)) end. End Boxed.
// $Header: /devl/xcs/repo/env/Databases/CAEInterfaces/verunilibs/data/glbl.v,v 1.14 2010/10/28 20:44:00 fphillip Exp $ `ifndef GLBL `define GLBL `timescale 1 ps / 1 ps module glbl (); parameter ROC_WIDTH = 100000; parameter TOC_WIDTH = 0; //-------- STARTUP Globals -------------- wire GSR; wire GTS; wire GWE; wire PRLD; tri1 p_up_tmp; tri (weak1, strong0) PLL_LOCKG = p_up_tmp; wire PROGB_GLBL; wire CCLKO_GLBL; wire FCSBO_GLBL; wire [3:0] DO_GLBL; wire [3:0] DI_GLBL; reg GSR_int; reg GTS_int; reg PRLD_int; //-------- JTAG Globals -------------- wire JTAG_TDO_GLBL; wire JTAG_TCK_GLBL; wire JTAG_TDI_GLBL; wire JTAG_TMS_GLBL; wire JTAG_TRST_GLBL; reg JTAG_CAPTURE_GLBL; reg JTAG_RESET_GLBL; reg JTAG_SHIFT_GLBL; reg JTAG_UPDATE_GLBL; reg JTAG_RUNTEST_GLBL; reg JTAG_SEL1_GLBL = 0; reg JTAG_SEL2_GLBL = 0 ; reg JTAG_SEL3_GLBL = 0; reg JTAG_SEL4_GLBL = 0; reg JTAG_USER_TDO1_GLBL = 1'bz; reg JTAG_USER_TDO2_GLBL = 1'bz; reg JTAG_USER_TDO3_GLBL = 1'bz; reg JTAG_USER_TDO4_GLBL = 1'bz; assign (strong1, weak0) GSR = GSR_int; assign (strong1, weak0) GTS = GTS_int; assign (weak1, weak0) PRLD = PRLD_int; initial begin GSR_int = 1'b1; PRLD_int = 1'b1; #(ROC_WIDTH) GSR_int = 1'b0; PRLD_int = 1'b0; end initial begin GTS_int = 1'b1; #(TOC_WIDTH) GTS_int = 1'b0; end endmodule `endif
// $Header: /devl/xcs/repo/env/Databases/CAEInterfaces/verunilibs/data/glbl.v,v 1.14 2010/10/28 20:44:00 fphillip Exp $ `ifndef GLBL `define GLBL `timescale 1 ps / 1 ps module glbl (); parameter ROC_WIDTH = 100000; parameter TOC_WIDTH = 0; //-------- STARTUP Globals -------------- wire GSR; wire GTS; wire GWE; wire PRLD; tri1 p_up_tmp; tri (weak1, strong0) PLL_LOCKG = p_up_tmp; wire PROGB_GLBL; wire CCLKO_GLBL; wire FCSBO_GLBL; wire [3:0] DO_GLBL; wire [3:0] DI_GLBL; reg GSR_int; reg GTS_int; reg PRLD_int; //-------- JTAG Globals -------------- wire JTAG_TDO_GLBL; wire JTAG_TCK_GLBL; wire JTAG_TDI_GLBL; wire JTAG_TMS_GLBL; wire JTAG_TRST_GLBL; reg JTAG_CAPTURE_GLBL; reg JTAG_RESET_GLBL; reg JTAG_SHIFT_GLBL; reg JTAG_UPDATE_GLBL; reg JTAG_RUNTEST_GLBL; reg JTAG_SEL1_GLBL = 0; reg JTAG_SEL2_GLBL = 0 ; reg JTAG_SEL3_GLBL = 0; reg JTAG_SEL4_GLBL = 0; reg JTAG_USER_TDO1_GLBL = 1'bz; reg JTAG_USER_TDO2_GLBL = 1'bz; reg JTAG_USER_TDO3_GLBL = 1'bz; reg JTAG_USER_TDO4_GLBL = 1'bz; assign (strong1, weak0) GSR = GSR_int; assign (strong1, weak0) GTS = GTS_int; assign (weak1, weak0) PRLD = PRLD_int; initial begin GSR_int = 1'b1; PRLD_int = 1'b1; #(ROC_WIDTH) GSR_int = 1'b0; PRLD_int = 1'b0; end initial begin GTS_int = 1'b1; #(TOC_WIDTH) GTS_int = 1'b0; end endmodule `endif
// $Header: /devl/xcs/repo/env/Databases/CAEInterfaces/verunilibs/data/glbl.v,v 1.14 2010/10/28 20:44:00 fphillip Exp $ `ifndef GLBL `define GLBL `timescale 1 ps / 1 ps module glbl (); parameter ROC_WIDTH = 100000; parameter TOC_WIDTH = 0; //-------- STARTUP Globals -------------- wire GSR; wire GTS; wire GWE; wire PRLD; tri1 p_up_tmp; tri (weak1, strong0) PLL_LOCKG = p_up_tmp; wire PROGB_GLBL; wire CCLKO_GLBL; wire FCSBO_GLBL; wire [3:0] DO_GLBL; wire [3:0] DI_GLBL; reg GSR_int; reg GTS_int; reg PRLD_int; //-------- JTAG Globals -------------- wire JTAG_TDO_GLBL; wire JTAG_TCK_GLBL; wire JTAG_TDI_GLBL; wire JTAG_TMS_GLBL; wire JTAG_TRST_GLBL; reg JTAG_CAPTURE_GLBL; reg JTAG_RESET_GLBL; reg JTAG_SHIFT_GLBL; reg JTAG_UPDATE_GLBL; reg JTAG_RUNTEST_GLBL; reg JTAG_SEL1_GLBL = 0; reg JTAG_SEL2_GLBL = 0 ; reg JTAG_SEL3_GLBL = 0; reg JTAG_SEL4_GLBL = 0; reg JTAG_USER_TDO1_GLBL = 1'bz; reg JTAG_USER_TDO2_GLBL = 1'bz; reg JTAG_USER_TDO3_GLBL = 1'bz; reg JTAG_USER_TDO4_GLBL = 1'bz; assign (strong1, weak0) GSR = GSR_int; assign (strong1, weak0) GTS = GTS_int; assign (weak1, weak0) PRLD = PRLD_int; initial begin GSR_int = 1'b1; PRLD_int = 1'b1; #(ROC_WIDTH) GSR_int = 1'b0; PRLD_int = 1'b0; end initial begin GTS_int = 1'b1; #(TOC_WIDTH) GTS_int = 1'b0; end endmodule `endif
// $Header: /devl/xcs/repo/env/Databases/CAEInterfaces/verunilibs/data/glbl.v,v 1.14 2010/10/28 20:44:00 fphillip Exp $ `ifndef GLBL `define GLBL `timescale 1 ps / 1 ps module glbl (); parameter ROC_WIDTH = 100000; parameter TOC_WIDTH = 0; //-------- STARTUP Globals -------------- wire GSR; wire GTS; wire GWE; wire PRLD; tri1 p_up_tmp; tri (weak1, strong0) PLL_LOCKG = p_up_tmp; wire PROGB_GLBL; wire CCLKO_GLBL; wire FCSBO_GLBL; wire [3:0] DO_GLBL; wire [3:0] DI_GLBL; reg GSR_int; reg GTS_int; reg PRLD_int; //-------- JTAG Globals -------------- wire JTAG_TDO_GLBL; wire JTAG_TCK_GLBL; wire JTAG_TDI_GLBL; wire JTAG_TMS_GLBL; wire JTAG_TRST_GLBL; reg JTAG_CAPTURE_GLBL; reg JTAG_RESET_GLBL; reg JTAG_SHIFT_GLBL; reg JTAG_UPDATE_GLBL; reg JTAG_RUNTEST_GLBL; reg JTAG_SEL1_GLBL = 0; reg JTAG_SEL2_GLBL = 0 ; reg JTAG_SEL3_GLBL = 0; reg JTAG_SEL4_GLBL = 0; reg JTAG_USER_TDO1_GLBL = 1'bz; reg JTAG_USER_TDO2_GLBL = 1'bz; reg JTAG_USER_TDO3_GLBL = 1'bz; reg JTAG_USER_TDO4_GLBL = 1'bz; assign (strong1, weak0) GSR = GSR_int; assign (strong1, weak0) GTS = GTS_int; assign (weak1, weak0) PRLD = PRLD_int; initial begin GSR_int = 1'b1; PRLD_int = 1'b1; #(ROC_WIDTH) GSR_int = 1'b0; PRLD_int = 1'b0; end initial begin GTS_int = 1'b1; #(TOC_WIDTH) GTS_int = 1'b0; end endmodule `endif
// $Header: /devl/xcs/repo/env/Databases/CAEInterfaces/verunilibs/data/glbl.v,v 1.14 2010/10/28 20:44:00 fphillip Exp $ `ifndef GLBL `define GLBL `timescale 1 ps / 1 ps module glbl (); parameter ROC_WIDTH = 100000; parameter TOC_WIDTH = 0; //-------- STARTUP Globals -------------- wire GSR; wire GTS; wire GWE; wire PRLD; tri1 p_up_tmp; tri (weak1, strong0) PLL_LOCKG = p_up_tmp; wire PROGB_GLBL; wire CCLKO_GLBL; wire FCSBO_GLBL; wire [3:0] DO_GLBL; wire [3:0] DI_GLBL; reg GSR_int; reg GTS_int; reg PRLD_int; //-------- JTAG Globals -------------- wire JTAG_TDO_GLBL; wire JTAG_TCK_GLBL; wire JTAG_TDI_GLBL; wire JTAG_TMS_GLBL; wire JTAG_TRST_GLBL; reg JTAG_CAPTURE_GLBL; reg JTAG_RESET_GLBL; reg JTAG_SHIFT_GLBL; reg JTAG_UPDATE_GLBL; reg JTAG_RUNTEST_GLBL; reg JTAG_SEL1_GLBL = 0; reg JTAG_SEL2_GLBL = 0 ; reg JTAG_SEL3_GLBL = 0; reg JTAG_SEL4_GLBL = 0; reg JTAG_USER_TDO1_GLBL = 1'bz; reg JTAG_USER_TDO2_GLBL = 1'bz; reg JTAG_USER_TDO3_GLBL = 1'bz; reg JTAG_USER_TDO4_GLBL = 1'bz; assign (strong1, weak0) GSR = GSR_int; assign (strong1, weak0) GTS = GTS_int; assign (weak1, weak0) PRLD = PRLD_int; initial begin GSR_int = 1'b1; PRLD_int = 1'b1; #(ROC_WIDTH) GSR_int = 1'b0; PRLD_int = 1'b0; end initial begin GTS_int = 1'b1; #(TOC_WIDTH) GTS_int = 1'b0; end endmodule `endif
// $Header: /devl/xcs/repo/env/Databases/CAEInterfaces/verunilibs/data/glbl.v,v 1.14 2010/10/28 20:44:00 fphillip Exp $ `ifndef GLBL `define GLBL `timescale 1 ps / 1 ps module glbl (); parameter ROC_WIDTH = 100000; parameter TOC_WIDTH = 0; //-------- STARTUP Globals -------------- wire GSR; wire GTS; wire GWE; wire PRLD; tri1 p_up_tmp; tri (weak1, strong0) PLL_LOCKG = p_up_tmp; wire PROGB_GLBL; wire CCLKO_GLBL; wire FCSBO_GLBL; wire [3:0] DO_GLBL; wire [3:0] DI_GLBL; reg GSR_int; reg GTS_int; reg PRLD_int; //-------- JTAG Globals -------------- wire JTAG_TDO_GLBL; wire JTAG_TCK_GLBL; wire JTAG_TDI_GLBL; wire JTAG_TMS_GLBL; wire JTAG_TRST_GLBL; reg JTAG_CAPTURE_GLBL; reg JTAG_RESET_GLBL; reg JTAG_SHIFT_GLBL; reg JTAG_UPDATE_GLBL; reg JTAG_RUNTEST_GLBL; reg JTAG_SEL1_GLBL = 0; reg JTAG_SEL2_GLBL = 0 ; reg JTAG_SEL3_GLBL = 0; reg JTAG_SEL4_GLBL = 0; reg JTAG_USER_TDO1_GLBL = 1'bz; reg JTAG_USER_TDO2_GLBL = 1'bz; reg JTAG_USER_TDO3_GLBL = 1'bz; reg JTAG_USER_TDO4_GLBL = 1'bz; assign (strong1, weak0) GSR = GSR_int; assign (strong1, weak0) GTS = GTS_int; assign (weak1, weak0) PRLD = PRLD_int; initial begin GSR_int = 1'b1; PRLD_int = 1'b1; #(ROC_WIDTH) GSR_int = 1'b0; PRLD_int = 1'b0; end initial begin GTS_int = 1'b1; #(TOC_WIDTH) GTS_int = 1'b0; end endmodule `endif
// $Header: /devl/xcs/repo/env/Databases/CAEInterfaces/verunilibs/data/glbl.v,v 1.14 2010/10/28 20:44:00 fphillip Exp $ `ifndef GLBL `define GLBL `timescale 1 ps / 1 ps module glbl (); parameter ROC_WIDTH = 100000; parameter TOC_WIDTH = 0; //-------- STARTUP Globals -------------- wire GSR; wire GTS; wire GWE; wire PRLD; tri1 p_up_tmp; tri (weak1, strong0) PLL_LOCKG = p_up_tmp; wire PROGB_GLBL; wire CCLKO_GLBL; wire FCSBO_GLBL; wire [3:0] DO_GLBL; wire [3:0] DI_GLBL; reg GSR_int; reg GTS_int; reg PRLD_int; //-------- JTAG Globals -------------- wire JTAG_TDO_GLBL; wire JTAG_TCK_GLBL; wire JTAG_TDI_GLBL; wire JTAG_TMS_GLBL; wire JTAG_TRST_GLBL; reg JTAG_CAPTURE_GLBL; reg JTAG_RESET_GLBL; reg JTAG_SHIFT_GLBL; reg JTAG_UPDATE_GLBL; reg JTAG_RUNTEST_GLBL; reg JTAG_SEL1_GLBL = 0; reg JTAG_SEL2_GLBL = 0 ; reg JTAG_SEL3_GLBL = 0; reg JTAG_SEL4_GLBL = 0; reg JTAG_USER_TDO1_GLBL = 1'bz; reg JTAG_USER_TDO2_GLBL = 1'bz; reg JTAG_USER_TDO3_GLBL = 1'bz; reg JTAG_USER_TDO4_GLBL = 1'bz; assign (strong1, weak0) GSR = GSR_int; assign (strong1, weak0) GTS = GTS_int; assign (weak1, weak0) PRLD = PRLD_int; initial begin GSR_int = 1'b1; PRLD_int = 1'b1; #(ROC_WIDTH) GSR_int = 1'b0; PRLD_int = 1'b0; end initial begin GTS_int = 1'b1; #(TOC_WIDTH) GTS_int = 1'b0; end endmodule `endif
// $Header: /devl/xcs/repo/env/Databases/CAEInterfaces/verunilibs/data/glbl.v,v 1.14 2010/10/28 20:44:00 fphillip Exp $ `ifndef GLBL `define GLBL `timescale 1 ps / 1 ps module glbl (); parameter ROC_WIDTH = 100000; parameter TOC_WIDTH = 0; //-------- STARTUP Globals -------------- wire GSR; wire GTS; wire GWE; wire PRLD; tri1 p_up_tmp; tri (weak1, strong0) PLL_LOCKG = p_up_tmp; wire PROGB_GLBL; wire CCLKO_GLBL; wire FCSBO_GLBL; wire [3:0] DO_GLBL; wire [3:0] DI_GLBL; reg GSR_int; reg GTS_int; reg PRLD_int; //-------- JTAG Globals -------------- wire JTAG_TDO_GLBL; wire JTAG_TCK_GLBL; wire JTAG_TDI_GLBL; wire JTAG_TMS_GLBL; wire JTAG_TRST_GLBL; reg JTAG_CAPTURE_GLBL; reg JTAG_RESET_GLBL; reg JTAG_SHIFT_GLBL; reg JTAG_UPDATE_GLBL; reg JTAG_RUNTEST_GLBL; reg JTAG_SEL1_GLBL = 0; reg JTAG_SEL2_GLBL = 0 ; reg JTAG_SEL3_GLBL = 0; reg JTAG_SEL4_GLBL = 0; reg JTAG_USER_TDO1_GLBL = 1'bz; reg JTAG_USER_TDO2_GLBL = 1'bz; reg JTAG_USER_TDO3_GLBL = 1'bz; reg JTAG_USER_TDO4_GLBL = 1'bz; assign (strong1, weak0) GSR = GSR_int; assign (strong1, weak0) GTS = GTS_int; assign (weak1, weak0) PRLD = PRLD_int; initial begin GSR_int = 1'b1; PRLD_int = 1'b1; #(ROC_WIDTH) GSR_int = 1'b0; PRLD_int = 1'b0; end initial begin GTS_int = 1'b1; #(TOC_WIDTH) GTS_int = 1'b0; end endmodule `endif
// $Header: /devl/xcs/repo/env/Databases/CAEInterfaces/verunilibs/data/glbl.v,v 1.14 2010/10/28 20:44:00 fphillip Exp $ `ifndef GLBL `define GLBL `timescale 1 ps / 1 ps module glbl (); parameter ROC_WIDTH = 100000; parameter TOC_WIDTH = 0; //-------- STARTUP Globals -------------- wire GSR; wire GTS; wire GWE; wire PRLD; tri1 p_up_tmp; tri (weak1, strong0) PLL_LOCKG = p_up_tmp; wire PROGB_GLBL; wire CCLKO_GLBL; wire FCSBO_GLBL; wire [3:0] DO_GLBL; wire [3:0] DI_GLBL; reg GSR_int; reg GTS_int; reg PRLD_int; //-------- JTAG Globals -------------- wire JTAG_TDO_GLBL; wire JTAG_TCK_GLBL; wire JTAG_TDI_GLBL; wire JTAG_TMS_GLBL; wire JTAG_TRST_GLBL; reg JTAG_CAPTURE_GLBL; reg JTAG_RESET_GLBL; reg JTAG_SHIFT_GLBL; reg JTAG_UPDATE_GLBL; reg JTAG_RUNTEST_GLBL; reg JTAG_SEL1_GLBL = 0; reg JTAG_SEL2_GLBL = 0 ; reg JTAG_SEL3_GLBL = 0; reg JTAG_SEL4_GLBL = 0; reg JTAG_USER_TDO1_GLBL = 1'bz; reg JTAG_USER_TDO2_GLBL = 1'bz; reg JTAG_USER_TDO3_GLBL = 1'bz; reg JTAG_USER_TDO4_GLBL = 1'bz; assign (strong1, weak0) GSR = GSR_int; assign (strong1, weak0) GTS = GTS_int; assign (weak1, weak0) PRLD = PRLD_int; initial begin GSR_int = 1'b1; PRLD_int = 1'b1; #(ROC_WIDTH) GSR_int = 1'b0; PRLD_int = 1'b0; end initial begin GTS_int = 1'b1; #(TOC_WIDTH) GTS_int = 1'b0; end endmodule `endif
// $Header: /devl/xcs/repo/env/Databases/CAEInterfaces/verunilibs/data/glbl.v,v 1.14 2010/10/28 20:44:00 fphillip Exp $ `ifndef GLBL `define GLBL `timescale 1 ps / 1 ps module glbl (); parameter ROC_WIDTH = 100000; parameter TOC_WIDTH = 0; //-------- STARTUP Globals -------------- wire GSR; wire GTS; wire GWE; wire PRLD; tri1 p_up_tmp; tri (weak1, strong0) PLL_LOCKG = p_up_tmp; wire PROGB_GLBL; wire CCLKO_GLBL; wire FCSBO_GLBL; wire [3:0] DO_GLBL; wire [3:0] DI_GLBL; reg GSR_int; reg GTS_int; reg PRLD_int; //-------- JTAG Globals -------------- wire JTAG_TDO_GLBL; wire JTAG_TCK_GLBL; wire JTAG_TDI_GLBL; wire JTAG_TMS_GLBL; wire JTAG_TRST_GLBL; reg JTAG_CAPTURE_GLBL; reg JTAG_RESET_GLBL; reg JTAG_SHIFT_GLBL; reg JTAG_UPDATE_GLBL; reg JTAG_RUNTEST_GLBL; reg JTAG_SEL1_GLBL = 0; reg JTAG_SEL2_GLBL = 0 ; reg JTAG_SEL3_GLBL = 0; reg JTAG_SEL4_GLBL = 0; reg JTAG_USER_TDO1_GLBL = 1'bz; reg JTAG_USER_TDO2_GLBL = 1'bz; reg JTAG_USER_TDO3_GLBL = 1'bz; reg JTAG_USER_TDO4_GLBL = 1'bz; assign (strong1, weak0) GSR = GSR_int; assign (strong1, weak0) GTS = GTS_int; assign (weak1, weak0) PRLD = PRLD_int; initial begin GSR_int = 1'b1; PRLD_int = 1'b1; #(ROC_WIDTH) GSR_int = 1'b0; PRLD_int = 1'b0; end initial begin GTS_int = 1'b1; #(TOC_WIDTH) GTS_int = 1'b0; end endmodule `endif
//Legal Notice: (C)2017 Altera Corporation. All rights reserved. Your //use of Altera Corporation's design tools, logic functions and other //software and tools, and its AMPP partner logic functions, and any //output files any of the foregoing (including device programming or //simulation files), and any associated documentation or information are //expressly subject to the terms and conditions of the Altera Program //License Subscription Agreement or other applicable license agreement, //including, without limitation, that your use is for the sole purpose //of programming logic devices manufactured by Altera and sold by Altera //or its authorized distributors. Please refer to the applicable //agreement for further details. // synthesis translate_off `timescale 1ns / 1ps // synthesis translate_on // turn off superfluous verilog processor warnings // altera message_level Level1 // altera message_off 10034 10035 10036 10037 10230 10240 10030 module soc_design_niosII_core_cpu_debug_slave_wrapper ( // inputs: MonDReg, break_readreg, clk, dbrk_hit0_latch, dbrk_hit1_latch, dbrk_hit2_latch, dbrk_hit3_latch, debugack, monitor_error, monitor_ready, reset_n, resetlatch, tracemem_on, tracemem_trcdata, tracemem_tw, trc_im_addr, trc_on, trc_wrap, trigbrktype, trigger_state_1, // outputs: jdo, jrst_n, st_ready_test_idle, take_action_break_a, take_action_break_b, take_action_break_c, take_action_ocimem_a, take_action_ocimem_b, take_action_tracectrl, take_no_action_break_a, take_no_action_break_b, take_no_action_break_c, take_no_action_ocimem_a ) ; output [ 37: 0] jdo; output jrst_n; output st_ready_test_idle; output take_action_break_a; output take_action_break_b; output take_action_break_c; output take_action_ocimem_a; output take_action_ocimem_b; output take_action_tracectrl; output take_no_action_break_a; output take_no_action_break_b; output take_no_action_break_c; output take_no_action_ocimem_a; input [ 31: 0] MonDReg; input [ 31: 0] break_readreg; input clk; input dbrk_hit0_latch; input dbrk_hit1_latch; input dbrk_hit2_latch; input dbrk_hit3_latch; input debugack; input monitor_error; input monitor_ready; input reset_n; input resetlatch; input tracemem_on; input [ 35: 0] tracemem_trcdata; input tracemem_tw; input [ 6: 0] trc_im_addr; input trc_on; input trc_wrap; input trigbrktype; input trigger_state_1; wire [ 37: 0] jdo; wire jrst_n; wire [ 37: 0] sr; wire st_ready_test_idle; wire take_action_break_a; wire take_action_break_b; wire take_action_break_c; wire take_action_ocimem_a; wire take_action_ocimem_b; wire take_action_tracectrl; wire take_no_action_break_a; wire take_no_action_break_b; wire take_no_action_break_c; wire take_no_action_ocimem_a; wire vji_cdr; wire [ 1: 0] vji_ir_in; wire [ 1: 0] vji_ir_out; wire vji_rti; wire vji_sdr; wire vji_tck; wire vji_tdi; wire vji_tdo; wire vji_udr; wire vji_uir; //Change the sld_virtual_jtag_basic's defparams to //switch between a regular Nios II or an internally embedded Nios II. //For a regular Nios II, sld_mfg_id = 70, sld_type_id = 34. //For an internally embedded Nios II, slf_mfg_id = 110, sld_type_id = 135. soc_design_niosII_core_cpu_debug_slave_tck the_soc_design_niosII_core_cpu_debug_slave_tck ( .MonDReg (MonDReg), .break_readreg (break_readreg), .dbrk_hit0_latch (dbrk_hit0_latch), .dbrk_hit1_latch (dbrk_hit1_latch), .dbrk_hit2_latch (dbrk_hit2_latch), .dbrk_hit3_latch (dbrk_hit3_latch), .debugack (debugack), .ir_in (vji_ir_in), .ir_out (vji_ir_out), .jrst_n (jrst_n), .jtag_state_rti (vji_rti), .monitor_error (monitor_error), .monitor_ready (monitor_ready), .reset_n (reset_n), .resetlatch (resetlatch), .sr (sr), .st_ready_test_idle (st_ready_test_idle), .tck (vji_tck), .tdi (vji_tdi), .tdo (vji_tdo), .tracemem_on (tracemem_on), .tracemem_trcdata (tracemem_trcdata), .tracemem_tw (tracemem_tw), .trc_im_addr (trc_im_addr), .trc_on (trc_on), .trc_wrap (trc_wrap), .trigbrktype (trigbrktype), .trigger_state_1 (trigger_state_1), .vs_cdr (vji_cdr), .vs_sdr (vji_sdr), .vs_uir (vji_uir) ); soc_design_niosII_core_cpu_debug_slave_sysclk the_soc_design_niosII_core_cpu_debug_slave_sysclk ( .clk (clk), .ir_in (vji_ir_in), .jdo (jdo), .sr (sr), .take_action_break_a (take_action_break_a), .take_action_break_b (take_action_break_b), .take_action_break_c (take_action_break_c), .take_action_ocimem_a (take_action_ocimem_a), .take_action_ocimem_b (take_action_ocimem_b), .take_action_tracectrl (take_action_tracectrl), .take_no_action_break_a (take_no_action_break_a), .take_no_action_break_b (take_no_action_break_b), .take_no_action_break_c (take_no_action_break_c), .take_no_action_ocimem_a (take_no_action_ocimem_a), .vs_udr (vji_udr), .vs_uir (vji_uir) ); //synthesis translate_off //////////////// SIMULATION-ONLY CONTENTS assign vji_tck = 1'b0; assign vji_tdi = 1'b0; assign vji_sdr = 1'b0; assign vji_cdr = 1'b0; assign vji_rti = 1'b0; assign vji_uir = 1'b0; assign vji_udr = 1'b0; assign vji_ir_in = 2'b0; //////////////// END SIMULATION-ONLY CONTENTS //synthesis translate_on //synthesis read_comments_as_HDL on // sld_virtual_jtag_basic soc_design_niosII_core_cpu_debug_slave_phy // ( // .ir_in (vji_ir_in), // .ir_out (vji_ir_out), // .jtag_state_rti (vji_rti), // .tck (vji_tck), // .tdi (vji_tdi), // .tdo (vji_tdo), // .virtual_state_cdr (vji_cdr), // .virtual_state_sdr (vji_sdr), // .virtual_state_udr (vji_udr), // .virtual_state_uir (vji_uir) // ); // // defparam soc_design_niosII_core_cpu_debug_slave_phy.sld_auto_instance_index = "YES", // soc_design_niosII_core_cpu_debug_slave_phy.sld_instance_index = 0, // soc_design_niosII_core_cpu_debug_slave_phy.sld_ir_width = 2, // soc_design_niosII_core_cpu_debug_slave_phy.sld_mfg_id = 70, // soc_design_niosII_core_cpu_debug_slave_phy.sld_sim_action = "", // soc_design_niosII_core_cpu_debug_slave_phy.sld_sim_n_scan = 0, // soc_design_niosII_core_cpu_debug_slave_phy.sld_sim_total_length = 0, // soc_design_niosII_core_cpu_debug_slave_phy.sld_type_id = 34, // soc_design_niosII_core_cpu_debug_slave_phy.sld_version = 3; // //synthesis read_comments_as_HDL off endmodule
//Legal Notice: (C)2017 Altera Corporation. All rights reserved. Your //use of Altera Corporation's design tools, logic functions and other //software and tools, and its AMPP partner logic functions, and any //output files any of the foregoing (including device programming or //simulation files), and any associated documentation or information are //expressly subject to the terms and conditions of the Altera Program //License Subscription Agreement or other applicable license agreement, //including, without limitation, that your use is for the sole purpose //of programming logic devices manufactured by Altera and sold by Altera //or its authorized distributors. Please refer to the applicable //agreement for further details. // synthesis translate_off `timescale 1ns / 1ps // synthesis translate_on // turn off superfluous verilog processor warnings // altera message_level Level1 // altera message_off 10034 10035 10036 10037 10230 10240 10030 module soc_design_JTAG_sim_scfifo_w ( // inputs: clk, fifo_wdata, fifo_wr, // outputs: fifo_FF, r_dat, wfifo_empty, wfifo_used ) ; output fifo_FF; output [ 7: 0] r_dat; output wfifo_empty; output [ 5: 0] wfifo_used; input clk; input [ 7: 0] fifo_wdata; input fifo_wr; wire fifo_FF; wire [ 7: 0] r_dat; wire wfifo_empty; wire [ 5: 0] wfifo_used; //synthesis translate_off //////////////// SIMULATION-ONLY CONTENTS always @(posedge clk) begin if (fifo_wr) $write("%c", fifo_wdata); end assign wfifo_used = {6{1'b0}}; assign r_dat = {8{1'b0}}; assign fifo_FF = 1'b0; assign wfifo_empty = 1'b1; //////////////// END SIMULATION-ONLY CONTENTS //synthesis translate_on endmodule // synthesis translate_off `timescale 1ns / 1ps // synthesis translate_on // turn off superfluous verilog processor warnings // altera message_level Level1 // altera message_off 10034 10035 10036 10037 10230 10240 10030 module soc_design_JTAG_scfifo_w ( // inputs: clk, fifo_clear, fifo_wdata, fifo_wr, rd_wfifo, // outputs: fifo_FF, r_dat, wfifo_empty, wfifo_used ) ; output fifo_FF; output [ 7: 0] r_dat; output wfifo_empty; output [ 5: 0] wfifo_used; input clk; input fifo_clear; input [ 7: 0] fifo_wdata; input fifo_wr; input rd_wfifo; wire fifo_FF; wire [ 7: 0] r_dat; wire wfifo_empty; wire [ 5: 0] wfifo_used; //synthesis translate_off //////////////// SIMULATION-ONLY CONTENTS soc_design_JTAG_sim_scfifo_w the_soc_design_JTAG_sim_scfifo_w ( .clk (clk), .fifo_FF (fifo_FF), .fifo_wdata (fifo_wdata), .fifo_wr (fifo_wr), .r_dat (r_dat), .wfifo_empty (wfifo_empty), .wfifo_used (wfifo_used) ); //////////////// END SIMULATION-ONLY CONTENTS //synthesis translate_on //synthesis read_comments_as_HDL on // scfifo wfifo // ( // .aclr (fifo_clear), // .clock (clk), // .data (fifo_wdata), // .empty (wfifo_empty), // .full (fifo_FF), // .q (r_dat), // .rdreq (rd_wfifo), // .usedw (wfifo_used), // .wrreq (fifo_wr) // ); // // defparam wfifo.lpm_hint = "RAM_BLOCK_TYPE=AUTO", // wfifo.lpm_numwords = 64, // wfifo.lpm_showahead = "OFF", // wfifo.lpm_type = "scfifo", // wfifo.lpm_width = 8, // wfifo.lpm_widthu = 6, // wfifo.overflow_checking = "OFF", // wfifo.underflow_checking = "OFF", // wfifo.use_eab = "ON"; // //synthesis read_comments_as_HDL off endmodule // synthesis translate_off `timescale 1ns / 1ps // synthesis translate_on // turn off superfluous verilog processor warnings // altera message_level Level1 // altera message_off 10034 10035 10036 10037 10230 10240 10030 module soc_design_JTAG_sim_scfifo_r ( // inputs: clk, fifo_rd, rst_n, // outputs: fifo_EF, fifo_rdata, rfifo_full, rfifo_used ) ; output fifo_EF; output [ 7: 0] fifo_rdata; output rfifo_full; output [ 5: 0] rfifo_used; input clk; input fifo_rd; input rst_n; reg [ 31: 0] bytes_left; wire fifo_EF; reg fifo_rd_d; wire [ 7: 0] fifo_rdata; wire new_rom; wire [ 31: 0] num_bytes; wire [ 6: 0] rfifo_entries; wire rfifo_full; wire [ 5: 0] rfifo_used; //synthesis translate_off //////////////// SIMULATION-ONLY CONTENTS // Generate rfifo_entries for simulation always @(posedge clk or negedge rst_n) begin if (rst_n == 0) begin bytes_left <= 32'h0; fifo_rd_d <= 1'b0; end else begin fifo_rd_d <= fifo_rd; // decrement on read if (fifo_rd_d) bytes_left <= bytes_left - 1'b1; // catch new contents if (new_rom) bytes_left <= num_bytes; end end assign fifo_EF = bytes_left == 32'b0; assign rfifo_full = bytes_left > 7'h40; assign rfifo_entries = (rfifo_full) ? 7'h40 : bytes_left; assign rfifo_used = rfifo_entries[5 : 0]; assign new_rom = 1'b0; assign num_bytes = 32'b0; assign fifo_rdata = 8'b0; //////////////// END SIMULATION-ONLY CONTENTS //synthesis translate_on endmodule // synthesis translate_off `timescale 1ns / 1ps // synthesis translate_on // turn off superfluous verilog processor warnings // altera message_level Level1 // altera message_off 10034 10035 10036 10037 10230 10240 10030 module soc_design_JTAG_scfifo_r ( // inputs: clk, fifo_clear, fifo_rd, rst_n, t_dat, wr_rfifo, // outputs: fifo_EF, fifo_rdata, rfifo_full, rfifo_used ) ; output fifo_EF; output [ 7: 0] fifo_rdata; output rfifo_full; output [ 5: 0] rfifo_used; input clk; input fifo_clear; input fifo_rd; input rst_n; input [ 7: 0] t_dat; input wr_rfifo; wire fifo_EF; wire [ 7: 0] fifo_rdata; wire rfifo_full; wire [ 5: 0] rfifo_used; //synthesis translate_off //////////////// SIMULATION-ONLY CONTENTS soc_design_JTAG_sim_scfifo_r the_soc_design_JTAG_sim_scfifo_r ( .clk (clk), .fifo_EF (fifo_EF), .fifo_rd (fifo_rd), .fifo_rdata (fifo_rdata), .rfifo_full (rfifo_full), .rfifo_used (rfifo_used), .rst_n (rst_n) ); //////////////// END SIMULATION-ONLY CONTENTS //synthesis translate_on //synthesis read_comments_as_HDL on // scfifo rfifo // ( // .aclr (fifo_clear), // .clock (clk), // .data (t_dat), // .empty (fifo_EF), // .full (rfifo_full), // .q (fifo_rdata), // .rdreq (fifo_rd), // .usedw (rfifo_used), // .wrreq (wr_rfifo) // ); // // defparam rfifo.lpm_hint = "RAM_BLOCK_TYPE=AUTO", // rfifo.lpm_numwords = 64, // rfifo.lpm_showahead = "OFF", // rfifo.lpm_type = "scfifo", // rfifo.lpm_width = 8, // rfifo.lpm_widthu = 6, // rfifo.overflow_checking = "OFF", // rfifo.underflow_checking = "OFF", // rfifo.use_eab = "ON"; // //synthesis read_comments_as_HDL off endmodule // synthesis translate_off `timescale 1ns / 1ps // synthesis translate_on // turn off superfluous verilog processor warnings // altera message_level Level1 // altera message_off 10034 10035 10036 10037 10230 10240 10030 module soc_design_JTAG ( // inputs: av_address, av_chipselect, av_read_n, av_write_n, av_writedata, clk, rst_n, // outputs: av_irq, av_readdata, av_waitrequest, dataavailable, readyfordata ) /* synthesis ALTERA_ATTRIBUTE = "SUPPRESS_DA_RULE_INTERNAL=\"R101,C106,D101,D103\"" */ ; output av_irq; output [ 31: 0] av_readdata; output av_waitrequest; output dataavailable; output readyfordata; input av_address; input av_chipselect; input av_read_n; input av_write_n; input [ 31: 0] av_writedata; input clk; input rst_n; reg ac; wire activity; wire av_irq; wire [ 31: 0] av_readdata; reg av_waitrequest; reg dataavailable; reg fifo_AE; reg fifo_AF; wire fifo_EF; wire fifo_FF; wire fifo_clear; wire fifo_rd; wire [ 7: 0] fifo_rdata; wire [ 7: 0] fifo_wdata; reg fifo_wr; reg ien_AE; reg ien_AF; wire ipen_AE; wire ipen_AF; reg pause_irq; wire [ 7: 0] r_dat; wire r_ena; reg r_val; wire rd_wfifo; reg read_0; reg readyfordata; wire rfifo_full; wire [ 5: 0] rfifo_used; reg rvalid; reg sim_r_ena; reg sim_t_dat; reg sim_t_ena; reg sim_t_pause; wire [ 7: 0] t_dat; reg t_dav; wire t_ena; wire t_pause; wire wfifo_empty; wire [ 5: 0] wfifo_used; reg woverflow; wire wr_rfifo; //avalon_jtag_slave, which is an e_avalon_slave assign rd_wfifo = r_ena & ~wfifo_empty; assign wr_rfifo = t_ena & ~rfifo_full; assign fifo_clear = ~rst_n; soc_design_JTAG_scfifo_w the_soc_design_JTAG_scfifo_w ( .clk (clk), .fifo_FF (fifo_FF), .fifo_clear (fifo_clear), .fifo_wdata (fifo_wdata), .fifo_wr (fifo_wr), .r_dat (r_dat), .rd_wfifo (rd_wfifo), .wfifo_empty (wfifo_empty), .wfifo_used (wfifo_used) ); soc_design_JTAG_scfifo_r the_soc_design_JTAG_scfifo_r ( .clk (clk), .fifo_EF (fifo_EF), .fifo_clear (fifo_clear), .fifo_rd (fifo_rd), .fifo_rdata (fifo_rdata), .rfifo_full (rfifo_full), .rfifo_used (rfifo_used), .rst_n (rst_n), .t_dat (t_dat), .wr_rfifo (wr_rfifo) ); assign ipen_AE = ien_AE & fifo_AE; assign ipen_AF = ien_AF & (pause_irq | fifo_AF); assign av_irq = ipen_AE | ipen_AF; assign activity = t_pause | t_ena; always @(posedge clk or negedge rst_n) begin if (rst_n == 0) pause_irq <= 1'b0; else // only if fifo is not empty... if (t_pause & ~fifo_EF) pause_irq <= 1'b1; else if (read_0) pause_irq <= 1'b0; end always @(posedge clk or negedge rst_n) begin if (rst_n == 0) begin r_val <= 1'b0; t_dav <= 1'b1; end else begin r_val <= r_ena & ~wfifo_empty; t_dav <= ~rfifo_full; end end always @(posedge clk or negedge rst_n) begin if (rst_n == 0) begin fifo_AE <= 1'b0; fifo_AF <= 1'b0; fifo_wr <= 1'b0; rvalid <= 1'b0; read_0 <= 1'b0; ien_AE <= 1'b0; ien_AF <= 1'b0; ac <= 1'b0; woverflow <= 1'b0; av_waitrequest <= 1'b1; end else begin fifo_AE <= {fifo_FF,wfifo_used} <= 8; fifo_AF <= (7'h40 - {rfifo_full,rfifo_used}) <= 8; fifo_wr <= 1'b0; read_0 <= 1'b0; av_waitrequest <= ~(av_chipselect & (~av_write_n | ~av_read_n) & av_waitrequest); if (activity) ac <= 1'b1; // write if (av_chipselect & ~av_write_n & av_waitrequest) // addr 1 is control; addr 0 is data if (av_address) begin ien_AF <= av_writedata[0]; ien_AE <= av_writedata[1]; if (av_writedata[10] & ~activity) ac <= 1'b0; end else begin fifo_wr <= ~fifo_FF; woverflow <= fifo_FF; end // read if (av_chipselect & ~av_read_n & av_waitrequest) begin // addr 1 is interrupt; addr 0 is data if (~av_address) rvalid <= ~fifo_EF; read_0 <= ~av_address; end end end assign fifo_wdata = av_writedata[7 : 0]; assign fifo_rd = (av_chipselect & ~av_read_n & av_waitrequest & ~av_address) ? ~fifo_EF : 1'b0; assign av_readdata = read_0 ? { {9{1'b0}},rfifo_full,rfifo_used,rvalid,woverflow,~fifo_FF,~fifo_EF,1'b0,ac,ipen_AE,ipen_AF,fifo_rdata } : { {9{1'b0}},(7'h40 - {fifo_FF,wfifo_used}),rvalid,woverflow,~fifo_FF,~fifo_EF,1'b0,ac,ipen_AE,ipen_AF,{6{1'b0}},ien_AE,ien_AF }; always @(posedge clk or negedge rst_n) begin if (rst_n == 0) readyfordata <= 0; else readyfordata <= ~fifo_FF; end //synthesis translate_off //////////////// SIMULATION-ONLY CONTENTS // Tie off Atlantic Interface signals not used for simulation always @(posedge clk) begin sim_t_pause <= 1'b0; sim_t_ena <= 1'b0; sim_t_dat <= t_dav ? r_dat : {8{r_val}}; sim_r_ena <= 1'b0; end assign r_ena = sim_r_ena; assign t_ena = sim_t_ena; assign t_dat = sim_t_dat; assign t_pause = sim_t_pause; always @(fifo_EF) begin dataavailable = ~fifo_EF; end //////////////// END SIMULATION-ONLY CONTENTS //synthesis translate_on //synthesis read_comments_as_HDL on // alt_jtag_atlantic soc_design_JTAG_alt_jtag_atlantic // ( // .clk (clk), // .r_dat (r_dat), // .r_ena (r_ena), // .r_val (r_val), // .rst_n (rst_n), // .t_dat (t_dat), // .t_dav (t_dav), // .t_ena (t_ena), // .t_pause (t_pause) // ); // // defparam soc_design_JTAG_alt_jtag_atlantic.INSTANCE_ID = 0, // soc_design_JTAG_alt_jtag_atlantic.LOG2_RXFIFO_DEPTH = 6, // soc_design_JTAG_alt_jtag_atlantic.LOG2_TXFIFO_DEPTH = 6, // soc_design_JTAG_alt_jtag_atlantic.SLD_AUTO_INSTANCE_INDEX = "YES"; // // always @(posedge clk or negedge rst_n) // begin // if (rst_n == 0) // dataavailable <= 0; // else // dataavailable <= ~fifo_EF; // end // // //synthesis read_comments_as_HDL off endmodule
//Legal Notice: (C)2017 Altera Corporation. All rights reserved. Your //use of Altera Corporation's design tools, logic functions and other //software and tools, and its AMPP partner logic functions, and any //output files any of the foregoing (including device programming or //simulation files), and any associated documentation or information are //expressly subject to the terms and conditions of the Altera Program //License Subscription Agreement or other applicable license agreement, //including, without limitation, that your use is for the sole purpose //of programming logic devices manufactured by Altera and sold by Altera //or its authorized distributors. Please refer to the applicable //agreement for further details. // synthesis translate_off `timescale 1ns / 1ps // synthesis translate_on // turn off superfluous verilog processor warnings // altera message_level Level1 // altera message_off 10034 10035 10036 10037 10230 10240 10030 module soc_design_JTAG_sim_scfifo_w ( // inputs: clk, fifo_wdata, fifo_wr, // outputs: fifo_FF, r_dat, wfifo_empty, wfifo_used ) ; output fifo_FF; output [ 7: 0] r_dat; output wfifo_empty; output [ 5: 0] wfifo_used; input clk; input [ 7: 0] fifo_wdata; input fifo_wr; wire fifo_FF; wire [ 7: 0] r_dat; wire wfifo_empty; wire [ 5: 0] wfifo_used; //synthesis translate_off //////////////// SIMULATION-ONLY CONTENTS always @(posedge clk) begin if (fifo_wr) $write("%c", fifo_wdata); end assign wfifo_used = {6{1'b0}}; assign r_dat = {8{1'b0}}; assign fifo_FF = 1'b0; assign wfifo_empty = 1'b1; //////////////// END SIMULATION-ONLY CONTENTS //synthesis translate_on endmodule // synthesis translate_off `timescale 1ns / 1ps // synthesis translate_on // turn off superfluous verilog processor warnings // altera message_level Level1 // altera message_off 10034 10035 10036 10037 10230 10240 10030 module soc_design_JTAG_scfifo_w ( // inputs: clk, fifo_clear, fifo_wdata, fifo_wr, rd_wfifo, // outputs: fifo_FF, r_dat, wfifo_empty, wfifo_used ) ; output fifo_FF; output [ 7: 0] r_dat; output wfifo_empty; output [ 5: 0] wfifo_used; input clk; input fifo_clear; input [ 7: 0] fifo_wdata; input fifo_wr; input rd_wfifo; wire fifo_FF; wire [ 7: 0] r_dat; wire wfifo_empty; wire [ 5: 0] wfifo_used; //synthesis translate_off //////////////// SIMULATION-ONLY CONTENTS soc_design_JTAG_sim_scfifo_w the_soc_design_JTAG_sim_scfifo_w ( .clk (clk), .fifo_FF (fifo_FF), .fifo_wdata (fifo_wdata), .fifo_wr (fifo_wr), .r_dat (r_dat), .wfifo_empty (wfifo_empty), .wfifo_used (wfifo_used) ); //////////////// END SIMULATION-ONLY CONTENTS //synthesis translate_on //synthesis read_comments_as_HDL on // scfifo wfifo // ( // .aclr (fifo_clear), // .clock (clk), // .data (fifo_wdata), // .empty (wfifo_empty), // .full (fifo_FF), // .q (r_dat), // .rdreq (rd_wfifo), // .usedw (wfifo_used), // .wrreq (fifo_wr) // ); // // defparam wfifo.lpm_hint = "RAM_BLOCK_TYPE=AUTO", // wfifo.lpm_numwords = 64, // wfifo.lpm_showahead = "OFF", // wfifo.lpm_type = "scfifo", // wfifo.lpm_width = 8, // wfifo.lpm_widthu = 6, // wfifo.overflow_checking = "OFF", // wfifo.underflow_checking = "OFF", // wfifo.use_eab = "ON"; // //synthesis read_comments_as_HDL off endmodule // synthesis translate_off `timescale 1ns / 1ps // synthesis translate_on // turn off superfluous verilog processor warnings // altera message_level Level1 // altera message_off 10034 10035 10036 10037 10230 10240 10030 module soc_design_JTAG_sim_scfifo_r ( // inputs: clk, fifo_rd, rst_n, // outputs: fifo_EF, fifo_rdata, rfifo_full, rfifo_used ) ; output fifo_EF; output [ 7: 0] fifo_rdata; output rfifo_full; output [ 5: 0] rfifo_used; input clk; input fifo_rd; input rst_n; reg [ 31: 0] bytes_left; wire fifo_EF; reg fifo_rd_d; wire [ 7: 0] fifo_rdata; wire new_rom; wire [ 31: 0] num_bytes; wire [ 6: 0] rfifo_entries; wire rfifo_full; wire [ 5: 0] rfifo_used; //synthesis translate_off //////////////// SIMULATION-ONLY CONTENTS // Generate rfifo_entries for simulation always @(posedge clk or negedge rst_n) begin if (rst_n == 0) begin bytes_left <= 32'h0; fifo_rd_d <= 1'b0; end else begin fifo_rd_d <= fifo_rd; // decrement on read if (fifo_rd_d) bytes_left <= bytes_left - 1'b1; // catch new contents if (new_rom) bytes_left <= num_bytes; end end assign fifo_EF = bytes_left == 32'b0; assign rfifo_full = bytes_left > 7'h40; assign rfifo_entries = (rfifo_full) ? 7'h40 : bytes_left; assign rfifo_used = rfifo_entries[5 : 0]; assign new_rom = 1'b0; assign num_bytes = 32'b0; assign fifo_rdata = 8'b0; //////////////// END SIMULATION-ONLY CONTENTS //synthesis translate_on endmodule // synthesis translate_off `timescale 1ns / 1ps // synthesis translate_on // turn off superfluous verilog processor warnings // altera message_level Level1 // altera message_off 10034 10035 10036 10037 10230 10240 10030 module soc_design_JTAG_scfifo_r ( // inputs: clk, fifo_clear, fifo_rd, rst_n, t_dat, wr_rfifo, // outputs: fifo_EF, fifo_rdata, rfifo_full, rfifo_used ) ; output fifo_EF; output [ 7: 0] fifo_rdata; output rfifo_full; output [ 5: 0] rfifo_used; input clk; input fifo_clear; input fifo_rd; input rst_n; input [ 7: 0] t_dat; input wr_rfifo; wire fifo_EF; wire [ 7: 0] fifo_rdata; wire rfifo_full; wire [ 5: 0] rfifo_used; //synthesis translate_off //////////////// SIMULATION-ONLY CONTENTS soc_design_JTAG_sim_scfifo_r the_soc_design_JTAG_sim_scfifo_r ( .clk (clk), .fifo_EF (fifo_EF), .fifo_rd (fifo_rd), .fifo_rdata (fifo_rdata), .rfifo_full (rfifo_full), .rfifo_used (rfifo_used), .rst_n (rst_n) ); //////////////// END SIMULATION-ONLY CONTENTS //synthesis translate_on //synthesis read_comments_as_HDL on // scfifo rfifo // ( // .aclr (fifo_clear), // .clock (clk), // .data (t_dat), // .empty (fifo_EF), // .full (rfifo_full), // .q (fifo_rdata), // .rdreq (fifo_rd), // .usedw (rfifo_used), // .wrreq (wr_rfifo) // ); // // defparam rfifo.lpm_hint = "RAM_BLOCK_TYPE=AUTO", // rfifo.lpm_numwords = 64, // rfifo.lpm_showahead = "OFF", // rfifo.lpm_type = "scfifo", // rfifo.lpm_width = 8, // rfifo.lpm_widthu = 6, // rfifo.overflow_checking = "OFF", // rfifo.underflow_checking = "OFF", // rfifo.use_eab = "ON"; // //synthesis read_comments_as_HDL off endmodule // synthesis translate_off `timescale 1ns / 1ps // synthesis translate_on // turn off superfluous verilog processor warnings // altera message_level Level1 // altera message_off 10034 10035 10036 10037 10230 10240 10030 module soc_design_JTAG ( // inputs: av_address, av_chipselect, av_read_n, av_write_n, av_writedata, clk, rst_n, // outputs: av_irq, av_readdata, av_waitrequest, dataavailable, readyfordata ) /* synthesis ALTERA_ATTRIBUTE = "SUPPRESS_DA_RULE_INTERNAL=\"R101,C106,D101,D103\"" */ ; output av_irq; output [ 31: 0] av_readdata; output av_waitrequest; output dataavailable; output readyfordata; input av_address; input av_chipselect; input av_read_n; input av_write_n; input [ 31: 0] av_writedata; input clk; input rst_n; reg ac; wire activity; wire av_irq; wire [ 31: 0] av_readdata; reg av_waitrequest; reg dataavailable; reg fifo_AE; reg fifo_AF; wire fifo_EF; wire fifo_FF; wire fifo_clear; wire fifo_rd; wire [ 7: 0] fifo_rdata; wire [ 7: 0] fifo_wdata; reg fifo_wr; reg ien_AE; reg ien_AF; wire ipen_AE; wire ipen_AF; reg pause_irq; wire [ 7: 0] r_dat; wire r_ena; reg r_val; wire rd_wfifo; reg read_0; reg readyfordata; wire rfifo_full; wire [ 5: 0] rfifo_used; reg rvalid; reg sim_r_ena; reg sim_t_dat; reg sim_t_ena; reg sim_t_pause; wire [ 7: 0] t_dat; reg t_dav; wire t_ena; wire t_pause; wire wfifo_empty; wire [ 5: 0] wfifo_used; reg woverflow; wire wr_rfifo; //avalon_jtag_slave, which is an e_avalon_slave assign rd_wfifo = r_ena & ~wfifo_empty; assign wr_rfifo = t_ena & ~rfifo_full; assign fifo_clear = ~rst_n; soc_design_JTAG_scfifo_w the_soc_design_JTAG_scfifo_w ( .clk (clk), .fifo_FF (fifo_FF), .fifo_clear (fifo_clear), .fifo_wdata (fifo_wdata), .fifo_wr (fifo_wr), .r_dat (r_dat), .rd_wfifo (rd_wfifo), .wfifo_empty (wfifo_empty), .wfifo_used (wfifo_used) ); soc_design_JTAG_scfifo_r the_soc_design_JTAG_scfifo_r ( .clk (clk), .fifo_EF (fifo_EF), .fifo_clear (fifo_clear), .fifo_rd (fifo_rd), .fifo_rdata (fifo_rdata), .rfifo_full (rfifo_full), .rfifo_used (rfifo_used), .rst_n (rst_n), .t_dat (t_dat), .wr_rfifo (wr_rfifo) ); assign ipen_AE = ien_AE & fifo_AE; assign ipen_AF = ien_AF & (pause_irq | fifo_AF); assign av_irq = ipen_AE | ipen_AF; assign activity = t_pause | t_ena; always @(posedge clk or negedge rst_n) begin if (rst_n == 0) pause_irq <= 1'b0; else // only if fifo is not empty... if (t_pause & ~fifo_EF) pause_irq <= 1'b1; else if (read_0) pause_irq <= 1'b0; end always @(posedge clk or negedge rst_n) begin if (rst_n == 0) begin r_val <= 1'b0; t_dav <= 1'b1; end else begin r_val <= r_ena & ~wfifo_empty; t_dav <= ~rfifo_full; end end always @(posedge clk or negedge rst_n) begin if (rst_n == 0) begin fifo_AE <= 1'b0; fifo_AF <= 1'b0; fifo_wr <= 1'b0; rvalid <= 1'b0; read_0 <= 1'b0; ien_AE <= 1'b0; ien_AF <= 1'b0; ac <= 1'b0; woverflow <= 1'b0; av_waitrequest <= 1'b1; end else begin fifo_AE <= {fifo_FF,wfifo_used} <= 8; fifo_AF <= (7'h40 - {rfifo_full,rfifo_used}) <= 8; fifo_wr <= 1'b0; read_0 <= 1'b0; av_waitrequest <= ~(av_chipselect & (~av_write_n | ~av_read_n) & av_waitrequest); if (activity) ac <= 1'b1; // write if (av_chipselect & ~av_write_n & av_waitrequest) // addr 1 is control; addr 0 is data if (av_address) begin ien_AF <= av_writedata[0]; ien_AE <= av_writedata[1]; if (av_writedata[10] & ~activity) ac <= 1'b0; end else begin fifo_wr <= ~fifo_FF; woverflow <= fifo_FF; end // read if (av_chipselect & ~av_read_n & av_waitrequest) begin // addr 1 is interrupt; addr 0 is data if (~av_address) rvalid <= ~fifo_EF; read_0 <= ~av_address; end end end assign fifo_wdata = av_writedata[7 : 0]; assign fifo_rd = (av_chipselect & ~av_read_n & av_waitrequest & ~av_address) ? ~fifo_EF : 1'b0; assign av_readdata = read_0 ? { {9{1'b0}},rfifo_full,rfifo_used,rvalid,woverflow,~fifo_FF,~fifo_EF,1'b0,ac,ipen_AE,ipen_AF,fifo_rdata } : { {9{1'b0}},(7'h40 - {fifo_FF,wfifo_used}),rvalid,woverflow,~fifo_FF,~fifo_EF,1'b0,ac,ipen_AE,ipen_AF,{6{1'b0}},ien_AE,ien_AF }; always @(posedge clk or negedge rst_n) begin if (rst_n == 0) readyfordata <= 0; else readyfordata <= ~fifo_FF; end //synthesis translate_off //////////////// SIMULATION-ONLY CONTENTS // Tie off Atlantic Interface signals not used for simulation always @(posedge clk) begin sim_t_pause <= 1'b0; sim_t_ena <= 1'b0; sim_t_dat <= t_dav ? r_dat : {8{r_val}}; sim_r_ena <= 1'b0; end assign r_ena = sim_r_ena; assign t_ena = sim_t_ena; assign t_dat = sim_t_dat; assign t_pause = sim_t_pause; always @(fifo_EF) begin dataavailable = ~fifo_EF; end //////////////// END SIMULATION-ONLY CONTENTS //synthesis translate_on //synthesis read_comments_as_HDL on // alt_jtag_atlantic soc_design_JTAG_alt_jtag_atlantic // ( // .clk (clk), // .r_dat (r_dat), // .r_ena (r_ena), // .r_val (r_val), // .rst_n (rst_n), // .t_dat (t_dat), // .t_dav (t_dav), // .t_ena (t_ena), // .t_pause (t_pause) // ); // // defparam soc_design_JTAG_alt_jtag_atlantic.INSTANCE_ID = 0, // soc_design_JTAG_alt_jtag_atlantic.LOG2_RXFIFO_DEPTH = 6, // soc_design_JTAG_alt_jtag_atlantic.LOG2_TXFIFO_DEPTH = 6, // soc_design_JTAG_alt_jtag_atlantic.SLD_AUTO_INSTANCE_INDEX = "YES"; // // always @(posedge clk or negedge rst_n) // begin // if (rst_n == 0) // dataavailable <= 0; // else // dataavailable <= ~fifo_EF; // end // // //synthesis read_comments_as_HDL off endmodule
//Legal Notice: (C)2017 Altera Corporation. All rights reserved. Your //use of Altera Corporation's design tools, logic functions and other //software and tools, and its AMPP partner logic functions, and any //output files any of the foregoing (including device programming or //simulation files), and any associated documentation or information are //expressly subject to the terms and conditions of the Altera Program //License Subscription Agreement or other applicable license agreement, //including, without limitation, that your use is for the sole purpose //of programming logic devices manufactured by Altera and sold by Altera //or its authorized distributors. Please refer to the applicable //agreement for further details. // synthesis translate_off `timescale 1ns / 1ps // synthesis translate_on // turn off superfluous verilog processor warnings // altera message_level Level1 // altera message_off 10034 10035 10036 10037 10230 10240 10030 module soc_design_JTAG_sim_scfifo_w ( // inputs: clk, fifo_wdata, fifo_wr, // outputs: fifo_FF, r_dat, wfifo_empty, wfifo_used ) ; output fifo_FF; output [ 7: 0] r_dat; output wfifo_empty; output [ 5: 0] wfifo_used; input clk; input [ 7: 0] fifo_wdata; input fifo_wr; wire fifo_FF; wire [ 7: 0] r_dat; wire wfifo_empty; wire [ 5: 0] wfifo_used; //synthesis translate_off //////////////// SIMULATION-ONLY CONTENTS always @(posedge clk) begin if (fifo_wr) $write("%c", fifo_wdata); end assign wfifo_used = {6{1'b0}}; assign r_dat = {8{1'b0}}; assign fifo_FF = 1'b0; assign wfifo_empty = 1'b1; //////////////// END SIMULATION-ONLY CONTENTS //synthesis translate_on endmodule // synthesis translate_off `timescale 1ns / 1ps // synthesis translate_on // turn off superfluous verilog processor warnings // altera message_level Level1 // altera message_off 10034 10035 10036 10037 10230 10240 10030 module soc_design_JTAG_scfifo_w ( // inputs: clk, fifo_clear, fifo_wdata, fifo_wr, rd_wfifo, // outputs: fifo_FF, r_dat, wfifo_empty, wfifo_used ) ; output fifo_FF; output [ 7: 0] r_dat; output wfifo_empty; output [ 5: 0] wfifo_used; input clk; input fifo_clear; input [ 7: 0] fifo_wdata; input fifo_wr; input rd_wfifo; wire fifo_FF; wire [ 7: 0] r_dat; wire wfifo_empty; wire [ 5: 0] wfifo_used; //synthesis translate_off //////////////// SIMULATION-ONLY CONTENTS soc_design_JTAG_sim_scfifo_w the_soc_design_JTAG_sim_scfifo_w ( .clk (clk), .fifo_FF (fifo_FF), .fifo_wdata (fifo_wdata), .fifo_wr (fifo_wr), .r_dat (r_dat), .wfifo_empty (wfifo_empty), .wfifo_used (wfifo_used) ); //////////////// END SIMULATION-ONLY CONTENTS //synthesis translate_on //synthesis read_comments_as_HDL on // scfifo wfifo // ( // .aclr (fifo_clear), // .clock (clk), // .data (fifo_wdata), // .empty (wfifo_empty), // .full (fifo_FF), // .q (r_dat), // .rdreq (rd_wfifo), // .usedw (wfifo_used), // .wrreq (fifo_wr) // ); // // defparam wfifo.lpm_hint = "RAM_BLOCK_TYPE=AUTO", // wfifo.lpm_numwords = 64, // wfifo.lpm_showahead = "OFF", // wfifo.lpm_type = "scfifo", // wfifo.lpm_width = 8, // wfifo.lpm_widthu = 6, // wfifo.overflow_checking = "OFF", // wfifo.underflow_checking = "OFF", // wfifo.use_eab = "ON"; // //synthesis read_comments_as_HDL off endmodule // synthesis translate_off `timescale 1ns / 1ps // synthesis translate_on // turn off superfluous verilog processor warnings // altera message_level Level1 // altera message_off 10034 10035 10036 10037 10230 10240 10030 module soc_design_JTAG_sim_scfifo_r ( // inputs: clk, fifo_rd, rst_n, // outputs: fifo_EF, fifo_rdata, rfifo_full, rfifo_used ) ; output fifo_EF; output [ 7: 0] fifo_rdata; output rfifo_full; output [ 5: 0] rfifo_used; input clk; input fifo_rd; input rst_n; reg [ 31: 0] bytes_left; wire fifo_EF; reg fifo_rd_d; wire [ 7: 0] fifo_rdata; wire new_rom; wire [ 31: 0] num_bytes; wire [ 6: 0] rfifo_entries; wire rfifo_full; wire [ 5: 0] rfifo_used; //synthesis translate_off //////////////// SIMULATION-ONLY CONTENTS // Generate rfifo_entries for simulation always @(posedge clk or negedge rst_n) begin if (rst_n == 0) begin bytes_left <= 32'h0; fifo_rd_d <= 1'b0; end else begin fifo_rd_d <= fifo_rd; // decrement on read if (fifo_rd_d) bytes_left <= bytes_left - 1'b1; // catch new contents if (new_rom) bytes_left <= num_bytes; end end assign fifo_EF = bytes_left == 32'b0; assign rfifo_full = bytes_left > 7'h40; assign rfifo_entries = (rfifo_full) ? 7'h40 : bytes_left; assign rfifo_used = rfifo_entries[5 : 0]; assign new_rom = 1'b0; assign num_bytes = 32'b0; assign fifo_rdata = 8'b0; //////////////// END SIMULATION-ONLY CONTENTS //synthesis translate_on endmodule // synthesis translate_off `timescale 1ns / 1ps // synthesis translate_on // turn off superfluous verilog processor warnings // altera message_level Level1 // altera message_off 10034 10035 10036 10037 10230 10240 10030 module soc_design_JTAG_scfifo_r ( // inputs: clk, fifo_clear, fifo_rd, rst_n, t_dat, wr_rfifo, // outputs: fifo_EF, fifo_rdata, rfifo_full, rfifo_used ) ; output fifo_EF; output [ 7: 0] fifo_rdata; output rfifo_full; output [ 5: 0] rfifo_used; input clk; input fifo_clear; input fifo_rd; input rst_n; input [ 7: 0] t_dat; input wr_rfifo; wire fifo_EF; wire [ 7: 0] fifo_rdata; wire rfifo_full; wire [ 5: 0] rfifo_used; //synthesis translate_off //////////////// SIMULATION-ONLY CONTENTS soc_design_JTAG_sim_scfifo_r the_soc_design_JTAG_sim_scfifo_r ( .clk (clk), .fifo_EF (fifo_EF), .fifo_rd (fifo_rd), .fifo_rdata (fifo_rdata), .rfifo_full (rfifo_full), .rfifo_used (rfifo_used), .rst_n (rst_n) ); //////////////// END SIMULATION-ONLY CONTENTS //synthesis translate_on //synthesis read_comments_as_HDL on // scfifo rfifo // ( // .aclr (fifo_clear), // .clock (clk), // .data (t_dat), // .empty (fifo_EF), // .full (rfifo_full), // .q (fifo_rdata), // .rdreq (fifo_rd), // .usedw (rfifo_used), // .wrreq (wr_rfifo) // ); // // defparam rfifo.lpm_hint = "RAM_BLOCK_TYPE=AUTO", // rfifo.lpm_numwords = 64, // rfifo.lpm_showahead = "OFF", // rfifo.lpm_type = "scfifo", // rfifo.lpm_width = 8, // rfifo.lpm_widthu = 6, // rfifo.overflow_checking = "OFF", // rfifo.underflow_checking = "OFF", // rfifo.use_eab = "ON"; // //synthesis read_comments_as_HDL off endmodule // synthesis translate_off `timescale 1ns / 1ps // synthesis translate_on // turn off superfluous verilog processor warnings // altera message_level Level1 // altera message_off 10034 10035 10036 10037 10230 10240 10030 module soc_design_JTAG ( // inputs: av_address, av_chipselect, av_read_n, av_write_n, av_writedata, clk, rst_n, // outputs: av_irq, av_readdata, av_waitrequest, dataavailable, readyfordata ) /* synthesis ALTERA_ATTRIBUTE = "SUPPRESS_DA_RULE_INTERNAL=\"R101,C106,D101,D103\"" */ ; output av_irq; output [ 31: 0] av_readdata; output av_waitrequest; output dataavailable; output readyfordata; input av_address; input av_chipselect; input av_read_n; input av_write_n; input [ 31: 0] av_writedata; input clk; input rst_n; reg ac; wire activity; wire av_irq; wire [ 31: 0] av_readdata; reg av_waitrequest; reg dataavailable; reg fifo_AE; reg fifo_AF; wire fifo_EF; wire fifo_FF; wire fifo_clear; wire fifo_rd; wire [ 7: 0] fifo_rdata; wire [ 7: 0] fifo_wdata; reg fifo_wr; reg ien_AE; reg ien_AF; wire ipen_AE; wire ipen_AF; reg pause_irq; wire [ 7: 0] r_dat; wire r_ena; reg r_val; wire rd_wfifo; reg read_0; reg readyfordata; wire rfifo_full; wire [ 5: 0] rfifo_used; reg rvalid; reg sim_r_ena; reg sim_t_dat; reg sim_t_ena; reg sim_t_pause; wire [ 7: 0] t_dat; reg t_dav; wire t_ena; wire t_pause; wire wfifo_empty; wire [ 5: 0] wfifo_used; reg woverflow; wire wr_rfifo; //avalon_jtag_slave, which is an e_avalon_slave assign rd_wfifo = r_ena & ~wfifo_empty; assign wr_rfifo = t_ena & ~rfifo_full; assign fifo_clear = ~rst_n; soc_design_JTAG_scfifo_w the_soc_design_JTAG_scfifo_w ( .clk (clk), .fifo_FF (fifo_FF), .fifo_clear (fifo_clear), .fifo_wdata (fifo_wdata), .fifo_wr (fifo_wr), .r_dat (r_dat), .rd_wfifo (rd_wfifo), .wfifo_empty (wfifo_empty), .wfifo_used (wfifo_used) ); soc_design_JTAG_scfifo_r the_soc_design_JTAG_scfifo_r ( .clk (clk), .fifo_EF (fifo_EF), .fifo_clear (fifo_clear), .fifo_rd (fifo_rd), .fifo_rdata (fifo_rdata), .rfifo_full (rfifo_full), .rfifo_used (rfifo_used), .rst_n (rst_n), .t_dat (t_dat), .wr_rfifo (wr_rfifo) ); assign ipen_AE = ien_AE & fifo_AE; assign ipen_AF = ien_AF & (pause_irq | fifo_AF); assign av_irq = ipen_AE | ipen_AF; assign activity = t_pause | t_ena; always @(posedge clk or negedge rst_n) begin if (rst_n == 0) pause_irq <= 1'b0; else // only if fifo is not empty... if (t_pause & ~fifo_EF) pause_irq <= 1'b1; else if (read_0) pause_irq <= 1'b0; end always @(posedge clk or negedge rst_n) begin if (rst_n == 0) begin r_val <= 1'b0; t_dav <= 1'b1; end else begin r_val <= r_ena & ~wfifo_empty; t_dav <= ~rfifo_full; end end always @(posedge clk or negedge rst_n) begin if (rst_n == 0) begin fifo_AE <= 1'b0; fifo_AF <= 1'b0; fifo_wr <= 1'b0; rvalid <= 1'b0; read_0 <= 1'b0; ien_AE <= 1'b0; ien_AF <= 1'b0; ac <= 1'b0; woverflow <= 1'b0; av_waitrequest <= 1'b1; end else begin fifo_AE <= {fifo_FF,wfifo_used} <= 8; fifo_AF <= (7'h40 - {rfifo_full,rfifo_used}) <= 8; fifo_wr <= 1'b0; read_0 <= 1'b0; av_waitrequest <= ~(av_chipselect & (~av_write_n | ~av_read_n) & av_waitrequest); if (activity) ac <= 1'b1; // write if (av_chipselect & ~av_write_n & av_waitrequest) // addr 1 is control; addr 0 is data if (av_address) begin ien_AF <= av_writedata[0]; ien_AE <= av_writedata[1]; if (av_writedata[10] & ~activity) ac <= 1'b0; end else begin fifo_wr <= ~fifo_FF; woverflow <= fifo_FF; end // read if (av_chipselect & ~av_read_n & av_waitrequest) begin // addr 1 is interrupt; addr 0 is data if (~av_address) rvalid <= ~fifo_EF; read_0 <= ~av_address; end end end assign fifo_wdata = av_writedata[7 : 0]; assign fifo_rd = (av_chipselect & ~av_read_n & av_waitrequest & ~av_address) ? ~fifo_EF : 1'b0; assign av_readdata = read_0 ? { {9{1'b0}},rfifo_full,rfifo_used,rvalid,woverflow,~fifo_FF,~fifo_EF,1'b0,ac,ipen_AE,ipen_AF,fifo_rdata } : { {9{1'b0}},(7'h40 - {fifo_FF,wfifo_used}),rvalid,woverflow,~fifo_FF,~fifo_EF,1'b0,ac,ipen_AE,ipen_AF,{6{1'b0}},ien_AE,ien_AF }; always @(posedge clk or negedge rst_n) begin if (rst_n == 0) readyfordata <= 0; else readyfordata <= ~fifo_FF; end //synthesis translate_off //////////////// SIMULATION-ONLY CONTENTS // Tie off Atlantic Interface signals not used for simulation always @(posedge clk) begin sim_t_pause <= 1'b0; sim_t_ena <= 1'b0; sim_t_dat <= t_dav ? r_dat : {8{r_val}}; sim_r_ena <= 1'b0; end assign r_ena = sim_r_ena; assign t_ena = sim_t_ena; assign t_dat = sim_t_dat; assign t_pause = sim_t_pause; always @(fifo_EF) begin dataavailable = ~fifo_EF; end //////////////// END SIMULATION-ONLY CONTENTS //synthesis translate_on //synthesis read_comments_as_HDL on // alt_jtag_atlantic soc_design_JTAG_alt_jtag_atlantic // ( // .clk (clk), // .r_dat (r_dat), // .r_ena (r_ena), // .r_val (r_val), // .rst_n (rst_n), // .t_dat (t_dat), // .t_dav (t_dav), // .t_ena (t_ena), // .t_pause (t_pause) // ); // // defparam soc_design_JTAG_alt_jtag_atlantic.INSTANCE_ID = 0, // soc_design_JTAG_alt_jtag_atlantic.LOG2_RXFIFO_DEPTH = 6, // soc_design_JTAG_alt_jtag_atlantic.LOG2_TXFIFO_DEPTH = 6, // soc_design_JTAG_alt_jtag_atlantic.SLD_AUTO_INSTANCE_INDEX = "YES"; // // always @(posedge clk or negedge rst_n) // begin // if (rst_n == 0) // dataavailable <= 0; // else // dataavailable <= ~fifo_EF; // end // // //synthesis read_comments_as_HDL off endmodule
// -- (c) Copyright 2010 - 2011 Xilinx, Inc. All rights reserved. // -- // -- This file contains confidential and proprietary information // -- of Xilinx, Inc. and is protected under U.S. and // -- international copyright and other intellectual property // -- laws. // -- // -- DISCLAIMER // -- This disclaimer is not a license and does not grant any // -- rights to the materials distributed herewith. Except as // -- otherwise provided in a valid license issued to you by // -- Xilinx, and to the maximum extent permitted by applicable // -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND // -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES // -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING // -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- // -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and // -- (2) Xilinx shall not be liable (whether in contract or tort, // -- including negligence, or under any other theory of // -- liability) for any loss or damage of any kind or nature // -- related to, arising under or in connection with these // -- materials, including for any direct, or any indirect, // -- special, incidental, or consequential loss or damage // -- (including loss of data, profits, goodwill, or any type of // -- loss or damage suffered as a result of any action brought // -- by a third party) even if such damage or loss was // -- reasonably foreseeable or Xilinx had been advised of the // -- possibility of the same. // -- // -- CRITICAL APPLICATIONS // -- Xilinx products are not designed or intended to be fail- // -- safe, or for use in any application requiring fail-safe // -- performance, such as life-support or safety devices or // -- systems, Class III medical devices, nuclear facilities, // -- applications related to the deployment of airbags, or any // -- other applications that could lead to death, personal // -- injury, or severe property or environmental damage // -- (individually and collectively, "Critical // -- Applications"). Customer assumes the sole risk and // -- liability of any use of Xilinx products in Critical // -- Applications, subject only to applicable laws and // -- regulations governing limitations on product liability. // -- // -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS // -- PART OF THIS FILE AT ALL TIMES. //----------------------------------------------------------------------------- // // Description: Write Data Response Down-Sizer // Collect MI-side responses and set the SI-side response to the most critical // level (in descending order): // DECERR, SLVERROR and OKAY. // EXOKAY cannot occur for split transactions. // // // Verilog-standard: Verilog 2001 //-------------------------------------------------------------------------- // // Structure: // wr_upsizer // //-------------------------------------------------------------------------- `timescale 1ps/1ps (* DowngradeIPIdentifiedWarnings="yes" *) module axi_protocol_converter_v2_1_b_downsizer # ( parameter C_FAMILY = "none", // FPGA Family. Current version: virtex6 or spartan6. parameter integer C_AXI_ID_WIDTH = 4, // Width of all ID signals on SI and MI side of converter. // Range: >= 1. parameter integer C_AXI_SUPPORTS_USER_SIGNALS = 0, // 1 = Propagate all USER signals, 0 = Don�t propagate. parameter integer C_AXI_BUSER_WIDTH = 1 // Width of BUSER signals. // Range: >= 1. ) ( // Global Signals input wire ARESET, input wire ACLK, // Command Interface input wire cmd_valid, input wire cmd_split, input wire [4-1:0] cmd_repeat, output wire cmd_ready, // Slave Interface Write Response Ports output wire [C_AXI_ID_WIDTH-1:0] S_AXI_BID, output wire [2-1:0] S_AXI_BRESP, output wire [C_AXI_BUSER_WIDTH-1:0] S_AXI_BUSER, output wire S_AXI_BVALID, input wire S_AXI_BREADY, // Master Interface Write Response Ports input wire [C_AXI_ID_WIDTH-1:0] M_AXI_BID, input wire [2-1:0] M_AXI_BRESP, input wire [C_AXI_BUSER_WIDTH-1:0] M_AXI_BUSER, input wire M_AXI_BVALID, output wire M_AXI_BREADY ); ///////////////////////////////////////////////////////////////////////////// // Variables for generating parameter controlled instances. ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Local params ///////////////////////////////////////////////////////////////////////////// // Constants for packing levels. localparam [2-1:0] C_RESP_OKAY = 2'b00; localparam [2-1:0] C_RESP_EXOKAY = 2'b01; localparam [2-1:0] C_RESP_SLVERROR = 2'b10; localparam [2-1:0] C_RESP_DECERR = 2'b11; ///////////////////////////////////////////////////////////////////////////// // Functions ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Internal signals ///////////////////////////////////////////////////////////////////////////// // Throttling help signals. wire cmd_ready_i; wire pop_mi_data; wire mi_stalling; // Repeat handling related. reg [4-1:0] repeat_cnt_pre; reg [4-1:0] repeat_cnt; wire [4-1:0] next_repeat_cnt; reg first_mi_word; wire last_word; // Ongoing split transaction. wire load_bresp; wire need_to_update_bresp; reg [2-1:0] S_AXI_BRESP_ACC; // Internal signals for MI-side. wire M_AXI_BREADY_I; // Internal signals for SI-side. wire [C_AXI_ID_WIDTH-1:0] S_AXI_BID_I; reg [2-1:0] S_AXI_BRESP_I; wire [C_AXI_BUSER_WIDTH-1:0] S_AXI_BUSER_I; wire S_AXI_BVALID_I; wire S_AXI_BREADY_I; ///////////////////////////////////////////////////////////////////////////// // Handle interface handshaking: // // The MI-side BRESP is popped when at once for split transactions, except // for the last cycle that behaves like a "normal" transaction. // A "normal" BRESP is popped once the SI-side is able to use it, // // ///////////////////////////////////////////////////////////////////////////// // Pop word from MI-side. assign M_AXI_BREADY_I = M_AXI_BVALID & ~mi_stalling; assign M_AXI_BREADY = M_AXI_BREADY_I; // Indicate when there is a BRESP available @ SI-side. assign S_AXI_BVALID_I = M_AXI_BVALID & last_word; // Get MI-side data. assign pop_mi_data = M_AXI_BVALID & M_AXI_BREADY_I; // Signal that the command is done (so that it can be poped from command queue). assign cmd_ready_i = cmd_valid & pop_mi_data & last_word; assign cmd_ready = cmd_ready_i; // Detect when MI-side is stalling. assign mi_stalling = (~S_AXI_BREADY_I & last_word); ///////////////////////////////////////////////////////////////////////////// // Handle the accumulation of BRESP. // // Forward the accumulated or MI-side BRESP value depending on state: // * MI-side BRESP is forwarded untouched when it is a non split cycle. // (MI-side BRESP value is also used when updating the accumulated for // the last access during a split access). // * The accumulated BRESP is for a split transaction. // // The accumulated BRESP register is updated for each MI-side response that // is used. // ///////////////////////////////////////////////////////////////////////////// // Force load accumulated BRESPs to first value assign load_bresp = (cmd_split & first_mi_word); // Update if more critical. assign need_to_update_bresp = ( M_AXI_BRESP > S_AXI_BRESP_ACC ); // Select accumultated or direct depending on setting. always @ * begin if ( cmd_split ) begin if ( load_bresp || need_to_update_bresp ) begin S_AXI_BRESP_I = M_AXI_BRESP; end else begin S_AXI_BRESP_I = S_AXI_BRESP_ACC; end end else begin S_AXI_BRESP_I = M_AXI_BRESP; end end // Accumulate MI-side BRESP. always @ (posedge ACLK) begin if (ARESET) begin S_AXI_BRESP_ACC <= C_RESP_OKAY; end else begin if ( pop_mi_data ) begin S_AXI_BRESP_ACC <= S_AXI_BRESP_I; end end end ///////////////////////////////////////////////////////////////////////////// // Keep track of BRESP repeat counter. // // Last BRESP word is either: // * The first and only word when not merging. // * The last value when merging. // // The internal counter is taken from the external command interface during // the first response when merging. The counter is updated each time a // BRESP is popped from the MI-side interface. // ///////////////////////////////////////////////////////////////////////////// // Determine last BRESP cycle. assign last_word = ( ( repeat_cnt == 4'b0 ) & ~first_mi_word ) | ~cmd_split; // Select command reapeat or counted repeat value. always @ * begin if ( first_mi_word ) begin repeat_cnt_pre = cmd_repeat; end else begin repeat_cnt_pre = repeat_cnt; end end // Calculate next repeat counter value. assign next_repeat_cnt = repeat_cnt_pre - 1'b1; // Keep track of the repeat count. always @ (posedge ACLK) begin if (ARESET) begin repeat_cnt <= 4'b0; first_mi_word <= 1'b1; end else begin if ( pop_mi_data ) begin repeat_cnt <= next_repeat_cnt; first_mi_word <= last_word; end end end ///////////////////////////////////////////////////////////////////////////// // BID Handling ///////////////////////////////////////////////////////////////////////////// assign S_AXI_BID_I = M_AXI_BID; ///////////////////////////////////////////////////////////////////////////// // USER Data bits // // The last USER bits are simply taken from the last BRESP that is merged. // Ground USER bits when unused. ///////////////////////////////////////////////////////////////////////////// // Select USER bits. assign S_AXI_BUSER_I = {C_AXI_BUSER_WIDTH{1'b0}}; ///////////////////////////////////////////////////////////////////////////// // SI-side output handling ///////////////////////////////////////////////////////////////////////////// // TODO: registered? assign S_AXI_BID = S_AXI_BID_I; assign S_AXI_BRESP = S_AXI_BRESP_I; assign S_AXI_BUSER = S_AXI_BUSER_I; assign S_AXI_BVALID = S_AXI_BVALID_I; assign S_AXI_BREADY_I = S_AXI_BREADY; endmodule
// -- (c) Copyright 2010 - 2011 Xilinx, Inc. All rights reserved. // -- // -- This file contains confidential and proprietary information // -- of Xilinx, Inc. and is protected under U.S. and // -- international copyright and other intellectual property // -- laws. // -- // -- DISCLAIMER // -- This disclaimer is not a license and does not grant any // -- rights to the materials distributed herewith. Except as // -- otherwise provided in a valid license issued to you by // -- Xilinx, and to the maximum extent permitted by applicable // -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND // -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES // -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING // -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- // -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and // -- (2) Xilinx shall not be liable (whether in contract or tort, // -- including negligence, or under any other theory of // -- liability) for any loss or damage of any kind or nature // -- related to, arising under or in connection with these // -- materials, including for any direct, or any indirect, // -- special, incidental, or consequential loss or damage // -- (including loss of data, profits, goodwill, or any type of // -- loss or damage suffered as a result of any action brought // -- by a third party) even if such damage or loss was // -- reasonably foreseeable or Xilinx had been advised of the // -- possibility of the same. // -- // -- CRITICAL APPLICATIONS // -- Xilinx products are not designed or intended to be fail- // -- safe, or for use in any application requiring fail-safe // -- performance, such as life-support or safety devices or // -- systems, Class III medical devices, nuclear facilities, // -- applications related to the deployment of airbags, or any // -- other applications that could lead to death, personal // -- injury, or severe property or environmental damage // -- (individually and collectively, "Critical // -- Applications"). Customer assumes the sole risk and // -- liability of any use of Xilinx products in Critical // -- Applications, subject only to applicable laws and // -- regulations governing limitations on product liability. // -- // -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS // -- PART OF THIS FILE AT ALL TIMES. //----------------------------------------------------------------------------- // // Description: Write Data Response Down-Sizer // Collect MI-side responses and set the SI-side response to the most critical // level (in descending order): // DECERR, SLVERROR and OKAY. // EXOKAY cannot occur for split transactions. // // // Verilog-standard: Verilog 2001 //-------------------------------------------------------------------------- // // Structure: // wr_upsizer // //-------------------------------------------------------------------------- `timescale 1ps/1ps (* DowngradeIPIdentifiedWarnings="yes" *) module axi_protocol_converter_v2_1_b_downsizer # ( parameter C_FAMILY = "none", // FPGA Family. Current version: virtex6 or spartan6. parameter integer C_AXI_ID_WIDTH = 4, // Width of all ID signals on SI and MI side of converter. // Range: >= 1. parameter integer C_AXI_SUPPORTS_USER_SIGNALS = 0, // 1 = Propagate all USER signals, 0 = Don�t propagate. parameter integer C_AXI_BUSER_WIDTH = 1 // Width of BUSER signals. // Range: >= 1. ) ( // Global Signals input wire ARESET, input wire ACLK, // Command Interface input wire cmd_valid, input wire cmd_split, input wire [4-1:0] cmd_repeat, output wire cmd_ready, // Slave Interface Write Response Ports output wire [C_AXI_ID_WIDTH-1:0] S_AXI_BID, output wire [2-1:0] S_AXI_BRESP, output wire [C_AXI_BUSER_WIDTH-1:0] S_AXI_BUSER, output wire S_AXI_BVALID, input wire S_AXI_BREADY, // Master Interface Write Response Ports input wire [C_AXI_ID_WIDTH-1:0] M_AXI_BID, input wire [2-1:0] M_AXI_BRESP, input wire [C_AXI_BUSER_WIDTH-1:0] M_AXI_BUSER, input wire M_AXI_BVALID, output wire M_AXI_BREADY ); ///////////////////////////////////////////////////////////////////////////// // Variables for generating parameter controlled instances. ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Local params ///////////////////////////////////////////////////////////////////////////// // Constants for packing levels. localparam [2-1:0] C_RESP_OKAY = 2'b00; localparam [2-1:0] C_RESP_EXOKAY = 2'b01; localparam [2-1:0] C_RESP_SLVERROR = 2'b10; localparam [2-1:0] C_RESP_DECERR = 2'b11; ///////////////////////////////////////////////////////////////////////////// // Functions ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Internal signals ///////////////////////////////////////////////////////////////////////////// // Throttling help signals. wire cmd_ready_i; wire pop_mi_data; wire mi_stalling; // Repeat handling related. reg [4-1:0] repeat_cnt_pre; reg [4-1:0] repeat_cnt; wire [4-1:0] next_repeat_cnt; reg first_mi_word; wire last_word; // Ongoing split transaction. wire load_bresp; wire need_to_update_bresp; reg [2-1:0] S_AXI_BRESP_ACC; // Internal signals for MI-side. wire M_AXI_BREADY_I; // Internal signals for SI-side. wire [C_AXI_ID_WIDTH-1:0] S_AXI_BID_I; reg [2-1:0] S_AXI_BRESP_I; wire [C_AXI_BUSER_WIDTH-1:0] S_AXI_BUSER_I; wire S_AXI_BVALID_I; wire S_AXI_BREADY_I; ///////////////////////////////////////////////////////////////////////////// // Handle interface handshaking: // // The MI-side BRESP is popped when at once for split transactions, except // for the last cycle that behaves like a "normal" transaction. // A "normal" BRESP is popped once the SI-side is able to use it, // // ///////////////////////////////////////////////////////////////////////////// // Pop word from MI-side. assign M_AXI_BREADY_I = M_AXI_BVALID & ~mi_stalling; assign M_AXI_BREADY = M_AXI_BREADY_I; // Indicate when there is a BRESP available @ SI-side. assign S_AXI_BVALID_I = M_AXI_BVALID & last_word; // Get MI-side data. assign pop_mi_data = M_AXI_BVALID & M_AXI_BREADY_I; // Signal that the command is done (so that it can be poped from command queue). assign cmd_ready_i = cmd_valid & pop_mi_data & last_word; assign cmd_ready = cmd_ready_i; // Detect when MI-side is stalling. assign mi_stalling = (~S_AXI_BREADY_I & last_word); ///////////////////////////////////////////////////////////////////////////// // Handle the accumulation of BRESP. // // Forward the accumulated or MI-side BRESP value depending on state: // * MI-side BRESP is forwarded untouched when it is a non split cycle. // (MI-side BRESP value is also used when updating the accumulated for // the last access during a split access). // * The accumulated BRESP is for a split transaction. // // The accumulated BRESP register is updated for each MI-side response that // is used. // ///////////////////////////////////////////////////////////////////////////// // Force load accumulated BRESPs to first value assign load_bresp = (cmd_split & first_mi_word); // Update if more critical. assign need_to_update_bresp = ( M_AXI_BRESP > S_AXI_BRESP_ACC ); // Select accumultated or direct depending on setting. always @ * begin if ( cmd_split ) begin if ( load_bresp || need_to_update_bresp ) begin S_AXI_BRESP_I = M_AXI_BRESP; end else begin S_AXI_BRESP_I = S_AXI_BRESP_ACC; end end else begin S_AXI_BRESP_I = M_AXI_BRESP; end end // Accumulate MI-side BRESP. always @ (posedge ACLK) begin if (ARESET) begin S_AXI_BRESP_ACC <= C_RESP_OKAY; end else begin if ( pop_mi_data ) begin S_AXI_BRESP_ACC <= S_AXI_BRESP_I; end end end ///////////////////////////////////////////////////////////////////////////// // Keep track of BRESP repeat counter. // // Last BRESP word is either: // * The first and only word when not merging. // * The last value when merging. // // The internal counter is taken from the external command interface during // the first response when merging. The counter is updated each time a // BRESP is popped from the MI-side interface. // ///////////////////////////////////////////////////////////////////////////// // Determine last BRESP cycle. assign last_word = ( ( repeat_cnt == 4'b0 ) & ~first_mi_word ) | ~cmd_split; // Select command reapeat or counted repeat value. always @ * begin if ( first_mi_word ) begin repeat_cnt_pre = cmd_repeat; end else begin repeat_cnt_pre = repeat_cnt; end end // Calculate next repeat counter value. assign next_repeat_cnt = repeat_cnt_pre - 1'b1; // Keep track of the repeat count. always @ (posedge ACLK) begin if (ARESET) begin repeat_cnt <= 4'b0; first_mi_word <= 1'b1; end else begin if ( pop_mi_data ) begin repeat_cnt <= next_repeat_cnt; first_mi_word <= last_word; end end end ///////////////////////////////////////////////////////////////////////////// // BID Handling ///////////////////////////////////////////////////////////////////////////// assign S_AXI_BID_I = M_AXI_BID; ///////////////////////////////////////////////////////////////////////////// // USER Data bits // // The last USER bits are simply taken from the last BRESP that is merged. // Ground USER bits when unused. ///////////////////////////////////////////////////////////////////////////// // Select USER bits. assign S_AXI_BUSER_I = {C_AXI_BUSER_WIDTH{1'b0}}; ///////////////////////////////////////////////////////////////////////////// // SI-side output handling ///////////////////////////////////////////////////////////////////////////// // TODO: registered? assign S_AXI_BID = S_AXI_BID_I; assign S_AXI_BRESP = S_AXI_BRESP_I; assign S_AXI_BUSER = S_AXI_BUSER_I; assign S_AXI_BVALID = S_AXI_BVALID_I; assign S_AXI_BREADY_I = S_AXI_BREADY; endmodule
// -- (c) Copyright 2010 - 2011 Xilinx, Inc. All rights reserved. // -- // -- This file contains confidential and proprietary information // -- of Xilinx, Inc. and is protected under U.S. and // -- international copyright and other intellectual property // -- laws. // -- // -- DISCLAIMER // -- This disclaimer is not a license and does not grant any // -- rights to the materials distributed herewith. Except as // -- otherwise provided in a valid license issued to you by // -- Xilinx, and to the maximum extent permitted by applicable // -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND // -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES // -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING // -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- // -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and // -- (2) Xilinx shall not be liable (whether in contract or tort, // -- including negligence, or under any other theory of // -- liability) for any loss or damage of any kind or nature // -- related to, arising under or in connection with these // -- materials, including for any direct, or any indirect, // -- special, incidental, or consequential loss or damage // -- (including loss of data, profits, goodwill, or any type of // -- loss or damage suffered as a result of any action brought // -- by a third party) even if such damage or loss was // -- reasonably foreseeable or Xilinx had been advised of the // -- possibility of the same. // -- // -- CRITICAL APPLICATIONS // -- Xilinx products are not designed or intended to be fail- // -- safe, or for use in any application requiring fail-safe // -- performance, such as life-support or safety devices or // -- systems, Class III medical devices, nuclear facilities, // -- applications related to the deployment of airbags, or any // -- other applications that could lead to death, personal // -- injury, or severe property or environmental damage // -- (individually and collectively, "Critical // -- Applications"). Customer assumes the sole risk and // -- liability of any use of Xilinx products in Critical // -- Applications, subject only to applicable laws and // -- regulations governing limitations on product liability. // -- // -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS // -- PART OF THIS FILE AT ALL TIMES. //----------------------------------------------------------------------------- // // Description: Write Data Response Down-Sizer // Collect MI-side responses and set the SI-side response to the most critical // level (in descending order): // DECERR, SLVERROR and OKAY. // EXOKAY cannot occur for split transactions. // // // Verilog-standard: Verilog 2001 //-------------------------------------------------------------------------- // // Structure: // wr_upsizer // //-------------------------------------------------------------------------- `timescale 1ps/1ps (* DowngradeIPIdentifiedWarnings="yes" *) module axi_protocol_converter_v2_1_b_downsizer # ( parameter C_FAMILY = "none", // FPGA Family. Current version: virtex6 or spartan6. parameter integer C_AXI_ID_WIDTH = 4, // Width of all ID signals on SI and MI side of converter. // Range: >= 1. parameter integer C_AXI_SUPPORTS_USER_SIGNALS = 0, // 1 = Propagate all USER signals, 0 = Don�t propagate. parameter integer C_AXI_BUSER_WIDTH = 1 // Width of BUSER signals. // Range: >= 1. ) ( // Global Signals input wire ARESET, input wire ACLK, // Command Interface input wire cmd_valid, input wire cmd_split, input wire [4-1:0] cmd_repeat, output wire cmd_ready, // Slave Interface Write Response Ports output wire [C_AXI_ID_WIDTH-1:0] S_AXI_BID, output wire [2-1:0] S_AXI_BRESP, output wire [C_AXI_BUSER_WIDTH-1:0] S_AXI_BUSER, output wire S_AXI_BVALID, input wire S_AXI_BREADY, // Master Interface Write Response Ports input wire [C_AXI_ID_WIDTH-1:0] M_AXI_BID, input wire [2-1:0] M_AXI_BRESP, input wire [C_AXI_BUSER_WIDTH-1:0] M_AXI_BUSER, input wire M_AXI_BVALID, output wire M_AXI_BREADY ); ///////////////////////////////////////////////////////////////////////////// // Variables for generating parameter controlled instances. ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Local params ///////////////////////////////////////////////////////////////////////////// // Constants for packing levels. localparam [2-1:0] C_RESP_OKAY = 2'b00; localparam [2-1:0] C_RESP_EXOKAY = 2'b01; localparam [2-1:0] C_RESP_SLVERROR = 2'b10; localparam [2-1:0] C_RESP_DECERR = 2'b11; ///////////////////////////////////////////////////////////////////////////// // Functions ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Internal signals ///////////////////////////////////////////////////////////////////////////// // Throttling help signals. wire cmd_ready_i; wire pop_mi_data; wire mi_stalling; // Repeat handling related. reg [4-1:0] repeat_cnt_pre; reg [4-1:0] repeat_cnt; wire [4-1:0] next_repeat_cnt; reg first_mi_word; wire last_word; // Ongoing split transaction. wire load_bresp; wire need_to_update_bresp; reg [2-1:0] S_AXI_BRESP_ACC; // Internal signals for MI-side. wire M_AXI_BREADY_I; // Internal signals for SI-side. wire [C_AXI_ID_WIDTH-1:0] S_AXI_BID_I; reg [2-1:0] S_AXI_BRESP_I; wire [C_AXI_BUSER_WIDTH-1:0] S_AXI_BUSER_I; wire S_AXI_BVALID_I; wire S_AXI_BREADY_I; ///////////////////////////////////////////////////////////////////////////// // Handle interface handshaking: // // The MI-side BRESP is popped when at once for split transactions, except // for the last cycle that behaves like a "normal" transaction. // A "normal" BRESP is popped once the SI-side is able to use it, // // ///////////////////////////////////////////////////////////////////////////// // Pop word from MI-side. assign M_AXI_BREADY_I = M_AXI_BVALID & ~mi_stalling; assign M_AXI_BREADY = M_AXI_BREADY_I; // Indicate when there is a BRESP available @ SI-side. assign S_AXI_BVALID_I = M_AXI_BVALID & last_word; // Get MI-side data. assign pop_mi_data = M_AXI_BVALID & M_AXI_BREADY_I; // Signal that the command is done (so that it can be poped from command queue). assign cmd_ready_i = cmd_valid & pop_mi_data & last_word; assign cmd_ready = cmd_ready_i; // Detect when MI-side is stalling. assign mi_stalling = (~S_AXI_BREADY_I & last_word); ///////////////////////////////////////////////////////////////////////////// // Handle the accumulation of BRESP. // // Forward the accumulated or MI-side BRESP value depending on state: // * MI-side BRESP is forwarded untouched when it is a non split cycle. // (MI-side BRESP value is also used when updating the accumulated for // the last access during a split access). // * The accumulated BRESP is for a split transaction. // // The accumulated BRESP register is updated for each MI-side response that // is used. // ///////////////////////////////////////////////////////////////////////////// // Force load accumulated BRESPs to first value assign load_bresp = (cmd_split & first_mi_word); // Update if more critical. assign need_to_update_bresp = ( M_AXI_BRESP > S_AXI_BRESP_ACC ); // Select accumultated or direct depending on setting. always @ * begin if ( cmd_split ) begin if ( load_bresp || need_to_update_bresp ) begin S_AXI_BRESP_I = M_AXI_BRESP; end else begin S_AXI_BRESP_I = S_AXI_BRESP_ACC; end end else begin S_AXI_BRESP_I = M_AXI_BRESP; end end // Accumulate MI-side BRESP. always @ (posedge ACLK) begin if (ARESET) begin S_AXI_BRESP_ACC <= C_RESP_OKAY; end else begin if ( pop_mi_data ) begin S_AXI_BRESP_ACC <= S_AXI_BRESP_I; end end end ///////////////////////////////////////////////////////////////////////////// // Keep track of BRESP repeat counter. // // Last BRESP word is either: // * The first and only word when not merging. // * The last value when merging. // // The internal counter is taken from the external command interface during // the first response when merging. The counter is updated each time a // BRESP is popped from the MI-side interface. // ///////////////////////////////////////////////////////////////////////////// // Determine last BRESP cycle. assign last_word = ( ( repeat_cnt == 4'b0 ) & ~first_mi_word ) | ~cmd_split; // Select command reapeat or counted repeat value. always @ * begin if ( first_mi_word ) begin repeat_cnt_pre = cmd_repeat; end else begin repeat_cnt_pre = repeat_cnt; end end // Calculate next repeat counter value. assign next_repeat_cnt = repeat_cnt_pre - 1'b1; // Keep track of the repeat count. always @ (posedge ACLK) begin if (ARESET) begin repeat_cnt <= 4'b0; first_mi_word <= 1'b1; end else begin if ( pop_mi_data ) begin repeat_cnt <= next_repeat_cnt; first_mi_word <= last_word; end end end ///////////////////////////////////////////////////////////////////////////// // BID Handling ///////////////////////////////////////////////////////////////////////////// assign S_AXI_BID_I = M_AXI_BID; ///////////////////////////////////////////////////////////////////////////// // USER Data bits // // The last USER bits are simply taken from the last BRESP that is merged. // Ground USER bits when unused. ///////////////////////////////////////////////////////////////////////////// // Select USER bits. assign S_AXI_BUSER_I = {C_AXI_BUSER_WIDTH{1'b0}}; ///////////////////////////////////////////////////////////////////////////// // SI-side output handling ///////////////////////////////////////////////////////////////////////////// // TODO: registered? assign S_AXI_BID = S_AXI_BID_I; assign S_AXI_BRESP = S_AXI_BRESP_I; assign S_AXI_BUSER = S_AXI_BUSER_I; assign S_AXI_BVALID = S_AXI_BVALID_I; assign S_AXI_BREADY_I = S_AXI_BREADY; endmodule
// -- (c) Copyright 2010 - 2011 Xilinx, Inc. All rights reserved. // -- // -- This file contains confidential and proprietary information // -- of Xilinx, Inc. and is protected under U.S. and // -- international copyright and other intellectual property // -- laws. // -- // -- DISCLAIMER // -- This disclaimer is not a license and does not grant any // -- rights to the materials distributed herewith. Except as // -- otherwise provided in a valid license issued to you by // -- Xilinx, and to the maximum extent permitted by applicable // -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND // -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES // -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING // -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- // -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and // -- (2) Xilinx shall not be liable (whether in contract or tort, // -- including negligence, or under any other theory of // -- liability) for any loss or damage of any kind or nature // -- related to, arising under or in connection with these // -- materials, including for any direct, or any indirect, // -- special, incidental, or consequential loss or damage // -- (including loss of data, profits, goodwill, or any type of // -- loss or damage suffered as a result of any action brought // -- by a third party) even if such damage or loss was // -- reasonably foreseeable or Xilinx had been advised of the // -- possibility of the same. // -- // -- CRITICAL APPLICATIONS // -- Xilinx products are not designed or intended to be fail- // -- safe, or for use in any application requiring fail-safe // -- performance, such as life-support or safety devices or // -- systems, Class III medical devices, nuclear facilities, // -- applications related to the deployment of airbags, or any // -- other applications that could lead to death, personal // -- injury, or severe property or environmental damage // -- (individually and collectively, "Critical // -- Applications"). Customer assumes the sole risk and // -- liability of any use of Xilinx products in Critical // -- Applications, subject only to applicable laws and // -- regulations governing limitations on product liability. // -- // -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS // -- PART OF THIS FILE AT ALL TIMES. //----------------------------------------------------------------------------- // // Description: Write Data Response Down-Sizer // Collect MI-side responses and set the SI-side response to the most critical // level (in descending order): // DECERR, SLVERROR and OKAY. // EXOKAY cannot occur for split transactions. // // // Verilog-standard: Verilog 2001 //-------------------------------------------------------------------------- // // Structure: // wr_upsizer // //-------------------------------------------------------------------------- `timescale 1ps/1ps (* DowngradeIPIdentifiedWarnings="yes" *) module axi_protocol_converter_v2_1_b_downsizer # ( parameter C_FAMILY = "none", // FPGA Family. Current version: virtex6 or spartan6. parameter integer C_AXI_ID_WIDTH = 4, // Width of all ID signals on SI and MI side of converter. // Range: >= 1. parameter integer C_AXI_SUPPORTS_USER_SIGNALS = 0, // 1 = Propagate all USER signals, 0 = Don�t propagate. parameter integer C_AXI_BUSER_WIDTH = 1 // Width of BUSER signals. // Range: >= 1. ) ( // Global Signals input wire ARESET, input wire ACLK, // Command Interface input wire cmd_valid, input wire cmd_split, input wire [4-1:0] cmd_repeat, output wire cmd_ready, // Slave Interface Write Response Ports output wire [C_AXI_ID_WIDTH-1:0] S_AXI_BID, output wire [2-1:0] S_AXI_BRESP, output wire [C_AXI_BUSER_WIDTH-1:0] S_AXI_BUSER, output wire S_AXI_BVALID, input wire S_AXI_BREADY, // Master Interface Write Response Ports input wire [C_AXI_ID_WIDTH-1:0] M_AXI_BID, input wire [2-1:0] M_AXI_BRESP, input wire [C_AXI_BUSER_WIDTH-1:0] M_AXI_BUSER, input wire M_AXI_BVALID, output wire M_AXI_BREADY ); ///////////////////////////////////////////////////////////////////////////// // Variables for generating parameter controlled instances. ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Local params ///////////////////////////////////////////////////////////////////////////// // Constants for packing levels. localparam [2-1:0] C_RESP_OKAY = 2'b00; localparam [2-1:0] C_RESP_EXOKAY = 2'b01; localparam [2-1:0] C_RESP_SLVERROR = 2'b10; localparam [2-1:0] C_RESP_DECERR = 2'b11; ///////////////////////////////////////////////////////////////////////////// // Functions ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Internal signals ///////////////////////////////////////////////////////////////////////////// // Throttling help signals. wire cmd_ready_i; wire pop_mi_data; wire mi_stalling; // Repeat handling related. reg [4-1:0] repeat_cnt_pre; reg [4-1:0] repeat_cnt; wire [4-1:0] next_repeat_cnt; reg first_mi_word; wire last_word; // Ongoing split transaction. wire load_bresp; wire need_to_update_bresp; reg [2-1:0] S_AXI_BRESP_ACC; // Internal signals for MI-side. wire M_AXI_BREADY_I; // Internal signals for SI-side. wire [C_AXI_ID_WIDTH-1:0] S_AXI_BID_I; reg [2-1:0] S_AXI_BRESP_I; wire [C_AXI_BUSER_WIDTH-1:0] S_AXI_BUSER_I; wire S_AXI_BVALID_I; wire S_AXI_BREADY_I; ///////////////////////////////////////////////////////////////////////////// // Handle interface handshaking: // // The MI-side BRESP is popped when at once for split transactions, except // for the last cycle that behaves like a "normal" transaction. // A "normal" BRESP is popped once the SI-side is able to use it, // // ///////////////////////////////////////////////////////////////////////////// // Pop word from MI-side. assign M_AXI_BREADY_I = M_AXI_BVALID & ~mi_stalling; assign M_AXI_BREADY = M_AXI_BREADY_I; // Indicate when there is a BRESP available @ SI-side. assign S_AXI_BVALID_I = M_AXI_BVALID & last_word; // Get MI-side data. assign pop_mi_data = M_AXI_BVALID & M_AXI_BREADY_I; // Signal that the command is done (so that it can be poped from command queue). assign cmd_ready_i = cmd_valid & pop_mi_data & last_word; assign cmd_ready = cmd_ready_i; // Detect when MI-side is stalling. assign mi_stalling = (~S_AXI_BREADY_I & last_word); ///////////////////////////////////////////////////////////////////////////// // Handle the accumulation of BRESP. // // Forward the accumulated or MI-side BRESP value depending on state: // * MI-side BRESP is forwarded untouched when it is a non split cycle. // (MI-side BRESP value is also used when updating the accumulated for // the last access during a split access). // * The accumulated BRESP is for a split transaction. // // The accumulated BRESP register is updated for each MI-side response that // is used. // ///////////////////////////////////////////////////////////////////////////// // Force load accumulated BRESPs to first value assign load_bresp = (cmd_split & first_mi_word); // Update if more critical. assign need_to_update_bresp = ( M_AXI_BRESP > S_AXI_BRESP_ACC ); // Select accumultated or direct depending on setting. always @ * begin if ( cmd_split ) begin if ( load_bresp || need_to_update_bresp ) begin S_AXI_BRESP_I = M_AXI_BRESP; end else begin S_AXI_BRESP_I = S_AXI_BRESP_ACC; end end else begin S_AXI_BRESP_I = M_AXI_BRESP; end end // Accumulate MI-side BRESP. always @ (posedge ACLK) begin if (ARESET) begin S_AXI_BRESP_ACC <= C_RESP_OKAY; end else begin if ( pop_mi_data ) begin S_AXI_BRESP_ACC <= S_AXI_BRESP_I; end end end ///////////////////////////////////////////////////////////////////////////// // Keep track of BRESP repeat counter. // // Last BRESP word is either: // * The first and only word when not merging. // * The last value when merging. // // The internal counter is taken from the external command interface during // the first response when merging. The counter is updated each time a // BRESP is popped from the MI-side interface. // ///////////////////////////////////////////////////////////////////////////// // Determine last BRESP cycle. assign last_word = ( ( repeat_cnt == 4'b0 ) & ~first_mi_word ) | ~cmd_split; // Select command reapeat or counted repeat value. always @ * begin if ( first_mi_word ) begin repeat_cnt_pre = cmd_repeat; end else begin repeat_cnt_pre = repeat_cnt; end end // Calculate next repeat counter value. assign next_repeat_cnt = repeat_cnt_pre - 1'b1; // Keep track of the repeat count. always @ (posedge ACLK) begin if (ARESET) begin repeat_cnt <= 4'b0; first_mi_word <= 1'b1; end else begin if ( pop_mi_data ) begin repeat_cnt <= next_repeat_cnt; first_mi_word <= last_word; end end end ///////////////////////////////////////////////////////////////////////////// // BID Handling ///////////////////////////////////////////////////////////////////////////// assign S_AXI_BID_I = M_AXI_BID; ///////////////////////////////////////////////////////////////////////////// // USER Data bits // // The last USER bits are simply taken from the last BRESP that is merged. // Ground USER bits when unused. ///////////////////////////////////////////////////////////////////////////// // Select USER bits. assign S_AXI_BUSER_I = {C_AXI_BUSER_WIDTH{1'b0}}; ///////////////////////////////////////////////////////////////////////////// // SI-side output handling ///////////////////////////////////////////////////////////////////////////// // TODO: registered? assign S_AXI_BID = S_AXI_BID_I; assign S_AXI_BRESP = S_AXI_BRESP_I; assign S_AXI_BUSER = S_AXI_BUSER_I; assign S_AXI_BVALID = S_AXI_BVALID_I; assign S_AXI_BREADY_I = S_AXI_BREADY; endmodule
// -- (c) Copyright 2010 - 2011 Xilinx, Inc. All rights reserved. // -- // -- This file contains confidential and proprietary information // -- of Xilinx, Inc. and is protected under U.S. and // -- international copyright and other intellectual property // -- laws. // -- // -- DISCLAIMER // -- This disclaimer is not a license and does not grant any // -- rights to the materials distributed herewith. Except as // -- otherwise provided in a valid license issued to you by // -- Xilinx, and to the maximum extent permitted by applicable // -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND // -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES // -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING // -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- // -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and // -- (2) Xilinx shall not be liable (whether in contract or tort, // -- including negligence, or under any other theory of // -- liability) for any loss or damage of any kind or nature // -- related to, arising under or in connection with these // -- materials, including for any direct, or any indirect, // -- special, incidental, or consequential loss or damage // -- (including loss of data, profits, goodwill, or any type of // -- loss or damage suffered as a result of any action brought // -- by a third party) even if such damage or loss was // -- reasonably foreseeable or Xilinx had been advised of the // -- possibility of the same. // -- // -- CRITICAL APPLICATIONS // -- Xilinx products are not designed or intended to be fail- // -- safe, or for use in any application requiring fail-safe // -- performance, such as life-support or safety devices or // -- systems, Class III medical devices, nuclear facilities, // -- applications related to the deployment of airbags, or any // -- other applications that could lead to death, personal // -- injury, or severe property or environmental damage // -- (individually and collectively, "Critical // -- Applications"). Customer assumes the sole risk and // -- liability of any use of Xilinx products in Critical // -- Applications, subject only to applicable laws and // -- regulations governing limitations on product liability. // -- // -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS // -- PART OF THIS FILE AT ALL TIMES. //----------------------------------------------------------------------------- // // Description: Write Data Response Down-Sizer // Collect MI-side responses and set the SI-side response to the most critical // level (in descending order): // DECERR, SLVERROR and OKAY. // EXOKAY cannot occur for split transactions. // // // Verilog-standard: Verilog 2001 //-------------------------------------------------------------------------- // // Structure: // wr_upsizer // //-------------------------------------------------------------------------- `timescale 1ps/1ps (* DowngradeIPIdentifiedWarnings="yes" *) module axi_protocol_converter_v2_1_b_downsizer # ( parameter C_FAMILY = "none", // FPGA Family. Current version: virtex6 or spartan6. parameter integer C_AXI_ID_WIDTH = 4, // Width of all ID signals on SI and MI side of converter. // Range: >= 1. parameter integer C_AXI_SUPPORTS_USER_SIGNALS = 0, // 1 = Propagate all USER signals, 0 = Don�t propagate. parameter integer C_AXI_BUSER_WIDTH = 1 // Width of BUSER signals. // Range: >= 1. ) ( // Global Signals input wire ARESET, input wire ACLK, // Command Interface input wire cmd_valid, input wire cmd_split, input wire [4-1:0] cmd_repeat, output wire cmd_ready, // Slave Interface Write Response Ports output wire [C_AXI_ID_WIDTH-1:0] S_AXI_BID, output wire [2-1:0] S_AXI_BRESP, output wire [C_AXI_BUSER_WIDTH-1:0] S_AXI_BUSER, output wire S_AXI_BVALID, input wire S_AXI_BREADY, // Master Interface Write Response Ports input wire [C_AXI_ID_WIDTH-1:0] M_AXI_BID, input wire [2-1:0] M_AXI_BRESP, input wire [C_AXI_BUSER_WIDTH-1:0] M_AXI_BUSER, input wire M_AXI_BVALID, output wire M_AXI_BREADY ); ///////////////////////////////////////////////////////////////////////////// // Variables for generating parameter controlled instances. ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Local params ///////////////////////////////////////////////////////////////////////////// // Constants for packing levels. localparam [2-1:0] C_RESP_OKAY = 2'b00; localparam [2-1:0] C_RESP_EXOKAY = 2'b01; localparam [2-1:0] C_RESP_SLVERROR = 2'b10; localparam [2-1:0] C_RESP_DECERR = 2'b11; ///////////////////////////////////////////////////////////////////////////// // Functions ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Internal signals ///////////////////////////////////////////////////////////////////////////// // Throttling help signals. wire cmd_ready_i; wire pop_mi_data; wire mi_stalling; // Repeat handling related. reg [4-1:0] repeat_cnt_pre; reg [4-1:0] repeat_cnt; wire [4-1:0] next_repeat_cnt; reg first_mi_word; wire last_word; // Ongoing split transaction. wire load_bresp; wire need_to_update_bresp; reg [2-1:0] S_AXI_BRESP_ACC; // Internal signals for MI-side. wire M_AXI_BREADY_I; // Internal signals for SI-side. wire [C_AXI_ID_WIDTH-1:0] S_AXI_BID_I; reg [2-1:0] S_AXI_BRESP_I; wire [C_AXI_BUSER_WIDTH-1:0] S_AXI_BUSER_I; wire S_AXI_BVALID_I; wire S_AXI_BREADY_I; ///////////////////////////////////////////////////////////////////////////// // Handle interface handshaking: // // The MI-side BRESP is popped when at once for split transactions, except // for the last cycle that behaves like a "normal" transaction. // A "normal" BRESP is popped once the SI-side is able to use it, // // ///////////////////////////////////////////////////////////////////////////// // Pop word from MI-side. assign M_AXI_BREADY_I = M_AXI_BVALID & ~mi_stalling; assign M_AXI_BREADY = M_AXI_BREADY_I; // Indicate when there is a BRESP available @ SI-side. assign S_AXI_BVALID_I = M_AXI_BVALID & last_word; // Get MI-side data. assign pop_mi_data = M_AXI_BVALID & M_AXI_BREADY_I; // Signal that the command is done (so that it can be poped from command queue). assign cmd_ready_i = cmd_valid & pop_mi_data & last_word; assign cmd_ready = cmd_ready_i; // Detect when MI-side is stalling. assign mi_stalling = (~S_AXI_BREADY_I & last_word); ///////////////////////////////////////////////////////////////////////////// // Handle the accumulation of BRESP. // // Forward the accumulated or MI-side BRESP value depending on state: // * MI-side BRESP is forwarded untouched when it is a non split cycle. // (MI-side BRESP value is also used when updating the accumulated for // the last access during a split access). // * The accumulated BRESP is for a split transaction. // // The accumulated BRESP register is updated for each MI-side response that // is used. // ///////////////////////////////////////////////////////////////////////////// // Force load accumulated BRESPs to first value assign load_bresp = (cmd_split & first_mi_word); // Update if more critical. assign need_to_update_bresp = ( M_AXI_BRESP > S_AXI_BRESP_ACC ); // Select accumultated or direct depending on setting. always @ * begin if ( cmd_split ) begin if ( load_bresp || need_to_update_bresp ) begin S_AXI_BRESP_I = M_AXI_BRESP; end else begin S_AXI_BRESP_I = S_AXI_BRESP_ACC; end end else begin S_AXI_BRESP_I = M_AXI_BRESP; end end // Accumulate MI-side BRESP. always @ (posedge ACLK) begin if (ARESET) begin S_AXI_BRESP_ACC <= C_RESP_OKAY; end else begin if ( pop_mi_data ) begin S_AXI_BRESP_ACC <= S_AXI_BRESP_I; end end end ///////////////////////////////////////////////////////////////////////////// // Keep track of BRESP repeat counter. // // Last BRESP word is either: // * The first and only word when not merging. // * The last value when merging. // // The internal counter is taken from the external command interface during // the first response when merging. The counter is updated each time a // BRESP is popped from the MI-side interface. // ///////////////////////////////////////////////////////////////////////////// // Determine last BRESP cycle. assign last_word = ( ( repeat_cnt == 4'b0 ) & ~first_mi_word ) | ~cmd_split; // Select command reapeat or counted repeat value. always @ * begin if ( first_mi_word ) begin repeat_cnt_pre = cmd_repeat; end else begin repeat_cnt_pre = repeat_cnt; end end // Calculate next repeat counter value. assign next_repeat_cnt = repeat_cnt_pre - 1'b1; // Keep track of the repeat count. always @ (posedge ACLK) begin if (ARESET) begin repeat_cnt <= 4'b0; first_mi_word <= 1'b1; end else begin if ( pop_mi_data ) begin repeat_cnt <= next_repeat_cnt; first_mi_word <= last_word; end end end ///////////////////////////////////////////////////////////////////////////// // BID Handling ///////////////////////////////////////////////////////////////////////////// assign S_AXI_BID_I = M_AXI_BID; ///////////////////////////////////////////////////////////////////////////// // USER Data bits // // The last USER bits are simply taken from the last BRESP that is merged. // Ground USER bits when unused. ///////////////////////////////////////////////////////////////////////////// // Select USER bits. assign S_AXI_BUSER_I = {C_AXI_BUSER_WIDTH{1'b0}}; ///////////////////////////////////////////////////////////////////////////// // SI-side output handling ///////////////////////////////////////////////////////////////////////////// // TODO: registered? assign S_AXI_BID = S_AXI_BID_I; assign S_AXI_BRESP = S_AXI_BRESP_I; assign S_AXI_BUSER = S_AXI_BUSER_I; assign S_AXI_BVALID = S_AXI_BVALID_I; assign S_AXI_BREADY_I = S_AXI_BREADY; endmodule
/* salsa_slowsixteen.v * * Copyright (c) 2013 kramble * Derived from scrypt.c Copyright 2009 Colin Percival, 2011 ArtForz * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ `timescale 1ns/1ps `define IDX(x) (((x)+1)*(32)-1):((x)*(32)) module salsa (clk, B, Bx, Bo, X0out, Xaddr); // Latency 16 clock cycles, approx 20nS propagation delay (SLOW!) input clk; // input feedback; input [511:0]B; input [511:0]Bx; // output reg [511:0]Bo; // Output is registered output [511:0]Bo; // Output is async output [511:0]X0out; // Becomes new X0 output [9:0] Xaddr; wire [9:0] xa1, xa2, xa3, xa4, ya1, ya2, ya3, ya4; reg [511:0]x1d1, x1d1a; reg [511:0]x1d2, x1d2a; reg [511:0]x1d3, x1d3a; reg [511:0]x1d4, x1d4a; reg [511:0]Xod1, Xod1a; reg [511:0]Xod2, Xod2a; reg [511:0]Xod3, Xod3a; reg [511:0]Xod4, X0out; reg [511:0]xxd1, xxd1a; reg [511:0]xxd2, xxd2a; reg [511:0]xxd3, xxd3a; reg [511:0]xxd4, xxd4a; reg [511:0]yyd1, yyd1a; reg [511:0]yyd2, yyd2a; reg [511:0]yyd3, yyd3a; reg [511:0]yyd4, yyd4a; wire [511:0]xx; // Initial xor wire [511:0]x1; // Salasa core outputs wire [511:0]x2; wire [511:0]x3; wire [511:0]xr; wire [511:0]Xo; // Four salsa iterations. NB use registered salsa_core so 4 clock cycles. salsa_core salsax1 (clk, xx, x1, xa1); salsa_core salsax2 (clk, x1, x2, xa2); salsa_core salsax3 (clk, x2, x3, xa3); salsa_core salsax4 (clk, x3, xr, xa4); wire [511:0]yy; // Initial xor wire [511:0]y1; // Salasa core outputs wire [511:0]y2; wire [511:0]y3; wire [511:0]yr; // Four salsa iterations. NB use registered salsa_core so 4 clock cycles. salsa_core salsay1 (clk, yy, y1, ya1); salsa_core salsay2 (clk, y1, y2, ya2); salsa_core salsay3 (clk, y2, y3, ya3); salsa_core salsay4 (clk, y3, yr, ya4); assign Xaddr = yyd4[9:0] + ya4; genvar i; generate for (i = 0; i < 16; i = i + 1) begin : XX // Initial XOR. NB this adds to the propagation delay of the first salsa, may want register it. assign xx[`IDX(i)] = B[`IDX(i)] ^ Bx[`IDX(i)]; assign Xo[`IDX(i)] = xxd4a[`IDX(i)] + xr[`IDX(i)]; assign yy[`IDX(i)] = x1d4a[`IDX(i)] ^ Xo[`IDX(i)]; assign Bo[`IDX(i)] = yyd4a[`IDX(i)] + yr[`IDX(i)]; // Async output end endgenerate always @ (posedge clk) begin x1d1 <= Bx; x1d1a <= x1d1; x1d2 <= x1d1a; x1d2a <= x1d2; x1d3 <= x1d2a; x1d3a <= x1d3; x1d4 <= x1d3a; x1d4a <= x1d4; Xod1 <= Xo; Xod1a <= Xod1; Xod2 <= Xod1a; Xod2a <= Xod2; Xod3 <= Xod2a; Xod3a <= Xod3; Xod4 <= Xod3a; X0out <= Xod4; // We output this to become new X0 xxd1 <= xx; xxd1a <= xxd1; xxd2 <= xxd1a; xxd2a <= xxd2; xxd3 <= xxd2a; xxd3a <= xxd3; xxd4 <= xxd3a; xxd4a <= xxd4; yyd1 <= yy; yyd1a <= yyd1; yyd2 <= yyd1a; yyd2a <= yyd2; yyd3 <= yyd2a; yyd3a <= yyd3; yyd4 <= yyd3a; yyd4a <= yyd4; end endmodule module salsa_core (clk, xx, out, Xaddr); input clk; input [511:0]xx; output reg [511:0]out; // Output is registered output [9:0] Xaddr; // Address output unregistered // This is clunky due to my lack of verilog skills but it works so elegance can come later wire [31:0]c00; // Column results wire [31:0]c01; wire [31:0]c02; wire [31:0]c03; wire [31:0]c04; wire [31:0]c05; wire [31:0]c06; wire [31:0]c07; wire [31:0]c08; wire [31:0]c09; wire [31:0]c10; wire [31:0]c11; wire [31:0]c12; wire [31:0]c13; wire [31:0]c14; wire [31:0]c15; wire [31:0]r00; // Row results wire [31:0]r01; wire [31:0]r02; wire [31:0]r03; wire [31:0]r04; wire [31:0]r05; wire [31:0]r06; wire [31:0]r07; wire [31:0]r08; wire [31:0]r09; wire [31:0]r10; wire [31:0]r11; wire [31:0]r12; wire [31:0]r13; wire [31:0]r14; wire [31:0]r15; wire [31:0]c00s; // Column sums wire [31:0]c01s; wire [31:0]c02s; wire [31:0]c03s; wire [31:0]c04s; wire [31:0]c05s; wire [31:0]c06s; wire [31:0]c07s; wire [31:0]c08s; wire [31:0]c09s; wire [31:0]c10s; wire [31:0]c11s; wire [31:0]c12s; wire [31:0]c13s; wire [31:0]c14s; wire [31:0]c15s; wire [31:0]r00s; // Row sums wire [31:0]r01s; wire [31:0]r02s; wire [31:0]r03s; wire [31:0]r04s; wire [31:0]r05s; wire [31:0]r06s; wire [31:0]r07s; wire [31:0]r08s; wire [31:0]r09s; wire [31:0]r10s; wire [31:0]r11s; wire [31:0]r12s; wire [31:0]r13s; wire [31:0]r14s; wire [31:0]r15s; reg [31:0]c00d; // Column results registered reg [31:0]c01d; reg [31:0]c02d; reg [31:0]c03d; reg [31:0]c04d; reg [31:0]c05d; reg [31:0]c06d; reg [31:0]c07d; reg [31:0]c08d; reg [31:0]c09d; reg [31:0]c10d; reg [31:0]c11d; reg [31:0]c12d; reg [31:0]c13d; reg [31:0]c14d; reg [31:0]c15d; /* From scrypt.c #define R(a,b) (((a) << (b)) | ((a) >> (32 - (b)))) for (i = 0; i < 8; i += 2) { // Operate on columns x04 ^= R(x00+x12, 7); x09 ^= R(x05+x01, 7); x14 ^= R(x10+x06, 7); x03 ^= R(x15+x11, 7); x08 ^= R(x04+x00, 9); x13 ^= R(x09+x05, 9); x02 ^= R(x14+x10, 9); x07 ^= R(x03+x15, 9); x12 ^= R(x08+x04,13); x01 ^= R(x13+x09,13); x06 ^= R(x02+x14,13); x11 ^= R(x07+x03,13); x00 ^= R(x12+x08,18); x05 ^= R(x01+x13,18); x10 ^= R(x06+x02,18); x15 ^= R(x11+x07,18); // Operate on rows x01 ^= R(x00+x03, 7); x06 ^= R(x05+x04, 7); x11 ^= R(x10+x09, 7); x12 ^= R(x15+x14, 7); x02 ^= R(x01+x00, 9); x07 ^= R(x06+x05, 9); x08 ^= R(x11+x10, 9); x13 ^= R(x12+x15, 9); x03 ^= R(x02+x01,13); x04 ^= R(x07+x06,13); x09 ^= R(x08+x11,13); x14 ^= R(x13+x12,13); x00 ^= R(x03+x02,18); x05 ^= R(x04+x07,18); x10 ^= R(x09+x08,18); x15 ^= R(x14+x13,18); } */ // cols assign c04s = xx[`IDX(0)] + xx[`IDX(12)]; assign c04 = xx[`IDX(4)] ^ { c04s[24:0], c04s[31:25] }; assign c09s = xx[`IDX(5)] + xx[`IDX(1)]; assign c09 = xx[`IDX(9)] ^ { c09s[24:0], c09s[31:25] }; assign c14s = xx[`IDX(10)] + xx[`IDX(6)]; assign c14 = xx[`IDX(14)] ^ { c14s[24:0], c14s[31:25] }; assign c03s = xx[`IDX(15)] + xx[`IDX(11)]; assign c03 = xx[`IDX(03)] ^ { c03s[24:0], c03s[31:25] }; assign c08s = c04 + xx[`IDX(0)]; assign c08 = xx[`IDX(8)] ^ { c08s[22:0], c08s[31:23] }; assign c13s = c09 + xx[`IDX(5)]; assign c13 = xx[`IDX(13)] ^ { c13s[22:0], c13s[31:23] }; assign c02s = c14 + xx[`IDX(10)]; assign c02 = xx[`IDX(2)] ^ { c02s[22:0], c02s[31:23] }; assign c07s = c03 + xx[`IDX(15)]; assign c07 = xx[`IDX(7)] ^ { c07s[22:0], c07s[31:23] }; assign c12s = c08 + c04; assign c12 = xx[`IDX(12)] ^ { c12s[18:0], c12s[31:19] }; assign c01s = c13 + c09; assign c01 = xx[`IDX(1)] ^ { c01s[18:0], c01s[31:19] }; assign c06s = c02 + c14; assign c06 = xx[`IDX(6)] ^ { c06s[18:0], c06s[31:19] }; assign c11s = c07 + c03; assign c11 = xx[`IDX(11)] ^ { c11s[18:0], c11s[31:19] }; assign c00s = c12 + c08; assign c00 = xx[`IDX(0)] ^ { c00s[13:0], c00s[31:14] }; assign c05s = c01 + c13; assign c05 = xx[`IDX(5)] ^ { c05s[13:0], c05s[31:14] }; assign c10s = c06 + c02; assign c10 = xx[`IDX(10)] ^ { c10s[13:0], c10s[31:14] }; assign c15s = c11 + c07; assign c15 = xx[`IDX(15)] ^ { c15s[13:0], c15s[31:14] }; // rows assign r01s = c00d + c03d; assign r01 = c01d ^ { r01s[24:0], r01s[31:25] }; assign r06s = c05d + c04d; assign r06 = c06d ^ { r06s[24:0], r06s[31:25] }; assign r11s = c10d + c09d; assign r11 = c11d ^ { r11s[24:0], r11s[31:25] }; assign r12s = c15d + c14d; assign r12 = c12d ^ { r12s[24:0], r12s[31:25] }; assign r02s = r01 + c00d; assign r02 = c02d ^ { r02s[22:0], r02s[31:23] }; assign r07s = r06 + c05d; assign r07 = c07d ^ { r07s[22:0], r07s[31:23] }; assign r08s = r11 + c10d; assign r08 = c08d ^ { r08s[22:0], r08s[31:23] }; assign r13s = r12 + c15d; assign r13 = c13d ^ { r13s[22:0], r13s[31:23] }; assign r03s = r02 + r01; assign r03 = c03d ^ { r03s[18:0], r03s[31:19] }; assign r04s = r07 + r06; assign r04 = c04d ^ { r04s[18:0], r04s[31:19] }; assign r09s = r08 + r11; assign r09 = c09d ^ { r09s[18:0], r09s[31:19] }; assign r14s = r13 + r12; assign r14 = c14d ^ { r14s[18:0], r14s[31:19] }; assign r00s = r03 + r02; assign r00 = c00d ^ { r00s[13:0], r00s[31:14] }; assign r05s = r04 + r07; assign r05 = c05d ^ { r05s[13:0], r05s[31:14] }; assign r10s = r09 + r08; assign r10 = c10d ^ { r10s[13:0], r10s[31:14] }; assign r15s = r14 + r13; assign r15 = c15d ^ { r15s[13:0], r15s[31:14] }; wire [511:0]xo; // Rename row results assign xo = { r15, r14, r13, r12, r11, r10, r09, r08, r07, r06, r05, r04, r03, r02, r01, r00 }; assign Xaddr = xo[9:0]; // Unregistered output always @ (posedge clk) begin c00d <= c00; c01d <= c01; c02d <= c02; c03d <= c03; c04d <= c04; c05d <= c05; c06d <= c06; c07d <= c07; c08d <= c08; c09d <= c09; c10d <= c10; c11d <= c11; c12d <= c12; c13d <= c13; c14d <= c14; c15d <= c15; out <= xo; // Registered output end endmodule
// -- (c) Copyright 2010 - 2011 Xilinx, Inc. All rights reserved. // -- // -- This file contains confidential and proprietary information // -- of Xilinx, Inc. and is protected under U.S. and // -- international copyright and other intellectual property // -- laws. // -- // -- DISCLAIMER // -- This disclaimer is not a license and does not grant any // -- rights to the materials distributed herewith. Except as // -- otherwise provided in a valid license issued to you by // -- Xilinx, and to the maximum extent permitted by applicable // -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND // -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES // -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING // -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- // -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and // -- (2) Xilinx shall not be liable (whether in contract or tort, // -- including negligence, or under any other theory of // -- liability) for any loss or damage of any kind or nature // -- related to, arising under or in connection with these // -- materials, including for any direct, or any indirect, // -- special, incidental, or consequential loss or damage // -- (including loss of data, profits, goodwill, or any type of // -- loss or damage suffered as a result of any action brought // -- by a third party) even if such damage or loss was // -- reasonably foreseeable or Xilinx had been advised of the // -- possibility of the same. // -- // -- CRITICAL APPLICATIONS // -- Xilinx products are not designed or intended to be fail- // -- safe, or for use in any application requiring fail-safe // -- performance, such as life-support or safety devices or // -- systems, Class III medical devices, nuclear facilities, // -- applications related to the deployment of airbags, or any // -- other applications that could lead to death, personal // -- injury, or severe property or environmental damage // -- (individually and collectively, "Critical // -- Applications"). Customer assumes the sole risk and // -- liability of any use of Xilinx products in Critical // -- Applications, subject only to applicable laws and // -- regulations governing limitations on product liability. // -- // -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS // -- PART OF THIS FILE AT ALL TIMES. //----------------------------------------------------------------------------- // // Description: AXI3 Slave Converter // This module instantiates Address, Write Data and Read Data AXI3 Converter // modules, each one taking care of the channel specific tasks. // The Address AXI3 converter can handle both AR and AW channels. // The Write Respons Channel is reused from the Down-Sizer. // // Verilog-standard: Verilog 2001 //-------------------------------------------------------------------------- // // Structure: // axi3_conv // a_axi3_conv // axic_fifo // w_axi3_conv // b_downsizer // r_axi3_conv // //-------------------------------------------------------------------------- `timescale 1ps/1ps (* DowngradeIPIdentifiedWarnings="yes" *) module axi_protocol_converter_v2_1_axi3_conv # ( parameter C_FAMILY = "none", parameter integer C_AXI_ID_WIDTH = 1, parameter integer C_AXI_ADDR_WIDTH = 32, parameter integer C_AXI_DATA_WIDTH = 32, parameter integer C_AXI_SUPPORTS_USER_SIGNALS = 0, parameter integer C_AXI_AWUSER_WIDTH = 1, parameter integer C_AXI_ARUSER_WIDTH = 1, parameter integer C_AXI_WUSER_WIDTH = 1, parameter integer C_AXI_RUSER_WIDTH = 1, parameter integer C_AXI_BUSER_WIDTH = 1, parameter integer C_AXI_SUPPORTS_WRITE = 1, parameter integer C_AXI_SUPPORTS_READ = 1, parameter integer C_SUPPORT_SPLITTING = 1, // Implement transaction splitting logic. // Disabled whan all connected masters are AXI3 and have same or narrower data width. parameter integer C_SUPPORT_BURSTS = 1, // Disabled when all connected masters are AxiLite, // allowing logic to be simplified. parameter integer C_SINGLE_THREAD = 1 // 0 = Ignore ID when propagating transactions (assume all responses are in order). // 1 = Enforce single-threading (one ID at a time) when any outstanding or // requested transaction requires splitting. // While no split is ongoing any new non-split transaction will pass immediately regardless // off ID. // A split transaction will stall if there are multiple ID (non-split) transactions // ongoing, once it has been forwarded only transactions with the same ID is allowed // (split or not) until all ongoing split transactios has been completed. ) ( // System Signals input wire ACLK, input wire ARESETN, // Slave Interface Write Address Ports input wire [C_AXI_ID_WIDTH-1:0] S_AXI_AWID, input wire [C_AXI_ADDR_WIDTH-1:0] S_AXI_AWADDR, input wire [8-1:0] S_AXI_AWLEN, input wire [3-1:0] S_AXI_AWSIZE, input wire [2-1:0] S_AXI_AWBURST, input wire [1-1:0] S_AXI_AWLOCK, input wire [4-1:0] S_AXI_AWCACHE, input wire [3-1:0] S_AXI_AWPROT, input wire [4-1:0] S_AXI_AWQOS, input wire [C_AXI_AWUSER_WIDTH-1:0] S_AXI_AWUSER, input wire S_AXI_AWVALID, output wire S_AXI_AWREADY, // Slave Interface Write Data Ports input wire [C_AXI_DATA_WIDTH-1:0] S_AXI_WDATA, input wire [C_AXI_DATA_WIDTH/8-1:0] S_AXI_WSTRB, input wire S_AXI_WLAST, input wire [C_AXI_WUSER_WIDTH-1:0] S_AXI_WUSER, input wire S_AXI_WVALID, output wire S_AXI_WREADY, // Slave Interface Write Response Ports output wire [C_AXI_ID_WIDTH-1:0] S_AXI_BID, output wire [2-1:0] S_AXI_BRESP, output wire [C_AXI_BUSER_WIDTH-1:0] S_AXI_BUSER, output wire S_AXI_BVALID, input wire S_AXI_BREADY, // Slave Interface Read Address Ports input wire [C_AXI_ID_WIDTH-1:0] S_AXI_ARID, input wire [C_AXI_ADDR_WIDTH-1:0] S_AXI_ARADDR, input wire [8-1:0] S_AXI_ARLEN, input wire [3-1:0] S_AXI_ARSIZE, input wire [2-1:0] S_AXI_ARBURST, input wire [1-1:0] S_AXI_ARLOCK, input wire [4-1:0] S_AXI_ARCACHE, input wire [3-1:0] S_AXI_ARPROT, input wire [4-1:0] S_AXI_ARQOS, input wire [C_AXI_ARUSER_WIDTH-1:0] S_AXI_ARUSER, input wire S_AXI_ARVALID, output wire S_AXI_ARREADY, // Slave Interface Read Data Ports output wire [C_AXI_ID_WIDTH-1:0] S_AXI_RID, output wire [C_AXI_DATA_WIDTH-1:0] S_AXI_RDATA, output wire [2-1:0] S_AXI_RRESP, output wire S_AXI_RLAST, output wire [C_AXI_RUSER_WIDTH-1:0] S_AXI_RUSER, output wire S_AXI_RVALID, input wire S_AXI_RREADY, // Master Interface Write Address Port output wire [C_AXI_ID_WIDTH-1:0] M_AXI_AWID, output wire [C_AXI_ADDR_WIDTH-1:0] M_AXI_AWADDR, output wire [4-1:0] M_AXI_AWLEN, output wire [3-1:0] M_AXI_AWSIZE, output wire [2-1:0] M_AXI_AWBURST, output wire [2-1:0] M_AXI_AWLOCK, output wire [4-1:0] M_AXI_AWCACHE, output wire [3-1:0] M_AXI_AWPROT, output wire [4-1:0] M_AXI_AWQOS, output wire [C_AXI_AWUSER_WIDTH-1:0] M_AXI_AWUSER, output wire M_AXI_AWVALID, input wire M_AXI_AWREADY, // Master Interface Write Data Ports output wire [C_AXI_ID_WIDTH-1:0] M_AXI_WID, output wire [C_AXI_DATA_WIDTH-1:0] M_AXI_WDATA, output wire [C_AXI_DATA_WIDTH/8-1:0] M_AXI_WSTRB, output wire M_AXI_WLAST, output wire [C_AXI_WUSER_WIDTH-1:0] M_AXI_WUSER, output wire M_AXI_WVALID, input wire M_AXI_WREADY, // Master Interface Write Response Ports input wire [C_AXI_ID_WIDTH-1:0] M_AXI_BID, input wire [2-1:0] M_AXI_BRESP, input wire [C_AXI_BUSER_WIDTH-1:0] M_AXI_BUSER, input wire M_AXI_BVALID, output wire M_AXI_BREADY, // Master Interface Read Address Port output wire [C_AXI_ID_WIDTH-1:0] M_AXI_ARID, output wire [C_AXI_ADDR_WIDTH-1:0] M_AXI_ARADDR, output wire [4-1:0] M_AXI_ARLEN, output wire [3-1:0] M_AXI_ARSIZE, output wire [2-1:0] M_AXI_ARBURST, output wire [2-1:0] M_AXI_ARLOCK, output wire [4-1:0] M_AXI_ARCACHE, output wire [3-1:0] M_AXI_ARPROT, output wire [4-1:0] M_AXI_ARQOS, output wire [C_AXI_ARUSER_WIDTH-1:0] M_AXI_ARUSER, output wire M_AXI_ARVALID, input wire M_AXI_ARREADY, // Master Interface Read Data Ports input wire [C_AXI_ID_WIDTH-1:0] M_AXI_RID, input wire [C_AXI_DATA_WIDTH-1:0] M_AXI_RDATA, input wire [2-1:0] M_AXI_RRESP, input wire M_AXI_RLAST, input wire [C_AXI_RUSER_WIDTH-1:0] M_AXI_RUSER, input wire M_AXI_RVALID, output wire M_AXI_RREADY ); ///////////////////////////////////////////////////////////////////////////// // Functions ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Local params ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Variables for generating parameter controlled instances. ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Internal signals ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Handle Write Channels (AW/W/B) ///////////////////////////////////////////////////////////////////////////// generate if (C_AXI_SUPPORTS_WRITE == 1) begin : USE_WRITE // Write Channel Signals for Commands Queue Interface. wire wr_cmd_valid; wire [C_AXI_ID_WIDTH-1:0] wr_cmd_id; wire [4-1:0] wr_cmd_length; wire wr_cmd_ready; wire wr_cmd_b_valid; wire wr_cmd_b_split; wire [4-1:0] wr_cmd_b_repeat; wire wr_cmd_b_ready; // Write Address Channel. axi_protocol_converter_v2_1_a_axi3_conv # ( .C_FAMILY (C_FAMILY), .C_AXI_ID_WIDTH (C_AXI_ID_WIDTH), .C_AXI_ADDR_WIDTH (C_AXI_ADDR_WIDTH), .C_AXI_DATA_WIDTH (C_AXI_DATA_WIDTH), .C_AXI_SUPPORTS_USER_SIGNALS (C_AXI_SUPPORTS_USER_SIGNALS), .C_AXI_AUSER_WIDTH (C_AXI_AWUSER_WIDTH), .C_AXI_CHANNEL (0), .C_SUPPORT_SPLITTING (C_SUPPORT_SPLITTING), .C_SUPPORT_BURSTS (C_SUPPORT_BURSTS), .C_SINGLE_THREAD (C_SINGLE_THREAD) ) write_addr_inst ( // Global Signals .ARESET (~ARESETN), .ACLK (ACLK), // Command Interface (W) .cmd_valid (wr_cmd_valid), .cmd_split (), .cmd_id (wr_cmd_id), .cmd_length (wr_cmd_length), .cmd_ready (wr_cmd_ready), // Command Interface (B) .cmd_b_valid (wr_cmd_b_valid), .cmd_b_split (wr_cmd_b_split), .cmd_b_repeat (wr_cmd_b_repeat), .cmd_b_ready (wr_cmd_b_ready), // Slave Interface Write Address Ports .S_AXI_AID (S_AXI_AWID), .S_AXI_AADDR (S_AXI_AWADDR), .S_AXI_ALEN (S_AXI_AWLEN), .S_AXI_ASIZE (S_AXI_AWSIZE), .S_AXI_ABURST (S_AXI_AWBURST), .S_AXI_ALOCK (S_AXI_AWLOCK), .S_AXI_ACACHE (S_AXI_AWCACHE), .S_AXI_APROT (S_AXI_AWPROT), .S_AXI_AQOS (S_AXI_AWQOS), .S_AXI_AUSER (S_AXI_AWUSER), .S_AXI_AVALID (S_AXI_AWVALID), .S_AXI_AREADY (S_AXI_AWREADY), // Master Interface Write Address Port .M_AXI_AID (M_AXI_AWID), .M_AXI_AADDR (M_AXI_AWADDR), .M_AXI_ALEN (M_AXI_AWLEN), .M_AXI_ASIZE (M_AXI_AWSIZE), .M_AXI_ABURST (M_AXI_AWBURST), .M_AXI_ALOCK (M_AXI_AWLOCK), .M_AXI_ACACHE (M_AXI_AWCACHE), .M_AXI_APROT (M_AXI_AWPROT), .M_AXI_AQOS (M_AXI_AWQOS), .M_AXI_AUSER (M_AXI_AWUSER), .M_AXI_AVALID (M_AXI_AWVALID), .M_AXI_AREADY (M_AXI_AWREADY) ); // Write Data Channel. axi_protocol_converter_v2_1_w_axi3_conv # ( .C_FAMILY (C_FAMILY), .C_AXI_ID_WIDTH (C_AXI_ID_WIDTH), .C_AXI_DATA_WIDTH (C_AXI_DATA_WIDTH), .C_AXI_SUPPORTS_USER_SIGNALS (C_AXI_SUPPORTS_USER_SIGNALS), .C_AXI_WUSER_WIDTH (C_AXI_WUSER_WIDTH), .C_SUPPORT_SPLITTING (C_SUPPORT_SPLITTING), .C_SUPPORT_BURSTS (C_SUPPORT_BURSTS) ) write_data_inst ( // Global Signals .ARESET (~ARESETN), .ACLK (ACLK), // Command Interface .cmd_valid (wr_cmd_valid), .cmd_id (wr_cmd_id), .cmd_length (wr_cmd_length), .cmd_ready (wr_cmd_ready), // Slave Interface Write Data Ports .S_AXI_WDATA (S_AXI_WDATA), .S_AXI_WSTRB (S_AXI_WSTRB), .S_AXI_WLAST (S_AXI_WLAST), .S_AXI_WUSER (S_AXI_WUSER), .S_AXI_WVALID (S_AXI_WVALID), .S_AXI_WREADY (S_AXI_WREADY), // Master Interface Write Data Ports .M_AXI_WID (M_AXI_WID), .M_AXI_WDATA (M_AXI_WDATA), .M_AXI_WSTRB (M_AXI_WSTRB), .M_AXI_WLAST (M_AXI_WLAST), .M_AXI_WUSER (M_AXI_WUSER), .M_AXI_WVALID (M_AXI_WVALID), .M_AXI_WREADY (M_AXI_WREADY) ); if ( C_SUPPORT_SPLITTING == 1 && C_SUPPORT_BURSTS == 1 ) begin : USE_SPLIT_W // Write Data Response Channel. axi_protocol_converter_v2_1_b_downsizer # ( .C_FAMILY (C_FAMILY), .C_AXI_ID_WIDTH (C_AXI_ID_WIDTH), .C_AXI_SUPPORTS_USER_SIGNALS (C_AXI_SUPPORTS_USER_SIGNALS), .C_AXI_BUSER_WIDTH (C_AXI_BUSER_WIDTH) ) write_resp_inst ( // Global Signals .ARESET (~ARESETN), .ACLK (ACLK), // Command Interface .cmd_valid (wr_cmd_b_valid), .cmd_split (wr_cmd_b_split), .cmd_repeat (wr_cmd_b_repeat), .cmd_ready (wr_cmd_b_ready), // Slave Interface Write Response Ports .S_AXI_BID (S_AXI_BID), .S_AXI_BRESP (S_AXI_BRESP), .S_AXI_BUSER (S_AXI_BUSER), .S_AXI_BVALID (S_AXI_BVALID), .S_AXI_BREADY (S_AXI_BREADY), // Master Interface Write Response Ports .M_AXI_BID (M_AXI_BID), .M_AXI_BRESP (M_AXI_BRESP), .M_AXI_BUSER (M_AXI_BUSER), .M_AXI_BVALID (M_AXI_BVALID), .M_AXI_BREADY (M_AXI_BREADY) ); end else begin : NO_SPLIT_W // MI -> SI Interface Write Response Ports assign S_AXI_BID = M_AXI_BID; assign S_AXI_BRESP = M_AXI_BRESP; assign S_AXI_BUSER = M_AXI_BUSER; assign S_AXI_BVALID = M_AXI_BVALID; assign M_AXI_BREADY = S_AXI_BREADY; end end else begin : NO_WRITE // Slave Interface Write Address Ports assign S_AXI_AWREADY = 1'b0; // Slave Interface Write Data Ports assign S_AXI_WREADY = 1'b0; // Slave Interface Write Response Ports assign S_AXI_BID = {C_AXI_ID_WIDTH{1'b0}}; assign S_AXI_BRESP = 2'b0; assign S_AXI_BUSER = {C_AXI_BUSER_WIDTH{1'b0}}; assign S_AXI_BVALID = 1'b0; // Master Interface Write Address Port assign M_AXI_AWID = {C_AXI_ID_WIDTH{1'b0}}; assign M_AXI_AWADDR = {C_AXI_ADDR_WIDTH{1'b0}}; assign M_AXI_AWLEN = 4'b0; assign M_AXI_AWSIZE = 3'b0; assign M_AXI_AWBURST = 2'b0; assign M_AXI_AWLOCK = 2'b0; assign M_AXI_AWCACHE = 4'b0; assign M_AXI_AWPROT = 3'b0; assign M_AXI_AWQOS = 4'b0; assign M_AXI_AWUSER = {C_AXI_AWUSER_WIDTH{1'b0}}; assign M_AXI_AWVALID = 1'b0; // Master Interface Write Data Ports assign M_AXI_WDATA = {C_AXI_DATA_WIDTH{1'b0}}; assign M_AXI_WSTRB = {C_AXI_DATA_WIDTH/8{1'b0}}; assign M_AXI_WLAST = 1'b0; assign M_AXI_WUSER = {C_AXI_WUSER_WIDTH{1'b0}}; assign M_AXI_WVALID = 1'b0; // Master Interface Write Response Ports assign M_AXI_BREADY = 1'b0; end endgenerate ///////////////////////////////////////////////////////////////////////////// // Handle Read Channels (AR/R) ///////////////////////////////////////////////////////////////////////////// generate if (C_AXI_SUPPORTS_READ == 1) begin : USE_READ // Write Response channel. if ( C_SUPPORT_SPLITTING == 1 && C_SUPPORT_BURSTS == 1 ) begin : USE_SPLIT_R // Read Channel Signals for Commands Queue Interface. wire rd_cmd_valid; wire rd_cmd_split; wire rd_cmd_ready; // Write Address Channel. axi_protocol_converter_v2_1_a_axi3_conv # ( .C_FAMILY (C_FAMILY), .C_AXI_ID_WIDTH (C_AXI_ID_WIDTH), .C_AXI_ADDR_WIDTH (C_AXI_ADDR_WIDTH), .C_AXI_DATA_WIDTH (C_AXI_DATA_WIDTH), .C_AXI_SUPPORTS_USER_SIGNALS (C_AXI_SUPPORTS_USER_SIGNALS), .C_AXI_AUSER_WIDTH (C_AXI_ARUSER_WIDTH), .C_AXI_CHANNEL (1), .C_SUPPORT_SPLITTING (C_SUPPORT_SPLITTING), .C_SUPPORT_BURSTS (C_SUPPORT_BURSTS), .C_SINGLE_THREAD (C_SINGLE_THREAD) ) read_addr_inst ( // Global Signals .ARESET (~ARESETN), .ACLK (ACLK), // Command Interface (R) .cmd_valid (rd_cmd_valid), .cmd_split (rd_cmd_split), .cmd_id (), .cmd_length (), .cmd_ready (rd_cmd_ready), // Command Interface (B) .cmd_b_valid (), .cmd_b_split (), .cmd_b_repeat (), .cmd_b_ready (1'b0), // Slave Interface Write Address Ports .S_AXI_AID (S_AXI_ARID), .S_AXI_AADDR (S_AXI_ARADDR), .S_AXI_ALEN (S_AXI_ARLEN), .S_AXI_ASIZE (S_AXI_ARSIZE), .S_AXI_ABURST (S_AXI_ARBURST), .S_AXI_ALOCK (S_AXI_ARLOCK), .S_AXI_ACACHE (S_AXI_ARCACHE), .S_AXI_APROT (S_AXI_ARPROT), .S_AXI_AQOS (S_AXI_ARQOS), .S_AXI_AUSER (S_AXI_ARUSER), .S_AXI_AVALID (S_AXI_ARVALID), .S_AXI_AREADY (S_AXI_ARREADY), // Master Interface Write Address Port .M_AXI_AID (M_AXI_ARID), .M_AXI_AADDR (M_AXI_ARADDR), .M_AXI_ALEN (M_AXI_ARLEN), .M_AXI_ASIZE (M_AXI_ARSIZE), .M_AXI_ABURST (M_AXI_ARBURST), .M_AXI_ALOCK (M_AXI_ARLOCK), .M_AXI_ACACHE (M_AXI_ARCACHE), .M_AXI_APROT (M_AXI_ARPROT), .M_AXI_AQOS (M_AXI_ARQOS), .M_AXI_AUSER (M_AXI_ARUSER), .M_AXI_AVALID (M_AXI_ARVALID), .M_AXI_AREADY (M_AXI_ARREADY) ); // Read Data Channel. axi_protocol_converter_v2_1_r_axi3_conv # ( .C_FAMILY (C_FAMILY), .C_AXI_ID_WIDTH (C_AXI_ID_WIDTH), .C_AXI_DATA_WIDTH (C_AXI_DATA_WIDTH), .C_AXI_SUPPORTS_USER_SIGNALS (C_AXI_SUPPORTS_USER_SIGNALS), .C_AXI_RUSER_WIDTH (C_AXI_RUSER_WIDTH), .C_SUPPORT_SPLITTING (C_SUPPORT_SPLITTING), .C_SUPPORT_BURSTS (C_SUPPORT_BURSTS) ) read_data_inst ( // Global Signals .ARESET (~ARESETN), .ACLK (ACLK), // Command Interface .cmd_valid (rd_cmd_valid), .cmd_split (rd_cmd_split), .cmd_ready (rd_cmd_ready), // Slave Interface Read Data Ports .S_AXI_RID (S_AXI_RID), .S_AXI_RDATA (S_AXI_RDATA), .S_AXI_RRESP (S_AXI_RRESP), .S_AXI_RLAST (S_AXI_RLAST), .S_AXI_RUSER (S_AXI_RUSER), .S_AXI_RVALID (S_AXI_RVALID), .S_AXI_RREADY (S_AXI_RREADY), // Master Interface Read Data Ports .M_AXI_RID (M_AXI_RID), .M_AXI_RDATA (M_AXI_RDATA), .M_AXI_RRESP (M_AXI_RRESP), .M_AXI_RLAST (M_AXI_RLAST), .M_AXI_RUSER (M_AXI_RUSER), .M_AXI_RVALID (M_AXI_RVALID), .M_AXI_RREADY (M_AXI_RREADY) ); end else begin : NO_SPLIT_R // SI -> MI Interface Write Address Port assign M_AXI_ARID = S_AXI_ARID; assign M_AXI_ARADDR = S_AXI_ARADDR; assign M_AXI_ARLEN = S_AXI_ARLEN; assign M_AXI_ARSIZE = S_AXI_ARSIZE; assign M_AXI_ARBURST = S_AXI_ARBURST; assign M_AXI_ARLOCK = S_AXI_ARLOCK; assign M_AXI_ARCACHE = S_AXI_ARCACHE; assign M_AXI_ARPROT = S_AXI_ARPROT; assign M_AXI_ARQOS = S_AXI_ARQOS; assign M_AXI_ARUSER = S_AXI_ARUSER; assign M_AXI_ARVALID = S_AXI_ARVALID; assign S_AXI_ARREADY = M_AXI_ARREADY; // MI -> SI Interface Read Data Ports assign S_AXI_RID = M_AXI_RID; assign S_AXI_RDATA = M_AXI_RDATA; assign S_AXI_RRESP = M_AXI_RRESP; assign S_AXI_RLAST = M_AXI_RLAST; assign S_AXI_RUSER = M_AXI_RUSER; assign S_AXI_RVALID = M_AXI_RVALID; assign M_AXI_RREADY = S_AXI_RREADY; end end else begin : NO_READ // Slave Interface Read Address Ports assign S_AXI_ARREADY = 1'b0; // Slave Interface Read Data Ports assign S_AXI_RID = {C_AXI_ID_WIDTH{1'b0}}; assign S_AXI_RDATA = {C_AXI_DATA_WIDTH{1'b0}}; assign S_AXI_RRESP = 2'b0; assign S_AXI_RLAST = 1'b0; assign S_AXI_RUSER = {C_AXI_RUSER_WIDTH{1'b0}}; assign S_AXI_RVALID = 1'b0; // Master Interface Read Address Port assign M_AXI_ARID = {C_AXI_ID_WIDTH{1'b0}}; assign M_AXI_ARADDR = {C_AXI_ADDR_WIDTH{1'b0}}; assign M_AXI_ARLEN = 4'b0; assign M_AXI_ARSIZE = 3'b0; assign M_AXI_ARBURST = 2'b0; assign M_AXI_ARLOCK = 2'b0; assign M_AXI_ARCACHE = 4'b0; assign M_AXI_ARPROT = 3'b0; assign M_AXI_ARQOS = 4'b0; assign M_AXI_ARUSER = {C_AXI_ARUSER_WIDTH{1'b0}}; assign M_AXI_ARVALID = 1'b0; // Master Interface Read Data Ports assign M_AXI_RREADY = 1'b0; end endgenerate endmodule
// -- (c) Copyright 2010 - 2011 Xilinx, Inc. All rights reserved. // -- // -- This file contains confidential and proprietary information // -- of Xilinx, Inc. and is protected under U.S. and // -- international copyright and other intellectual property // -- laws. // -- // -- DISCLAIMER // -- This disclaimer is not a license and does not grant any // -- rights to the materials distributed herewith. Except as // -- otherwise provided in a valid license issued to you by // -- Xilinx, and to the maximum extent permitted by applicable // -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND // -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES // -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING // -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- // -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and // -- (2) Xilinx shall not be liable (whether in contract or tort, // -- including negligence, or under any other theory of // -- liability) for any loss or damage of any kind or nature // -- related to, arising under or in connection with these // -- materials, including for any direct, or any indirect, // -- special, incidental, or consequential loss or damage // -- (including loss of data, profits, goodwill, or any type of // -- loss or damage suffered as a result of any action brought // -- by a third party) even if such damage or loss was // -- reasonably foreseeable or Xilinx had been advised of the // -- possibility of the same. // -- // -- CRITICAL APPLICATIONS // -- Xilinx products are not designed or intended to be fail- // -- safe, or for use in any application requiring fail-safe // -- performance, such as life-support or safety devices or // -- systems, Class III medical devices, nuclear facilities, // -- applications related to the deployment of airbags, or any // -- other applications that could lead to death, personal // -- injury, or severe property or environmental damage // -- (individually and collectively, "Critical // -- Applications"). Customer assumes the sole risk and // -- liability of any use of Xilinx products in Critical // -- Applications, subject only to applicable laws and // -- regulations governing limitations on product liability. // -- // -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS // -- PART OF THIS FILE AT ALL TIMES. //----------------------------------------------------------------------------- // // Description: AXI3 Slave Converter // This module instantiates Address, Write Data and Read Data AXI3 Converter // modules, each one taking care of the channel specific tasks. // The Address AXI3 converter can handle both AR and AW channels. // The Write Respons Channel is reused from the Down-Sizer. // // Verilog-standard: Verilog 2001 //-------------------------------------------------------------------------- // // Structure: // axi3_conv // a_axi3_conv // axic_fifo // w_axi3_conv // b_downsizer // r_axi3_conv // //-------------------------------------------------------------------------- `timescale 1ps/1ps (* DowngradeIPIdentifiedWarnings="yes" *) module axi_protocol_converter_v2_1_axi3_conv # ( parameter C_FAMILY = "none", parameter integer C_AXI_ID_WIDTH = 1, parameter integer C_AXI_ADDR_WIDTH = 32, parameter integer C_AXI_DATA_WIDTH = 32, parameter integer C_AXI_SUPPORTS_USER_SIGNALS = 0, parameter integer C_AXI_AWUSER_WIDTH = 1, parameter integer C_AXI_ARUSER_WIDTH = 1, parameter integer C_AXI_WUSER_WIDTH = 1, parameter integer C_AXI_RUSER_WIDTH = 1, parameter integer C_AXI_BUSER_WIDTH = 1, parameter integer C_AXI_SUPPORTS_WRITE = 1, parameter integer C_AXI_SUPPORTS_READ = 1, parameter integer C_SUPPORT_SPLITTING = 1, // Implement transaction splitting logic. // Disabled whan all connected masters are AXI3 and have same or narrower data width. parameter integer C_SUPPORT_BURSTS = 1, // Disabled when all connected masters are AxiLite, // allowing logic to be simplified. parameter integer C_SINGLE_THREAD = 1 // 0 = Ignore ID when propagating transactions (assume all responses are in order). // 1 = Enforce single-threading (one ID at a time) when any outstanding or // requested transaction requires splitting. // While no split is ongoing any new non-split transaction will pass immediately regardless // off ID. // A split transaction will stall if there are multiple ID (non-split) transactions // ongoing, once it has been forwarded only transactions with the same ID is allowed // (split or not) until all ongoing split transactios has been completed. ) ( // System Signals input wire ACLK, input wire ARESETN, // Slave Interface Write Address Ports input wire [C_AXI_ID_WIDTH-1:0] S_AXI_AWID, input wire [C_AXI_ADDR_WIDTH-1:0] S_AXI_AWADDR, input wire [8-1:0] S_AXI_AWLEN, input wire [3-1:0] S_AXI_AWSIZE, input wire [2-1:0] S_AXI_AWBURST, input wire [1-1:0] S_AXI_AWLOCK, input wire [4-1:0] S_AXI_AWCACHE, input wire [3-1:0] S_AXI_AWPROT, input wire [4-1:0] S_AXI_AWQOS, input wire [C_AXI_AWUSER_WIDTH-1:0] S_AXI_AWUSER, input wire S_AXI_AWVALID, output wire S_AXI_AWREADY, // Slave Interface Write Data Ports input wire [C_AXI_DATA_WIDTH-1:0] S_AXI_WDATA, input wire [C_AXI_DATA_WIDTH/8-1:0] S_AXI_WSTRB, input wire S_AXI_WLAST, input wire [C_AXI_WUSER_WIDTH-1:0] S_AXI_WUSER, input wire S_AXI_WVALID, output wire S_AXI_WREADY, // Slave Interface Write Response Ports output wire [C_AXI_ID_WIDTH-1:0] S_AXI_BID, output wire [2-1:0] S_AXI_BRESP, output wire [C_AXI_BUSER_WIDTH-1:0] S_AXI_BUSER, output wire S_AXI_BVALID, input wire S_AXI_BREADY, // Slave Interface Read Address Ports input wire [C_AXI_ID_WIDTH-1:0] S_AXI_ARID, input wire [C_AXI_ADDR_WIDTH-1:0] S_AXI_ARADDR, input wire [8-1:0] S_AXI_ARLEN, input wire [3-1:0] S_AXI_ARSIZE, input wire [2-1:0] S_AXI_ARBURST, input wire [1-1:0] S_AXI_ARLOCK, input wire [4-1:0] S_AXI_ARCACHE, input wire [3-1:0] S_AXI_ARPROT, input wire [4-1:0] S_AXI_ARQOS, input wire [C_AXI_ARUSER_WIDTH-1:0] S_AXI_ARUSER, input wire S_AXI_ARVALID, output wire S_AXI_ARREADY, // Slave Interface Read Data Ports output wire [C_AXI_ID_WIDTH-1:0] S_AXI_RID, output wire [C_AXI_DATA_WIDTH-1:0] S_AXI_RDATA, output wire [2-1:0] S_AXI_RRESP, output wire S_AXI_RLAST, output wire [C_AXI_RUSER_WIDTH-1:0] S_AXI_RUSER, output wire S_AXI_RVALID, input wire S_AXI_RREADY, // Master Interface Write Address Port output wire [C_AXI_ID_WIDTH-1:0] M_AXI_AWID, output wire [C_AXI_ADDR_WIDTH-1:0] M_AXI_AWADDR, output wire [4-1:0] M_AXI_AWLEN, output wire [3-1:0] M_AXI_AWSIZE, output wire [2-1:0] M_AXI_AWBURST, output wire [2-1:0] M_AXI_AWLOCK, output wire [4-1:0] M_AXI_AWCACHE, output wire [3-1:0] M_AXI_AWPROT, output wire [4-1:0] M_AXI_AWQOS, output wire [C_AXI_AWUSER_WIDTH-1:0] M_AXI_AWUSER, output wire M_AXI_AWVALID, input wire M_AXI_AWREADY, // Master Interface Write Data Ports output wire [C_AXI_ID_WIDTH-1:0] M_AXI_WID, output wire [C_AXI_DATA_WIDTH-1:0] M_AXI_WDATA, output wire [C_AXI_DATA_WIDTH/8-1:0] M_AXI_WSTRB, output wire M_AXI_WLAST, output wire [C_AXI_WUSER_WIDTH-1:0] M_AXI_WUSER, output wire M_AXI_WVALID, input wire M_AXI_WREADY, // Master Interface Write Response Ports input wire [C_AXI_ID_WIDTH-1:0] M_AXI_BID, input wire [2-1:0] M_AXI_BRESP, input wire [C_AXI_BUSER_WIDTH-1:0] M_AXI_BUSER, input wire M_AXI_BVALID, output wire M_AXI_BREADY, // Master Interface Read Address Port output wire [C_AXI_ID_WIDTH-1:0] M_AXI_ARID, output wire [C_AXI_ADDR_WIDTH-1:0] M_AXI_ARADDR, output wire [4-1:0] M_AXI_ARLEN, output wire [3-1:0] M_AXI_ARSIZE, output wire [2-1:0] M_AXI_ARBURST, output wire [2-1:0] M_AXI_ARLOCK, output wire [4-1:0] M_AXI_ARCACHE, output wire [3-1:0] M_AXI_ARPROT, output wire [4-1:0] M_AXI_ARQOS, output wire [C_AXI_ARUSER_WIDTH-1:0] M_AXI_ARUSER, output wire M_AXI_ARVALID, input wire M_AXI_ARREADY, // Master Interface Read Data Ports input wire [C_AXI_ID_WIDTH-1:0] M_AXI_RID, input wire [C_AXI_DATA_WIDTH-1:0] M_AXI_RDATA, input wire [2-1:0] M_AXI_RRESP, input wire M_AXI_RLAST, input wire [C_AXI_RUSER_WIDTH-1:0] M_AXI_RUSER, input wire M_AXI_RVALID, output wire M_AXI_RREADY ); ///////////////////////////////////////////////////////////////////////////// // Functions ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Local params ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Variables for generating parameter controlled instances. ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Internal signals ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Handle Write Channels (AW/W/B) ///////////////////////////////////////////////////////////////////////////// generate if (C_AXI_SUPPORTS_WRITE == 1) begin : USE_WRITE // Write Channel Signals for Commands Queue Interface. wire wr_cmd_valid; wire [C_AXI_ID_WIDTH-1:0] wr_cmd_id; wire [4-1:0] wr_cmd_length; wire wr_cmd_ready; wire wr_cmd_b_valid; wire wr_cmd_b_split; wire [4-1:0] wr_cmd_b_repeat; wire wr_cmd_b_ready; // Write Address Channel. axi_protocol_converter_v2_1_a_axi3_conv # ( .C_FAMILY (C_FAMILY), .C_AXI_ID_WIDTH (C_AXI_ID_WIDTH), .C_AXI_ADDR_WIDTH (C_AXI_ADDR_WIDTH), .C_AXI_DATA_WIDTH (C_AXI_DATA_WIDTH), .C_AXI_SUPPORTS_USER_SIGNALS (C_AXI_SUPPORTS_USER_SIGNALS), .C_AXI_AUSER_WIDTH (C_AXI_AWUSER_WIDTH), .C_AXI_CHANNEL (0), .C_SUPPORT_SPLITTING (C_SUPPORT_SPLITTING), .C_SUPPORT_BURSTS (C_SUPPORT_BURSTS), .C_SINGLE_THREAD (C_SINGLE_THREAD) ) write_addr_inst ( // Global Signals .ARESET (~ARESETN), .ACLK (ACLK), // Command Interface (W) .cmd_valid (wr_cmd_valid), .cmd_split (), .cmd_id (wr_cmd_id), .cmd_length (wr_cmd_length), .cmd_ready (wr_cmd_ready), // Command Interface (B) .cmd_b_valid (wr_cmd_b_valid), .cmd_b_split (wr_cmd_b_split), .cmd_b_repeat (wr_cmd_b_repeat), .cmd_b_ready (wr_cmd_b_ready), // Slave Interface Write Address Ports .S_AXI_AID (S_AXI_AWID), .S_AXI_AADDR (S_AXI_AWADDR), .S_AXI_ALEN (S_AXI_AWLEN), .S_AXI_ASIZE (S_AXI_AWSIZE), .S_AXI_ABURST (S_AXI_AWBURST), .S_AXI_ALOCK (S_AXI_AWLOCK), .S_AXI_ACACHE (S_AXI_AWCACHE), .S_AXI_APROT (S_AXI_AWPROT), .S_AXI_AQOS (S_AXI_AWQOS), .S_AXI_AUSER (S_AXI_AWUSER), .S_AXI_AVALID (S_AXI_AWVALID), .S_AXI_AREADY (S_AXI_AWREADY), // Master Interface Write Address Port .M_AXI_AID (M_AXI_AWID), .M_AXI_AADDR (M_AXI_AWADDR), .M_AXI_ALEN (M_AXI_AWLEN), .M_AXI_ASIZE (M_AXI_AWSIZE), .M_AXI_ABURST (M_AXI_AWBURST), .M_AXI_ALOCK (M_AXI_AWLOCK), .M_AXI_ACACHE (M_AXI_AWCACHE), .M_AXI_APROT (M_AXI_AWPROT), .M_AXI_AQOS (M_AXI_AWQOS), .M_AXI_AUSER (M_AXI_AWUSER), .M_AXI_AVALID (M_AXI_AWVALID), .M_AXI_AREADY (M_AXI_AWREADY) ); // Write Data Channel. axi_protocol_converter_v2_1_w_axi3_conv # ( .C_FAMILY (C_FAMILY), .C_AXI_ID_WIDTH (C_AXI_ID_WIDTH), .C_AXI_DATA_WIDTH (C_AXI_DATA_WIDTH), .C_AXI_SUPPORTS_USER_SIGNALS (C_AXI_SUPPORTS_USER_SIGNALS), .C_AXI_WUSER_WIDTH (C_AXI_WUSER_WIDTH), .C_SUPPORT_SPLITTING (C_SUPPORT_SPLITTING), .C_SUPPORT_BURSTS (C_SUPPORT_BURSTS) ) write_data_inst ( // Global Signals .ARESET (~ARESETN), .ACLK (ACLK), // Command Interface .cmd_valid (wr_cmd_valid), .cmd_id (wr_cmd_id), .cmd_length (wr_cmd_length), .cmd_ready (wr_cmd_ready), // Slave Interface Write Data Ports .S_AXI_WDATA (S_AXI_WDATA), .S_AXI_WSTRB (S_AXI_WSTRB), .S_AXI_WLAST (S_AXI_WLAST), .S_AXI_WUSER (S_AXI_WUSER), .S_AXI_WVALID (S_AXI_WVALID), .S_AXI_WREADY (S_AXI_WREADY), // Master Interface Write Data Ports .M_AXI_WID (M_AXI_WID), .M_AXI_WDATA (M_AXI_WDATA), .M_AXI_WSTRB (M_AXI_WSTRB), .M_AXI_WLAST (M_AXI_WLAST), .M_AXI_WUSER (M_AXI_WUSER), .M_AXI_WVALID (M_AXI_WVALID), .M_AXI_WREADY (M_AXI_WREADY) ); if ( C_SUPPORT_SPLITTING == 1 && C_SUPPORT_BURSTS == 1 ) begin : USE_SPLIT_W // Write Data Response Channel. axi_protocol_converter_v2_1_b_downsizer # ( .C_FAMILY (C_FAMILY), .C_AXI_ID_WIDTH (C_AXI_ID_WIDTH), .C_AXI_SUPPORTS_USER_SIGNALS (C_AXI_SUPPORTS_USER_SIGNALS), .C_AXI_BUSER_WIDTH (C_AXI_BUSER_WIDTH) ) write_resp_inst ( // Global Signals .ARESET (~ARESETN), .ACLK (ACLK), // Command Interface .cmd_valid (wr_cmd_b_valid), .cmd_split (wr_cmd_b_split), .cmd_repeat (wr_cmd_b_repeat), .cmd_ready (wr_cmd_b_ready), // Slave Interface Write Response Ports .S_AXI_BID (S_AXI_BID), .S_AXI_BRESP (S_AXI_BRESP), .S_AXI_BUSER (S_AXI_BUSER), .S_AXI_BVALID (S_AXI_BVALID), .S_AXI_BREADY (S_AXI_BREADY), // Master Interface Write Response Ports .M_AXI_BID (M_AXI_BID), .M_AXI_BRESP (M_AXI_BRESP), .M_AXI_BUSER (M_AXI_BUSER), .M_AXI_BVALID (M_AXI_BVALID), .M_AXI_BREADY (M_AXI_BREADY) ); end else begin : NO_SPLIT_W // MI -> SI Interface Write Response Ports assign S_AXI_BID = M_AXI_BID; assign S_AXI_BRESP = M_AXI_BRESP; assign S_AXI_BUSER = M_AXI_BUSER; assign S_AXI_BVALID = M_AXI_BVALID; assign M_AXI_BREADY = S_AXI_BREADY; end end else begin : NO_WRITE // Slave Interface Write Address Ports assign S_AXI_AWREADY = 1'b0; // Slave Interface Write Data Ports assign S_AXI_WREADY = 1'b0; // Slave Interface Write Response Ports assign S_AXI_BID = {C_AXI_ID_WIDTH{1'b0}}; assign S_AXI_BRESP = 2'b0; assign S_AXI_BUSER = {C_AXI_BUSER_WIDTH{1'b0}}; assign S_AXI_BVALID = 1'b0; // Master Interface Write Address Port assign M_AXI_AWID = {C_AXI_ID_WIDTH{1'b0}}; assign M_AXI_AWADDR = {C_AXI_ADDR_WIDTH{1'b0}}; assign M_AXI_AWLEN = 4'b0; assign M_AXI_AWSIZE = 3'b0; assign M_AXI_AWBURST = 2'b0; assign M_AXI_AWLOCK = 2'b0; assign M_AXI_AWCACHE = 4'b0; assign M_AXI_AWPROT = 3'b0; assign M_AXI_AWQOS = 4'b0; assign M_AXI_AWUSER = {C_AXI_AWUSER_WIDTH{1'b0}}; assign M_AXI_AWVALID = 1'b0; // Master Interface Write Data Ports assign M_AXI_WDATA = {C_AXI_DATA_WIDTH{1'b0}}; assign M_AXI_WSTRB = {C_AXI_DATA_WIDTH/8{1'b0}}; assign M_AXI_WLAST = 1'b0; assign M_AXI_WUSER = {C_AXI_WUSER_WIDTH{1'b0}}; assign M_AXI_WVALID = 1'b0; // Master Interface Write Response Ports assign M_AXI_BREADY = 1'b0; end endgenerate ///////////////////////////////////////////////////////////////////////////// // Handle Read Channels (AR/R) ///////////////////////////////////////////////////////////////////////////// generate if (C_AXI_SUPPORTS_READ == 1) begin : USE_READ // Write Response channel. if ( C_SUPPORT_SPLITTING == 1 && C_SUPPORT_BURSTS == 1 ) begin : USE_SPLIT_R // Read Channel Signals for Commands Queue Interface. wire rd_cmd_valid; wire rd_cmd_split; wire rd_cmd_ready; // Write Address Channel. axi_protocol_converter_v2_1_a_axi3_conv # ( .C_FAMILY (C_FAMILY), .C_AXI_ID_WIDTH (C_AXI_ID_WIDTH), .C_AXI_ADDR_WIDTH (C_AXI_ADDR_WIDTH), .C_AXI_DATA_WIDTH (C_AXI_DATA_WIDTH), .C_AXI_SUPPORTS_USER_SIGNALS (C_AXI_SUPPORTS_USER_SIGNALS), .C_AXI_AUSER_WIDTH (C_AXI_ARUSER_WIDTH), .C_AXI_CHANNEL (1), .C_SUPPORT_SPLITTING (C_SUPPORT_SPLITTING), .C_SUPPORT_BURSTS (C_SUPPORT_BURSTS), .C_SINGLE_THREAD (C_SINGLE_THREAD) ) read_addr_inst ( // Global Signals .ARESET (~ARESETN), .ACLK (ACLK), // Command Interface (R) .cmd_valid (rd_cmd_valid), .cmd_split (rd_cmd_split), .cmd_id (), .cmd_length (), .cmd_ready (rd_cmd_ready), // Command Interface (B) .cmd_b_valid (), .cmd_b_split (), .cmd_b_repeat (), .cmd_b_ready (1'b0), // Slave Interface Write Address Ports .S_AXI_AID (S_AXI_ARID), .S_AXI_AADDR (S_AXI_ARADDR), .S_AXI_ALEN (S_AXI_ARLEN), .S_AXI_ASIZE (S_AXI_ARSIZE), .S_AXI_ABURST (S_AXI_ARBURST), .S_AXI_ALOCK (S_AXI_ARLOCK), .S_AXI_ACACHE (S_AXI_ARCACHE), .S_AXI_APROT (S_AXI_ARPROT), .S_AXI_AQOS (S_AXI_ARQOS), .S_AXI_AUSER (S_AXI_ARUSER), .S_AXI_AVALID (S_AXI_ARVALID), .S_AXI_AREADY (S_AXI_ARREADY), // Master Interface Write Address Port .M_AXI_AID (M_AXI_ARID), .M_AXI_AADDR (M_AXI_ARADDR), .M_AXI_ALEN (M_AXI_ARLEN), .M_AXI_ASIZE (M_AXI_ARSIZE), .M_AXI_ABURST (M_AXI_ARBURST), .M_AXI_ALOCK (M_AXI_ARLOCK), .M_AXI_ACACHE (M_AXI_ARCACHE), .M_AXI_APROT (M_AXI_ARPROT), .M_AXI_AQOS (M_AXI_ARQOS), .M_AXI_AUSER (M_AXI_ARUSER), .M_AXI_AVALID (M_AXI_ARVALID), .M_AXI_AREADY (M_AXI_ARREADY) ); // Read Data Channel. axi_protocol_converter_v2_1_r_axi3_conv # ( .C_FAMILY (C_FAMILY), .C_AXI_ID_WIDTH (C_AXI_ID_WIDTH), .C_AXI_DATA_WIDTH (C_AXI_DATA_WIDTH), .C_AXI_SUPPORTS_USER_SIGNALS (C_AXI_SUPPORTS_USER_SIGNALS), .C_AXI_RUSER_WIDTH (C_AXI_RUSER_WIDTH), .C_SUPPORT_SPLITTING (C_SUPPORT_SPLITTING), .C_SUPPORT_BURSTS (C_SUPPORT_BURSTS) ) read_data_inst ( // Global Signals .ARESET (~ARESETN), .ACLK (ACLK), // Command Interface .cmd_valid (rd_cmd_valid), .cmd_split (rd_cmd_split), .cmd_ready (rd_cmd_ready), // Slave Interface Read Data Ports .S_AXI_RID (S_AXI_RID), .S_AXI_RDATA (S_AXI_RDATA), .S_AXI_RRESP (S_AXI_RRESP), .S_AXI_RLAST (S_AXI_RLAST), .S_AXI_RUSER (S_AXI_RUSER), .S_AXI_RVALID (S_AXI_RVALID), .S_AXI_RREADY (S_AXI_RREADY), // Master Interface Read Data Ports .M_AXI_RID (M_AXI_RID), .M_AXI_RDATA (M_AXI_RDATA), .M_AXI_RRESP (M_AXI_RRESP), .M_AXI_RLAST (M_AXI_RLAST), .M_AXI_RUSER (M_AXI_RUSER), .M_AXI_RVALID (M_AXI_RVALID), .M_AXI_RREADY (M_AXI_RREADY) ); end else begin : NO_SPLIT_R // SI -> MI Interface Write Address Port assign M_AXI_ARID = S_AXI_ARID; assign M_AXI_ARADDR = S_AXI_ARADDR; assign M_AXI_ARLEN = S_AXI_ARLEN; assign M_AXI_ARSIZE = S_AXI_ARSIZE; assign M_AXI_ARBURST = S_AXI_ARBURST; assign M_AXI_ARLOCK = S_AXI_ARLOCK; assign M_AXI_ARCACHE = S_AXI_ARCACHE; assign M_AXI_ARPROT = S_AXI_ARPROT; assign M_AXI_ARQOS = S_AXI_ARQOS; assign M_AXI_ARUSER = S_AXI_ARUSER; assign M_AXI_ARVALID = S_AXI_ARVALID; assign S_AXI_ARREADY = M_AXI_ARREADY; // MI -> SI Interface Read Data Ports assign S_AXI_RID = M_AXI_RID; assign S_AXI_RDATA = M_AXI_RDATA; assign S_AXI_RRESP = M_AXI_RRESP; assign S_AXI_RLAST = M_AXI_RLAST; assign S_AXI_RUSER = M_AXI_RUSER; assign S_AXI_RVALID = M_AXI_RVALID; assign M_AXI_RREADY = S_AXI_RREADY; end end else begin : NO_READ // Slave Interface Read Address Ports assign S_AXI_ARREADY = 1'b0; // Slave Interface Read Data Ports assign S_AXI_RID = {C_AXI_ID_WIDTH{1'b0}}; assign S_AXI_RDATA = {C_AXI_DATA_WIDTH{1'b0}}; assign S_AXI_RRESP = 2'b0; assign S_AXI_RLAST = 1'b0; assign S_AXI_RUSER = {C_AXI_RUSER_WIDTH{1'b0}}; assign S_AXI_RVALID = 1'b0; // Master Interface Read Address Port assign M_AXI_ARID = {C_AXI_ID_WIDTH{1'b0}}; assign M_AXI_ARADDR = {C_AXI_ADDR_WIDTH{1'b0}}; assign M_AXI_ARLEN = 4'b0; assign M_AXI_ARSIZE = 3'b0; assign M_AXI_ARBURST = 2'b0; assign M_AXI_ARLOCK = 2'b0; assign M_AXI_ARCACHE = 4'b0; assign M_AXI_ARPROT = 3'b0; assign M_AXI_ARQOS = 4'b0; assign M_AXI_ARUSER = {C_AXI_ARUSER_WIDTH{1'b0}}; assign M_AXI_ARVALID = 1'b0; // Master Interface Read Data Ports assign M_AXI_RREADY = 1'b0; end endgenerate endmodule