text
stringlengths
938
1.05M
// -*- verilog -*- // // USRP - Universal Software Radio Peripheral // // Copyright (C) 2003 Matt Ettus // // 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., 51 Franklin Street, Boston, MA 02110-1301 USA // // DUC block module duc(input clock, input reset, input enable, input [3:0] rate1, input [3:0] rate2, output strobe, input [31:0] freq, input [15:0] i_in, input [15:0] q_in, output [15:0] i_out, output [15:0] q_out ); parameter bw = 16; parameter zw = 16; wire [15:0] i_interp_out, q_interp_out; wire [31:0] phase; wire strobe1, strobe2; reg [3:0] strobe_ctr1,strobe_ctr2; always @(posedge clock) if(reset | ~enable) strobe_ctr2 <= #1 4'd0; else if(strobe2) strobe_ctr2 <= #1 4'd0; else strobe_ctr2 <= #1 strobe_ctr2 + 4'd1; always @(posedge clock) if(reset | ~enable) strobe_ctr1 <= #1 4'd0; else if(strobe1) strobe_ctr1 <= #1 4'd0; else if(strobe2) strobe_ctr1 <= #1 strobe_ctr1 + 4'd1; assign strobe2 = enable & ( strobe_ctr2 == rate2 ); assign strobe1 = strobe2 & ( strobe_ctr1 == rate1 ); assign strobe = strobe1; function [2:0] log_ceil; input [3:0] val; log_ceil = val[3] ? 3'd4 : val[2] ? 3'd3 : val[1] ? 3'd2 : 3'd1; endfunction wire [2:0] shift1 = log_ceil(rate1); wire [2:0] shift2 = log_ceil(rate2); cordic #(.bitwidth(bw),.zwidth(zw),.stages(16)) cordic(.clock(clock), .reset(reset), .enable(enable), .xi(i_interp_out), .yi(q_interp_out), .zi(phase[31:32-zw]), .xo(i_out), .yo(q_out), .zo() ); cic_interp_2stage #(.bw(bw),.N(4)) interp_i(.clock(clock),.reset(reset),.enable(enable), .strobe1(strobe1),.strobe2(strobe2),.strobe3(1'b1),.shift1(shift1),.shift2(shift2), .signal_in(i_in),.signal_out(i_interp_out)); cic_interp_2stage #(.bw(bw),.N(4)) interp_q(.clock(clock),.reset(reset),.enable(enable), .strobe1(strobe1),.strobe2(strobe2),.strobe3(1'b1),.shift1(shift1),.shift2(shift2), .signal_in(q_in),.signal_out(q_interp_out)); phase_acc #(.resolution(32)) nco (.clk(clock),.reset(reset),.enable(enable), .freq(freq),.phase(phase)); 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: Addr Decoder // Each received address is compared to base and high address pairs for each // of a set of decode targets. // The matching target's index (if any) is output combinatorially. // If the decode is successful (matches any target), the MATCH output is asserted. // For each target, a set of alternative address ranges may be specified. // The base and high address pairs are formatted as a pair of 2-dimensional arrays, // alternative address ranges iterate within each target. // The alternative range which matches the address is also output as REGION. // // Verilog-standard: Verilog 2001 //-------------------------------------------------------------------------- // // Structure: // addr_decoder // comparator_static // //-------------------------------------------------------------------------- `timescale 1ps/1ps (* DowngradeIPIdentifiedWarnings="yes" *) module axi_crossbar_v2_1_addr_decoder # ( parameter C_FAMILY = "none", parameter integer C_NUM_TARGETS = 2, // Number of decode targets = [1:16] parameter integer C_NUM_TARGETS_LOG = 1, // Log2(C_NUM_TARGETS) parameter integer C_NUM_RANGES = 1, // Number of alternative ranges that // can match each target [1:16] parameter integer C_ADDR_WIDTH = 32, // Width of decoder operand and of // each base and high address [2:64] parameter integer C_TARGET_ENC = 0, // Enable encoded target output parameter integer C_TARGET_HOT = 1, // Enable 1-hot target output parameter integer C_REGION_ENC = 0, // Enable REGION output parameter [C_NUM_TARGETS*C_NUM_RANGES*64-1:0] C_BASE_ADDR = {C_NUM_TARGETS*C_NUM_RANGES*64{1'b1}}, parameter [C_NUM_TARGETS*C_NUM_RANGES*64-1:0] C_HIGH_ADDR = {C_NUM_TARGETS*C_NUM_RANGES*64{1'b0}}, parameter [C_NUM_TARGETS:0] C_TARGET_QUAL = {C_NUM_TARGETS{1'b1}}, // Indicates whether each target has connectivity. // Format: C_NUM_TARGETS{Bit1}. parameter integer C_RESOLUTION = 0, // Number of low-order ADDR bits that can be ignored when decoding. parameter integer C_COMPARATOR_THRESHOLD = 6 // Number of decoded ADDR bits above which will implement comparator_static. ) ( input wire [C_ADDR_WIDTH-1:0] ADDR, // Decoder input operand output wire [C_NUM_TARGETS-1:0] TARGET_HOT, // Target matching address (1-hot) output wire [C_NUM_TARGETS_LOG-1:0] TARGET_ENC, // Target matching address (encoded) output wire MATCH, // Decode successful output wire [3:0] REGION // Range within target matching address (encoded) ); ///////////////////////////////////////////////////////////////////////////// // Variables for generating parameter controlled instances. genvar target_cnt; genvar region_cnt; ///////////////////////////////////////////////////////////////////////////// // Function to detect addrs is in the addressable range. // Only compare 4KB page address (ignore low-order 12 bits) function decode_address; input [C_ADDR_WIDTH-1:0] base, high, addr; reg [C_ADDR_WIDTH-C_RESOLUTION-1:0] mask; reg [C_ADDR_WIDTH-C_RESOLUTION-1:0] addr_page; reg [C_ADDR_WIDTH-C_RESOLUTION-1:0] base_page; reg [C_ADDR_WIDTH-C_RESOLUTION-1:0] high_page; begin addr_page = addr[C_RESOLUTION+:C_ADDR_WIDTH-C_RESOLUTION]; base_page = base[C_RESOLUTION+:C_ADDR_WIDTH-C_RESOLUTION]; high_page = high[C_RESOLUTION+:C_ADDR_WIDTH-C_RESOLUTION]; if (base[C_ADDR_WIDTH-1] & ~high[C_ADDR_WIDTH-1]) begin decode_address = 1'b0; end else begin mask = base_page ^ high_page; if ( (base_page & ~mask) == (addr_page & ~mask) ) begin decode_address = 1'b1; end else begin decode_address = 1'b0; end end end endfunction // Generates a binary coded from onehotone encoded function [3:0] f_hot2enc ( input [15:0] one_hot ); begin f_hot2enc[0] = |(one_hot & 16'b1010101010101010); f_hot2enc[1] = |(one_hot & 16'b1100110011001100); f_hot2enc[2] = |(one_hot & 16'b1111000011110000); f_hot2enc[3] = |(one_hot & 16'b1111111100000000); end endfunction ///////////////////////////////////////////////////////////////////////////// // Internal signals wire [C_NUM_TARGETS-1:0] TARGET_HOT_I; // Target matching address (1-hot). wire [C_NUM_TARGETS*C_NUM_RANGES-1:0] ADDRESS_HIT; // For address hit (1-hot). wire [C_NUM_TARGETS*C_NUM_RANGES-1:0] ADDRESS_HIT_REG; // For address hit (1-hot). wire [C_NUM_RANGES-1:0] REGION_HOT; // Reginon matching address (1-hot). wire [3:0] TARGET_ENC_I; // Internal version of encoded hit. ///////////////////////////////////////////////////////////////////////////// // Generate detection per region per target. generate for (target_cnt = 0; target_cnt < C_NUM_TARGETS; target_cnt = target_cnt + 1) begin : gen_target for (region_cnt = 0; region_cnt < C_NUM_RANGES; region_cnt = region_cnt + 1) begin : gen_region // Detect if this is an address hit (including used region decoding). if ((C_ADDR_WIDTH - C_RESOLUTION) > C_COMPARATOR_THRESHOLD) begin : gen_comparator_static if (C_TARGET_QUAL[target_cnt] && ((C_BASE_ADDR[(target_cnt*C_NUM_RANGES+region_cnt)*64 +: C_ADDR_WIDTH] == 0) || (C_HIGH_ADDR[(target_cnt*C_NUM_RANGES+region_cnt)*64 +: C_ADDR_WIDTH] != 0))) begin : gen_addr_range generic_baseblocks_v2_1_comparator_static # ( .C_FAMILY("rtl"), .C_VALUE(C_BASE_ADDR[(target_cnt*C_NUM_RANGES+region_cnt)*64+C_RESOLUTION +: C_ADDR_WIDTH-C_RESOLUTION]), .C_DATA_WIDTH(C_ADDR_WIDTH-C_RESOLUTION) ) addr_decode_comparator ( .CIN(1'b1), .A(ADDR[C_RESOLUTION +: C_ADDR_WIDTH-C_RESOLUTION] & ~(C_BASE_ADDR[(target_cnt*C_NUM_RANGES+region_cnt)*64+C_RESOLUTION +: C_ADDR_WIDTH-C_RESOLUTION] ^ C_HIGH_ADDR[(target_cnt*C_NUM_RANGES+region_cnt)*64+C_RESOLUTION +: C_ADDR_WIDTH-C_RESOLUTION])), .COUT(ADDRESS_HIT[target_cnt*C_NUM_RANGES + region_cnt]) ); end else begin : gen_null_range assign ADDRESS_HIT[target_cnt*C_NUM_RANGES + region_cnt] = 1'b0; end end else begin : gen_no_comparator_static assign ADDRESS_HIT[target_cnt*C_NUM_RANGES + region_cnt] = C_TARGET_QUAL[target_cnt] ? decode_address( C_BASE_ADDR[(target_cnt*C_NUM_RANGES+region_cnt)*64 +: C_ADDR_WIDTH], C_HIGH_ADDR[(target_cnt*C_NUM_RANGES+region_cnt)*64 +: C_ADDR_WIDTH], ADDR) : 1'b0; end // gen_comparator_static assign ADDRESS_HIT_REG[region_cnt*C_NUM_TARGETS+target_cnt] = ADDRESS_HIT[target_cnt*C_NUM_RANGES + region_cnt]; assign REGION_HOT[region_cnt] = | ADDRESS_HIT_REG[region_cnt*C_NUM_TARGETS +: C_NUM_TARGETS]; end // gen_region // All regions are non-overlapping // => Or all the region detections for this target to determine if it is a hit. assign TARGET_HOT_I[target_cnt] = | ADDRESS_HIT[target_cnt*C_NUM_RANGES +: C_NUM_RANGES]; end // gen_target endgenerate ///////////////////////////////////////////////////////////////////////////// // All regions are non-overlapping // => Or all the target hit detections if it is a match. assign MATCH = | TARGET_HOT_I; ///////////////////////////////////////////////////////////////////////////// // Assign conditional onehot target output signal. generate if (C_TARGET_HOT == 1) begin : USE_TARGET_ONEHOT assign TARGET_HOT = MATCH ? TARGET_HOT_I : 1; end else begin : NO_TARGET_ONEHOT assign TARGET_HOT = {C_NUM_TARGETS{1'b0}}; end endgenerate ///////////////////////////////////////////////////////////////////////////// // Assign conditional encoded target output signal. generate if (C_TARGET_ENC == 1) begin : USE_TARGET_ENCODED assign TARGET_ENC_I = f_hot2enc(TARGET_HOT_I); assign TARGET_ENC = TARGET_ENC_I[C_NUM_TARGETS_LOG-1:0]; end else begin : NO_TARGET_ENCODED assign TARGET_ENC = {C_NUM_TARGETS_LOG{1'b0}}; end endgenerate ///////////////////////////////////////////////////////////////////////////// // Assign conditional encoded region output signal. generate if (C_TARGET_ENC == 1) begin : USE_REGION_ENCODED assign REGION = f_hot2enc(REGION_HOT); end else begin : NO_REGION_ENCODED assign REGION = 4'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: Addr Decoder // Each received address is compared to base and high address pairs for each // of a set of decode targets. // The matching target's index (if any) is output combinatorially. // If the decode is successful (matches any target), the MATCH output is asserted. // For each target, a set of alternative address ranges may be specified. // The base and high address pairs are formatted as a pair of 2-dimensional arrays, // alternative address ranges iterate within each target. // The alternative range which matches the address is also output as REGION. // // Verilog-standard: Verilog 2001 //-------------------------------------------------------------------------- // // Structure: // addr_decoder // comparator_static // //-------------------------------------------------------------------------- `timescale 1ps/1ps (* DowngradeIPIdentifiedWarnings="yes" *) module axi_crossbar_v2_1_addr_decoder # ( parameter C_FAMILY = "none", parameter integer C_NUM_TARGETS = 2, // Number of decode targets = [1:16] parameter integer C_NUM_TARGETS_LOG = 1, // Log2(C_NUM_TARGETS) parameter integer C_NUM_RANGES = 1, // Number of alternative ranges that // can match each target [1:16] parameter integer C_ADDR_WIDTH = 32, // Width of decoder operand and of // each base and high address [2:64] parameter integer C_TARGET_ENC = 0, // Enable encoded target output parameter integer C_TARGET_HOT = 1, // Enable 1-hot target output parameter integer C_REGION_ENC = 0, // Enable REGION output parameter [C_NUM_TARGETS*C_NUM_RANGES*64-1:0] C_BASE_ADDR = {C_NUM_TARGETS*C_NUM_RANGES*64{1'b1}}, parameter [C_NUM_TARGETS*C_NUM_RANGES*64-1:0] C_HIGH_ADDR = {C_NUM_TARGETS*C_NUM_RANGES*64{1'b0}}, parameter [C_NUM_TARGETS:0] C_TARGET_QUAL = {C_NUM_TARGETS{1'b1}}, // Indicates whether each target has connectivity. // Format: C_NUM_TARGETS{Bit1}. parameter integer C_RESOLUTION = 0, // Number of low-order ADDR bits that can be ignored when decoding. parameter integer C_COMPARATOR_THRESHOLD = 6 // Number of decoded ADDR bits above which will implement comparator_static. ) ( input wire [C_ADDR_WIDTH-1:0] ADDR, // Decoder input operand output wire [C_NUM_TARGETS-1:0] TARGET_HOT, // Target matching address (1-hot) output wire [C_NUM_TARGETS_LOG-1:0] TARGET_ENC, // Target matching address (encoded) output wire MATCH, // Decode successful output wire [3:0] REGION // Range within target matching address (encoded) ); ///////////////////////////////////////////////////////////////////////////// // Variables for generating parameter controlled instances. genvar target_cnt; genvar region_cnt; ///////////////////////////////////////////////////////////////////////////// // Function to detect addrs is in the addressable range. // Only compare 4KB page address (ignore low-order 12 bits) function decode_address; input [C_ADDR_WIDTH-1:0] base, high, addr; reg [C_ADDR_WIDTH-C_RESOLUTION-1:0] mask; reg [C_ADDR_WIDTH-C_RESOLUTION-1:0] addr_page; reg [C_ADDR_WIDTH-C_RESOLUTION-1:0] base_page; reg [C_ADDR_WIDTH-C_RESOLUTION-1:0] high_page; begin addr_page = addr[C_RESOLUTION+:C_ADDR_WIDTH-C_RESOLUTION]; base_page = base[C_RESOLUTION+:C_ADDR_WIDTH-C_RESOLUTION]; high_page = high[C_RESOLUTION+:C_ADDR_WIDTH-C_RESOLUTION]; if (base[C_ADDR_WIDTH-1] & ~high[C_ADDR_WIDTH-1]) begin decode_address = 1'b0; end else begin mask = base_page ^ high_page; if ( (base_page & ~mask) == (addr_page & ~mask) ) begin decode_address = 1'b1; end else begin decode_address = 1'b0; end end end endfunction // Generates a binary coded from onehotone encoded function [3:0] f_hot2enc ( input [15:0] one_hot ); begin f_hot2enc[0] = |(one_hot & 16'b1010101010101010); f_hot2enc[1] = |(one_hot & 16'b1100110011001100); f_hot2enc[2] = |(one_hot & 16'b1111000011110000); f_hot2enc[3] = |(one_hot & 16'b1111111100000000); end endfunction ///////////////////////////////////////////////////////////////////////////// // Internal signals wire [C_NUM_TARGETS-1:0] TARGET_HOT_I; // Target matching address (1-hot). wire [C_NUM_TARGETS*C_NUM_RANGES-1:0] ADDRESS_HIT; // For address hit (1-hot). wire [C_NUM_TARGETS*C_NUM_RANGES-1:0] ADDRESS_HIT_REG; // For address hit (1-hot). wire [C_NUM_RANGES-1:0] REGION_HOT; // Reginon matching address (1-hot). wire [3:0] TARGET_ENC_I; // Internal version of encoded hit. ///////////////////////////////////////////////////////////////////////////// // Generate detection per region per target. generate for (target_cnt = 0; target_cnt < C_NUM_TARGETS; target_cnt = target_cnt + 1) begin : gen_target for (region_cnt = 0; region_cnt < C_NUM_RANGES; region_cnt = region_cnt + 1) begin : gen_region // Detect if this is an address hit (including used region decoding). if ((C_ADDR_WIDTH - C_RESOLUTION) > C_COMPARATOR_THRESHOLD) begin : gen_comparator_static if (C_TARGET_QUAL[target_cnt] && ((C_BASE_ADDR[(target_cnt*C_NUM_RANGES+region_cnt)*64 +: C_ADDR_WIDTH] == 0) || (C_HIGH_ADDR[(target_cnt*C_NUM_RANGES+region_cnt)*64 +: C_ADDR_WIDTH] != 0))) begin : gen_addr_range generic_baseblocks_v2_1_comparator_static # ( .C_FAMILY("rtl"), .C_VALUE(C_BASE_ADDR[(target_cnt*C_NUM_RANGES+region_cnt)*64+C_RESOLUTION +: C_ADDR_WIDTH-C_RESOLUTION]), .C_DATA_WIDTH(C_ADDR_WIDTH-C_RESOLUTION) ) addr_decode_comparator ( .CIN(1'b1), .A(ADDR[C_RESOLUTION +: C_ADDR_WIDTH-C_RESOLUTION] & ~(C_BASE_ADDR[(target_cnt*C_NUM_RANGES+region_cnt)*64+C_RESOLUTION +: C_ADDR_WIDTH-C_RESOLUTION] ^ C_HIGH_ADDR[(target_cnt*C_NUM_RANGES+region_cnt)*64+C_RESOLUTION +: C_ADDR_WIDTH-C_RESOLUTION])), .COUT(ADDRESS_HIT[target_cnt*C_NUM_RANGES + region_cnt]) ); end else begin : gen_null_range assign ADDRESS_HIT[target_cnt*C_NUM_RANGES + region_cnt] = 1'b0; end end else begin : gen_no_comparator_static assign ADDRESS_HIT[target_cnt*C_NUM_RANGES + region_cnt] = C_TARGET_QUAL[target_cnt] ? decode_address( C_BASE_ADDR[(target_cnt*C_NUM_RANGES+region_cnt)*64 +: C_ADDR_WIDTH], C_HIGH_ADDR[(target_cnt*C_NUM_RANGES+region_cnt)*64 +: C_ADDR_WIDTH], ADDR) : 1'b0; end // gen_comparator_static assign ADDRESS_HIT_REG[region_cnt*C_NUM_TARGETS+target_cnt] = ADDRESS_HIT[target_cnt*C_NUM_RANGES + region_cnt]; assign REGION_HOT[region_cnt] = | ADDRESS_HIT_REG[region_cnt*C_NUM_TARGETS +: C_NUM_TARGETS]; end // gen_region // All regions are non-overlapping // => Or all the region detections for this target to determine if it is a hit. assign TARGET_HOT_I[target_cnt] = | ADDRESS_HIT[target_cnt*C_NUM_RANGES +: C_NUM_RANGES]; end // gen_target endgenerate ///////////////////////////////////////////////////////////////////////////// // All regions are non-overlapping // => Or all the target hit detections if it is a match. assign MATCH = | TARGET_HOT_I; ///////////////////////////////////////////////////////////////////////////// // Assign conditional onehot target output signal. generate if (C_TARGET_HOT == 1) begin : USE_TARGET_ONEHOT assign TARGET_HOT = MATCH ? TARGET_HOT_I : 1; end else begin : NO_TARGET_ONEHOT assign TARGET_HOT = {C_NUM_TARGETS{1'b0}}; end endgenerate ///////////////////////////////////////////////////////////////////////////// // Assign conditional encoded target output signal. generate if (C_TARGET_ENC == 1) begin : USE_TARGET_ENCODED assign TARGET_ENC_I = f_hot2enc(TARGET_HOT_I); assign TARGET_ENC = TARGET_ENC_I[C_NUM_TARGETS_LOG-1:0]; end else begin : NO_TARGET_ENCODED assign TARGET_ENC = {C_NUM_TARGETS_LOG{1'b0}}; end endgenerate ///////////////////////////////////////////////////////////////////////////// // Assign conditional encoded region output signal. generate if (C_TARGET_ENC == 1) begin : USE_REGION_ENCODED assign REGION = f_hot2enc(REGION_HOT); end else begin : NO_REGION_ENCODED assign REGION = 4'b0; end endgenerate endmodule
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 15:15:08 08/27/2015 // Design Name: // Module Name: Tenth_Phase // Project Name: // Target Devices: // Tool versions: // Description: // // Dependencies: // // Revision: // Revision 0.01 - File Created // Additional Comments: // ////////////////////////////////////////////////////////////////////////////////// module Tenth_Phase //Module Parameters /***SINGLE PRECISION***/ // W = 32 // EW = 8 // SW = 23 /***DOUBLE PRECISION***/ // W = 64 // EW = 11 // SW = 52 # (parameter W = 32, parameter EW = 8, parameter SW = 23) // # (parameter W = 64, parameter EW = 11, parameter SW = 52) ( //INPUTS input wire clk, //Clock Signal input wire rst, //Reset Signal input wire load_i, input wire sel_a_i, //Overflow/add/subt result's mux's selector input wire sel_b_i, //underflow/add/subt result's mux's selector input wire sign_i, //Sign of the largest Operand input wire [EW-1:0] exp_ieee_i, //Final Exponent input wire [SW-1:0] sgf_ieee_i,//Final Significand //OUTPUTS output wire [W-1:0] final_result_ieee_o //Final Result ); //Wire Connection signals wire [SW-1:0] Sgf_S_mux; wire [EW-1:0] Exp_S_mux; wire Sign_S_mux; wire [W-1:0] final_result_reg; wire overunder; wire [EW-1:0] exp_mux_D1; wire [SW-1:0] sgf_mux_D1; ////////////////////////////////////////////////////////// assign overunder = sel_a_i | sel_b_i; Mux_3x1 #(.W(1)) Sign_Mux ( .ctrl({sel_a_i,sel_b_i}), .D0(sign_i), .D1(1'b1), .D2(1'b0), .S(Sign_S_mux) ); Multiplexer_AC #(.W(EW)) Exp_Mux ( .ctrl(overunder), .D0(exp_ieee_i), .D1(exp_mux_D1), .S(Exp_S_mux) ); Multiplexer_AC #(.W(SW)) Sgf_Mux ( .ctrl(overunder), .D0(sgf_ieee_i), .D1(sgf_mux_D1), .S(Sgf_S_mux) ); ///////////////////////////////////////////////////////// generate if(W == 32) begin assign exp_mux_D1 =8'hff; assign sgf_mux_D1 =23'd0; end else begin assign exp_mux_D1 =11'hfff; assign sgf_mux_D1 =52'd0; end endgenerate //////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////// RegisterAdd #(.W(W)) Final_Result_IEEE ( .clk(clk), .rst(rst), .load(load_i), .D({Sign_S_mux,Exp_S_mux,Sgf_S_mux}), .Q(final_result_ieee_o) ); endmodule
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 15:15:08 08/27/2015 // Design Name: // Module Name: Tenth_Phase // Project Name: // Target Devices: // Tool versions: // Description: // // Dependencies: // // Revision: // Revision 0.01 - File Created // Additional Comments: // ////////////////////////////////////////////////////////////////////////////////// module Tenth_Phase //Module Parameters /***SINGLE PRECISION***/ // W = 32 // EW = 8 // SW = 23 /***DOUBLE PRECISION***/ // W = 64 // EW = 11 // SW = 52 # (parameter W = 32, parameter EW = 8, parameter SW = 23) // # (parameter W = 64, parameter EW = 11, parameter SW = 52) ( //INPUTS input wire clk, //Clock Signal input wire rst, //Reset Signal input wire load_i, input wire sel_a_i, //Overflow/add/subt result's mux's selector input wire sel_b_i, //underflow/add/subt result's mux's selector input wire sign_i, //Sign of the largest Operand input wire [EW-1:0] exp_ieee_i, //Final Exponent input wire [SW-1:0] sgf_ieee_i,//Final Significand //OUTPUTS output wire [W-1:0] final_result_ieee_o //Final Result ); //Wire Connection signals wire [SW-1:0] Sgf_S_mux; wire [EW-1:0] Exp_S_mux; wire Sign_S_mux; wire [W-1:0] final_result_reg; wire overunder; wire [EW-1:0] exp_mux_D1; wire [SW-1:0] sgf_mux_D1; ////////////////////////////////////////////////////////// assign overunder = sel_a_i | sel_b_i; Mux_3x1 #(.W(1)) Sign_Mux ( .ctrl({sel_a_i,sel_b_i}), .D0(sign_i), .D1(1'b1), .D2(1'b0), .S(Sign_S_mux) ); Multiplexer_AC #(.W(EW)) Exp_Mux ( .ctrl(overunder), .D0(exp_ieee_i), .D1(exp_mux_D1), .S(Exp_S_mux) ); Multiplexer_AC #(.W(SW)) Sgf_Mux ( .ctrl(overunder), .D0(sgf_ieee_i), .D1(sgf_mux_D1), .S(Sgf_S_mux) ); ///////////////////////////////////////////////////////// generate if(W == 32) begin assign exp_mux_D1 =8'hff; assign sgf_mux_D1 =23'd0; end else begin assign exp_mux_D1 =11'hfff; assign sgf_mux_D1 =52'd0; end endgenerate //////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////// RegisterAdd #(.W(W)) Final_Result_IEEE ( .clk(clk), .rst(rst), .load(load_i), .D({Sign_S_mux,Exp_S_mux,Sgf_S_mux}), .Q(final_result_ieee_o) ); endmodule
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 15:15:08 08/27/2015 // Design Name: // Module Name: Tenth_Phase // Project Name: // Target Devices: // Tool versions: // Description: // // Dependencies: // // Revision: // Revision 0.01 - File Created // Additional Comments: // ////////////////////////////////////////////////////////////////////////////////// module Tenth_Phase //Module Parameters /***SINGLE PRECISION***/ // W = 32 // EW = 8 // SW = 23 /***DOUBLE PRECISION***/ // W = 64 // EW = 11 // SW = 52 # (parameter W = 32, parameter EW = 8, parameter SW = 23) // # (parameter W = 64, parameter EW = 11, parameter SW = 52) ( //INPUTS input wire clk, //Clock Signal input wire rst, //Reset Signal input wire load_i, input wire sel_a_i, //Overflow/add/subt result's mux's selector input wire sel_b_i, //underflow/add/subt result's mux's selector input wire sign_i, //Sign of the largest Operand input wire [EW-1:0] exp_ieee_i, //Final Exponent input wire [SW-1:0] sgf_ieee_i,//Final Significand //OUTPUTS output wire [W-1:0] final_result_ieee_o //Final Result ); //Wire Connection signals wire [SW-1:0] Sgf_S_mux; wire [EW-1:0] Exp_S_mux; wire Sign_S_mux; wire [W-1:0] final_result_reg; wire overunder; wire [EW-1:0] exp_mux_D1; wire [SW-1:0] sgf_mux_D1; ////////////////////////////////////////////////////////// assign overunder = sel_a_i | sel_b_i; Mux_3x1 #(.W(1)) Sign_Mux ( .ctrl({sel_a_i,sel_b_i}), .D0(sign_i), .D1(1'b1), .D2(1'b0), .S(Sign_S_mux) ); Multiplexer_AC #(.W(EW)) Exp_Mux ( .ctrl(overunder), .D0(exp_ieee_i), .D1(exp_mux_D1), .S(Exp_S_mux) ); Multiplexer_AC #(.W(SW)) Sgf_Mux ( .ctrl(overunder), .D0(sgf_ieee_i), .D1(sgf_mux_D1), .S(Sgf_S_mux) ); ///////////////////////////////////////////////////////// generate if(W == 32) begin assign exp_mux_D1 =8'hff; assign sgf_mux_D1 =23'd0; end else begin assign exp_mux_D1 =11'hfff; assign sgf_mux_D1 =52'd0; end endgenerate //////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////// RegisterAdd #(.W(W)) Final_Result_IEEE ( .clk(clk), .rst(rst), .load(load_i), .D({Sign_S_mux,Exp_S_mux,Sgf_S_mux}), .Q(final_result_ieee_o) ); endmodule
//IEEE Floating Point Adder (Single Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 module adder( input_a, input_b, input_a_stb, input_b_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack, input_b_ack); input clk; input rst; input [31:0] input_a; input input_a_stb; output input_a_ack; input [31:0] input_b; input input_b_stb; output input_b_ack; output [31:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [31:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [3:0] state; parameter get_a = 4'd0, get_b = 4'd1, unpack = 4'd2, special_cases = 4'd3, align = 4'd4, add_0 = 4'd5, add_1 = 4'd6, normalise_1 = 4'd7, normalise_2 = 4'd8, round = 4'd9, pack = 4'd10, put_z = 4'd11; reg [31:0] a, b, z; reg [26:0] a_m, b_m; reg [23:0] z_m; reg [9:0] a_e, b_e, z_e; reg a_s, b_s, z_s; reg guard, round_bit, sticky; reg [27:0] sum; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= get_b; end end get_b: begin s_input_b_ack <= 1; if (s_input_b_ack && input_b_stb) begin b <= input_b; s_input_b_ack <= 0; state <= unpack; end end unpack: begin a_m <= {a[22 : 0], 3'd0}; b_m <= {b[22 : 0], 3'd0}; a_e <= a[30 : 23] - 127; b_e <= b[30 : 23] - 127; a_s <= a[31]; b_s <= b[31]; state <= special_cases; end special_cases: begin //if a is NaN or b is NaN return NaN if ((a_e == 128 && a_m != 0) || (b_e == 128 && b_m != 0)) begin z[31] <= 1; z[30:23] <= 255; z[22] <= 1; z[21:0] <= 0; state <= put_z; //if a is inf return inf end else if (a_e == 128) begin z[31] <= a_s; z[30:23] <= 255; z[22:0] <= 0; state <= put_z; //if b is inf return inf end else if (b_e == 128) begin z[31] <= b_s; z[30:23] <= 255; z[22:0] <= 0; state <= put_z; //if a is zero return b end else if ((($signed(a_e) == -127) && (a_m == 0)) && (($signed(b_e) == -127) && (b_m == 0))) begin z[31] <= a_s & b_s; z[30:23] <= b_e[7:0] + 127; z[22:0] <= b_m[26:3]; state <= put_z; //if a is zero return b end else if (($signed(a_e) == -127) && (a_m == 0)) begin z[31] <= b_s; z[30:23] <= b_e[7:0] + 127; z[22:0] <= b_m[26:3]; state <= put_z; //if b is zero return a end else if (($signed(b_e) == -127) && (b_m == 0)) begin z[31] <= a_s; z[30:23] <= a_e[7:0] + 127; z[22:0] <= a_m[26:3]; state <= put_z; end else begin //Denormalised Number if ($signed(a_e) == -127) begin a_e <= -126; end else begin a_m[26] <= 1; end //Denormalised Number if ($signed(b_e) == -127) begin b_e <= -126; end else begin b_m[26] <= 1; end state <= align; end end align: begin if ($signed(a_e) > $signed(b_e)) begin b_e <= b_e + 1; b_m <= b_m >> 1; b_m[0] <= b_m[0] | b_m[1]; end else if ($signed(a_e) < $signed(b_e)) begin a_e <= a_e + 1; a_m <= a_m >> 1; a_m[0] <= a_m[0] | a_m[1]; end else begin state <= add_0; end end add_0: begin z_e <= a_e; if (a_s == b_s) begin sum <= a_m + b_m; z_s <= a_s; end else begin if (a_m >= b_m) begin sum <= a_m - b_m; z_s <= a_s; end else begin sum <= b_m - a_m; z_s <= b_s; end end state <= add_1; end add_1: begin if (sum[27]) begin z_m <= sum[27:4]; guard <= sum[3]; round_bit <= sum[2]; sticky <= sum[1] | sum[0]; z_e <= z_e + 1; end else begin z_m <= sum[26:3]; guard <= sum[2]; round_bit <= sum[1]; sticky <= sum[0]; end state <= normalise_1; end normalise_1: begin if (z_m[23] == 0 && $signed(z_e) > -126) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= guard; guard <= round_bit; round_bit <= 0; end else begin state <= normalise_2; end end normalise_2: begin if ($signed(z_e) < -126) begin z_e <= z_e + 1; z_m <= z_m >> 1; guard <= z_m[0]; round_bit <= guard; sticky <= sticky | round_bit; end else begin state <= round; end end round: begin if (guard && (round_bit | sticky | z_m[0])) begin z_m <= z_m + 1; if (z_m == 24'hffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[22 : 0] <= z_m[22:0]; z[30 : 23] <= z_e[7:0] + 127; z[31] <= z_s; if ($signed(z_e) == -126 && z_m[23] == 0) begin z[30 : 23] <= 0; end //if overflow occurs, return inf if ($signed(z_e) > 127) begin z[22 : 0] <= 0; z[30 : 23] <= 255; z[31] <= z_s; end state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_input_b_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign input_b_ack = s_input_b_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point Divider (Single Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 // module divider( input_a, input_b, input_a_stb, input_b_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack, input_b_ack); input clk; input rst; input [31:0] input_a; input input_a_stb; output input_a_ack; input [31:0] input_b; input input_b_stb; output input_b_ack; output [31:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [31:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [3:0] state; parameter get_a = 4'd0, get_b = 4'd1, unpack = 4'd2, special_cases = 4'd3, normalise_a = 4'd4, normalise_b = 4'd5, divide_0 = 4'd6, divide_1 = 4'd7, divide_2 = 4'd8, divide_3 = 4'd9, normalise_1 = 4'd10, normalise_2 = 4'd11, round = 4'd12, pack = 4'd13, put_z = 4'd14; reg [31:0] a, b, z; reg [23:0] a_m, b_m, z_m; reg [9:0] a_e, b_e, z_e; reg a_s, b_s, z_s; reg guard, round_bit, sticky; reg [50:0] quotient, divisor, dividend, remainder; reg [5:0] count; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= get_b; end end get_b: begin s_input_b_ack <= 1; if (s_input_b_ack && input_b_stb) begin b <= input_b; s_input_b_ack <= 0; state <= unpack; end end unpack: begin a_m <= a[22 : 0]; b_m <= b[22 : 0]; a_e <= a[30 : 23] - 127; b_e <= b[30 : 23] - 127; a_s <= a[31]; b_s <= b[31]; state <= special_cases; end special_cases: begin //if a is NaN or b is NaN return NaN if ((a_e == 128 && a_m != 0) || (b_e == 128 && b_m != 0)) begin z[31] <= 1; z[30:23] <= 255; z[22] <= 1; z[21:0] <= 0; state <= put_z; //if a is inf and b is inf return NaN end else if ((a_e == 128) && (b_e == 128)) begin z[31] <= 1; z[30:23] <= 255; z[22] <= 1; z[21:0] <= 0; state <= put_z; //if a is inf return inf end else if (a_e == 128) begin z[31] <= a_s ^ b_s; z[30:23] <= 255; z[22:0] <= 0; state <= put_z; //if b is zero return NaN if ($signed(b_e == -127) && (b_m == 0)) begin z[31] <= 1; z[30:23] <= 255; z[22] <= 1; z[21:0] <= 0; state <= put_z; end //if b is inf return zero end else if (b_e == 128) begin z[31] <= a_s ^ b_s; z[30:23] <= 0; z[22:0] <= 0; state <= put_z; //if a is zero return zero end else if (($signed(a_e) == -127) && (a_m == 0)) begin z[31] <= a_s ^ b_s; z[30:23] <= 0; z[22:0] <= 0; state <= put_z; //if b is zero return NaN if (($signed(b_e) == -127) && (b_m == 0)) begin z[31] <= 1; z[30:23] <= 255; z[22] <= 1; z[21:0] <= 0; state <= put_z; end //if b is zero return inf end else if (($signed(b_e) == -127) && (b_m == 0)) begin z[31] <= a_s ^ b_s; z[30:23] <= 255; z[22:0] <= 0; state <= put_z; end else begin //Denormalised Number if ($signed(a_e) == -127) begin a_e <= -126; end else begin a_m[23] <= 1; end //Denormalised Number if ($signed(b_e) == -127) begin b_e <= -126; end else begin b_m[23] <= 1; end state <= normalise_a; end end normalise_a: begin if (a_m[23]) begin state <= normalise_b; end else begin a_m <= a_m << 1; a_e <= a_e - 1; end end normalise_b: begin if (b_m[23]) begin state <= divide_0; end else begin b_m <= b_m << 1; b_e <= b_e - 1; end end divide_0: begin z_s <= a_s ^ b_s; z_e <= a_e - b_e; quotient <= 0; remainder <= 0; count <= 0; dividend <= a_m << 27; divisor <= b_m; state <= divide_1; end divide_1: begin quotient <= quotient << 1; remainder <= remainder << 1; remainder[0] <= dividend[50]; dividend <= dividend << 1; state <= divide_2; end divide_2: begin if (remainder >= divisor) begin quotient[0] <= 1; remainder <= remainder - divisor; end if (count == 49) begin state <= divide_3; end else begin count <= count + 1; state <= divide_1; end end divide_3: begin z_m <= quotient[26:3]; guard <= quotient[2]; round_bit <= quotient[1]; sticky <= quotient[0] | (remainder != 0); state <= normalise_1; end normalise_1: begin if (z_m[23] == 0 && $signed(z_e) > -126) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= guard; guard <= round_bit; round_bit <= 0; end else begin state <= normalise_2; end end normalise_2: begin if ($signed(z_e) < -126) begin z_e <= z_e + 1; z_m <= z_m >> 1; guard <= z_m[0]; round_bit <= guard; sticky <= sticky | round_bit; end else begin state <= round; end end round: begin if (guard && (round_bit | sticky | z_m[0])) begin z_m <= z_m + 1; if (z_m == 24'hffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[22 : 0] <= z_m[22:0]; z[30 : 23] <= z_e[7:0] + 127; z[31] <= z_s; if ($signed(z_e) == -126 && z_m[23] == 0) begin z[30 : 23] <= 0; end //if overflow occurs, return inf if ($signed(z_e) > 127) begin z[22 : 0] <= 0; z[30 : 23] <= 255; z[31] <= z_s; end state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_input_b_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign input_b_ack = s_input_b_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point Multiplier (Single Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 module multiplier( input_a, input_b, input_a_stb, input_b_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack, input_b_ack); input clk; input rst; input [31:0] input_a; input input_a_stb; output input_a_ack; input [31:0] input_b; input input_b_stb; output input_b_ack; output [31:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [31:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [3:0] state; parameter get_a = 4'd0, get_b = 4'd1, unpack = 4'd2, special_cases = 4'd3, normalise_a = 4'd4, normalise_b = 4'd5, multiply_0 = 4'd6, multiply_1 = 4'd7, normalise_1 = 4'd8, normalise_2 = 4'd9, round = 4'd10, pack = 4'd11, put_z = 4'd12; reg [31:0] a, b, z; reg [23:0] a_m, b_m, z_m; reg [9:0] a_e, b_e, z_e; reg a_s, b_s, z_s; reg guard, round_bit, sticky; reg [49:0] product; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= get_b; end end get_b: begin s_input_b_ack <= 1; if (s_input_b_ack && input_b_stb) begin b <= input_b; s_input_b_ack <= 0; state <= unpack; end end unpack: begin a_m <= a[22 : 0]; b_m <= b[22 : 0]; a_e <= a[30 : 23] - 127; b_e <= b[30 : 23] - 127; a_s <= a[31]; b_s <= b[31]; state <= special_cases; end special_cases: begin //if a is NaN or b is NaN return NaN if ((a_e == 128 && a_m != 0) || (b_e == 128 && b_m != 0)) begin z[31] <= 1; z[30:23] <= 255; z[22] <= 1; z[21:0] <= 0; state <= put_z; //if a is inf return inf end else if (a_e == 128) begin z[31] <= a_s ^ b_s; z[30:23] <= 255; z[22:0] <= 0; state <= put_z; //if b is zero return NaN if ($signed(b_e == -127) && (b_m == 0)) begin z[31] <= 1; z[30:23] <= 255; z[22] <= 1; z[21:0] <= 0; state <= put_z; end //if b is inf return inf end else if (b_e == 128) begin z[31] <= a_s ^ b_s; z[30:23] <= 255; z[22:0] <= 0; state <= put_z; //if a is zero return zero end else if (($signed(a_e) == -127) && (a_m == 0)) begin z[31] <= a_s ^ b_s; z[30:23] <= 0; z[22:0] <= 0; state <= put_z; //if b is zero return zero end else if (($signed(b_e) == -127) && (b_m == 0)) begin z[31] <= a_s ^ b_s; z[30:23] <= 0; z[22:0] <= 0; state <= put_z; end else begin //Denormalised Number if ($signed(a_e) == -127) begin a_e <= -126; end else begin a_m[23] <= 1; end //Denormalised Number if ($signed(b_e) == -127) begin b_e <= -126; end else begin b_m[23] <= 1; end state <= normalise_a; end end normalise_a: begin if (a_m[23]) begin state <= normalise_b; end else begin a_m <= a_m << 1; a_e <= a_e - 1; end end normalise_b: begin if (b_m[23]) begin state <= multiply_0; end else begin b_m <= b_m << 1; b_e <= b_e - 1; end end multiply_0: begin z_s <= a_s ^ b_s; z_e <= a_e + b_e + 1; product <= a_m * b_m * 4; state <= multiply_1; end multiply_1: begin z_m <= product[49:26]; guard <= product[25]; round_bit <= product[24]; sticky <= (product[23:0] != 0); state <= normalise_1; end normalise_1: begin if (z_m[23] == 0) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= guard; guard <= round_bit; round_bit <= 0; end else begin state <= normalise_2; end end normalise_2: begin if ($signed(z_e) < -126) begin z_e <= z_e + 1; z_m <= z_m >> 1; guard <= z_m[0]; round_bit <= guard; sticky <= sticky | round_bit; end else begin state <= round; end end round: begin if (guard && (round_bit | sticky | z_m[0])) begin z_m <= z_m + 1; if (z_m == 24'hffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[22 : 0] <= z_m[22:0]; z[30 : 23] <= z_e[7:0] + 127; z[31] <= z_s; if ($signed(z_e) == -126 && z_m[23] == 0) begin z[30 : 23] <= 0; end //if overflow occurs, return inf if ($signed(z_e) > 127) begin z[22 : 0] <= 0; z[30 : 23] <= 255; z[31] <= z_s; end state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_input_b_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign input_b_ack = s_input_b_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point Divider (Double Precision) //Copyright (C) Jonathan P Dawson 2014 //2014-01-11 // module double_divider( input_a, input_b, input_a_stb, input_b_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack, input_b_ack); input clk; input rst; input [63:0] input_a; input input_a_stb; output input_a_ack; input [63:0] input_b; input input_b_stb; output input_b_ack; output [63:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [63:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [3:0] state; parameter get_a = 4'd0, get_b = 4'd1, unpack = 4'd2, special_cases = 4'd3, normalise_a = 4'd4, normalise_b = 4'd5, divide_0 = 4'd6, divide_1 = 4'd7, divide_2 = 4'd8, divide_3 = 4'd9, normalise_1 = 4'd10, normalise_2 = 4'd11, round = 4'd12, pack = 4'd13, put_z = 4'd14; reg [63:0] a, b, z; reg [52:0] a_m, b_m, z_m; reg [12:0] a_e, b_e, z_e; reg a_s, b_s, z_s; reg guard, round_bit, sticky; reg [108:0] quotient, divisor, dividend, remainder; reg [6:0] count; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= get_b; end end get_b: begin s_input_b_ack <= 1; if (s_input_b_ack && input_b_stb) begin b <= input_b; s_input_b_ack <= 0; state <= unpack; end end unpack: begin a_m <= a[51 : 0]; b_m <= b[51 : 0]; a_e <= a[62 : 52] - 1023; b_e <= b[62 : 52] - 1023; a_s <= a[63]; b_s <= b[63]; state <= special_cases; end special_cases: begin //if a is NaN or b is NaN return NaN if ((a_e == 1024 && a_m != 0) || (b_e == 1024 && b_m != 0)) begin z[63] <= 1; z[62:52] <= 2047; z[51] <= 1; z[50:0] <= 0; state <= put_z; //if a is inf and b is inf return NaN end else if ((a_e == 1024) && (b_e == 1024)) begin z[63] <= 1; z[62:52] <= 2047; z[51] <= 1; z[50:0] <= 0; state <= put_z; //if a is inf return inf end else if (a_e == 1024) begin z[63] <= a_s ^ b_s; z[62:52] <= 2047; z[51:0] <= 0; state <= put_z; //if b is zero return NaN if ($signed(b_e == -1023) && (b_m == 0)) begin z[63] <= 1; z[62:52] <= 2047; z[51] <= 1; z[50:0] <= 0; state <= put_z; end //if b is inf return zero end else if (b_e == 1024) begin z[63] <= a_s ^ b_s; z[62:52] <= 0; z[51:0] <= 0; state <= put_z; //if a is zero return zero end else if (($signed(a_e) == -1023) && (a_m == 0)) begin z[63] <= a_s ^ b_s; z[62:52] <= 0; z[51:0] <= 0; state <= put_z; //if b is zero return NaN if (($signed(b_e) == -1023) && (b_m == 0)) begin z[63] <= 1; z[62:52] <= 2047; z[51] <= 1; z[50:0] <= 0; state <= put_z; end //if b is zero return inf end else if (($signed(b_e) == -1023) && (b_m == 0)) begin z[63] <= a_s ^ b_s; z[62:52] <= 2047; z[51:0] <= 0; state <= put_z; end else begin //Denormalised Number if ($signed(a_e) == -1023) begin a_e <= -1022; end else begin a_m[52] <= 1; end //Denormalised Number if ($signed(b_e) == -1023) begin b_e <= -1022; end else begin b_m[52] <= 1; end state <= normalise_a; end end normalise_a: begin if (a_m[52]) begin state <= normalise_b; end else begin a_m <= a_m << 1; a_e <= a_e - 1; end end normalise_b: begin if (b_m[52]) begin state <= divide_0; end else begin b_m <= b_m << 1; b_e <= b_e - 1; end end divide_0: begin z_s <= a_s ^ b_s; z_e <= a_e - b_e; quotient <= 0; remainder <= 0; count <= 0; dividend <= a_m << 56; divisor <= b_m; state <= divide_1; end divide_1: begin quotient <= quotient << 1; remainder <= remainder << 1; remainder[0] <= dividend[108]; dividend <= dividend << 1; state <= divide_2; end divide_2: begin if (remainder >= divisor) begin quotient[0] <= 1; remainder <= remainder - divisor; end if (count == 107) begin state <= divide_3; end else begin count <= count + 1; state <= divide_1; end end divide_3: begin z_m <= quotient[55:3]; guard <= quotient[2]; round_bit <= quotient[1]; sticky <= quotient[0] | (remainder != 0); state <= normalise_1; end normalise_1: begin if (z_m[52] == 0 && $signed(z_e) > -1022) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= guard; guard <= round_bit; round_bit <= 0; end else begin state <= normalise_2; end end normalise_2: begin if ($signed(z_e) < -1022) begin z_e <= z_e + 1; z_m <= z_m >> 1; guard <= z_m[0]; round_bit <= guard; sticky <= sticky | round_bit; end else begin state <= round; end end round: begin if (guard && (round_bit | sticky | z_m[0])) begin z_m <= z_m + 1; if (z_m == 53'hffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[51 : 0] <= z_m[51:0]; z[62 : 52] <= z_e[10:0] + 1023; z[63] <= z_s; if ($signed(z_e) == -1022 && z_m[52] == 0) begin z[62 : 52] <= 0; end //if overflow occurs, return inf if ($signed(z_e) > 1023) begin z[51 : 0] <= 0; z[62 : 52] <= 2047; z[63] <= z_s; end state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_input_b_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign input_b_ack = s_input_b_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point Multiplier (Double Precision) //Copyright (C) Jonathan P Dawson 2014 //2014-01-10 module double_multiplier( input_a, input_b, input_a_stb, input_b_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack, input_b_ack); input clk; input rst; input [63:0] input_a; input input_a_stb; output input_a_ack; input [63:0] input_b; input input_b_stb; output input_b_ack; output [63:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [63:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [3:0] state; parameter get_a = 4'd0, get_b = 4'd1, unpack = 4'd2, special_cases = 4'd3, normalise_a = 4'd4, normalise_b = 4'd5, multiply_0 = 4'd6, multiply_1 = 4'd7, normalise_1 = 4'd8, normalise_2 = 4'd9, round = 4'd10, pack = 4'd11, put_z = 4'd12; reg [63:0] a, b, z; reg [52:0] a_m, b_m, z_m; reg [12:0] a_e, b_e, z_e; reg a_s, b_s, z_s; reg guard, round_bit, sticky; reg [107:0] product; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= get_b; end end get_b: begin s_input_b_ack <= 1; if (s_input_b_ack && input_b_stb) begin b <= input_b; s_input_b_ack <= 0; state <= unpack; end end unpack: begin a_m <= a[51 : 0]; b_m <= b[51 : 0]; a_e <= a[62 : 52] - 1023; b_e <= b[62 : 52] - 1023; a_s <= a[63]; b_s <= b[63]; state <= special_cases; end special_cases: begin //if a is NaN or b is NaN return NaN if ((a_e == 1024 && a_m != 0) || (b_e == 1024 && b_m != 0)) begin z[63] <= 1; z[62:52] <= 2047; z[51] <= 1; z[50:0] <= 0; state <= put_z; //if a is inf return inf end else if (a_e == 1024) begin z[63] <= a_s ^ b_s; z[62:52] <= 2047; z[51:0] <= 0; state <= put_z; //if b is zero return NaN if ($signed(b_e == -1023) && (b_m == 0)) begin z[63] <= 1; z[62:52] <= 2047; z[51] <= 1; z[50:0] <= 0; state <= put_z; end //if b is inf return inf end else if (b_e == 1024) begin z[63] <= a_s ^ b_s; z[62:52] <= 2047; z[51:0] <= 0; state <= put_z; //if a is zero return zero end else if (($signed(a_e) == -1023) && (a_m == 0)) begin z[63] <= a_s ^ b_s; z[62:52] <= 0; z[51:0] <= 0; state <= put_z; //if b is zero return zero end else if (($signed(b_e) == -1023) && (b_m == 0)) begin z[63] <= a_s ^ b_s; z[62:52] <= 0; z[51:0] <= 0; state <= put_z; end else begin //Denormalised Number if ($signed(a_e) == -1023) begin a_e <= -1022; end else begin a_m[52] <= 1; end //Denormalised Number if ($signed(b_e) == -1023) begin b_e <= -1022; end else begin b_m[52] <= 1; end state <= normalise_a; end end normalise_a: begin if (a_m[52]) begin state <= normalise_b; end else begin a_m <= a_m << 1; a_e <= a_e - 1; end end normalise_b: begin if (b_m[52]) begin state <= multiply_0; end else begin b_m <= b_m << 1; b_e <= b_e - 1; end end multiply_0: begin z_s <= a_s ^ b_s; z_e <= a_e + b_e + 1; product <= a_m * b_m * 4; state <= multiply_1; end multiply_1: begin z_m <= product[107:55]; guard <= product[54]; round_bit <= product[53]; sticky <= (product[52:0] != 0); state <= normalise_1; end normalise_1: begin if (z_m[52] == 0) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= guard; guard <= round_bit; round_bit <= 0; end else begin state <= normalise_2; end end normalise_2: begin if ($signed(z_e) < -1022) begin z_e <= z_e + 1; z_m <= z_m >> 1; guard <= z_m[0]; round_bit <= guard; sticky <= sticky | round_bit; end else begin state <= round; end end round: begin if (guard && (round_bit | sticky | z_m[0])) begin z_m <= z_m + 1; if (z_m == 53'hffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[51 : 0] <= z_m[51:0]; z[62 : 52] <= z_e[11:0] + 1023; z[63] <= z_s; if ($signed(z_e) == -1022 && z_m[52] == 0) begin z[62 : 52] <= 0; end //if overflow occurs, return inf if ($signed(z_e) > 1023) begin z[51 : 0] <= 0; z[62 : 52] <= 2047; z[63] <= z_s; end state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_input_b_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign input_b_ack = s_input_b_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point Adder (Double Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 module double_adder( input_a, input_b, input_a_stb, input_b_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack, input_b_ack); input clk; input rst; input [63:0] input_a; input input_a_stb; output input_a_ack; input [63:0] input_b; input input_b_stb; output input_b_ack; output [63:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [63:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [3:0] state; parameter get_a = 4'd0, get_b = 4'd1, unpack = 4'd2, special_cases = 4'd3, align = 4'd4, add_0 = 4'd5, add_1 = 4'd6, normalise_1 = 4'd7, normalise_2 = 4'd8, round = 4'd9, pack = 4'd10, put_z = 4'd11; reg [63:0] a, b, z; reg [55:0] a_m, b_m; reg [52:0] z_m; reg [12:0] a_e, b_e, z_e; reg a_s, b_s, z_s; reg guard, round_bit, sticky; reg [56:0] sum; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= get_b; end end get_b: begin s_input_b_ack <= 1; if (s_input_b_ack && input_b_stb) begin b <= input_b; s_input_b_ack <= 0; state <= unpack; end end unpack: begin a_m <= {a[51 : 0], 3'd0}; b_m <= {b[51 : 0], 3'd0}; a_e <= a[62 : 52] - 1023; b_e <= b[62 : 52] - 1023; a_s <= a[63]; b_s <= b[63]; state <= special_cases; end special_cases: begin //if a is NaN or b is NaN return NaN if ((a_e == 1024 && a_m != 0) || (b_e == 1024 && b_m != 0)) begin z[63] <= 1; z[62:52] <= 2047; z[51] <= 1; z[50:0] <= 0; state <= put_z; //if a is inf return inf end else if (a_e == 1024) begin z[63] <= a_s; z[62:52] <= 2047; z[51:0] <= 0; state <= put_z; //if b is inf return inf end else if (b_e == 1024) begin z[63] <= b_s; z[62:52] <= 2047; z[51:0] <= 0; state <= put_z; //if a is zero return b end else if ((($signed(a_e) == -1023) && (a_m == 0)) && (($signed(b_e) == -1023) && (b_m == 0))) begin z[63] <= a_s & b_s; z[62:52] <= b_e[10:0] + 1023; z[51:0] <= b_m[55:3]; state <= put_z; //if a is zero return b end else if (($signed(a_e) == -1023) && (a_m == 0)) begin z[63] <= b_s; z[62:52] <= b_e[10:0] + 1023; z[51:0] <= b_m[55:3]; state <= put_z; //if b is zero return a end else if (($signed(b_e) == -1023) && (b_m == 0)) begin z[63] <= a_s; z[62:52] <= a_e[10:0] + 1023; z[51:0] <= a_m[55:3]; state <= put_z; end else begin //Denormalised Number if ($signed(a_e) == -1023) begin a_e <= -1022; end else begin a_m[55] <= 1; end //Denormalised Number if ($signed(b_e) == -1023) begin b_e <= -1022; end else begin b_m[55] <= 1; end state <= align; end end align: begin if ($signed(a_e) > $signed(b_e)) begin b_e <= b_e + 1; b_m <= b_m >> 1; b_m[0] <= b_m[0] | b_m[1]; end else if ($signed(a_e) < $signed(b_e)) begin a_e <= a_e + 1; a_m <= a_m >> 1; a_m[0] <= a_m[0] | a_m[1]; end else begin state <= add_0; end end add_0: begin z_e <= a_e; if (a_s == b_s) begin sum <= {1'd0, a_m} + b_m; z_s <= a_s; end else begin if (a_m > b_m) begin sum <= {1'd0, a_m} - b_m; z_s <= a_s; end else begin sum <= {1'd0, b_m} - a_m; z_s <= b_s; end end state <= add_1; end add_1: begin if (sum[56]) begin z_m <= sum[56:4]; guard <= sum[3]; round_bit <= sum[2]; sticky <= sum[1] | sum[0]; z_e <= z_e + 1; end else begin z_m <= sum[55:3]; guard <= sum[2]; round_bit <= sum[1]; sticky <= sum[0]; end state <= normalise_1; end normalise_1: begin if (z_m[52] == 0 && $signed(z_e) > -1022) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= guard; guard <= round_bit; round_bit <= 0; end else begin state <= normalise_2; end end normalise_2: begin if ($signed(z_e) < -1022) begin z_e <= z_e + 1; z_m <= z_m >> 1; guard <= z_m[0]; round_bit <= guard; sticky <= sticky | round_bit; end else begin state <= round; end end round: begin if (guard && (round_bit | sticky | z_m[0])) begin z_m <= z_m + 1; if (z_m == 53'h1fffffffffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[51 : 0] <= z_m[51:0]; z[62 : 52] <= z_e[10:0] + 1023; z[63] <= z_s; if ($signed(z_e) == -1022 && z_m[52] == 0) begin z[62 : 52] <= 0; end //if overflow occurs, return inf if ($signed(z_e) > 1023) begin z[51 : 0] <= 0; z[62 : 52] <= 2047; z[63] <= z_s; end state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_input_b_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign input_b_ack = s_input_b_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //Integer to IEEE Floating Point Converter (Single Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 module int_to_float( input_a, input_a_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack); input clk; input rst; input [31:0] input_a; input input_a_stb; output input_a_ack; output [31:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [31:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [2:0] state; parameter get_a = 3'd0, convert_0 = 3'd1, convert_1 = 3'd2, convert_2 = 3'd3, round = 3'd4, pack = 3'd5, put_z = 3'd6; reg [31:0] a, z, value; reg [23:0] z_m; reg [7:0] z_r; reg [7:0] z_e; reg z_s; reg guard, round_bit, sticky; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= convert_0; end end convert_0: begin if ( a == 0 ) begin z_s <= 0; z_m <= 0; z_e <= -127; state <= pack; end else begin value <= a[31] ? -a : a; z_s <= a[31]; state <= convert_1; end end convert_1: begin z_e <= 31; z_m <= value[31:8]; z_r <= value[7:0]; state <= convert_2; end convert_2: begin if (!z_m[23]) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= z_r[7]; z_r <= z_r << 1; end else begin guard <= z_r[7]; round_bit <= z_r[6]; sticky <= z_r[5:0] != 0; state <= round; end end round: begin if (guard && (round_bit || sticky || z_m[0])) begin z_m <= z_m + 1; if (z_m == 24'hffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[22 : 0] <= z_m[22:0]; z[30 : 23] <= z_e + 127; z[31] <= z_s; state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point to Integer Converter (Single Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 module float_to_int( input_a, input_a_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack); input clk; input rst; input [31:0] input_a; input input_a_stb; output input_a_ack; output [31:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [31:0] s_output_z; reg s_input_a_ack; reg [2:0] state; parameter get_a = 3'd0, special_cases = 3'd1, unpack = 3'd2, convert = 3'd3, put_z = 3'd4; reg [31:0] a_m, a, z; reg [8:0] a_e; reg a_s; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= unpack; end end unpack: begin a_m[31:8] <= {1'b1, a[22 : 0]}; a_m[7:0] <= 0; a_e <= a[30 : 23] - 127; a_s <= a[31]; state <= special_cases; end special_cases: begin if ($signed(a_e) == -127) begin z <= 0; state <= put_z; end else if ($signed(a_e) > 31) begin z <= 32'h80000000; state <= put_z; end else begin state <= convert; end end convert: begin if ($signed(a_e) < 31 && a_m) begin a_e <= a_e + 1; a_m <= a_m >> 1; end else begin if (a_m[31]) begin z <= 32'h80000000; end else begin z <= a_s ? -a_m : a_m; end state <= put_z; end end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //Integer to IEEE Floating Point Converter (Double Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 module long_to_double( input_a, input_a_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack); input clk; input rst; input [63:0] input_a; input input_a_stb; output input_a_ack; output [63:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [63:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [2:0] state; parameter get_a = 3'd0, convert_0 = 3'd1, convert_1 = 3'd2, convert_2 = 3'd3, round = 3'd4, pack = 3'd5, put_z = 3'd6; reg [63:0] a, z, value; reg [52:0] z_m; reg [10:0] z_r; reg [10:0] z_e; reg z_s; reg guard, round_bit, sticky; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= convert_0; end end convert_0: begin if ( a == 0 ) begin z_s <= 0; z_m <= 0; z_e <= -1023; state <= pack; end else begin value <= a[63] ? -a : a; z_s <= a[63]; state <= convert_1; end end convert_1: begin z_e <= 63; z_m <= value[63:11]; z_r <= value[10:0]; state <= convert_2; end convert_2: begin if (!z_m[52]) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= z_r[10]; z_r <= z_r << 1; end else begin guard <= z_r[10]; round_bit <= z_r[9]; sticky <= z_r[8:0] != 0; state <= round; end end round: begin if (guard && (round_bit || sticky || z_m[0])) begin z_m <= z_m + 1; if (z_m == 53'h1fffffffffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[51 : 0] <= z_m[51:0]; z[62 : 52] <= z_e + 1023; z[63] <= z_s; state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point to Integer Converter (Double Precision) //Copyright (C) Jonathan P Dawson 2014 //2014-01-11 module double_to_long( input_a, input_a_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack); input clk; input rst; input [63:0] input_a; input input_a_stb; output input_a_ack; output [63:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [63:0] s_output_z; reg s_input_a_ack; reg [2:0] state; parameter get_a = 3'd0, special_cases = 3'd1, unpack = 3'd2, convert = 3'd3, put_z = 3'd4; reg [63:0] a_m, a, z; reg [11:0] a_e; reg a_s; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= unpack; end end unpack: begin a_m[63:11] <= {1'b1, a[51 : 0]}; a_m[10:0] <= 0; a_e <= a[62 : 52] - 1023; a_s <= a[63]; state <= special_cases; end special_cases: begin if ($signed(a_e) == -1023) begin //zero z <= 0; state <= put_z; end else if ($signed(a_e) == 1024 && a[51:0] != 0) begin //nan z <= 64'h8000000000000000; state <= put_z; end else if ($signed(a_e) > 63) begin //too big if (a_s) begin z <= 64'h8000000000000000; end else begin z <= 64'h0000000000000000; end state <= put_z; end else begin state <= convert; end end convert: begin if ($signed(a_e) < 63 && a_m) begin a_e <= a_e + 1; a_m <= a_m >> 1; end else begin if (a_m[63] && a_s) begin z <= 64'h8000000000000000; end else begin z <= a_s ? -a_m : a_m; end state <= put_z; end end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //Integer to IEEE Floating Point Converter (Double Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 module float_to_double( input_a, input_a_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack); input clk; input rst; input [31:0] input_a; input input_a_stb; output input_a_ack; output [63:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [63:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [1:0] state; parameter get_a = 3'd0, convert_0 = 3'd1, normalise_0 = 3'd2, put_z = 3'd3; reg [63:0] z; reg [10:0] z_e; reg [52:0] z_m; reg [31:0] a; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= convert_0; end end convert_0: begin z[63] <= a[31]; z[62:52] <= (a[30:23] - 127) + 1023; z[51:0] <= {a[22:0], 29'd0}; if (a[30:23] == 255) begin z[62:52] <= 2047; end state <= put_z; if (a[30:23] == 0) begin if (a[23:0]) begin state <= normalise_0; z_e <= 897; z_m <= {1'd0, a[22:0], 29'd0}; end z[62:52] <= 0; end end normalise_0: begin if (z_m[52]) begin z[62:52] <= z_e; z[51:0] <= z_m[51:0]; state <= put_z; end else begin z_m <= {z_m[51:0], 1'd0}; z_e <= z_e - 1; end end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point to Integer Converter (Double Precision) //Copyright (C) Jonathan P Dawson 2014 //2014-01-11 module double_to_float( input_a, input_a_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack); input clk; input rst; input [63:0] input_a; input input_a_stb; output input_a_ack; output [31:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [31:0] s_output_z; reg s_input_a_ack; reg [1:0] state; parameter get_a = 3'd0, unpack = 3'd1, denormalise = 3'd2, put_z = 3'd3; reg [63:0] a; reg [31:0] z; reg [10:0] z_e; reg [23:0] z_m; reg guard; reg round; reg sticky; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= unpack; end end unpack: begin z[31] <= a[63]; state <= put_z; if (a[62:52] == 0) begin z[30:23] <= 0; z[22:0] <= 0; end else if (a[62:52] < 897) begin z[30:23] <= 0; z_m <= {1'd1, a[51:29]}; z_e <= a[62:52]; guard <= a[28]; round <= a[27]; sticky <= a[26:0] != 0; state <= denormalise; end else if (a[62:52] == 2047) begin z[30:23] <= 255; z[22:0] <= 0; if (a[51:0]) begin z[22] <= 1; end end else if (a[62:52] > 1150) begin z[30:23] <= 255; z[22:0] <= 0; end else begin z[30:23] <= (a[62:52] - 1023) + 127; if (a[28] && (a[27] || a[26:0])) begin z[22:0] <= a[51:29] + 1; end else begin z[22:0] <= a[51:29]; end end end denormalise: begin if (z_e == 897 || (z_m == 0 && guard == 0)) begin state <= put_z; z[22:0] <= z_m; if (guard && (round || sticky)) begin z[22:0] <= z_m + 1; end end else begin z_e <= z_e + 1; z_m <= {1'd0, z_m[23:1]}; guard <= z_m[0]; round <= guard; sticky <= sticky | round; end end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule
//IEEE Floating Point Adder (Single Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 module adder( input_a, input_b, input_a_stb, input_b_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack, input_b_ack); input clk; input rst; input [31:0] input_a; input input_a_stb; output input_a_ack; input [31:0] input_b; input input_b_stb; output input_b_ack; output [31:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [31:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [3:0] state; parameter get_a = 4'd0, get_b = 4'd1, unpack = 4'd2, special_cases = 4'd3, align = 4'd4, add_0 = 4'd5, add_1 = 4'd6, normalise_1 = 4'd7, normalise_2 = 4'd8, round = 4'd9, pack = 4'd10, put_z = 4'd11; reg [31:0] a, b, z; reg [26:0] a_m, b_m; reg [23:0] z_m; reg [9:0] a_e, b_e, z_e; reg a_s, b_s, z_s; reg guard, round_bit, sticky; reg [27:0] sum; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= get_b; end end get_b: begin s_input_b_ack <= 1; if (s_input_b_ack && input_b_stb) begin b <= input_b; s_input_b_ack <= 0; state <= unpack; end end unpack: begin a_m <= {a[22 : 0], 3'd0}; b_m <= {b[22 : 0], 3'd0}; a_e <= a[30 : 23] - 127; b_e <= b[30 : 23] - 127; a_s <= a[31]; b_s <= b[31]; state <= special_cases; end special_cases: begin //if a is NaN or b is NaN return NaN if ((a_e == 128 && a_m != 0) || (b_e == 128 && b_m != 0)) begin z[31] <= 1; z[30:23] <= 255; z[22] <= 1; z[21:0] <= 0; state <= put_z; //if a is inf return inf end else if (a_e == 128) begin z[31] <= a_s; z[30:23] <= 255; z[22:0] <= 0; state <= put_z; //if b is inf return inf end else if (b_e == 128) begin z[31] <= b_s; z[30:23] <= 255; z[22:0] <= 0; state <= put_z; //if a is zero return b end else if ((($signed(a_e) == -127) && (a_m == 0)) && (($signed(b_e) == -127) && (b_m == 0))) begin z[31] <= a_s & b_s; z[30:23] <= b_e[7:0] + 127; z[22:0] <= b_m[26:3]; state <= put_z; //if a is zero return b end else if (($signed(a_e) == -127) && (a_m == 0)) begin z[31] <= b_s; z[30:23] <= b_e[7:0] + 127; z[22:0] <= b_m[26:3]; state <= put_z; //if b is zero return a end else if (($signed(b_e) == -127) && (b_m == 0)) begin z[31] <= a_s; z[30:23] <= a_e[7:0] + 127; z[22:0] <= a_m[26:3]; state <= put_z; end else begin //Denormalised Number if ($signed(a_e) == -127) begin a_e <= -126; end else begin a_m[26] <= 1; end //Denormalised Number if ($signed(b_e) == -127) begin b_e <= -126; end else begin b_m[26] <= 1; end state <= align; end end align: begin if ($signed(a_e) > $signed(b_e)) begin b_e <= b_e + 1; b_m <= b_m >> 1; b_m[0] <= b_m[0] | b_m[1]; end else if ($signed(a_e) < $signed(b_e)) begin a_e <= a_e + 1; a_m <= a_m >> 1; a_m[0] <= a_m[0] | a_m[1]; end else begin state <= add_0; end end add_0: begin z_e <= a_e; if (a_s == b_s) begin sum <= a_m + b_m; z_s <= a_s; end else begin if (a_m >= b_m) begin sum <= a_m - b_m; z_s <= a_s; end else begin sum <= b_m - a_m; z_s <= b_s; end end state <= add_1; end add_1: begin if (sum[27]) begin z_m <= sum[27:4]; guard <= sum[3]; round_bit <= sum[2]; sticky <= sum[1] | sum[0]; z_e <= z_e + 1; end else begin z_m <= sum[26:3]; guard <= sum[2]; round_bit <= sum[1]; sticky <= sum[0]; end state <= normalise_1; end normalise_1: begin if (z_m[23] == 0 && $signed(z_e) > -126) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= guard; guard <= round_bit; round_bit <= 0; end else begin state <= normalise_2; end end normalise_2: begin if ($signed(z_e) < -126) begin z_e <= z_e + 1; z_m <= z_m >> 1; guard <= z_m[0]; round_bit <= guard; sticky <= sticky | round_bit; end else begin state <= round; end end round: begin if (guard && (round_bit | sticky | z_m[0])) begin z_m <= z_m + 1; if (z_m == 24'hffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[22 : 0] <= z_m[22:0]; z[30 : 23] <= z_e[7:0] + 127; z[31] <= z_s; if ($signed(z_e) == -126 && z_m[23] == 0) begin z[30 : 23] <= 0; end //if overflow occurs, return inf if ($signed(z_e) > 127) begin z[22 : 0] <= 0; z[30 : 23] <= 255; z[31] <= z_s; end state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_input_b_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign input_b_ack = s_input_b_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point Divider (Single Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 // module divider( input_a, input_b, input_a_stb, input_b_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack, input_b_ack); input clk; input rst; input [31:0] input_a; input input_a_stb; output input_a_ack; input [31:0] input_b; input input_b_stb; output input_b_ack; output [31:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [31:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [3:0] state; parameter get_a = 4'd0, get_b = 4'd1, unpack = 4'd2, special_cases = 4'd3, normalise_a = 4'd4, normalise_b = 4'd5, divide_0 = 4'd6, divide_1 = 4'd7, divide_2 = 4'd8, divide_3 = 4'd9, normalise_1 = 4'd10, normalise_2 = 4'd11, round = 4'd12, pack = 4'd13, put_z = 4'd14; reg [31:0] a, b, z; reg [23:0] a_m, b_m, z_m; reg [9:0] a_e, b_e, z_e; reg a_s, b_s, z_s; reg guard, round_bit, sticky; reg [50:0] quotient, divisor, dividend, remainder; reg [5:0] count; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= get_b; end end get_b: begin s_input_b_ack <= 1; if (s_input_b_ack && input_b_stb) begin b <= input_b; s_input_b_ack <= 0; state <= unpack; end end unpack: begin a_m <= a[22 : 0]; b_m <= b[22 : 0]; a_e <= a[30 : 23] - 127; b_e <= b[30 : 23] - 127; a_s <= a[31]; b_s <= b[31]; state <= special_cases; end special_cases: begin //if a is NaN or b is NaN return NaN if ((a_e == 128 && a_m != 0) || (b_e == 128 && b_m != 0)) begin z[31] <= 1; z[30:23] <= 255; z[22] <= 1; z[21:0] <= 0; state <= put_z; //if a is inf and b is inf return NaN end else if ((a_e == 128) && (b_e == 128)) begin z[31] <= 1; z[30:23] <= 255; z[22] <= 1; z[21:0] <= 0; state <= put_z; //if a is inf return inf end else if (a_e == 128) begin z[31] <= a_s ^ b_s; z[30:23] <= 255; z[22:0] <= 0; state <= put_z; //if b is zero return NaN if ($signed(b_e == -127) && (b_m == 0)) begin z[31] <= 1; z[30:23] <= 255; z[22] <= 1; z[21:0] <= 0; state <= put_z; end //if b is inf return zero end else if (b_e == 128) begin z[31] <= a_s ^ b_s; z[30:23] <= 0; z[22:0] <= 0; state <= put_z; //if a is zero return zero end else if (($signed(a_e) == -127) && (a_m == 0)) begin z[31] <= a_s ^ b_s; z[30:23] <= 0; z[22:0] <= 0; state <= put_z; //if b is zero return NaN if (($signed(b_e) == -127) && (b_m == 0)) begin z[31] <= 1; z[30:23] <= 255; z[22] <= 1; z[21:0] <= 0; state <= put_z; end //if b is zero return inf end else if (($signed(b_e) == -127) && (b_m == 0)) begin z[31] <= a_s ^ b_s; z[30:23] <= 255; z[22:0] <= 0; state <= put_z; end else begin //Denormalised Number if ($signed(a_e) == -127) begin a_e <= -126; end else begin a_m[23] <= 1; end //Denormalised Number if ($signed(b_e) == -127) begin b_e <= -126; end else begin b_m[23] <= 1; end state <= normalise_a; end end normalise_a: begin if (a_m[23]) begin state <= normalise_b; end else begin a_m <= a_m << 1; a_e <= a_e - 1; end end normalise_b: begin if (b_m[23]) begin state <= divide_0; end else begin b_m <= b_m << 1; b_e <= b_e - 1; end end divide_0: begin z_s <= a_s ^ b_s; z_e <= a_e - b_e; quotient <= 0; remainder <= 0; count <= 0; dividend <= a_m << 27; divisor <= b_m; state <= divide_1; end divide_1: begin quotient <= quotient << 1; remainder <= remainder << 1; remainder[0] <= dividend[50]; dividend <= dividend << 1; state <= divide_2; end divide_2: begin if (remainder >= divisor) begin quotient[0] <= 1; remainder <= remainder - divisor; end if (count == 49) begin state <= divide_3; end else begin count <= count + 1; state <= divide_1; end end divide_3: begin z_m <= quotient[26:3]; guard <= quotient[2]; round_bit <= quotient[1]; sticky <= quotient[0] | (remainder != 0); state <= normalise_1; end normalise_1: begin if (z_m[23] == 0 && $signed(z_e) > -126) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= guard; guard <= round_bit; round_bit <= 0; end else begin state <= normalise_2; end end normalise_2: begin if ($signed(z_e) < -126) begin z_e <= z_e + 1; z_m <= z_m >> 1; guard <= z_m[0]; round_bit <= guard; sticky <= sticky | round_bit; end else begin state <= round; end end round: begin if (guard && (round_bit | sticky | z_m[0])) begin z_m <= z_m + 1; if (z_m == 24'hffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[22 : 0] <= z_m[22:0]; z[30 : 23] <= z_e[7:0] + 127; z[31] <= z_s; if ($signed(z_e) == -126 && z_m[23] == 0) begin z[30 : 23] <= 0; end //if overflow occurs, return inf if ($signed(z_e) > 127) begin z[22 : 0] <= 0; z[30 : 23] <= 255; z[31] <= z_s; end state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_input_b_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign input_b_ack = s_input_b_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point Multiplier (Single Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 module multiplier( input_a, input_b, input_a_stb, input_b_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack, input_b_ack); input clk; input rst; input [31:0] input_a; input input_a_stb; output input_a_ack; input [31:0] input_b; input input_b_stb; output input_b_ack; output [31:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [31:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [3:0] state; parameter get_a = 4'd0, get_b = 4'd1, unpack = 4'd2, special_cases = 4'd3, normalise_a = 4'd4, normalise_b = 4'd5, multiply_0 = 4'd6, multiply_1 = 4'd7, normalise_1 = 4'd8, normalise_2 = 4'd9, round = 4'd10, pack = 4'd11, put_z = 4'd12; reg [31:0] a, b, z; reg [23:0] a_m, b_m, z_m; reg [9:0] a_e, b_e, z_e; reg a_s, b_s, z_s; reg guard, round_bit, sticky; reg [49:0] product; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= get_b; end end get_b: begin s_input_b_ack <= 1; if (s_input_b_ack && input_b_stb) begin b <= input_b; s_input_b_ack <= 0; state <= unpack; end end unpack: begin a_m <= a[22 : 0]; b_m <= b[22 : 0]; a_e <= a[30 : 23] - 127; b_e <= b[30 : 23] - 127; a_s <= a[31]; b_s <= b[31]; state <= special_cases; end special_cases: begin //if a is NaN or b is NaN return NaN if ((a_e == 128 && a_m != 0) || (b_e == 128 && b_m != 0)) begin z[31] <= 1; z[30:23] <= 255; z[22] <= 1; z[21:0] <= 0; state <= put_z; //if a is inf return inf end else if (a_e == 128) begin z[31] <= a_s ^ b_s; z[30:23] <= 255; z[22:0] <= 0; state <= put_z; //if b is zero return NaN if ($signed(b_e == -127) && (b_m == 0)) begin z[31] <= 1; z[30:23] <= 255; z[22] <= 1; z[21:0] <= 0; state <= put_z; end //if b is inf return inf end else if (b_e == 128) begin z[31] <= a_s ^ b_s; z[30:23] <= 255; z[22:0] <= 0; state <= put_z; //if a is zero return zero end else if (($signed(a_e) == -127) && (a_m == 0)) begin z[31] <= a_s ^ b_s; z[30:23] <= 0; z[22:0] <= 0; state <= put_z; //if b is zero return zero end else if (($signed(b_e) == -127) && (b_m == 0)) begin z[31] <= a_s ^ b_s; z[30:23] <= 0; z[22:0] <= 0; state <= put_z; end else begin //Denormalised Number if ($signed(a_e) == -127) begin a_e <= -126; end else begin a_m[23] <= 1; end //Denormalised Number if ($signed(b_e) == -127) begin b_e <= -126; end else begin b_m[23] <= 1; end state <= normalise_a; end end normalise_a: begin if (a_m[23]) begin state <= normalise_b; end else begin a_m <= a_m << 1; a_e <= a_e - 1; end end normalise_b: begin if (b_m[23]) begin state <= multiply_0; end else begin b_m <= b_m << 1; b_e <= b_e - 1; end end multiply_0: begin z_s <= a_s ^ b_s; z_e <= a_e + b_e + 1; product <= a_m * b_m * 4; state <= multiply_1; end multiply_1: begin z_m <= product[49:26]; guard <= product[25]; round_bit <= product[24]; sticky <= (product[23:0] != 0); state <= normalise_1; end normalise_1: begin if (z_m[23] == 0) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= guard; guard <= round_bit; round_bit <= 0; end else begin state <= normalise_2; end end normalise_2: begin if ($signed(z_e) < -126) begin z_e <= z_e + 1; z_m <= z_m >> 1; guard <= z_m[0]; round_bit <= guard; sticky <= sticky | round_bit; end else begin state <= round; end end round: begin if (guard && (round_bit | sticky | z_m[0])) begin z_m <= z_m + 1; if (z_m == 24'hffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[22 : 0] <= z_m[22:0]; z[30 : 23] <= z_e[7:0] + 127; z[31] <= z_s; if ($signed(z_e) == -126 && z_m[23] == 0) begin z[30 : 23] <= 0; end //if overflow occurs, return inf if ($signed(z_e) > 127) begin z[22 : 0] <= 0; z[30 : 23] <= 255; z[31] <= z_s; end state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_input_b_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign input_b_ack = s_input_b_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point Divider (Double Precision) //Copyright (C) Jonathan P Dawson 2014 //2014-01-11 // module double_divider( input_a, input_b, input_a_stb, input_b_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack, input_b_ack); input clk; input rst; input [63:0] input_a; input input_a_stb; output input_a_ack; input [63:0] input_b; input input_b_stb; output input_b_ack; output [63:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [63:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [3:0] state; parameter get_a = 4'd0, get_b = 4'd1, unpack = 4'd2, special_cases = 4'd3, normalise_a = 4'd4, normalise_b = 4'd5, divide_0 = 4'd6, divide_1 = 4'd7, divide_2 = 4'd8, divide_3 = 4'd9, normalise_1 = 4'd10, normalise_2 = 4'd11, round = 4'd12, pack = 4'd13, put_z = 4'd14; reg [63:0] a, b, z; reg [52:0] a_m, b_m, z_m; reg [12:0] a_e, b_e, z_e; reg a_s, b_s, z_s; reg guard, round_bit, sticky; reg [108:0] quotient, divisor, dividend, remainder; reg [6:0] count; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= get_b; end end get_b: begin s_input_b_ack <= 1; if (s_input_b_ack && input_b_stb) begin b <= input_b; s_input_b_ack <= 0; state <= unpack; end end unpack: begin a_m <= a[51 : 0]; b_m <= b[51 : 0]; a_e <= a[62 : 52] - 1023; b_e <= b[62 : 52] - 1023; a_s <= a[63]; b_s <= b[63]; state <= special_cases; end special_cases: begin //if a is NaN or b is NaN return NaN if ((a_e == 1024 && a_m != 0) || (b_e == 1024 && b_m != 0)) begin z[63] <= 1; z[62:52] <= 2047; z[51] <= 1; z[50:0] <= 0; state <= put_z; //if a is inf and b is inf return NaN end else if ((a_e == 1024) && (b_e == 1024)) begin z[63] <= 1; z[62:52] <= 2047; z[51] <= 1; z[50:0] <= 0; state <= put_z; //if a is inf return inf end else if (a_e == 1024) begin z[63] <= a_s ^ b_s; z[62:52] <= 2047; z[51:0] <= 0; state <= put_z; //if b is zero return NaN if ($signed(b_e == -1023) && (b_m == 0)) begin z[63] <= 1; z[62:52] <= 2047; z[51] <= 1; z[50:0] <= 0; state <= put_z; end //if b is inf return zero end else if (b_e == 1024) begin z[63] <= a_s ^ b_s; z[62:52] <= 0; z[51:0] <= 0; state <= put_z; //if a is zero return zero end else if (($signed(a_e) == -1023) && (a_m == 0)) begin z[63] <= a_s ^ b_s; z[62:52] <= 0; z[51:0] <= 0; state <= put_z; //if b is zero return NaN if (($signed(b_e) == -1023) && (b_m == 0)) begin z[63] <= 1; z[62:52] <= 2047; z[51] <= 1; z[50:0] <= 0; state <= put_z; end //if b is zero return inf end else if (($signed(b_e) == -1023) && (b_m == 0)) begin z[63] <= a_s ^ b_s; z[62:52] <= 2047; z[51:0] <= 0; state <= put_z; end else begin //Denormalised Number if ($signed(a_e) == -1023) begin a_e <= -1022; end else begin a_m[52] <= 1; end //Denormalised Number if ($signed(b_e) == -1023) begin b_e <= -1022; end else begin b_m[52] <= 1; end state <= normalise_a; end end normalise_a: begin if (a_m[52]) begin state <= normalise_b; end else begin a_m <= a_m << 1; a_e <= a_e - 1; end end normalise_b: begin if (b_m[52]) begin state <= divide_0; end else begin b_m <= b_m << 1; b_e <= b_e - 1; end end divide_0: begin z_s <= a_s ^ b_s; z_e <= a_e - b_e; quotient <= 0; remainder <= 0; count <= 0; dividend <= a_m << 56; divisor <= b_m; state <= divide_1; end divide_1: begin quotient <= quotient << 1; remainder <= remainder << 1; remainder[0] <= dividend[108]; dividend <= dividend << 1; state <= divide_2; end divide_2: begin if (remainder >= divisor) begin quotient[0] <= 1; remainder <= remainder - divisor; end if (count == 107) begin state <= divide_3; end else begin count <= count + 1; state <= divide_1; end end divide_3: begin z_m <= quotient[55:3]; guard <= quotient[2]; round_bit <= quotient[1]; sticky <= quotient[0] | (remainder != 0); state <= normalise_1; end normalise_1: begin if (z_m[52] == 0 && $signed(z_e) > -1022) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= guard; guard <= round_bit; round_bit <= 0; end else begin state <= normalise_2; end end normalise_2: begin if ($signed(z_e) < -1022) begin z_e <= z_e + 1; z_m <= z_m >> 1; guard <= z_m[0]; round_bit <= guard; sticky <= sticky | round_bit; end else begin state <= round; end end round: begin if (guard && (round_bit | sticky | z_m[0])) begin z_m <= z_m + 1; if (z_m == 53'hffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[51 : 0] <= z_m[51:0]; z[62 : 52] <= z_e[10:0] + 1023; z[63] <= z_s; if ($signed(z_e) == -1022 && z_m[52] == 0) begin z[62 : 52] <= 0; end //if overflow occurs, return inf if ($signed(z_e) > 1023) begin z[51 : 0] <= 0; z[62 : 52] <= 2047; z[63] <= z_s; end state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_input_b_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign input_b_ack = s_input_b_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point Multiplier (Double Precision) //Copyright (C) Jonathan P Dawson 2014 //2014-01-10 module double_multiplier( input_a, input_b, input_a_stb, input_b_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack, input_b_ack); input clk; input rst; input [63:0] input_a; input input_a_stb; output input_a_ack; input [63:0] input_b; input input_b_stb; output input_b_ack; output [63:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [63:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [3:0] state; parameter get_a = 4'd0, get_b = 4'd1, unpack = 4'd2, special_cases = 4'd3, normalise_a = 4'd4, normalise_b = 4'd5, multiply_0 = 4'd6, multiply_1 = 4'd7, normalise_1 = 4'd8, normalise_2 = 4'd9, round = 4'd10, pack = 4'd11, put_z = 4'd12; reg [63:0] a, b, z; reg [52:0] a_m, b_m, z_m; reg [12:0] a_e, b_e, z_e; reg a_s, b_s, z_s; reg guard, round_bit, sticky; reg [107:0] product; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= get_b; end end get_b: begin s_input_b_ack <= 1; if (s_input_b_ack && input_b_stb) begin b <= input_b; s_input_b_ack <= 0; state <= unpack; end end unpack: begin a_m <= a[51 : 0]; b_m <= b[51 : 0]; a_e <= a[62 : 52] - 1023; b_e <= b[62 : 52] - 1023; a_s <= a[63]; b_s <= b[63]; state <= special_cases; end special_cases: begin //if a is NaN or b is NaN return NaN if ((a_e == 1024 && a_m != 0) || (b_e == 1024 && b_m != 0)) begin z[63] <= 1; z[62:52] <= 2047; z[51] <= 1; z[50:0] <= 0; state <= put_z; //if a is inf return inf end else if (a_e == 1024) begin z[63] <= a_s ^ b_s; z[62:52] <= 2047; z[51:0] <= 0; state <= put_z; //if b is zero return NaN if ($signed(b_e == -1023) && (b_m == 0)) begin z[63] <= 1; z[62:52] <= 2047; z[51] <= 1; z[50:0] <= 0; state <= put_z; end //if b is inf return inf end else if (b_e == 1024) begin z[63] <= a_s ^ b_s; z[62:52] <= 2047; z[51:0] <= 0; state <= put_z; //if a is zero return zero end else if (($signed(a_e) == -1023) && (a_m == 0)) begin z[63] <= a_s ^ b_s; z[62:52] <= 0; z[51:0] <= 0; state <= put_z; //if b is zero return zero end else if (($signed(b_e) == -1023) && (b_m == 0)) begin z[63] <= a_s ^ b_s; z[62:52] <= 0; z[51:0] <= 0; state <= put_z; end else begin //Denormalised Number if ($signed(a_e) == -1023) begin a_e <= -1022; end else begin a_m[52] <= 1; end //Denormalised Number if ($signed(b_e) == -1023) begin b_e <= -1022; end else begin b_m[52] <= 1; end state <= normalise_a; end end normalise_a: begin if (a_m[52]) begin state <= normalise_b; end else begin a_m <= a_m << 1; a_e <= a_e - 1; end end normalise_b: begin if (b_m[52]) begin state <= multiply_0; end else begin b_m <= b_m << 1; b_e <= b_e - 1; end end multiply_0: begin z_s <= a_s ^ b_s; z_e <= a_e + b_e + 1; product <= a_m * b_m * 4; state <= multiply_1; end multiply_1: begin z_m <= product[107:55]; guard <= product[54]; round_bit <= product[53]; sticky <= (product[52:0] != 0); state <= normalise_1; end normalise_1: begin if (z_m[52] == 0) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= guard; guard <= round_bit; round_bit <= 0; end else begin state <= normalise_2; end end normalise_2: begin if ($signed(z_e) < -1022) begin z_e <= z_e + 1; z_m <= z_m >> 1; guard <= z_m[0]; round_bit <= guard; sticky <= sticky | round_bit; end else begin state <= round; end end round: begin if (guard && (round_bit | sticky | z_m[0])) begin z_m <= z_m + 1; if (z_m == 53'hffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[51 : 0] <= z_m[51:0]; z[62 : 52] <= z_e[11:0] + 1023; z[63] <= z_s; if ($signed(z_e) == -1022 && z_m[52] == 0) begin z[62 : 52] <= 0; end //if overflow occurs, return inf if ($signed(z_e) > 1023) begin z[51 : 0] <= 0; z[62 : 52] <= 2047; z[63] <= z_s; end state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_input_b_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign input_b_ack = s_input_b_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point Adder (Double Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 module double_adder( input_a, input_b, input_a_stb, input_b_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack, input_b_ack); input clk; input rst; input [63:0] input_a; input input_a_stb; output input_a_ack; input [63:0] input_b; input input_b_stb; output input_b_ack; output [63:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [63:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [3:0] state; parameter get_a = 4'd0, get_b = 4'd1, unpack = 4'd2, special_cases = 4'd3, align = 4'd4, add_0 = 4'd5, add_1 = 4'd6, normalise_1 = 4'd7, normalise_2 = 4'd8, round = 4'd9, pack = 4'd10, put_z = 4'd11; reg [63:0] a, b, z; reg [55:0] a_m, b_m; reg [52:0] z_m; reg [12:0] a_e, b_e, z_e; reg a_s, b_s, z_s; reg guard, round_bit, sticky; reg [56:0] sum; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= get_b; end end get_b: begin s_input_b_ack <= 1; if (s_input_b_ack && input_b_stb) begin b <= input_b; s_input_b_ack <= 0; state <= unpack; end end unpack: begin a_m <= {a[51 : 0], 3'd0}; b_m <= {b[51 : 0], 3'd0}; a_e <= a[62 : 52] - 1023; b_e <= b[62 : 52] - 1023; a_s <= a[63]; b_s <= b[63]; state <= special_cases; end special_cases: begin //if a is NaN or b is NaN return NaN if ((a_e == 1024 && a_m != 0) || (b_e == 1024 && b_m != 0)) begin z[63] <= 1; z[62:52] <= 2047; z[51] <= 1; z[50:0] <= 0; state <= put_z; //if a is inf return inf end else if (a_e == 1024) begin z[63] <= a_s; z[62:52] <= 2047; z[51:0] <= 0; state <= put_z; //if b is inf return inf end else if (b_e == 1024) begin z[63] <= b_s; z[62:52] <= 2047; z[51:0] <= 0; state <= put_z; //if a is zero return b end else if ((($signed(a_e) == -1023) && (a_m == 0)) && (($signed(b_e) == -1023) && (b_m == 0))) begin z[63] <= a_s & b_s; z[62:52] <= b_e[10:0] + 1023; z[51:0] <= b_m[55:3]; state <= put_z; //if a is zero return b end else if (($signed(a_e) == -1023) && (a_m == 0)) begin z[63] <= b_s; z[62:52] <= b_e[10:0] + 1023; z[51:0] <= b_m[55:3]; state <= put_z; //if b is zero return a end else if (($signed(b_e) == -1023) && (b_m == 0)) begin z[63] <= a_s; z[62:52] <= a_e[10:0] + 1023; z[51:0] <= a_m[55:3]; state <= put_z; end else begin //Denormalised Number if ($signed(a_e) == -1023) begin a_e <= -1022; end else begin a_m[55] <= 1; end //Denormalised Number if ($signed(b_e) == -1023) begin b_e <= -1022; end else begin b_m[55] <= 1; end state <= align; end end align: begin if ($signed(a_e) > $signed(b_e)) begin b_e <= b_e + 1; b_m <= b_m >> 1; b_m[0] <= b_m[0] | b_m[1]; end else if ($signed(a_e) < $signed(b_e)) begin a_e <= a_e + 1; a_m <= a_m >> 1; a_m[0] <= a_m[0] | a_m[1]; end else begin state <= add_0; end end add_0: begin z_e <= a_e; if (a_s == b_s) begin sum <= {1'd0, a_m} + b_m; z_s <= a_s; end else begin if (a_m > b_m) begin sum <= {1'd0, a_m} - b_m; z_s <= a_s; end else begin sum <= {1'd0, b_m} - a_m; z_s <= b_s; end end state <= add_1; end add_1: begin if (sum[56]) begin z_m <= sum[56:4]; guard <= sum[3]; round_bit <= sum[2]; sticky <= sum[1] | sum[0]; z_e <= z_e + 1; end else begin z_m <= sum[55:3]; guard <= sum[2]; round_bit <= sum[1]; sticky <= sum[0]; end state <= normalise_1; end normalise_1: begin if (z_m[52] == 0 && $signed(z_e) > -1022) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= guard; guard <= round_bit; round_bit <= 0; end else begin state <= normalise_2; end end normalise_2: begin if ($signed(z_e) < -1022) begin z_e <= z_e + 1; z_m <= z_m >> 1; guard <= z_m[0]; round_bit <= guard; sticky <= sticky | round_bit; end else begin state <= round; end end round: begin if (guard && (round_bit | sticky | z_m[0])) begin z_m <= z_m + 1; if (z_m == 53'h1fffffffffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[51 : 0] <= z_m[51:0]; z[62 : 52] <= z_e[10:0] + 1023; z[63] <= z_s; if ($signed(z_e) == -1022 && z_m[52] == 0) begin z[62 : 52] <= 0; end //if overflow occurs, return inf if ($signed(z_e) > 1023) begin z[51 : 0] <= 0; z[62 : 52] <= 2047; z[63] <= z_s; end state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_input_b_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign input_b_ack = s_input_b_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //Integer to IEEE Floating Point Converter (Single Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 module int_to_float( input_a, input_a_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack); input clk; input rst; input [31:0] input_a; input input_a_stb; output input_a_ack; output [31:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [31:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [2:0] state; parameter get_a = 3'd0, convert_0 = 3'd1, convert_1 = 3'd2, convert_2 = 3'd3, round = 3'd4, pack = 3'd5, put_z = 3'd6; reg [31:0] a, z, value; reg [23:0] z_m; reg [7:0] z_r; reg [7:0] z_e; reg z_s; reg guard, round_bit, sticky; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= convert_0; end end convert_0: begin if ( a == 0 ) begin z_s <= 0; z_m <= 0; z_e <= -127; state <= pack; end else begin value <= a[31] ? -a : a; z_s <= a[31]; state <= convert_1; end end convert_1: begin z_e <= 31; z_m <= value[31:8]; z_r <= value[7:0]; state <= convert_2; end convert_2: begin if (!z_m[23]) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= z_r[7]; z_r <= z_r << 1; end else begin guard <= z_r[7]; round_bit <= z_r[6]; sticky <= z_r[5:0] != 0; state <= round; end end round: begin if (guard && (round_bit || sticky || z_m[0])) begin z_m <= z_m + 1; if (z_m == 24'hffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[22 : 0] <= z_m[22:0]; z[30 : 23] <= z_e + 127; z[31] <= z_s; state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point to Integer Converter (Single Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 module float_to_int( input_a, input_a_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack); input clk; input rst; input [31:0] input_a; input input_a_stb; output input_a_ack; output [31:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [31:0] s_output_z; reg s_input_a_ack; reg [2:0] state; parameter get_a = 3'd0, special_cases = 3'd1, unpack = 3'd2, convert = 3'd3, put_z = 3'd4; reg [31:0] a_m, a, z; reg [8:0] a_e; reg a_s; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= unpack; end end unpack: begin a_m[31:8] <= {1'b1, a[22 : 0]}; a_m[7:0] <= 0; a_e <= a[30 : 23] - 127; a_s <= a[31]; state <= special_cases; end special_cases: begin if ($signed(a_e) == -127) begin z <= 0; state <= put_z; end else if ($signed(a_e) > 31) begin z <= 32'h80000000; state <= put_z; end else begin state <= convert; end end convert: begin if ($signed(a_e) < 31 && a_m) begin a_e <= a_e + 1; a_m <= a_m >> 1; end else begin if (a_m[31]) begin z <= 32'h80000000; end else begin z <= a_s ? -a_m : a_m; end state <= put_z; end end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //Integer to IEEE Floating Point Converter (Double Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 module long_to_double( input_a, input_a_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack); input clk; input rst; input [63:0] input_a; input input_a_stb; output input_a_ack; output [63:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [63:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [2:0] state; parameter get_a = 3'd0, convert_0 = 3'd1, convert_1 = 3'd2, convert_2 = 3'd3, round = 3'd4, pack = 3'd5, put_z = 3'd6; reg [63:0] a, z, value; reg [52:0] z_m; reg [10:0] z_r; reg [10:0] z_e; reg z_s; reg guard, round_bit, sticky; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= convert_0; end end convert_0: begin if ( a == 0 ) begin z_s <= 0; z_m <= 0; z_e <= -1023; state <= pack; end else begin value <= a[63] ? -a : a; z_s <= a[63]; state <= convert_1; end end convert_1: begin z_e <= 63; z_m <= value[63:11]; z_r <= value[10:0]; state <= convert_2; end convert_2: begin if (!z_m[52]) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= z_r[10]; z_r <= z_r << 1; end else begin guard <= z_r[10]; round_bit <= z_r[9]; sticky <= z_r[8:0] != 0; state <= round; end end round: begin if (guard && (round_bit || sticky || z_m[0])) begin z_m <= z_m + 1; if (z_m == 53'h1fffffffffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[51 : 0] <= z_m[51:0]; z[62 : 52] <= z_e + 1023; z[63] <= z_s; state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point to Integer Converter (Double Precision) //Copyright (C) Jonathan P Dawson 2014 //2014-01-11 module double_to_long( input_a, input_a_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack); input clk; input rst; input [63:0] input_a; input input_a_stb; output input_a_ack; output [63:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [63:0] s_output_z; reg s_input_a_ack; reg [2:0] state; parameter get_a = 3'd0, special_cases = 3'd1, unpack = 3'd2, convert = 3'd3, put_z = 3'd4; reg [63:0] a_m, a, z; reg [11:0] a_e; reg a_s; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= unpack; end end unpack: begin a_m[63:11] <= {1'b1, a[51 : 0]}; a_m[10:0] <= 0; a_e <= a[62 : 52] - 1023; a_s <= a[63]; state <= special_cases; end special_cases: begin if ($signed(a_e) == -1023) begin //zero z <= 0; state <= put_z; end else if ($signed(a_e) == 1024 && a[51:0] != 0) begin //nan z <= 64'h8000000000000000; state <= put_z; end else if ($signed(a_e) > 63) begin //too big if (a_s) begin z <= 64'h8000000000000000; end else begin z <= 64'h0000000000000000; end state <= put_z; end else begin state <= convert; end end convert: begin if ($signed(a_e) < 63 && a_m) begin a_e <= a_e + 1; a_m <= a_m >> 1; end else begin if (a_m[63] && a_s) begin z <= 64'h8000000000000000; end else begin z <= a_s ? -a_m : a_m; end state <= put_z; end end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //Integer to IEEE Floating Point Converter (Double Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 module float_to_double( input_a, input_a_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack); input clk; input rst; input [31:0] input_a; input input_a_stb; output input_a_ack; output [63:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [63:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [1:0] state; parameter get_a = 3'd0, convert_0 = 3'd1, normalise_0 = 3'd2, put_z = 3'd3; reg [63:0] z; reg [10:0] z_e; reg [52:0] z_m; reg [31:0] a; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= convert_0; end end convert_0: begin z[63] <= a[31]; z[62:52] <= (a[30:23] - 127) + 1023; z[51:0] <= {a[22:0], 29'd0}; if (a[30:23] == 255) begin z[62:52] <= 2047; end state <= put_z; if (a[30:23] == 0) begin if (a[23:0]) begin state <= normalise_0; z_e <= 897; z_m <= {1'd0, a[22:0], 29'd0}; end z[62:52] <= 0; end end normalise_0: begin if (z_m[52]) begin z[62:52] <= z_e; z[51:0] <= z_m[51:0]; state <= put_z; end else begin z_m <= {z_m[51:0], 1'd0}; z_e <= z_e - 1; end end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point to Integer Converter (Double Precision) //Copyright (C) Jonathan P Dawson 2014 //2014-01-11 module double_to_float( input_a, input_a_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack); input clk; input rst; input [63:0] input_a; input input_a_stb; output input_a_ack; output [31:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [31:0] s_output_z; reg s_input_a_ack; reg [1:0] state; parameter get_a = 3'd0, unpack = 3'd1, denormalise = 3'd2, put_z = 3'd3; reg [63:0] a; reg [31:0] z; reg [10:0] z_e; reg [23:0] z_m; reg guard; reg round; reg sticky; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= unpack; end end unpack: begin z[31] <= a[63]; state <= put_z; if (a[62:52] == 0) begin z[30:23] <= 0; z[22:0] <= 0; end else if (a[62:52] < 897) begin z[30:23] <= 0; z_m <= {1'd1, a[51:29]}; z_e <= a[62:52]; guard <= a[28]; round <= a[27]; sticky <= a[26:0] != 0; state <= denormalise; end else if (a[62:52] == 2047) begin z[30:23] <= 255; z[22:0] <= 0; if (a[51:0]) begin z[22] <= 1; end end else if (a[62:52] > 1150) begin z[30:23] <= 255; z[22:0] <= 0; end else begin z[30:23] <= (a[62:52] - 1023) + 127; if (a[28] && (a[27] || a[26:0])) begin z[22:0] <= a[51:29] + 1; end else begin z[22:0] <= a[51:29]; end end end denormalise: begin if (z_e == 897 || (z_m == 0 && guard == 0)) begin state <= put_z; z[22:0] <= z_m; if (guard && (round || sticky)) begin z[22:0] <= z_m + 1; end end else begin z_e <= z_e + 1; z_m <= {1'd0, z_m[23:1]}; guard <= z_m[0]; round <= guard; sticky <= sticky | round; end end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule
//IEEE Floating Point Adder (Single Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 module adder( input_a, input_b, input_a_stb, input_b_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack, input_b_ack); input clk; input rst; input [31:0] input_a; input input_a_stb; output input_a_ack; input [31:0] input_b; input input_b_stb; output input_b_ack; output [31:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [31:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [3:0] state; parameter get_a = 4'd0, get_b = 4'd1, unpack = 4'd2, special_cases = 4'd3, align = 4'd4, add_0 = 4'd5, add_1 = 4'd6, normalise_1 = 4'd7, normalise_2 = 4'd8, round = 4'd9, pack = 4'd10, put_z = 4'd11; reg [31:0] a, b, z; reg [26:0] a_m, b_m; reg [23:0] z_m; reg [9:0] a_e, b_e, z_e; reg a_s, b_s, z_s; reg guard, round_bit, sticky; reg [27:0] sum; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= get_b; end end get_b: begin s_input_b_ack <= 1; if (s_input_b_ack && input_b_stb) begin b <= input_b; s_input_b_ack <= 0; state <= unpack; end end unpack: begin a_m <= {a[22 : 0], 3'd0}; b_m <= {b[22 : 0], 3'd0}; a_e <= a[30 : 23] - 127; b_e <= b[30 : 23] - 127; a_s <= a[31]; b_s <= b[31]; state <= special_cases; end special_cases: begin //if a is NaN or b is NaN return NaN if ((a_e == 128 && a_m != 0) || (b_e == 128 && b_m != 0)) begin z[31] <= 1; z[30:23] <= 255; z[22] <= 1; z[21:0] <= 0; state <= put_z; //if a is inf return inf end else if (a_e == 128) begin z[31] <= a_s; z[30:23] <= 255; z[22:0] <= 0; state <= put_z; //if b is inf return inf end else if (b_e == 128) begin z[31] <= b_s; z[30:23] <= 255; z[22:0] <= 0; state <= put_z; //if a is zero return b end else if ((($signed(a_e) == -127) && (a_m == 0)) && (($signed(b_e) == -127) && (b_m == 0))) begin z[31] <= a_s & b_s; z[30:23] <= b_e[7:0] + 127; z[22:0] <= b_m[26:3]; state <= put_z; //if a is zero return b end else if (($signed(a_e) == -127) && (a_m == 0)) begin z[31] <= b_s; z[30:23] <= b_e[7:0] + 127; z[22:0] <= b_m[26:3]; state <= put_z; //if b is zero return a end else if (($signed(b_e) == -127) && (b_m == 0)) begin z[31] <= a_s; z[30:23] <= a_e[7:0] + 127; z[22:0] <= a_m[26:3]; state <= put_z; end else begin //Denormalised Number if ($signed(a_e) == -127) begin a_e <= -126; end else begin a_m[26] <= 1; end //Denormalised Number if ($signed(b_e) == -127) begin b_e <= -126; end else begin b_m[26] <= 1; end state <= align; end end align: begin if ($signed(a_e) > $signed(b_e)) begin b_e <= b_e + 1; b_m <= b_m >> 1; b_m[0] <= b_m[0] | b_m[1]; end else if ($signed(a_e) < $signed(b_e)) begin a_e <= a_e + 1; a_m <= a_m >> 1; a_m[0] <= a_m[0] | a_m[1]; end else begin state <= add_0; end end add_0: begin z_e <= a_e; if (a_s == b_s) begin sum <= a_m + b_m; z_s <= a_s; end else begin if (a_m >= b_m) begin sum <= a_m - b_m; z_s <= a_s; end else begin sum <= b_m - a_m; z_s <= b_s; end end state <= add_1; end add_1: begin if (sum[27]) begin z_m <= sum[27:4]; guard <= sum[3]; round_bit <= sum[2]; sticky <= sum[1] | sum[0]; z_e <= z_e + 1; end else begin z_m <= sum[26:3]; guard <= sum[2]; round_bit <= sum[1]; sticky <= sum[0]; end state <= normalise_1; end normalise_1: begin if (z_m[23] == 0 && $signed(z_e) > -126) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= guard; guard <= round_bit; round_bit <= 0; end else begin state <= normalise_2; end end normalise_2: begin if ($signed(z_e) < -126) begin z_e <= z_e + 1; z_m <= z_m >> 1; guard <= z_m[0]; round_bit <= guard; sticky <= sticky | round_bit; end else begin state <= round; end end round: begin if (guard && (round_bit | sticky | z_m[0])) begin z_m <= z_m + 1; if (z_m == 24'hffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[22 : 0] <= z_m[22:0]; z[30 : 23] <= z_e[7:0] + 127; z[31] <= z_s; if ($signed(z_e) == -126 && z_m[23] == 0) begin z[30 : 23] <= 0; end //if overflow occurs, return inf if ($signed(z_e) > 127) begin z[22 : 0] <= 0; z[30 : 23] <= 255; z[31] <= z_s; end state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_input_b_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign input_b_ack = s_input_b_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point Divider (Single Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 // module divider( input_a, input_b, input_a_stb, input_b_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack, input_b_ack); input clk; input rst; input [31:0] input_a; input input_a_stb; output input_a_ack; input [31:0] input_b; input input_b_stb; output input_b_ack; output [31:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [31:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [3:0] state; parameter get_a = 4'd0, get_b = 4'd1, unpack = 4'd2, special_cases = 4'd3, normalise_a = 4'd4, normalise_b = 4'd5, divide_0 = 4'd6, divide_1 = 4'd7, divide_2 = 4'd8, divide_3 = 4'd9, normalise_1 = 4'd10, normalise_2 = 4'd11, round = 4'd12, pack = 4'd13, put_z = 4'd14; reg [31:0] a, b, z; reg [23:0] a_m, b_m, z_m; reg [9:0] a_e, b_e, z_e; reg a_s, b_s, z_s; reg guard, round_bit, sticky; reg [50:0] quotient, divisor, dividend, remainder; reg [5:0] count; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= get_b; end end get_b: begin s_input_b_ack <= 1; if (s_input_b_ack && input_b_stb) begin b <= input_b; s_input_b_ack <= 0; state <= unpack; end end unpack: begin a_m <= a[22 : 0]; b_m <= b[22 : 0]; a_e <= a[30 : 23] - 127; b_e <= b[30 : 23] - 127; a_s <= a[31]; b_s <= b[31]; state <= special_cases; end special_cases: begin //if a is NaN or b is NaN return NaN if ((a_e == 128 && a_m != 0) || (b_e == 128 && b_m != 0)) begin z[31] <= 1; z[30:23] <= 255; z[22] <= 1; z[21:0] <= 0; state <= put_z; //if a is inf and b is inf return NaN end else if ((a_e == 128) && (b_e == 128)) begin z[31] <= 1; z[30:23] <= 255; z[22] <= 1; z[21:0] <= 0; state <= put_z; //if a is inf return inf end else if (a_e == 128) begin z[31] <= a_s ^ b_s; z[30:23] <= 255; z[22:0] <= 0; state <= put_z; //if b is zero return NaN if ($signed(b_e == -127) && (b_m == 0)) begin z[31] <= 1; z[30:23] <= 255; z[22] <= 1; z[21:0] <= 0; state <= put_z; end //if b is inf return zero end else if (b_e == 128) begin z[31] <= a_s ^ b_s; z[30:23] <= 0; z[22:0] <= 0; state <= put_z; //if a is zero return zero end else if (($signed(a_e) == -127) && (a_m == 0)) begin z[31] <= a_s ^ b_s; z[30:23] <= 0; z[22:0] <= 0; state <= put_z; //if b is zero return NaN if (($signed(b_e) == -127) && (b_m == 0)) begin z[31] <= 1; z[30:23] <= 255; z[22] <= 1; z[21:0] <= 0; state <= put_z; end //if b is zero return inf end else if (($signed(b_e) == -127) && (b_m == 0)) begin z[31] <= a_s ^ b_s; z[30:23] <= 255; z[22:0] <= 0; state <= put_z; end else begin //Denormalised Number if ($signed(a_e) == -127) begin a_e <= -126; end else begin a_m[23] <= 1; end //Denormalised Number if ($signed(b_e) == -127) begin b_e <= -126; end else begin b_m[23] <= 1; end state <= normalise_a; end end normalise_a: begin if (a_m[23]) begin state <= normalise_b; end else begin a_m <= a_m << 1; a_e <= a_e - 1; end end normalise_b: begin if (b_m[23]) begin state <= divide_0; end else begin b_m <= b_m << 1; b_e <= b_e - 1; end end divide_0: begin z_s <= a_s ^ b_s; z_e <= a_e - b_e; quotient <= 0; remainder <= 0; count <= 0; dividend <= a_m << 27; divisor <= b_m; state <= divide_1; end divide_1: begin quotient <= quotient << 1; remainder <= remainder << 1; remainder[0] <= dividend[50]; dividend <= dividend << 1; state <= divide_2; end divide_2: begin if (remainder >= divisor) begin quotient[0] <= 1; remainder <= remainder - divisor; end if (count == 49) begin state <= divide_3; end else begin count <= count + 1; state <= divide_1; end end divide_3: begin z_m <= quotient[26:3]; guard <= quotient[2]; round_bit <= quotient[1]; sticky <= quotient[0] | (remainder != 0); state <= normalise_1; end normalise_1: begin if (z_m[23] == 0 && $signed(z_e) > -126) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= guard; guard <= round_bit; round_bit <= 0; end else begin state <= normalise_2; end end normalise_2: begin if ($signed(z_e) < -126) begin z_e <= z_e + 1; z_m <= z_m >> 1; guard <= z_m[0]; round_bit <= guard; sticky <= sticky | round_bit; end else begin state <= round; end end round: begin if (guard && (round_bit | sticky | z_m[0])) begin z_m <= z_m + 1; if (z_m == 24'hffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[22 : 0] <= z_m[22:0]; z[30 : 23] <= z_e[7:0] + 127; z[31] <= z_s; if ($signed(z_e) == -126 && z_m[23] == 0) begin z[30 : 23] <= 0; end //if overflow occurs, return inf if ($signed(z_e) > 127) begin z[22 : 0] <= 0; z[30 : 23] <= 255; z[31] <= z_s; end state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_input_b_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign input_b_ack = s_input_b_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point Multiplier (Single Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 module multiplier( input_a, input_b, input_a_stb, input_b_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack, input_b_ack); input clk; input rst; input [31:0] input_a; input input_a_stb; output input_a_ack; input [31:0] input_b; input input_b_stb; output input_b_ack; output [31:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [31:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [3:0] state; parameter get_a = 4'd0, get_b = 4'd1, unpack = 4'd2, special_cases = 4'd3, normalise_a = 4'd4, normalise_b = 4'd5, multiply_0 = 4'd6, multiply_1 = 4'd7, normalise_1 = 4'd8, normalise_2 = 4'd9, round = 4'd10, pack = 4'd11, put_z = 4'd12; reg [31:0] a, b, z; reg [23:0] a_m, b_m, z_m; reg [9:0] a_e, b_e, z_e; reg a_s, b_s, z_s; reg guard, round_bit, sticky; reg [49:0] product; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= get_b; end end get_b: begin s_input_b_ack <= 1; if (s_input_b_ack && input_b_stb) begin b <= input_b; s_input_b_ack <= 0; state <= unpack; end end unpack: begin a_m <= a[22 : 0]; b_m <= b[22 : 0]; a_e <= a[30 : 23] - 127; b_e <= b[30 : 23] - 127; a_s <= a[31]; b_s <= b[31]; state <= special_cases; end special_cases: begin //if a is NaN or b is NaN return NaN if ((a_e == 128 && a_m != 0) || (b_e == 128 && b_m != 0)) begin z[31] <= 1; z[30:23] <= 255; z[22] <= 1; z[21:0] <= 0; state <= put_z; //if a is inf return inf end else if (a_e == 128) begin z[31] <= a_s ^ b_s; z[30:23] <= 255; z[22:0] <= 0; state <= put_z; //if b is zero return NaN if ($signed(b_e == -127) && (b_m == 0)) begin z[31] <= 1; z[30:23] <= 255; z[22] <= 1; z[21:0] <= 0; state <= put_z; end //if b is inf return inf end else if (b_e == 128) begin z[31] <= a_s ^ b_s; z[30:23] <= 255; z[22:0] <= 0; state <= put_z; //if a is zero return zero end else if (($signed(a_e) == -127) && (a_m == 0)) begin z[31] <= a_s ^ b_s; z[30:23] <= 0; z[22:0] <= 0; state <= put_z; //if b is zero return zero end else if (($signed(b_e) == -127) && (b_m == 0)) begin z[31] <= a_s ^ b_s; z[30:23] <= 0; z[22:0] <= 0; state <= put_z; end else begin //Denormalised Number if ($signed(a_e) == -127) begin a_e <= -126; end else begin a_m[23] <= 1; end //Denormalised Number if ($signed(b_e) == -127) begin b_e <= -126; end else begin b_m[23] <= 1; end state <= normalise_a; end end normalise_a: begin if (a_m[23]) begin state <= normalise_b; end else begin a_m <= a_m << 1; a_e <= a_e - 1; end end normalise_b: begin if (b_m[23]) begin state <= multiply_0; end else begin b_m <= b_m << 1; b_e <= b_e - 1; end end multiply_0: begin z_s <= a_s ^ b_s; z_e <= a_e + b_e + 1; product <= a_m * b_m * 4; state <= multiply_1; end multiply_1: begin z_m <= product[49:26]; guard <= product[25]; round_bit <= product[24]; sticky <= (product[23:0] != 0); state <= normalise_1; end normalise_1: begin if (z_m[23] == 0) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= guard; guard <= round_bit; round_bit <= 0; end else begin state <= normalise_2; end end normalise_2: begin if ($signed(z_e) < -126) begin z_e <= z_e + 1; z_m <= z_m >> 1; guard <= z_m[0]; round_bit <= guard; sticky <= sticky | round_bit; end else begin state <= round; end end round: begin if (guard && (round_bit | sticky | z_m[0])) begin z_m <= z_m + 1; if (z_m == 24'hffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[22 : 0] <= z_m[22:0]; z[30 : 23] <= z_e[7:0] + 127; z[31] <= z_s; if ($signed(z_e) == -126 && z_m[23] == 0) begin z[30 : 23] <= 0; end //if overflow occurs, return inf if ($signed(z_e) > 127) begin z[22 : 0] <= 0; z[30 : 23] <= 255; z[31] <= z_s; end state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_input_b_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign input_b_ack = s_input_b_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point Divider (Double Precision) //Copyright (C) Jonathan P Dawson 2014 //2014-01-11 // module double_divider( input_a, input_b, input_a_stb, input_b_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack, input_b_ack); input clk; input rst; input [63:0] input_a; input input_a_stb; output input_a_ack; input [63:0] input_b; input input_b_stb; output input_b_ack; output [63:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [63:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [3:0] state; parameter get_a = 4'd0, get_b = 4'd1, unpack = 4'd2, special_cases = 4'd3, normalise_a = 4'd4, normalise_b = 4'd5, divide_0 = 4'd6, divide_1 = 4'd7, divide_2 = 4'd8, divide_3 = 4'd9, normalise_1 = 4'd10, normalise_2 = 4'd11, round = 4'd12, pack = 4'd13, put_z = 4'd14; reg [63:0] a, b, z; reg [52:0] a_m, b_m, z_m; reg [12:0] a_e, b_e, z_e; reg a_s, b_s, z_s; reg guard, round_bit, sticky; reg [108:0] quotient, divisor, dividend, remainder; reg [6:0] count; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= get_b; end end get_b: begin s_input_b_ack <= 1; if (s_input_b_ack && input_b_stb) begin b <= input_b; s_input_b_ack <= 0; state <= unpack; end end unpack: begin a_m <= a[51 : 0]; b_m <= b[51 : 0]; a_e <= a[62 : 52] - 1023; b_e <= b[62 : 52] - 1023; a_s <= a[63]; b_s <= b[63]; state <= special_cases; end special_cases: begin //if a is NaN or b is NaN return NaN if ((a_e == 1024 && a_m != 0) || (b_e == 1024 && b_m != 0)) begin z[63] <= 1; z[62:52] <= 2047; z[51] <= 1; z[50:0] <= 0; state <= put_z; //if a is inf and b is inf return NaN end else if ((a_e == 1024) && (b_e == 1024)) begin z[63] <= 1; z[62:52] <= 2047; z[51] <= 1; z[50:0] <= 0; state <= put_z; //if a is inf return inf end else if (a_e == 1024) begin z[63] <= a_s ^ b_s; z[62:52] <= 2047; z[51:0] <= 0; state <= put_z; //if b is zero return NaN if ($signed(b_e == -1023) && (b_m == 0)) begin z[63] <= 1; z[62:52] <= 2047; z[51] <= 1; z[50:0] <= 0; state <= put_z; end //if b is inf return zero end else if (b_e == 1024) begin z[63] <= a_s ^ b_s; z[62:52] <= 0; z[51:0] <= 0; state <= put_z; //if a is zero return zero end else if (($signed(a_e) == -1023) && (a_m == 0)) begin z[63] <= a_s ^ b_s; z[62:52] <= 0; z[51:0] <= 0; state <= put_z; //if b is zero return NaN if (($signed(b_e) == -1023) && (b_m == 0)) begin z[63] <= 1; z[62:52] <= 2047; z[51] <= 1; z[50:0] <= 0; state <= put_z; end //if b is zero return inf end else if (($signed(b_e) == -1023) && (b_m == 0)) begin z[63] <= a_s ^ b_s; z[62:52] <= 2047; z[51:0] <= 0; state <= put_z; end else begin //Denormalised Number if ($signed(a_e) == -1023) begin a_e <= -1022; end else begin a_m[52] <= 1; end //Denormalised Number if ($signed(b_e) == -1023) begin b_e <= -1022; end else begin b_m[52] <= 1; end state <= normalise_a; end end normalise_a: begin if (a_m[52]) begin state <= normalise_b; end else begin a_m <= a_m << 1; a_e <= a_e - 1; end end normalise_b: begin if (b_m[52]) begin state <= divide_0; end else begin b_m <= b_m << 1; b_e <= b_e - 1; end end divide_0: begin z_s <= a_s ^ b_s; z_e <= a_e - b_e; quotient <= 0; remainder <= 0; count <= 0; dividend <= a_m << 56; divisor <= b_m; state <= divide_1; end divide_1: begin quotient <= quotient << 1; remainder <= remainder << 1; remainder[0] <= dividend[108]; dividend <= dividend << 1; state <= divide_2; end divide_2: begin if (remainder >= divisor) begin quotient[0] <= 1; remainder <= remainder - divisor; end if (count == 107) begin state <= divide_3; end else begin count <= count + 1; state <= divide_1; end end divide_3: begin z_m <= quotient[55:3]; guard <= quotient[2]; round_bit <= quotient[1]; sticky <= quotient[0] | (remainder != 0); state <= normalise_1; end normalise_1: begin if (z_m[52] == 0 && $signed(z_e) > -1022) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= guard; guard <= round_bit; round_bit <= 0; end else begin state <= normalise_2; end end normalise_2: begin if ($signed(z_e) < -1022) begin z_e <= z_e + 1; z_m <= z_m >> 1; guard <= z_m[0]; round_bit <= guard; sticky <= sticky | round_bit; end else begin state <= round; end end round: begin if (guard && (round_bit | sticky | z_m[0])) begin z_m <= z_m + 1; if (z_m == 53'hffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[51 : 0] <= z_m[51:0]; z[62 : 52] <= z_e[10:0] + 1023; z[63] <= z_s; if ($signed(z_e) == -1022 && z_m[52] == 0) begin z[62 : 52] <= 0; end //if overflow occurs, return inf if ($signed(z_e) > 1023) begin z[51 : 0] <= 0; z[62 : 52] <= 2047; z[63] <= z_s; end state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_input_b_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign input_b_ack = s_input_b_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point Multiplier (Double Precision) //Copyright (C) Jonathan P Dawson 2014 //2014-01-10 module double_multiplier( input_a, input_b, input_a_stb, input_b_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack, input_b_ack); input clk; input rst; input [63:0] input_a; input input_a_stb; output input_a_ack; input [63:0] input_b; input input_b_stb; output input_b_ack; output [63:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [63:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [3:0] state; parameter get_a = 4'd0, get_b = 4'd1, unpack = 4'd2, special_cases = 4'd3, normalise_a = 4'd4, normalise_b = 4'd5, multiply_0 = 4'd6, multiply_1 = 4'd7, normalise_1 = 4'd8, normalise_2 = 4'd9, round = 4'd10, pack = 4'd11, put_z = 4'd12; reg [63:0] a, b, z; reg [52:0] a_m, b_m, z_m; reg [12:0] a_e, b_e, z_e; reg a_s, b_s, z_s; reg guard, round_bit, sticky; reg [107:0] product; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= get_b; end end get_b: begin s_input_b_ack <= 1; if (s_input_b_ack && input_b_stb) begin b <= input_b; s_input_b_ack <= 0; state <= unpack; end end unpack: begin a_m <= a[51 : 0]; b_m <= b[51 : 0]; a_e <= a[62 : 52] - 1023; b_e <= b[62 : 52] - 1023; a_s <= a[63]; b_s <= b[63]; state <= special_cases; end special_cases: begin //if a is NaN or b is NaN return NaN if ((a_e == 1024 && a_m != 0) || (b_e == 1024 && b_m != 0)) begin z[63] <= 1; z[62:52] <= 2047; z[51] <= 1; z[50:0] <= 0; state <= put_z; //if a is inf return inf end else if (a_e == 1024) begin z[63] <= a_s ^ b_s; z[62:52] <= 2047; z[51:0] <= 0; state <= put_z; //if b is zero return NaN if ($signed(b_e == -1023) && (b_m == 0)) begin z[63] <= 1; z[62:52] <= 2047; z[51] <= 1; z[50:0] <= 0; state <= put_z; end //if b is inf return inf end else if (b_e == 1024) begin z[63] <= a_s ^ b_s; z[62:52] <= 2047; z[51:0] <= 0; state <= put_z; //if a is zero return zero end else if (($signed(a_e) == -1023) && (a_m == 0)) begin z[63] <= a_s ^ b_s; z[62:52] <= 0; z[51:0] <= 0; state <= put_z; //if b is zero return zero end else if (($signed(b_e) == -1023) && (b_m == 0)) begin z[63] <= a_s ^ b_s; z[62:52] <= 0; z[51:0] <= 0; state <= put_z; end else begin //Denormalised Number if ($signed(a_e) == -1023) begin a_e <= -1022; end else begin a_m[52] <= 1; end //Denormalised Number if ($signed(b_e) == -1023) begin b_e <= -1022; end else begin b_m[52] <= 1; end state <= normalise_a; end end normalise_a: begin if (a_m[52]) begin state <= normalise_b; end else begin a_m <= a_m << 1; a_e <= a_e - 1; end end normalise_b: begin if (b_m[52]) begin state <= multiply_0; end else begin b_m <= b_m << 1; b_e <= b_e - 1; end end multiply_0: begin z_s <= a_s ^ b_s; z_e <= a_e + b_e + 1; product <= a_m * b_m * 4; state <= multiply_1; end multiply_1: begin z_m <= product[107:55]; guard <= product[54]; round_bit <= product[53]; sticky <= (product[52:0] != 0); state <= normalise_1; end normalise_1: begin if (z_m[52] == 0) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= guard; guard <= round_bit; round_bit <= 0; end else begin state <= normalise_2; end end normalise_2: begin if ($signed(z_e) < -1022) begin z_e <= z_e + 1; z_m <= z_m >> 1; guard <= z_m[0]; round_bit <= guard; sticky <= sticky | round_bit; end else begin state <= round; end end round: begin if (guard && (round_bit | sticky | z_m[0])) begin z_m <= z_m + 1; if (z_m == 53'hffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[51 : 0] <= z_m[51:0]; z[62 : 52] <= z_e[11:0] + 1023; z[63] <= z_s; if ($signed(z_e) == -1022 && z_m[52] == 0) begin z[62 : 52] <= 0; end //if overflow occurs, return inf if ($signed(z_e) > 1023) begin z[51 : 0] <= 0; z[62 : 52] <= 2047; z[63] <= z_s; end state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_input_b_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign input_b_ack = s_input_b_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point Adder (Double Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 module double_adder( input_a, input_b, input_a_stb, input_b_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack, input_b_ack); input clk; input rst; input [63:0] input_a; input input_a_stb; output input_a_ack; input [63:0] input_b; input input_b_stb; output input_b_ack; output [63:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [63:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [3:0] state; parameter get_a = 4'd0, get_b = 4'd1, unpack = 4'd2, special_cases = 4'd3, align = 4'd4, add_0 = 4'd5, add_1 = 4'd6, normalise_1 = 4'd7, normalise_2 = 4'd8, round = 4'd9, pack = 4'd10, put_z = 4'd11; reg [63:0] a, b, z; reg [55:0] a_m, b_m; reg [52:0] z_m; reg [12:0] a_e, b_e, z_e; reg a_s, b_s, z_s; reg guard, round_bit, sticky; reg [56:0] sum; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= get_b; end end get_b: begin s_input_b_ack <= 1; if (s_input_b_ack && input_b_stb) begin b <= input_b; s_input_b_ack <= 0; state <= unpack; end end unpack: begin a_m <= {a[51 : 0], 3'd0}; b_m <= {b[51 : 0], 3'd0}; a_e <= a[62 : 52] - 1023; b_e <= b[62 : 52] - 1023; a_s <= a[63]; b_s <= b[63]; state <= special_cases; end special_cases: begin //if a is NaN or b is NaN return NaN if ((a_e == 1024 && a_m != 0) || (b_e == 1024 && b_m != 0)) begin z[63] <= 1; z[62:52] <= 2047; z[51] <= 1; z[50:0] <= 0; state <= put_z; //if a is inf return inf end else if (a_e == 1024) begin z[63] <= a_s; z[62:52] <= 2047; z[51:0] <= 0; state <= put_z; //if b is inf return inf end else if (b_e == 1024) begin z[63] <= b_s; z[62:52] <= 2047; z[51:0] <= 0; state <= put_z; //if a is zero return b end else if ((($signed(a_e) == -1023) && (a_m == 0)) && (($signed(b_e) == -1023) && (b_m == 0))) begin z[63] <= a_s & b_s; z[62:52] <= b_e[10:0] + 1023; z[51:0] <= b_m[55:3]; state <= put_z; //if a is zero return b end else if (($signed(a_e) == -1023) && (a_m == 0)) begin z[63] <= b_s; z[62:52] <= b_e[10:0] + 1023; z[51:0] <= b_m[55:3]; state <= put_z; //if b is zero return a end else if (($signed(b_e) == -1023) && (b_m == 0)) begin z[63] <= a_s; z[62:52] <= a_e[10:0] + 1023; z[51:0] <= a_m[55:3]; state <= put_z; end else begin //Denormalised Number if ($signed(a_e) == -1023) begin a_e <= -1022; end else begin a_m[55] <= 1; end //Denormalised Number if ($signed(b_e) == -1023) begin b_e <= -1022; end else begin b_m[55] <= 1; end state <= align; end end align: begin if ($signed(a_e) > $signed(b_e)) begin b_e <= b_e + 1; b_m <= b_m >> 1; b_m[0] <= b_m[0] | b_m[1]; end else if ($signed(a_e) < $signed(b_e)) begin a_e <= a_e + 1; a_m <= a_m >> 1; a_m[0] <= a_m[0] | a_m[1]; end else begin state <= add_0; end end add_0: begin z_e <= a_e; if (a_s == b_s) begin sum <= {1'd0, a_m} + b_m; z_s <= a_s; end else begin if (a_m > b_m) begin sum <= {1'd0, a_m} - b_m; z_s <= a_s; end else begin sum <= {1'd0, b_m} - a_m; z_s <= b_s; end end state <= add_1; end add_1: begin if (sum[56]) begin z_m <= sum[56:4]; guard <= sum[3]; round_bit <= sum[2]; sticky <= sum[1] | sum[0]; z_e <= z_e + 1; end else begin z_m <= sum[55:3]; guard <= sum[2]; round_bit <= sum[1]; sticky <= sum[0]; end state <= normalise_1; end normalise_1: begin if (z_m[52] == 0 && $signed(z_e) > -1022) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= guard; guard <= round_bit; round_bit <= 0; end else begin state <= normalise_2; end end normalise_2: begin if ($signed(z_e) < -1022) begin z_e <= z_e + 1; z_m <= z_m >> 1; guard <= z_m[0]; round_bit <= guard; sticky <= sticky | round_bit; end else begin state <= round; end end round: begin if (guard && (round_bit | sticky | z_m[0])) begin z_m <= z_m + 1; if (z_m == 53'h1fffffffffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[51 : 0] <= z_m[51:0]; z[62 : 52] <= z_e[10:0] + 1023; z[63] <= z_s; if ($signed(z_e) == -1022 && z_m[52] == 0) begin z[62 : 52] <= 0; end //if overflow occurs, return inf if ($signed(z_e) > 1023) begin z[51 : 0] <= 0; z[62 : 52] <= 2047; z[63] <= z_s; end state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_input_b_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign input_b_ack = s_input_b_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //Integer to IEEE Floating Point Converter (Single Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 module int_to_float( input_a, input_a_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack); input clk; input rst; input [31:0] input_a; input input_a_stb; output input_a_ack; output [31:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [31:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [2:0] state; parameter get_a = 3'd0, convert_0 = 3'd1, convert_1 = 3'd2, convert_2 = 3'd3, round = 3'd4, pack = 3'd5, put_z = 3'd6; reg [31:0] a, z, value; reg [23:0] z_m; reg [7:0] z_r; reg [7:0] z_e; reg z_s; reg guard, round_bit, sticky; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= convert_0; end end convert_0: begin if ( a == 0 ) begin z_s <= 0; z_m <= 0; z_e <= -127; state <= pack; end else begin value <= a[31] ? -a : a; z_s <= a[31]; state <= convert_1; end end convert_1: begin z_e <= 31; z_m <= value[31:8]; z_r <= value[7:0]; state <= convert_2; end convert_2: begin if (!z_m[23]) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= z_r[7]; z_r <= z_r << 1; end else begin guard <= z_r[7]; round_bit <= z_r[6]; sticky <= z_r[5:0] != 0; state <= round; end end round: begin if (guard && (round_bit || sticky || z_m[0])) begin z_m <= z_m + 1; if (z_m == 24'hffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[22 : 0] <= z_m[22:0]; z[30 : 23] <= z_e + 127; z[31] <= z_s; state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point to Integer Converter (Single Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 module float_to_int( input_a, input_a_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack); input clk; input rst; input [31:0] input_a; input input_a_stb; output input_a_ack; output [31:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [31:0] s_output_z; reg s_input_a_ack; reg [2:0] state; parameter get_a = 3'd0, special_cases = 3'd1, unpack = 3'd2, convert = 3'd3, put_z = 3'd4; reg [31:0] a_m, a, z; reg [8:0] a_e; reg a_s; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= unpack; end end unpack: begin a_m[31:8] <= {1'b1, a[22 : 0]}; a_m[7:0] <= 0; a_e <= a[30 : 23] - 127; a_s <= a[31]; state <= special_cases; end special_cases: begin if ($signed(a_e) == -127) begin z <= 0; state <= put_z; end else if ($signed(a_e) > 31) begin z <= 32'h80000000; state <= put_z; end else begin state <= convert; end end convert: begin if ($signed(a_e) < 31 && a_m) begin a_e <= a_e + 1; a_m <= a_m >> 1; end else begin if (a_m[31]) begin z <= 32'h80000000; end else begin z <= a_s ? -a_m : a_m; end state <= put_z; end end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //Integer to IEEE Floating Point Converter (Double Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 module long_to_double( input_a, input_a_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack); input clk; input rst; input [63:0] input_a; input input_a_stb; output input_a_ack; output [63:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [63:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [2:0] state; parameter get_a = 3'd0, convert_0 = 3'd1, convert_1 = 3'd2, convert_2 = 3'd3, round = 3'd4, pack = 3'd5, put_z = 3'd6; reg [63:0] a, z, value; reg [52:0] z_m; reg [10:0] z_r; reg [10:0] z_e; reg z_s; reg guard, round_bit, sticky; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= convert_0; end end convert_0: begin if ( a == 0 ) begin z_s <= 0; z_m <= 0; z_e <= -1023; state <= pack; end else begin value <= a[63] ? -a : a; z_s <= a[63]; state <= convert_1; end end convert_1: begin z_e <= 63; z_m <= value[63:11]; z_r <= value[10:0]; state <= convert_2; end convert_2: begin if (!z_m[52]) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= z_r[10]; z_r <= z_r << 1; end else begin guard <= z_r[10]; round_bit <= z_r[9]; sticky <= z_r[8:0] != 0; state <= round; end end round: begin if (guard && (round_bit || sticky || z_m[0])) begin z_m <= z_m + 1; if (z_m == 53'h1fffffffffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[51 : 0] <= z_m[51:0]; z[62 : 52] <= z_e + 1023; z[63] <= z_s; state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point to Integer Converter (Double Precision) //Copyright (C) Jonathan P Dawson 2014 //2014-01-11 module double_to_long( input_a, input_a_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack); input clk; input rst; input [63:0] input_a; input input_a_stb; output input_a_ack; output [63:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [63:0] s_output_z; reg s_input_a_ack; reg [2:0] state; parameter get_a = 3'd0, special_cases = 3'd1, unpack = 3'd2, convert = 3'd3, put_z = 3'd4; reg [63:0] a_m, a, z; reg [11:0] a_e; reg a_s; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= unpack; end end unpack: begin a_m[63:11] <= {1'b1, a[51 : 0]}; a_m[10:0] <= 0; a_e <= a[62 : 52] - 1023; a_s <= a[63]; state <= special_cases; end special_cases: begin if ($signed(a_e) == -1023) begin //zero z <= 0; state <= put_z; end else if ($signed(a_e) == 1024 && a[51:0] != 0) begin //nan z <= 64'h8000000000000000; state <= put_z; end else if ($signed(a_e) > 63) begin //too big if (a_s) begin z <= 64'h8000000000000000; end else begin z <= 64'h0000000000000000; end state <= put_z; end else begin state <= convert; end end convert: begin if ($signed(a_e) < 63 && a_m) begin a_e <= a_e + 1; a_m <= a_m >> 1; end else begin if (a_m[63] && a_s) begin z <= 64'h8000000000000000; end else begin z <= a_s ? -a_m : a_m; end state <= put_z; end end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //Integer to IEEE Floating Point Converter (Double Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 module float_to_double( input_a, input_a_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack); input clk; input rst; input [31:0] input_a; input input_a_stb; output input_a_ack; output [63:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [63:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [1:0] state; parameter get_a = 3'd0, convert_0 = 3'd1, normalise_0 = 3'd2, put_z = 3'd3; reg [63:0] z; reg [10:0] z_e; reg [52:0] z_m; reg [31:0] a; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= convert_0; end end convert_0: begin z[63] <= a[31]; z[62:52] <= (a[30:23] - 127) + 1023; z[51:0] <= {a[22:0], 29'd0}; if (a[30:23] == 255) begin z[62:52] <= 2047; end state <= put_z; if (a[30:23] == 0) begin if (a[23:0]) begin state <= normalise_0; z_e <= 897; z_m <= {1'd0, a[22:0], 29'd0}; end z[62:52] <= 0; end end normalise_0: begin if (z_m[52]) begin z[62:52] <= z_e; z[51:0] <= z_m[51:0]; state <= put_z; end else begin z_m <= {z_m[51:0], 1'd0}; z_e <= z_e - 1; end end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point to Integer Converter (Double Precision) //Copyright (C) Jonathan P Dawson 2014 //2014-01-11 module double_to_float( input_a, input_a_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack); input clk; input rst; input [63:0] input_a; input input_a_stb; output input_a_ack; output [31:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [31:0] s_output_z; reg s_input_a_ack; reg [1:0] state; parameter get_a = 3'd0, unpack = 3'd1, denormalise = 3'd2, put_z = 3'd3; reg [63:0] a; reg [31:0] z; reg [10:0] z_e; reg [23:0] z_m; reg guard; reg round; reg sticky; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= unpack; end end unpack: begin z[31] <= a[63]; state <= put_z; if (a[62:52] == 0) begin z[30:23] <= 0; z[22:0] <= 0; end else if (a[62:52] < 897) begin z[30:23] <= 0; z_m <= {1'd1, a[51:29]}; z_e <= a[62:52]; guard <= a[28]; round <= a[27]; sticky <= a[26:0] != 0; state <= denormalise; end else if (a[62:52] == 2047) begin z[30:23] <= 255; z[22:0] <= 0; if (a[51:0]) begin z[22] <= 1; end end else if (a[62:52] > 1150) begin z[30:23] <= 255; z[22:0] <= 0; end else begin z[30:23] <= (a[62:52] - 1023) + 127; if (a[28] && (a[27] || a[26:0])) begin z[22:0] <= a[51:29] + 1; end else begin z[22:0] <= a[51:29]; end end end denormalise: begin if (z_e == 897 || (z_m == 0 && guard == 0)) begin state <= put_z; z[22:0] <= z_m; if (guard && (round || sticky)) begin z[22:0] <= z_m + 1; end end else begin z_e <= z_e + 1; z_m <= {1'd0, z_m[23:1]}; guard <= z_m[0]; round <= guard; sticky <= sticky | round; end end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule
//IEEE Floating Point Adder (Single Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 module adder( input_a, input_b, input_a_stb, input_b_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack, input_b_ack); input clk; input rst; input [31:0] input_a; input input_a_stb; output input_a_ack; input [31:0] input_b; input input_b_stb; output input_b_ack; output [31:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [31:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [3:0] state; parameter get_a = 4'd0, get_b = 4'd1, unpack = 4'd2, special_cases = 4'd3, align = 4'd4, add_0 = 4'd5, add_1 = 4'd6, normalise_1 = 4'd7, normalise_2 = 4'd8, round = 4'd9, pack = 4'd10, put_z = 4'd11; reg [31:0] a, b, z; reg [26:0] a_m, b_m; reg [23:0] z_m; reg [9:0] a_e, b_e, z_e; reg a_s, b_s, z_s; reg guard, round_bit, sticky; reg [27:0] sum; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= get_b; end end get_b: begin s_input_b_ack <= 1; if (s_input_b_ack && input_b_stb) begin b <= input_b; s_input_b_ack <= 0; state <= unpack; end end unpack: begin a_m <= {a[22 : 0], 3'd0}; b_m <= {b[22 : 0], 3'd0}; a_e <= a[30 : 23] - 127; b_e <= b[30 : 23] - 127; a_s <= a[31]; b_s <= b[31]; state <= special_cases; end special_cases: begin //if a is NaN or b is NaN return NaN if ((a_e == 128 && a_m != 0) || (b_e == 128 && b_m != 0)) begin z[31] <= 1; z[30:23] <= 255; z[22] <= 1; z[21:0] <= 0; state <= put_z; //if a is inf return inf end else if (a_e == 128) begin z[31] <= a_s; z[30:23] <= 255; z[22:0] <= 0; state <= put_z; //if b is inf return inf end else if (b_e == 128) begin z[31] <= b_s; z[30:23] <= 255; z[22:0] <= 0; state <= put_z; //if a is zero return b end else if ((($signed(a_e) == -127) && (a_m == 0)) && (($signed(b_e) == -127) && (b_m == 0))) begin z[31] <= a_s & b_s; z[30:23] <= b_e[7:0] + 127; z[22:0] <= b_m[26:3]; state <= put_z; //if a is zero return b end else if (($signed(a_e) == -127) && (a_m == 0)) begin z[31] <= b_s; z[30:23] <= b_e[7:0] + 127; z[22:0] <= b_m[26:3]; state <= put_z; //if b is zero return a end else if (($signed(b_e) == -127) && (b_m == 0)) begin z[31] <= a_s; z[30:23] <= a_e[7:0] + 127; z[22:0] <= a_m[26:3]; state <= put_z; end else begin //Denormalised Number if ($signed(a_e) == -127) begin a_e <= -126; end else begin a_m[26] <= 1; end //Denormalised Number if ($signed(b_e) == -127) begin b_e <= -126; end else begin b_m[26] <= 1; end state <= align; end end align: begin if ($signed(a_e) > $signed(b_e)) begin b_e <= b_e + 1; b_m <= b_m >> 1; b_m[0] <= b_m[0] | b_m[1]; end else if ($signed(a_e) < $signed(b_e)) begin a_e <= a_e + 1; a_m <= a_m >> 1; a_m[0] <= a_m[0] | a_m[1]; end else begin state <= add_0; end end add_0: begin z_e <= a_e; if (a_s == b_s) begin sum <= a_m + b_m; z_s <= a_s; end else begin if (a_m >= b_m) begin sum <= a_m - b_m; z_s <= a_s; end else begin sum <= b_m - a_m; z_s <= b_s; end end state <= add_1; end add_1: begin if (sum[27]) begin z_m <= sum[27:4]; guard <= sum[3]; round_bit <= sum[2]; sticky <= sum[1] | sum[0]; z_e <= z_e + 1; end else begin z_m <= sum[26:3]; guard <= sum[2]; round_bit <= sum[1]; sticky <= sum[0]; end state <= normalise_1; end normalise_1: begin if (z_m[23] == 0 && $signed(z_e) > -126) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= guard; guard <= round_bit; round_bit <= 0; end else begin state <= normalise_2; end end normalise_2: begin if ($signed(z_e) < -126) begin z_e <= z_e + 1; z_m <= z_m >> 1; guard <= z_m[0]; round_bit <= guard; sticky <= sticky | round_bit; end else begin state <= round; end end round: begin if (guard && (round_bit | sticky | z_m[0])) begin z_m <= z_m + 1; if (z_m == 24'hffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[22 : 0] <= z_m[22:0]; z[30 : 23] <= z_e[7:0] + 127; z[31] <= z_s; if ($signed(z_e) == -126 && z_m[23] == 0) begin z[30 : 23] <= 0; end //if overflow occurs, return inf if ($signed(z_e) > 127) begin z[22 : 0] <= 0; z[30 : 23] <= 255; z[31] <= z_s; end state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_input_b_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign input_b_ack = s_input_b_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point Divider (Single Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 // module divider( input_a, input_b, input_a_stb, input_b_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack, input_b_ack); input clk; input rst; input [31:0] input_a; input input_a_stb; output input_a_ack; input [31:0] input_b; input input_b_stb; output input_b_ack; output [31:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [31:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [3:0] state; parameter get_a = 4'd0, get_b = 4'd1, unpack = 4'd2, special_cases = 4'd3, normalise_a = 4'd4, normalise_b = 4'd5, divide_0 = 4'd6, divide_1 = 4'd7, divide_2 = 4'd8, divide_3 = 4'd9, normalise_1 = 4'd10, normalise_2 = 4'd11, round = 4'd12, pack = 4'd13, put_z = 4'd14; reg [31:0] a, b, z; reg [23:0] a_m, b_m, z_m; reg [9:0] a_e, b_e, z_e; reg a_s, b_s, z_s; reg guard, round_bit, sticky; reg [50:0] quotient, divisor, dividend, remainder; reg [5:0] count; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= get_b; end end get_b: begin s_input_b_ack <= 1; if (s_input_b_ack && input_b_stb) begin b <= input_b; s_input_b_ack <= 0; state <= unpack; end end unpack: begin a_m <= a[22 : 0]; b_m <= b[22 : 0]; a_e <= a[30 : 23] - 127; b_e <= b[30 : 23] - 127; a_s <= a[31]; b_s <= b[31]; state <= special_cases; end special_cases: begin //if a is NaN or b is NaN return NaN if ((a_e == 128 && a_m != 0) || (b_e == 128 && b_m != 0)) begin z[31] <= 1; z[30:23] <= 255; z[22] <= 1; z[21:0] <= 0; state <= put_z; //if a is inf and b is inf return NaN end else if ((a_e == 128) && (b_e == 128)) begin z[31] <= 1; z[30:23] <= 255; z[22] <= 1; z[21:0] <= 0; state <= put_z; //if a is inf return inf end else if (a_e == 128) begin z[31] <= a_s ^ b_s; z[30:23] <= 255; z[22:0] <= 0; state <= put_z; //if b is zero return NaN if ($signed(b_e == -127) && (b_m == 0)) begin z[31] <= 1; z[30:23] <= 255; z[22] <= 1; z[21:0] <= 0; state <= put_z; end //if b is inf return zero end else if (b_e == 128) begin z[31] <= a_s ^ b_s; z[30:23] <= 0; z[22:0] <= 0; state <= put_z; //if a is zero return zero end else if (($signed(a_e) == -127) && (a_m == 0)) begin z[31] <= a_s ^ b_s; z[30:23] <= 0; z[22:0] <= 0; state <= put_z; //if b is zero return NaN if (($signed(b_e) == -127) && (b_m == 0)) begin z[31] <= 1; z[30:23] <= 255; z[22] <= 1; z[21:0] <= 0; state <= put_z; end //if b is zero return inf end else if (($signed(b_e) == -127) && (b_m == 0)) begin z[31] <= a_s ^ b_s; z[30:23] <= 255; z[22:0] <= 0; state <= put_z; end else begin //Denormalised Number if ($signed(a_e) == -127) begin a_e <= -126; end else begin a_m[23] <= 1; end //Denormalised Number if ($signed(b_e) == -127) begin b_e <= -126; end else begin b_m[23] <= 1; end state <= normalise_a; end end normalise_a: begin if (a_m[23]) begin state <= normalise_b; end else begin a_m <= a_m << 1; a_e <= a_e - 1; end end normalise_b: begin if (b_m[23]) begin state <= divide_0; end else begin b_m <= b_m << 1; b_e <= b_e - 1; end end divide_0: begin z_s <= a_s ^ b_s; z_e <= a_e - b_e; quotient <= 0; remainder <= 0; count <= 0; dividend <= a_m << 27; divisor <= b_m; state <= divide_1; end divide_1: begin quotient <= quotient << 1; remainder <= remainder << 1; remainder[0] <= dividend[50]; dividend <= dividend << 1; state <= divide_2; end divide_2: begin if (remainder >= divisor) begin quotient[0] <= 1; remainder <= remainder - divisor; end if (count == 49) begin state <= divide_3; end else begin count <= count + 1; state <= divide_1; end end divide_3: begin z_m <= quotient[26:3]; guard <= quotient[2]; round_bit <= quotient[1]; sticky <= quotient[0] | (remainder != 0); state <= normalise_1; end normalise_1: begin if (z_m[23] == 0 && $signed(z_e) > -126) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= guard; guard <= round_bit; round_bit <= 0; end else begin state <= normalise_2; end end normalise_2: begin if ($signed(z_e) < -126) begin z_e <= z_e + 1; z_m <= z_m >> 1; guard <= z_m[0]; round_bit <= guard; sticky <= sticky | round_bit; end else begin state <= round; end end round: begin if (guard && (round_bit | sticky | z_m[0])) begin z_m <= z_m + 1; if (z_m == 24'hffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[22 : 0] <= z_m[22:0]; z[30 : 23] <= z_e[7:0] + 127; z[31] <= z_s; if ($signed(z_e) == -126 && z_m[23] == 0) begin z[30 : 23] <= 0; end //if overflow occurs, return inf if ($signed(z_e) > 127) begin z[22 : 0] <= 0; z[30 : 23] <= 255; z[31] <= z_s; end state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_input_b_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign input_b_ack = s_input_b_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point Multiplier (Single Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 module multiplier( input_a, input_b, input_a_stb, input_b_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack, input_b_ack); input clk; input rst; input [31:0] input_a; input input_a_stb; output input_a_ack; input [31:0] input_b; input input_b_stb; output input_b_ack; output [31:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [31:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [3:0] state; parameter get_a = 4'd0, get_b = 4'd1, unpack = 4'd2, special_cases = 4'd3, normalise_a = 4'd4, normalise_b = 4'd5, multiply_0 = 4'd6, multiply_1 = 4'd7, normalise_1 = 4'd8, normalise_2 = 4'd9, round = 4'd10, pack = 4'd11, put_z = 4'd12; reg [31:0] a, b, z; reg [23:0] a_m, b_m, z_m; reg [9:0] a_e, b_e, z_e; reg a_s, b_s, z_s; reg guard, round_bit, sticky; reg [49:0] product; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= get_b; end end get_b: begin s_input_b_ack <= 1; if (s_input_b_ack && input_b_stb) begin b <= input_b; s_input_b_ack <= 0; state <= unpack; end end unpack: begin a_m <= a[22 : 0]; b_m <= b[22 : 0]; a_e <= a[30 : 23] - 127; b_e <= b[30 : 23] - 127; a_s <= a[31]; b_s <= b[31]; state <= special_cases; end special_cases: begin //if a is NaN or b is NaN return NaN if ((a_e == 128 && a_m != 0) || (b_e == 128 && b_m != 0)) begin z[31] <= 1; z[30:23] <= 255; z[22] <= 1; z[21:0] <= 0; state <= put_z; //if a is inf return inf end else if (a_e == 128) begin z[31] <= a_s ^ b_s; z[30:23] <= 255; z[22:0] <= 0; state <= put_z; //if b is zero return NaN if ($signed(b_e == -127) && (b_m == 0)) begin z[31] <= 1; z[30:23] <= 255; z[22] <= 1; z[21:0] <= 0; state <= put_z; end //if b is inf return inf end else if (b_e == 128) begin z[31] <= a_s ^ b_s; z[30:23] <= 255; z[22:0] <= 0; state <= put_z; //if a is zero return zero end else if (($signed(a_e) == -127) && (a_m == 0)) begin z[31] <= a_s ^ b_s; z[30:23] <= 0; z[22:0] <= 0; state <= put_z; //if b is zero return zero end else if (($signed(b_e) == -127) && (b_m == 0)) begin z[31] <= a_s ^ b_s; z[30:23] <= 0; z[22:0] <= 0; state <= put_z; end else begin //Denormalised Number if ($signed(a_e) == -127) begin a_e <= -126; end else begin a_m[23] <= 1; end //Denormalised Number if ($signed(b_e) == -127) begin b_e <= -126; end else begin b_m[23] <= 1; end state <= normalise_a; end end normalise_a: begin if (a_m[23]) begin state <= normalise_b; end else begin a_m <= a_m << 1; a_e <= a_e - 1; end end normalise_b: begin if (b_m[23]) begin state <= multiply_0; end else begin b_m <= b_m << 1; b_e <= b_e - 1; end end multiply_0: begin z_s <= a_s ^ b_s; z_e <= a_e + b_e + 1; product <= a_m * b_m * 4; state <= multiply_1; end multiply_1: begin z_m <= product[49:26]; guard <= product[25]; round_bit <= product[24]; sticky <= (product[23:0] != 0); state <= normalise_1; end normalise_1: begin if (z_m[23] == 0) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= guard; guard <= round_bit; round_bit <= 0; end else begin state <= normalise_2; end end normalise_2: begin if ($signed(z_e) < -126) begin z_e <= z_e + 1; z_m <= z_m >> 1; guard <= z_m[0]; round_bit <= guard; sticky <= sticky | round_bit; end else begin state <= round; end end round: begin if (guard && (round_bit | sticky | z_m[0])) begin z_m <= z_m + 1; if (z_m == 24'hffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[22 : 0] <= z_m[22:0]; z[30 : 23] <= z_e[7:0] + 127; z[31] <= z_s; if ($signed(z_e) == -126 && z_m[23] == 0) begin z[30 : 23] <= 0; end //if overflow occurs, return inf if ($signed(z_e) > 127) begin z[22 : 0] <= 0; z[30 : 23] <= 255; z[31] <= z_s; end state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_input_b_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign input_b_ack = s_input_b_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point Divider (Double Precision) //Copyright (C) Jonathan P Dawson 2014 //2014-01-11 // module double_divider( input_a, input_b, input_a_stb, input_b_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack, input_b_ack); input clk; input rst; input [63:0] input_a; input input_a_stb; output input_a_ack; input [63:0] input_b; input input_b_stb; output input_b_ack; output [63:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [63:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [3:0] state; parameter get_a = 4'd0, get_b = 4'd1, unpack = 4'd2, special_cases = 4'd3, normalise_a = 4'd4, normalise_b = 4'd5, divide_0 = 4'd6, divide_1 = 4'd7, divide_2 = 4'd8, divide_3 = 4'd9, normalise_1 = 4'd10, normalise_2 = 4'd11, round = 4'd12, pack = 4'd13, put_z = 4'd14; reg [63:0] a, b, z; reg [52:0] a_m, b_m, z_m; reg [12:0] a_e, b_e, z_e; reg a_s, b_s, z_s; reg guard, round_bit, sticky; reg [108:0] quotient, divisor, dividend, remainder; reg [6:0] count; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= get_b; end end get_b: begin s_input_b_ack <= 1; if (s_input_b_ack && input_b_stb) begin b <= input_b; s_input_b_ack <= 0; state <= unpack; end end unpack: begin a_m <= a[51 : 0]; b_m <= b[51 : 0]; a_e <= a[62 : 52] - 1023; b_e <= b[62 : 52] - 1023; a_s <= a[63]; b_s <= b[63]; state <= special_cases; end special_cases: begin //if a is NaN or b is NaN return NaN if ((a_e == 1024 && a_m != 0) || (b_e == 1024 && b_m != 0)) begin z[63] <= 1; z[62:52] <= 2047; z[51] <= 1; z[50:0] <= 0; state <= put_z; //if a is inf and b is inf return NaN end else if ((a_e == 1024) && (b_e == 1024)) begin z[63] <= 1; z[62:52] <= 2047; z[51] <= 1; z[50:0] <= 0; state <= put_z; //if a is inf return inf end else if (a_e == 1024) begin z[63] <= a_s ^ b_s; z[62:52] <= 2047; z[51:0] <= 0; state <= put_z; //if b is zero return NaN if ($signed(b_e == -1023) && (b_m == 0)) begin z[63] <= 1; z[62:52] <= 2047; z[51] <= 1; z[50:0] <= 0; state <= put_z; end //if b is inf return zero end else if (b_e == 1024) begin z[63] <= a_s ^ b_s; z[62:52] <= 0; z[51:0] <= 0; state <= put_z; //if a is zero return zero end else if (($signed(a_e) == -1023) && (a_m == 0)) begin z[63] <= a_s ^ b_s; z[62:52] <= 0; z[51:0] <= 0; state <= put_z; //if b is zero return NaN if (($signed(b_e) == -1023) && (b_m == 0)) begin z[63] <= 1; z[62:52] <= 2047; z[51] <= 1; z[50:0] <= 0; state <= put_z; end //if b is zero return inf end else if (($signed(b_e) == -1023) && (b_m == 0)) begin z[63] <= a_s ^ b_s; z[62:52] <= 2047; z[51:0] <= 0; state <= put_z; end else begin //Denormalised Number if ($signed(a_e) == -1023) begin a_e <= -1022; end else begin a_m[52] <= 1; end //Denormalised Number if ($signed(b_e) == -1023) begin b_e <= -1022; end else begin b_m[52] <= 1; end state <= normalise_a; end end normalise_a: begin if (a_m[52]) begin state <= normalise_b; end else begin a_m <= a_m << 1; a_e <= a_e - 1; end end normalise_b: begin if (b_m[52]) begin state <= divide_0; end else begin b_m <= b_m << 1; b_e <= b_e - 1; end end divide_0: begin z_s <= a_s ^ b_s; z_e <= a_e - b_e; quotient <= 0; remainder <= 0; count <= 0; dividend <= a_m << 56; divisor <= b_m; state <= divide_1; end divide_1: begin quotient <= quotient << 1; remainder <= remainder << 1; remainder[0] <= dividend[108]; dividend <= dividend << 1; state <= divide_2; end divide_2: begin if (remainder >= divisor) begin quotient[0] <= 1; remainder <= remainder - divisor; end if (count == 107) begin state <= divide_3; end else begin count <= count + 1; state <= divide_1; end end divide_3: begin z_m <= quotient[55:3]; guard <= quotient[2]; round_bit <= quotient[1]; sticky <= quotient[0] | (remainder != 0); state <= normalise_1; end normalise_1: begin if (z_m[52] == 0 && $signed(z_e) > -1022) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= guard; guard <= round_bit; round_bit <= 0; end else begin state <= normalise_2; end end normalise_2: begin if ($signed(z_e) < -1022) begin z_e <= z_e + 1; z_m <= z_m >> 1; guard <= z_m[0]; round_bit <= guard; sticky <= sticky | round_bit; end else begin state <= round; end end round: begin if (guard && (round_bit | sticky | z_m[0])) begin z_m <= z_m + 1; if (z_m == 53'hffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[51 : 0] <= z_m[51:0]; z[62 : 52] <= z_e[10:0] + 1023; z[63] <= z_s; if ($signed(z_e) == -1022 && z_m[52] == 0) begin z[62 : 52] <= 0; end //if overflow occurs, return inf if ($signed(z_e) > 1023) begin z[51 : 0] <= 0; z[62 : 52] <= 2047; z[63] <= z_s; end state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_input_b_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign input_b_ack = s_input_b_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point Multiplier (Double Precision) //Copyright (C) Jonathan P Dawson 2014 //2014-01-10 module double_multiplier( input_a, input_b, input_a_stb, input_b_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack, input_b_ack); input clk; input rst; input [63:0] input_a; input input_a_stb; output input_a_ack; input [63:0] input_b; input input_b_stb; output input_b_ack; output [63:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [63:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [3:0] state; parameter get_a = 4'd0, get_b = 4'd1, unpack = 4'd2, special_cases = 4'd3, normalise_a = 4'd4, normalise_b = 4'd5, multiply_0 = 4'd6, multiply_1 = 4'd7, normalise_1 = 4'd8, normalise_2 = 4'd9, round = 4'd10, pack = 4'd11, put_z = 4'd12; reg [63:0] a, b, z; reg [52:0] a_m, b_m, z_m; reg [12:0] a_e, b_e, z_e; reg a_s, b_s, z_s; reg guard, round_bit, sticky; reg [107:0] product; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= get_b; end end get_b: begin s_input_b_ack <= 1; if (s_input_b_ack && input_b_stb) begin b <= input_b; s_input_b_ack <= 0; state <= unpack; end end unpack: begin a_m <= a[51 : 0]; b_m <= b[51 : 0]; a_e <= a[62 : 52] - 1023; b_e <= b[62 : 52] - 1023; a_s <= a[63]; b_s <= b[63]; state <= special_cases; end special_cases: begin //if a is NaN or b is NaN return NaN if ((a_e == 1024 && a_m != 0) || (b_e == 1024 && b_m != 0)) begin z[63] <= 1; z[62:52] <= 2047; z[51] <= 1; z[50:0] <= 0; state <= put_z; //if a is inf return inf end else if (a_e == 1024) begin z[63] <= a_s ^ b_s; z[62:52] <= 2047; z[51:0] <= 0; state <= put_z; //if b is zero return NaN if ($signed(b_e == -1023) && (b_m == 0)) begin z[63] <= 1; z[62:52] <= 2047; z[51] <= 1; z[50:0] <= 0; state <= put_z; end //if b is inf return inf end else if (b_e == 1024) begin z[63] <= a_s ^ b_s; z[62:52] <= 2047; z[51:0] <= 0; state <= put_z; //if a is zero return zero end else if (($signed(a_e) == -1023) && (a_m == 0)) begin z[63] <= a_s ^ b_s; z[62:52] <= 0; z[51:0] <= 0; state <= put_z; //if b is zero return zero end else if (($signed(b_e) == -1023) && (b_m == 0)) begin z[63] <= a_s ^ b_s; z[62:52] <= 0; z[51:0] <= 0; state <= put_z; end else begin //Denormalised Number if ($signed(a_e) == -1023) begin a_e <= -1022; end else begin a_m[52] <= 1; end //Denormalised Number if ($signed(b_e) == -1023) begin b_e <= -1022; end else begin b_m[52] <= 1; end state <= normalise_a; end end normalise_a: begin if (a_m[52]) begin state <= normalise_b; end else begin a_m <= a_m << 1; a_e <= a_e - 1; end end normalise_b: begin if (b_m[52]) begin state <= multiply_0; end else begin b_m <= b_m << 1; b_e <= b_e - 1; end end multiply_0: begin z_s <= a_s ^ b_s; z_e <= a_e + b_e + 1; product <= a_m * b_m * 4; state <= multiply_1; end multiply_1: begin z_m <= product[107:55]; guard <= product[54]; round_bit <= product[53]; sticky <= (product[52:0] != 0); state <= normalise_1; end normalise_1: begin if (z_m[52] == 0) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= guard; guard <= round_bit; round_bit <= 0; end else begin state <= normalise_2; end end normalise_2: begin if ($signed(z_e) < -1022) begin z_e <= z_e + 1; z_m <= z_m >> 1; guard <= z_m[0]; round_bit <= guard; sticky <= sticky | round_bit; end else begin state <= round; end end round: begin if (guard && (round_bit | sticky | z_m[0])) begin z_m <= z_m + 1; if (z_m == 53'hffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[51 : 0] <= z_m[51:0]; z[62 : 52] <= z_e[11:0] + 1023; z[63] <= z_s; if ($signed(z_e) == -1022 && z_m[52] == 0) begin z[62 : 52] <= 0; end //if overflow occurs, return inf if ($signed(z_e) > 1023) begin z[51 : 0] <= 0; z[62 : 52] <= 2047; z[63] <= z_s; end state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_input_b_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign input_b_ack = s_input_b_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point Adder (Double Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 module double_adder( input_a, input_b, input_a_stb, input_b_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack, input_b_ack); input clk; input rst; input [63:0] input_a; input input_a_stb; output input_a_ack; input [63:0] input_b; input input_b_stb; output input_b_ack; output [63:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [63:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [3:0] state; parameter get_a = 4'd0, get_b = 4'd1, unpack = 4'd2, special_cases = 4'd3, align = 4'd4, add_0 = 4'd5, add_1 = 4'd6, normalise_1 = 4'd7, normalise_2 = 4'd8, round = 4'd9, pack = 4'd10, put_z = 4'd11; reg [63:0] a, b, z; reg [55:0] a_m, b_m; reg [52:0] z_m; reg [12:0] a_e, b_e, z_e; reg a_s, b_s, z_s; reg guard, round_bit, sticky; reg [56:0] sum; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= get_b; end end get_b: begin s_input_b_ack <= 1; if (s_input_b_ack && input_b_stb) begin b <= input_b; s_input_b_ack <= 0; state <= unpack; end end unpack: begin a_m <= {a[51 : 0], 3'd0}; b_m <= {b[51 : 0], 3'd0}; a_e <= a[62 : 52] - 1023; b_e <= b[62 : 52] - 1023; a_s <= a[63]; b_s <= b[63]; state <= special_cases; end special_cases: begin //if a is NaN or b is NaN return NaN if ((a_e == 1024 && a_m != 0) || (b_e == 1024 && b_m != 0)) begin z[63] <= 1; z[62:52] <= 2047; z[51] <= 1; z[50:0] <= 0; state <= put_z; //if a is inf return inf end else if (a_e == 1024) begin z[63] <= a_s; z[62:52] <= 2047; z[51:0] <= 0; state <= put_z; //if b is inf return inf end else if (b_e == 1024) begin z[63] <= b_s; z[62:52] <= 2047; z[51:0] <= 0; state <= put_z; //if a is zero return b end else if ((($signed(a_e) == -1023) && (a_m == 0)) && (($signed(b_e) == -1023) && (b_m == 0))) begin z[63] <= a_s & b_s; z[62:52] <= b_e[10:0] + 1023; z[51:0] <= b_m[55:3]; state <= put_z; //if a is zero return b end else if (($signed(a_e) == -1023) && (a_m == 0)) begin z[63] <= b_s; z[62:52] <= b_e[10:0] + 1023; z[51:0] <= b_m[55:3]; state <= put_z; //if b is zero return a end else if (($signed(b_e) == -1023) && (b_m == 0)) begin z[63] <= a_s; z[62:52] <= a_e[10:0] + 1023; z[51:0] <= a_m[55:3]; state <= put_z; end else begin //Denormalised Number if ($signed(a_e) == -1023) begin a_e <= -1022; end else begin a_m[55] <= 1; end //Denormalised Number if ($signed(b_e) == -1023) begin b_e <= -1022; end else begin b_m[55] <= 1; end state <= align; end end align: begin if ($signed(a_e) > $signed(b_e)) begin b_e <= b_e + 1; b_m <= b_m >> 1; b_m[0] <= b_m[0] | b_m[1]; end else if ($signed(a_e) < $signed(b_e)) begin a_e <= a_e + 1; a_m <= a_m >> 1; a_m[0] <= a_m[0] | a_m[1]; end else begin state <= add_0; end end add_0: begin z_e <= a_e; if (a_s == b_s) begin sum <= {1'd0, a_m} + b_m; z_s <= a_s; end else begin if (a_m > b_m) begin sum <= {1'd0, a_m} - b_m; z_s <= a_s; end else begin sum <= {1'd0, b_m} - a_m; z_s <= b_s; end end state <= add_1; end add_1: begin if (sum[56]) begin z_m <= sum[56:4]; guard <= sum[3]; round_bit <= sum[2]; sticky <= sum[1] | sum[0]; z_e <= z_e + 1; end else begin z_m <= sum[55:3]; guard <= sum[2]; round_bit <= sum[1]; sticky <= sum[0]; end state <= normalise_1; end normalise_1: begin if (z_m[52] == 0 && $signed(z_e) > -1022) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= guard; guard <= round_bit; round_bit <= 0; end else begin state <= normalise_2; end end normalise_2: begin if ($signed(z_e) < -1022) begin z_e <= z_e + 1; z_m <= z_m >> 1; guard <= z_m[0]; round_bit <= guard; sticky <= sticky | round_bit; end else begin state <= round; end end round: begin if (guard && (round_bit | sticky | z_m[0])) begin z_m <= z_m + 1; if (z_m == 53'h1fffffffffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[51 : 0] <= z_m[51:0]; z[62 : 52] <= z_e[10:0] + 1023; z[63] <= z_s; if ($signed(z_e) == -1022 && z_m[52] == 0) begin z[62 : 52] <= 0; end //if overflow occurs, return inf if ($signed(z_e) > 1023) begin z[51 : 0] <= 0; z[62 : 52] <= 2047; z[63] <= z_s; end state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_input_b_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign input_b_ack = s_input_b_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //Integer to IEEE Floating Point Converter (Single Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 module int_to_float( input_a, input_a_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack); input clk; input rst; input [31:0] input_a; input input_a_stb; output input_a_ack; output [31:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [31:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [2:0] state; parameter get_a = 3'd0, convert_0 = 3'd1, convert_1 = 3'd2, convert_2 = 3'd3, round = 3'd4, pack = 3'd5, put_z = 3'd6; reg [31:0] a, z, value; reg [23:0] z_m; reg [7:0] z_r; reg [7:0] z_e; reg z_s; reg guard, round_bit, sticky; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= convert_0; end end convert_0: begin if ( a == 0 ) begin z_s <= 0; z_m <= 0; z_e <= -127; state <= pack; end else begin value <= a[31] ? -a : a; z_s <= a[31]; state <= convert_1; end end convert_1: begin z_e <= 31; z_m <= value[31:8]; z_r <= value[7:0]; state <= convert_2; end convert_2: begin if (!z_m[23]) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= z_r[7]; z_r <= z_r << 1; end else begin guard <= z_r[7]; round_bit <= z_r[6]; sticky <= z_r[5:0] != 0; state <= round; end end round: begin if (guard && (round_bit || sticky || z_m[0])) begin z_m <= z_m + 1; if (z_m == 24'hffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[22 : 0] <= z_m[22:0]; z[30 : 23] <= z_e + 127; z[31] <= z_s; state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point to Integer Converter (Single Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 module float_to_int( input_a, input_a_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack); input clk; input rst; input [31:0] input_a; input input_a_stb; output input_a_ack; output [31:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [31:0] s_output_z; reg s_input_a_ack; reg [2:0] state; parameter get_a = 3'd0, special_cases = 3'd1, unpack = 3'd2, convert = 3'd3, put_z = 3'd4; reg [31:0] a_m, a, z; reg [8:0] a_e; reg a_s; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= unpack; end end unpack: begin a_m[31:8] <= {1'b1, a[22 : 0]}; a_m[7:0] <= 0; a_e <= a[30 : 23] - 127; a_s <= a[31]; state <= special_cases; end special_cases: begin if ($signed(a_e) == -127) begin z <= 0; state <= put_z; end else if ($signed(a_e) > 31) begin z <= 32'h80000000; state <= put_z; end else begin state <= convert; end end convert: begin if ($signed(a_e) < 31 && a_m) begin a_e <= a_e + 1; a_m <= a_m >> 1; end else begin if (a_m[31]) begin z <= 32'h80000000; end else begin z <= a_s ? -a_m : a_m; end state <= put_z; end end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //Integer to IEEE Floating Point Converter (Double Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 module long_to_double( input_a, input_a_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack); input clk; input rst; input [63:0] input_a; input input_a_stb; output input_a_ack; output [63:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [63:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [2:0] state; parameter get_a = 3'd0, convert_0 = 3'd1, convert_1 = 3'd2, convert_2 = 3'd3, round = 3'd4, pack = 3'd5, put_z = 3'd6; reg [63:0] a, z, value; reg [52:0] z_m; reg [10:0] z_r; reg [10:0] z_e; reg z_s; reg guard, round_bit, sticky; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= convert_0; end end convert_0: begin if ( a == 0 ) begin z_s <= 0; z_m <= 0; z_e <= -1023; state <= pack; end else begin value <= a[63] ? -a : a; z_s <= a[63]; state <= convert_1; end end convert_1: begin z_e <= 63; z_m <= value[63:11]; z_r <= value[10:0]; state <= convert_2; end convert_2: begin if (!z_m[52]) begin z_e <= z_e - 1; z_m <= z_m << 1; z_m[0] <= z_r[10]; z_r <= z_r << 1; end else begin guard <= z_r[10]; round_bit <= z_r[9]; sticky <= z_r[8:0] != 0; state <= round; end end round: begin if (guard && (round_bit || sticky || z_m[0])) begin z_m <= z_m + 1; if (z_m == 53'h1fffffffffffff) begin z_e <=z_e + 1; end end state <= pack; end pack: begin z[51 : 0] <= z_m[51:0]; z[62 : 52] <= z_e + 1023; z[63] <= z_s; state <= put_z; end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point to Integer Converter (Double Precision) //Copyright (C) Jonathan P Dawson 2014 //2014-01-11 module double_to_long( input_a, input_a_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack); input clk; input rst; input [63:0] input_a; input input_a_stb; output input_a_ack; output [63:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [63:0] s_output_z; reg s_input_a_ack; reg [2:0] state; parameter get_a = 3'd0, special_cases = 3'd1, unpack = 3'd2, convert = 3'd3, put_z = 3'd4; reg [63:0] a_m, a, z; reg [11:0] a_e; reg a_s; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= unpack; end end unpack: begin a_m[63:11] <= {1'b1, a[51 : 0]}; a_m[10:0] <= 0; a_e <= a[62 : 52] - 1023; a_s <= a[63]; state <= special_cases; end special_cases: begin if ($signed(a_e) == -1023) begin //zero z <= 0; state <= put_z; end else if ($signed(a_e) == 1024 && a[51:0] != 0) begin //nan z <= 64'h8000000000000000; state <= put_z; end else if ($signed(a_e) > 63) begin //too big if (a_s) begin z <= 64'h8000000000000000; end else begin z <= 64'h0000000000000000; end state <= put_z; end else begin state <= convert; end end convert: begin if ($signed(a_e) < 63 && a_m) begin a_e <= a_e + 1; a_m <= a_m >> 1; end else begin if (a_m[63] && a_s) begin z <= 64'h8000000000000000; end else begin z <= a_s ? -a_m : a_m; end state <= put_z; end end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //Integer to IEEE Floating Point Converter (Double Precision) //Copyright (C) Jonathan P Dawson 2013 //2013-12-12 module float_to_double( input_a, input_a_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack); input clk; input rst; input [31:0] input_a; input input_a_stb; output input_a_ack; output [63:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [63:0] s_output_z; reg s_input_a_ack; reg s_input_b_ack; reg [1:0] state; parameter get_a = 3'd0, convert_0 = 3'd1, normalise_0 = 3'd2, put_z = 3'd3; reg [63:0] z; reg [10:0] z_e; reg [52:0] z_m; reg [31:0] a; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= convert_0; end end convert_0: begin z[63] <= a[31]; z[62:52] <= (a[30:23] - 127) + 1023; z[51:0] <= {a[22:0], 29'd0}; if (a[30:23] == 255) begin z[62:52] <= 2047; end state <= put_z; if (a[30:23] == 0) begin if (a[23:0]) begin state <= normalise_0; z_e <= 897; z_m <= {1'd0, a[22:0], 29'd0}; end z[62:52] <= 0; end end normalise_0: begin if (z_m[52]) begin z[62:52] <= z_e; z[51:0] <= z_m[51:0]; state <= put_z; end else begin z_m <= {z_m[51:0], 1'd0}; z_e <= z_e - 1; end end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule //IEEE Floating Point to Integer Converter (Double Precision) //Copyright (C) Jonathan P Dawson 2014 //2014-01-11 module double_to_float( input_a, input_a_stb, output_z_ack, clk, rst, output_z, output_z_stb, input_a_ack); input clk; input rst; input [63:0] input_a; input input_a_stb; output input_a_ack; output [31:0] output_z; output output_z_stb; input output_z_ack; reg s_output_z_stb; reg [31:0] s_output_z; reg s_input_a_ack; reg [1:0] state; parameter get_a = 3'd0, unpack = 3'd1, denormalise = 3'd2, put_z = 3'd3; reg [63:0] a; reg [31:0] z; reg [10:0] z_e; reg [23:0] z_m; reg guard; reg round; reg sticky; always @(posedge clk) begin case(state) get_a: begin s_input_a_ack <= 1; if (s_input_a_ack && input_a_stb) begin a <= input_a; s_input_a_ack <= 0; state <= unpack; end end unpack: begin z[31] <= a[63]; state <= put_z; if (a[62:52] == 0) begin z[30:23] <= 0; z[22:0] <= 0; end else if (a[62:52] < 897) begin z[30:23] <= 0; z_m <= {1'd1, a[51:29]}; z_e <= a[62:52]; guard <= a[28]; round <= a[27]; sticky <= a[26:0] != 0; state <= denormalise; end else if (a[62:52] == 2047) begin z[30:23] <= 255; z[22:0] <= 0; if (a[51:0]) begin z[22] <= 1; end end else if (a[62:52] > 1150) begin z[30:23] <= 255; z[22:0] <= 0; end else begin z[30:23] <= (a[62:52] - 1023) + 127; if (a[28] && (a[27] || a[26:0])) begin z[22:0] <= a[51:29] + 1; end else begin z[22:0] <= a[51:29]; end end end denormalise: begin if (z_e == 897 || (z_m == 0 && guard == 0)) begin state <= put_z; z[22:0] <= z_m; if (guard && (round || sticky)) begin z[22:0] <= z_m + 1; end end else begin z_e <= z_e + 1; z_m <= {1'd0, z_m[23:1]}; guard <= z_m[0]; round <= guard; sticky <= sticky | round; end end put_z: begin s_output_z_stb <= 1; s_output_z <= z; if (s_output_z_stb && output_z_ack) begin s_output_z_stb <= 0; state <= get_a; end end endcase if (rst == 1) begin state <= get_a; s_input_a_ack <= 0; s_output_z_stb <= 0; end end assign input_a_ack = s_input_a_ack; assign output_z_stb = s_output_z_stb; assign output_z = s_output_z; endmodule
//////////////////////////////////////////////////////////////////////////////// // Original Author: Schuyler Eldridge // Contact Point: Schuyler Eldridge ([email protected]) // sign_extender.v // Created: 5.16.2012 // Modified: 5.16.2012 // // Generic sign extension module // // Copyright (C) 2012 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/>. //////////////////////////////////////////////////////////////////////////////// `timescale 1ns/1ps module sign_extender #( parameter INPUT_WIDTH = 8, OUTPUT_WIDTH = 16 ) ( input [INPUT_WIDTH-1:0] original, output reg [OUTPUT_WIDTH-1:0] sign_extended_original ); wire [OUTPUT_WIDTH-INPUT_WIDTH-1:0] sign_extend; generate genvar i; for (i = 0; i < OUTPUT_WIDTH-INPUT_WIDTH; i = i + 1) begin : gen_sign_extend assign sign_extend[i] = (original[INPUT_WIDTH-1]) ? 1'b1 : 1'b0; end endgenerate always @ * begin sign_extended_original = {sign_extend,original}; end endmodule
//////////////////////////////////////////////////////////////////////////////// // Original Author: Schuyler Eldridge // Contact Point: Schuyler Eldridge ([email protected]) // sign_extender.v // Created: 5.16.2012 // Modified: 5.16.2012 // // Generic sign extension module // // Copyright (C) 2012 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/>. //////////////////////////////////////////////////////////////////////////////// `timescale 1ns/1ps module sign_extender #( parameter INPUT_WIDTH = 8, OUTPUT_WIDTH = 16 ) ( input [INPUT_WIDTH-1:0] original, output reg [OUTPUT_WIDTH-1:0] sign_extended_original ); wire [OUTPUT_WIDTH-INPUT_WIDTH-1:0] sign_extend; generate genvar i; for (i = 0; i < OUTPUT_WIDTH-INPUT_WIDTH; i = i + 1) begin : gen_sign_extend assign sign_extend[i] = (original[INPUT_WIDTH-1]) ? 1'b1 : 1'b0; end endgenerate always @ * begin sign_extended_original = {sign_extend,original}; end endmodule
//////////////////////////////////////////////////////////////////////////////// // Original Author: Schuyler Eldridge // Contact Point: Schuyler Eldridge ([email protected]) // sign_extender.v // Created: 5.16.2012 // Modified: 5.16.2012 // // Generic sign extension module // // Copyright (C) 2012 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/>. //////////////////////////////////////////////////////////////////////////////// `timescale 1ns/1ps module sign_extender #( parameter INPUT_WIDTH = 8, OUTPUT_WIDTH = 16 ) ( input [INPUT_WIDTH-1:0] original, output reg [OUTPUT_WIDTH-1:0] sign_extended_original ); wire [OUTPUT_WIDTH-INPUT_WIDTH-1:0] sign_extend; generate genvar i; for (i = 0; i < OUTPUT_WIDTH-INPUT_WIDTH; i = i + 1) begin : gen_sign_extend assign sign_extend[i] = (original[INPUT_WIDTH-1]) ? 1'b1 : 1'b0; end endgenerate always @ * begin sign_extended_original = {sign_extend,original}; end endmodule
//////////////////////////////////////////////////////////////////////////////// // Original Author: Schuyler Eldridge // Contact Point: Schuyler Eldridge ([email protected]) // sign_extender.v // Created: 5.16.2012 // Modified: 5.16.2012 // // Generic sign extension module // // Copyright (C) 2012 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/>. //////////////////////////////////////////////////////////////////////////////// `timescale 1ns/1ps module sign_extender #( parameter INPUT_WIDTH = 8, OUTPUT_WIDTH = 16 ) ( input [INPUT_WIDTH-1:0] original, output reg [OUTPUT_WIDTH-1:0] sign_extended_original ); wire [OUTPUT_WIDTH-INPUT_WIDTH-1:0] sign_extend; generate genvar i; for (i = 0; i < OUTPUT_WIDTH-INPUT_WIDTH; i = i + 1) begin : gen_sign_extend assign sign_extend[i] = (original[INPUT_WIDTH-1]) ? 1'b1 : 1'b0; end endgenerate always @ * begin sign_extended_original = {sign_extend,original}; end endmodule
//////////////////////////////////////////////////////////////////////////////// // Original Author: Schuyler Eldridge // Contact Point: Schuyler Eldridge ([email protected]) // sign_extender.v // Created: 5.16.2012 // Modified: 5.16.2012 // // Generic sign extension module // // Copyright (C) 2012 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/>. //////////////////////////////////////////////////////////////////////////////// `timescale 1ns/1ps module sign_extender #( parameter INPUT_WIDTH = 8, OUTPUT_WIDTH = 16 ) ( input [INPUT_WIDTH-1:0] original, output reg [OUTPUT_WIDTH-1:0] sign_extended_original ); wire [OUTPUT_WIDTH-INPUT_WIDTH-1:0] sign_extend; generate genvar i; for (i = 0; i < OUTPUT_WIDTH-INPUT_WIDTH; i = i + 1) begin : gen_sign_extend assign sign_extend[i] = (original[INPUT_WIDTH-1]) ? 1'b1 : 1'b0; end endgenerate always @ * begin sign_extended_original = {sign_extend,original}; end endmodule
//////////////////////////////////////////////////////////////////////////////// // Original Author: Schuyler Eldridge // Contact Point: Schuyler Eldridge ([email protected]) // sign_extender.v // Created: 5.16.2012 // Modified: 5.16.2012 // // Generic sign extension module // // Copyright (C) 2012 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/>. //////////////////////////////////////////////////////////////////////////////// `timescale 1ns/1ps module sign_extender #( parameter INPUT_WIDTH = 8, OUTPUT_WIDTH = 16 ) ( input [INPUT_WIDTH-1:0] original, output reg [OUTPUT_WIDTH-1:0] sign_extended_original ); wire [OUTPUT_WIDTH-INPUT_WIDTH-1:0] sign_extend; generate genvar i; for (i = 0; i < OUTPUT_WIDTH-INPUT_WIDTH; i = i + 1) begin : gen_sign_extend assign sign_extend[i] = (original[INPUT_WIDTH-1]) ? 1'b1 : 1'b0; end endgenerate always @ * begin sign_extended_original = {sign_extend,original}; end endmodule
//////////////////////////////////////////////////////////////////////////////// // Original Author: Schuyler Eldridge // Contact Point: Schuyler Eldridge ([email protected]) // sign_extender.v // Created: 5.16.2012 // Modified: 5.16.2012 // // Generic sign extension module // // Copyright (C) 2012 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/>. //////////////////////////////////////////////////////////////////////////////// `timescale 1ns/1ps module sign_extender #( parameter INPUT_WIDTH = 8, OUTPUT_WIDTH = 16 ) ( input [INPUT_WIDTH-1:0] original, output reg [OUTPUT_WIDTH-1:0] sign_extended_original ); wire [OUTPUT_WIDTH-INPUT_WIDTH-1:0] sign_extend; generate genvar i; for (i = 0; i < OUTPUT_WIDTH-INPUT_WIDTH; i = i + 1) begin : gen_sign_extend assign sign_extend[i] = (original[INPUT_WIDTH-1]) ? 1'b1 : 1'b0; end endgenerate always @ * begin sign_extended_original = {sign_extend,original}; end endmodule
`include "lo_read.v" /* pck0 - input main 24Mhz clock (PLL / 4) [7:0] adc_d - input data from A/D converter lo_is_125khz - input freq selector (1=125Khz, 0=136Khz) pwr_lo - output to coil drivers (ssp_clk / 8) adc_clk - output A/D clock signal ssp_frame - output SSS frame indicator (goes high while the 8 bits are shifted) ssp_din - output SSP data to ARM (shifts 8 bit A/D value serially to ARM MSB first) ssp_clk - output SSP clock signal 1Mhz/1.09Mhz (pck0 / 2*(11+lo_is_125khz) ) ck_1356meg - input unused ck_1356megb - input unused ssp_dout - input unused cross_hi - input unused cross_lo - input unused pwr_hi - output unused, tied low pwr_oe1 - output unused, undefined pwr_oe2 - output unused, undefined pwr_oe3 - output unused, undefined pwr_oe4 - output unused, undefined dbg - output alias for adc_clk */ module testbed_lo_read; reg pck0; reg [7:0] adc_d; reg lo_is_125khz; reg [15:0] divisor; wire pwr_lo; wire adc_clk; wire ck_1356meg; wire ck_1356megb; wire ssp_frame; wire ssp_din; wire ssp_clk; reg ssp_dout; wire pwr_hi; wire pwr_oe1; wire pwr_oe2; wire pwr_oe3; wire pwr_oe4; wire cross_lo; wire cross_hi; wire dbg; lo_read #(5,10) dut( .pck0(pck0), .ck_1356meg(ck_1356meg), .ck_1356megb(ck_1356megb), .pwr_lo(pwr_lo), .pwr_hi(pwr_hi), .pwr_oe1(pwr_oe1), .pwr_oe2(pwr_oe2), .pwr_oe3(pwr_oe3), .pwr_oe4(pwr_oe4), .adc_d(adc_d), .adc_clk(adc_clk), .ssp_frame(ssp_frame), .ssp_din(ssp_din), .ssp_dout(ssp_dout), .ssp_clk(ssp_clk), .cross_hi(cross_hi), .cross_lo(cross_lo), .dbg(dbg), .lo_is_125khz(lo_is_125khz), .divisor(divisor) ); integer idx, i, adc_val=8; // main clock always #5 pck0 = !pck0; task crank_dut; begin @(posedge adc_clk) ; adc_d = adc_val; adc_val = (adc_val *2) + 53; end endtask initial begin // init inputs pck0 = 0; adc_d = 0; ssp_dout = 0; lo_is_125khz = 1; divisor = 255; //min 16, 95=125Khz, max 255 // simulate 4 A/D cycles at 125Khz for (i = 0 ; i < 8 ; i = i + 1) begin crank_dut; end $finish; end endmodule // main
`include "lo_read.v" /* pck0 - input main 24Mhz clock (PLL / 4) [7:0] adc_d - input data from A/D converter lo_is_125khz - input freq selector (1=125Khz, 0=136Khz) pwr_lo - output to coil drivers (ssp_clk / 8) adc_clk - output A/D clock signal ssp_frame - output SSS frame indicator (goes high while the 8 bits are shifted) ssp_din - output SSP data to ARM (shifts 8 bit A/D value serially to ARM MSB first) ssp_clk - output SSP clock signal 1Mhz/1.09Mhz (pck0 / 2*(11+lo_is_125khz) ) ck_1356meg - input unused ck_1356megb - input unused ssp_dout - input unused cross_hi - input unused cross_lo - input unused pwr_hi - output unused, tied low pwr_oe1 - output unused, undefined pwr_oe2 - output unused, undefined pwr_oe3 - output unused, undefined pwr_oe4 - output unused, undefined dbg - output alias for adc_clk */ module testbed_lo_read; reg pck0; reg [7:0] adc_d; reg lo_is_125khz; reg [15:0] divisor; wire pwr_lo; wire adc_clk; wire ck_1356meg; wire ck_1356megb; wire ssp_frame; wire ssp_din; wire ssp_clk; reg ssp_dout; wire pwr_hi; wire pwr_oe1; wire pwr_oe2; wire pwr_oe3; wire pwr_oe4; wire cross_lo; wire cross_hi; wire dbg; lo_read #(5,10) dut( .pck0(pck0), .ck_1356meg(ck_1356meg), .ck_1356megb(ck_1356megb), .pwr_lo(pwr_lo), .pwr_hi(pwr_hi), .pwr_oe1(pwr_oe1), .pwr_oe2(pwr_oe2), .pwr_oe3(pwr_oe3), .pwr_oe4(pwr_oe4), .adc_d(adc_d), .adc_clk(adc_clk), .ssp_frame(ssp_frame), .ssp_din(ssp_din), .ssp_dout(ssp_dout), .ssp_clk(ssp_clk), .cross_hi(cross_hi), .cross_lo(cross_lo), .dbg(dbg), .lo_is_125khz(lo_is_125khz), .divisor(divisor) ); integer idx, i, adc_val=8; // main clock always #5 pck0 = !pck0; task crank_dut; begin @(posedge adc_clk) ; adc_d = adc_val; adc_val = (adc_val *2) + 53; end endtask initial begin // init inputs pck0 = 0; adc_d = 0; ssp_dout = 0; lo_is_125khz = 1; divisor = 255; //min 16, 95=125Khz, max 255 // simulate 4 A/D cycles at 125Khz for (i = 0 ; i < 8 ; i = i + 1) begin crank_dut; end $finish; end endmodule // main
`include "lo_read.v" /* pck0 - input main 24Mhz clock (PLL / 4) [7:0] adc_d - input data from A/D converter lo_is_125khz - input freq selector (1=125Khz, 0=136Khz) pwr_lo - output to coil drivers (ssp_clk / 8) adc_clk - output A/D clock signal ssp_frame - output SSS frame indicator (goes high while the 8 bits are shifted) ssp_din - output SSP data to ARM (shifts 8 bit A/D value serially to ARM MSB first) ssp_clk - output SSP clock signal 1Mhz/1.09Mhz (pck0 / 2*(11+lo_is_125khz) ) ck_1356meg - input unused ck_1356megb - input unused ssp_dout - input unused cross_hi - input unused cross_lo - input unused pwr_hi - output unused, tied low pwr_oe1 - output unused, undefined pwr_oe2 - output unused, undefined pwr_oe3 - output unused, undefined pwr_oe4 - output unused, undefined dbg - output alias for adc_clk */ module testbed_lo_read; reg pck0; reg [7:0] adc_d; reg lo_is_125khz; reg [15:0] divisor; wire pwr_lo; wire adc_clk; wire ck_1356meg; wire ck_1356megb; wire ssp_frame; wire ssp_din; wire ssp_clk; reg ssp_dout; wire pwr_hi; wire pwr_oe1; wire pwr_oe2; wire pwr_oe3; wire pwr_oe4; wire cross_lo; wire cross_hi; wire dbg; lo_read #(5,10) dut( .pck0(pck0), .ck_1356meg(ck_1356meg), .ck_1356megb(ck_1356megb), .pwr_lo(pwr_lo), .pwr_hi(pwr_hi), .pwr_oe1(pwr_oe1), .pwr_oe2(pwr_oe2), .pwr_oe3(pwr_oe3), .pwr_oe4(pwr_oe4), .adc_d(adc_d), .adc_clk(adc_clk), .ssp_frame(ssp_frame), .ssp_din(ssp_din), .ssp_dout(ssp_dout), .ssp_clk(ssp_clk), .cross_hi(cross_hi), .cross_lo(cross_lo), .dbg(dbg), .lo_is_125khz(lo_is_125khz), .divisor(divisor) ); integer idx, i, adc_val=8; // main clock always #5 pck0 = !pck0; task crank_dut; begin @(posedge adc_clk) ; adc_d = adc_val; adc_val = (adc_val *2) + 53; end endtask initial begin // init inputs pck0 = 0; adc_d = 0; ssp_dout = 0; lo_is_125khz = 1; divisor = 255; //min 16, 95=125Khz, max 255 // simulate 4 A/D cycles at 125Khz for (i = 0 ; i < 8 ; i = i + 1) begin crank_dut; end $finish; end endmodule // main
//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_tck ( // inputs: MonDReg, break_readreg, dbrk_hit0_latch, dbrk_hit1_latch, dbrk_hit2_latch, dbrk_hit3_latch, debugack, ir_in, jtag_state_rti, monitor_error, monitor_ready, reset_n, resetlatch, tck, tdi, tracemem_on, tracemem_trcdata, tracemem_tw, trc_im_addr, trc_on, trc_wrap, trigbrktype, trigger_state_1, vs_cdr, vs_sdr, vs_uir, // outputs: ir_out, jrst_n, sr, st_ready_test_idle, tdo ) ; output [ 1: 0] ir_out; output jrst_n; output [ 37: 0] sr; output st_ready_test_idle; output tdo; input [ 31: 0] MonDReg; input [ 31: 0] break_readreg; input dbrk_hit0_latch; input dbrk_hit1_latch; input dbrk_hit2_latch; input dbrk_hit3_latch; input debugack; input [ 1: 0] ir_in; input jtag_state_rti; input monitor_error; input monitor_ready; input reset_n; input resetlatch; input tck; input tdi; 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; input vs_cdr; input vs_sdr; input vs_uir; reg [ 2: 0] DRsize /* synthesis ALTERA_ATTRIBUTE = "SUPPRESS_DA_RULE_INTERNAL=\"D101,D103,R101\"" */; wire debugack_sync; reg [ 1: 0] ir_out; wire jrst_n; wire monitor_ready_sync; reg [ 37: 0] sr /* synthesis ALTERA_ATTRIBUTE = "SUPPRESS_DA_RULE_INTERNAL=\"D101,D103,R101\"" */; wire st_ready_test_idle; wire tdo; wire unxcomplemented_resetxx1; wire unxcomplemented_resetxx2; always @(posedge tck) begin if (vs_cdr) case (ir_in) 2'b00: begin sr[35] <= debugack_sync; sr[34] <= monitor_error; sr[33] <= resetlatch; sr[32 : 1] <= MonDReg; sr[0] <= monitor_ready_sync; end // 2'b00 2'b01: begin sr[35 : 0] <= tracemem_trcdata; sr[37] <= tracemem_tw; sr[36] <= tracemem_on; end // 2'b01 2'b10: begin sr[37] <= trigger_state_1; sr[36] <= dbrk_hit3_latch; sr[35] <= dbrk_hit2_latch; sr[34] <= dbrk_hit1_latch; sr[33] <= dbrk_hit0_latch; sr[32 : 1] <= break_readreg; sr[0] <= trigbrktype; end // 2'b10 2'b11: begin sr[15 : 2] <= trc_im_addr; sr[1] <= trc_wrap; sr[0] <= trc_on; end // 2'b11 endcase // ir_in if (vs_sdr) case (DRsize) 3'b000: begin sr <= {tdi, sr[37 : 2], tdi}; end // 3'b000 3'b001: begin sr <= {tdi, sr[37 : 9], tdi, sr[7 : 1]}; end // 3'b001 3'b010: begin sr <= {tdi, sr[37 : 17], tdi, sr[15 : 1]}; end // 3'b010 3'b011: begin sr <= {tdi, sr[37 : 33], tdi, sr[31 : 1]}; end // 3'b011 3'b100: begin sr <= {tdi, sr[37], tdi, sr[35 : 1]}; end // 3'b100 3'b101: begin sr <= {tdi, sr[37 : 1]}; end // 3'b101 default: begin sr <= {tdi, sr[37 : 2], tdi}; end // default endcase // DRsize if (vs_uir) case (ir_in) 2'b00: begin DRsize <= 3'b100; end // 2'b00 2'b01: begin DRsize <= 3'b101; end // 2'b01 2'b10: begin DRsize <= 3'b101; end // 2'b10 2'b11: begin DRsize <= 3'b010; end // 2'b11 endcase // ir_in end assign tdo = sr[0]; assign st_ready_test_idle = jtag_state_rti; assign unxcomplemented_resetxx1 = jrst_n; altera_std_synchronizer the_altera_std_synchronizer1 ( .clk (tck), .din (debugack), .dout (debugack_sync), .reset_n (unxcomplemented_resetxx1) ); defparam the_altera_std_synchronizer1.depth = 2; assign unxcomplemented_resetxx2 = jrst_n; altera_std_synchronizer the_altera_std_synchronizer2 ( .clk (tck), .din (monitor_ready), .dout (monitor_ready_sync), .reset_n (unxcomplemented_resetxx2) ); defparam the_altera_std_synchronizer2.depth = 2; always @(posedge tck or negedge jrst_n) begin if (jrst_n == 0) ir_out <= 2'b0; else ir_out <= {debugack_sync, monitor_ready_sync}; end //synthesis translate_off //////////////// SIMULATION-ONLY CONTENTS assign jrst_n = reset_n; //////////////// END SIMULATION-ONLY CONTENTS //synthesis translate_on //synthesis read_comments_as_HDL on // assign jrst_n = 1; //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 Response Channel for ATC // // // Verilog-standard: Verilog 2001 //-------------------------------------------------------------------------- // // Structure: // b_atc // //-------------------------------------------------------------------------- `timescale 1ps/1ps module processing_system7_v5_5_b_atc # ( parameter C_FAMILY = "rtl", // FPGA Family. Current version: virtex6, spartan6 or later. parameter integer C_AXI_ID_WIDTH = 4, // Width of all ID signals on SI and MI side of checker. // Range: >= 1. parameter integer C_AXI_BUSER_WIDTH = 1, // Width of AWUSER signals. // Range: >= 1. parameter integer C_FIFO_DEPTH_LOG = 4 ) ( // Global Signals input wire ARESET, input wire ACLK, // Command Interface input wire cmd_b_push, input wire cmd_b_error, input wire [C_AXI_ID_WIDTH-1:0] cmd_b_id, output wire cmd_b_ready, output wire [C_FIFO_DEPTH_LOG-1:0] cmd_b_addr, output reg cmd_b_full, // Slave Interface Write Response Ports output wire [C_AXI_ID_WIDTH-1:0] S_AXI_BID, output reg [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, // Trigger detection output reg ERROR_TRIGGER, output reg [C_AXI_ID_WIDTH-1:0] ERROR_TRANSACTION_ID ); ///////////////////////////////////////////////////////////////////////////// // 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; // Command FIFO settings localparam C_FIFO_WIDTH = C_AXI_ID_WIDTH + 1; localparam C_FIFO_DEPTH = 2 ** C_FIFO_DEPTH_LOG; ///////////////////////////////////////////////////////////////////////////// // Variables for generating parameter controlled instances. ///////////////////////////////////////////////////////////////////////////// integer index; ///////////////////////////////////////////////////////////////////////////// // Functions ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Internal signals ///////////////////////////////////////////////////////////////////////////// // Command Queue. reg [C_FIFO_DEPTH_LOG-1:0] addr_ptr; reg [C_FIFO_WIDTH-1:0] data_srl[C_FIFO_DEPTH-1:0]; reg cmd_b_valid; wire cmd_b_ready_i; wire inject_error; wire [C_AXI_ID_WIDTH-1:0] current_id; // Search command. wire found_match; wire use_match; wire matching_id; // Manage valid command. wire write_valid_cmd; reg [C_FIFO_DEPTH-2:0] valid_cmd; reg [C_FIFO_DEPTH-2:0] updated_valid_cmd; reg [C_FIFO_DEPTH-2:0] next_valid_cmd; reg [C_FIFO_DEPTH_LOG-1:0] search_addr_ptr; reg [C_FIFO_DEPTH_LOG-1:0] collapsed_addr_ptr; // Pipelined data reg [C_AXI_ID_WIDTH-1:0] M_AXI_BID_I; reg [2-1:0] M_AXI_BRESP_I; reg [C_AXI_BUSER_WIDTH-1:0] M_AXI_BUSER_I; reg M_AXI_BVALID_I; wire M_AXI_BREADY_I; ///////////////////////////////////////////////////////////////////////////// // Command Queue: // // Keep track of depth of Queue to generate full flag. // // Also generate valid to mark pressence of commands in Queue. // // Maintain Queue and extract data from currently searched entry. // ///////////////////////////////////////////////////////////////////////////// // SRL FIFO Pointer. always @ (posedge ACLK) begin if (ARESET) begin addr_ptr <= {C_FIFO_DEPTH_LOG{1'b1}}; end else begin if ( cmd_b_push & ~cmd_b_ready_i ) begin // Pushing data increase length/addr. addr_ptr <= addr_ptr + 1; end else if ( cmd_b_ready_i ) begin // Collapse addr when data is popped. addr_ptr <= collapsed_addr_ptr; end end end // FIFO Flags. always @ (posedge ACLK) begin if (ARESET) begin cmd_b_full <= 1'b0; cmd_b_valid <= 1'b0; end else begin if ( cmd_b_push & ~cmd_b_ready_i ) begin cmd_b_full <= ( addr_ptr == C_FIFO_DEPTH-3 ); cmd_b_valid <= 1'b1; end else if ( ~cmd_b_push & cmd_b_ready_i ) begin cmd_b_full <= 1'b0; cmd_b_valid <= ( collapsed_addr_ptr != C_FIFO_DEPTH-1 ); end end end // Infere SRL for storage. always @ (posedge ACLK) begin if ( cmd_b_push ) begin for (index = 0; index < C_FIFO_DEPTH-1 ; index = index + 1) begin data_srl[index+1] <= data_srl[index]; end data_srl[0] <= {cmd_b_error, cmd_b_id}; end end // Get current transaction info. assign {inject_error, current_id} = data_srl[search_addr_ptr]; // Assign outputs. assign cmd_b_addr = collapsed_addr_ptr; ///////////////////////////////////////////////////////////////////////////// // Search Command Queue: // // Search for matching valid command in queue. // // A command is found when an valid entry with correct ID is found. The queue // is search from the oldest entry, i.e. from a high value. // When new commands are pushed the search address has to be updated to always // start the search from the oldest available. // ///////////////////////////////////////////////////////////////////////////// // Handle search addr. always @ (posedge ACLK) begin if (ARESET) begin search_addr_ptr <= {C_FIFO_DEPTH_LOG{1'b1}}; end else begin if ( cmd_b_ready_i ) begin // Collapse addr when data is popped. search_addr_ptr <= collapsed_addr_ptr; end else if ( M_AXI_BVALID_I & cmd_b_valid & ~found_match & ~cmd_b_push ) begin // Skip non valid command. search_addr_ptr <= search_addr_ptr - 1; end else if ( cmd_b_push ) begin search_addr_ptr <= search_addr_ptr + 1; end end end // Check if searched command is valid and match ID (for existing response on MI side). assign matching_id = ( M_AXI_BID_I == current_id ); assign found_match = valid_cmd[search_addr_ptr] & matching_id & M_AXI_BVALID_I; assign use_match = found_match & S_AXI_BREADY; ///////////////////////////////////////////////////////////////////////////// // Track Used Commands: // // Actions that affect Valid Command: // * When a new command is pushed // => Shift valid vector one step // * When a command is used // => Clear corresponding valid bit // ///////////////////////////////////////////////////////////////////////////// // Valid command status is updated when a command is used or a new one is pushed. assign write_valid_cmd = cmd_b_push | cmd_b_ready_i; // Update the used command valid bit. always @ * begin updated_valid_cmd = valid_cmd; updated_valid_cmd[search_addr_ptr] = ~use_match; end // Shift valid vector when command is pushed. always @ * begin if ( cmd_b_push ) begin next_valid_cmd = {updated_valid_cmd[C_FIFO_DEPTH-3:0], 1'b1}; end else begin next_valid_cmd = updated_valid_cmd; end end // Valid signals for next cycle. always @ (posedge ACLK) begin if (ARESET) begin valid_cmd <= {C_FIFO_WIDTH{1'b0}}; end else if ( write_valid_cmd ) begin valid_cmd <= next_valid_cmd; end end // Detect oldest available command in Queue. always @ * begin // Default to empty. collapsed_addr_ptr = {C_FIFO_DEPTH_LOG{1'b1}}; for (index = 0; index < C_FIFO_DEPTH-2 ; index = index + 1) begin if ( next_valid_cmd[index] ) begin collapsed_addr_ptr = index; end end end ///////////////////////////////////////////////////////////////////////////// // Pipe incoming data: // // The B channel is piped to improve timing and avoid impact in search // mechanism due to late arriving signals. // ///////////////////////////////////////////////////////////////////////////// // Clock data. always @ (posedge ACLK) begin if (ARESET) begin M_AXI_BID_I <= {C_AXI_ID_WIDTH{1'b0}}; M_AXI_BRESP_I <= 2'b00; M_AXI_BUSER_I <= {C_AXI_BUSER_WIDTH{1'b0}}; M_AXI_BVALID_I <= 1'b0; end else begin if ( M_AXI_BREADY_I | ~M_AXI_BVALID_I ) begin M_AXI_BVALID_I <= 1'b0; end if (M_AXI_BVALID & ( M_AXI_BREADY_I | ~M_AXI_BVALID_I) ) begin M_AXI_BID_I <= M_AXI_BID; M_AXI_BRESP_I <= M_AXI_BRESP; M_AXI_BUSER_I <= M_AXI_BUSER; M_AXI_BVALID_I <= 1'b1; end end end // Generate ready to get new transaction. assign M_AXI_BREADY = M_AXI_BREADY_I | ~M_AXI_BVALID_I; ///////////////////////////////////////////////////////////////////////////// // Inject Error: // // BRESP is modified according to command information. // ///////////////////////////////////////////////////////////////////////////// // Inject error in response. always @ * begin if ( inject_error ) begin S_AXI_BRESP = C_RESP_SLVERROR; end else begin S_AXI_BRESP = M_AXI_BRESP_I; end end // Handle interrupt generation. always @ (posedge ACLK) begin if (ARESET) begin ERROR_TRIGGER <= 1'b0; ERROR_TRANSACTION_ID <= {C_AXI_ID_WIDTH{1'b0}}; end else begin if ( inject_error & cmd_b_ready_i ) begin ERROR_TRIGGER <= 1'b1; ERROR_TRANSACTION_ID <= M_AXI_BID_I; end else begin ERROR_TRIGGER <= 1'b0; end end end ///////////////////////////////////////////////////////////////////////////// // Transaction Throttling: // // Response is passed forward when a matching entry has been found in queue. // Both ready and valid are set when the command is completed. // ///////////////////////////////////////////////////////////////////////////// // Propagate masked valid. assign S_AXI_BVALID = M_AXI_BVALID_I & cmd_b_valid & found_match; // Return ready with push back. assign M_AXI_BREADY_I = cmd_b_valid & use_match; // Command has been handled. assign cmd_b_ready_i = M_AXI_BVALID_I & cmd_b_valid & use_match; assign cmd_b_ready = cmd_b_ready_i; ///////////////////////////////////////////////////////////////////////////// // Write Response Propagation: // // All information is simply forwarded on from MI- to SI-Side untouched. // ///////////////////////////////////////////////////////////////////////////// // 1:1 mapping. assign S_AXI_BID = M_AXI_BID_I; assign S_AXI_BUSER = M_AXI_BUSER_I; 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 Response Channel for ATC // // // Verilog-standard: Verilog 2001 //-------------------------------------------------------------------------- // // Structure: // b_atc // //-------------------------------------------------------------------------- `timescale 1ps/1ps module processing_system7_v5_5_b_atc # ( parameter C_FAMILY = "rtl", // FPGA Family. Current version: virtex6, spartan6 or later. parameter integer C_AXI_ID_WIDTH = 4, // Width of all ID signals on SI and MI side of checker. // Range: >= 1. parameter integer C_AXI_BUSER_WIDTH = 1, // Width of AWUSER signals. // Range: >= 1. parameter integer C_FIFO_DEPTH_LOG = 4 ) ( // Global Signals input wire ARESET, input wire ACLK, // Command Interface input wire cmd_b_push, input wire cmd_b_error, input wire [C_AXI_ID_WIDTH-1:0] cmd_b_id, output wire cmd_b_ready, output wire [C_FIFO_DEPTH_LOG-1:0] cmd_b_addr, output reg cmd_b_full, // Slave Interface Write Response Ports output wire [C_AXI_ID_WIDTH-1:0] S_AXI_BID, output reg [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, // Trigger detection output reg ERROR_TRIGGER, output reg [C_AXI_ID_WIDTH-1:0] ERROR_TRANSACTION_ID ); ///////////////////////////////////////////////////////////////////////////// // 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; // Command FIFO settings localparam C_FIFO_WIDTH = C_AXI_ID_WIDTH + 1; localparam C_FIFO_DEPTH = 2 ** C_FIFO_DEPTH_LOG; ///////////////////////////////////////////////////////////////////////////// // Variables for generating parameter controlled instances. ///////////////////////////////////////////////////////////////////////////// integer index; ///////////////////////////////////////////////////////////////////////////// // Functions ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Internal signals ///////////////////////////////////////////////////////////////////////////// // Command Queue. reg [C_FIFO_DEPTH_LOG-1:0] addr_ptr; reg [C_FIFO_WIDTH-1:0] data_srl[C_FIFO_DEPTH-1:0]; reg cmd_b_valid; wire cmd_b_ready_i; wire inject_error; wire [C_AXI_ID_WIDTH-1:0] current_id; // Search command. wire found_match; wire use_match; wire matching_id; // Manage valid command. wire write_valid_cmd; reg [C_FIFO_DEPTH-2:0] valid_cmd; reg [C_FIFO_DEPTH-2:0] updated_valid_cmd; reg [C_FIFO_DEPTH-2:0] next_valid_cmd; reg [C_FIFO_DEPTH_LOG-1:0] search_addr_ptr; reg [C_FIFO_DEPTH_LOG-1:0] collapsed_addr_ptr; // Pipelined data reg [C_AXI_ID_WIDTH-1:0] M_AXI_BID_I; reg [2-1:0] M_AXI_BRESP_I; reg [C_AXI_BUSER_WIDTH-1:0] M_AXI_BUSER_I; reg M_AXI_BVALID_I; wire M_AXI_BREADY_I; ///////////////////////////////////////////////////////////////////////////// // Command Queue: // // Keep track of depth of Queue to generate full flag. // // Also generate valid to mark pressence of commands in Queue. // // Maintain Queue and extract data from currently searched entry. // ///////////////////////////////////////////////////////////////////////////// // SRL FIFO Pointer. always @ (posedge ACLK) begin if (ARESET) begin addr_ptr <= {C_FIFO_DEPTH_LOG{1'b1}}; end else begin if ( cmd_b_push & ~cmd_b_ready_i ) begin // Pushing data increase length/addr. addr_ptr <= addr_ptr + 1; end else if ( cmd_b_ready_i ) begin // Collapse addr when data is popped. addr_ptr <= collapsed_addr_ptr; end end end // FIFO Flags. always @ (posedge ACLK) begin if (ARESET) begin cmd_b_full <= 1'b0; cmd_b_valid <= 1'b0; end else begin if ( cmd_b_push & ~cmd_b_ready_i ) begin cmd_b_full <= ( addr_ptr == C_FIFO_DEPTH-3 ); cmd_b_valid <= 1'b1; end else if ( ~cmd_b_push & cmd_b_ready_i ) begin cmd_b_full <= 1'b0; cmd_b_valid <= ( collapsed_addr_ptr != C_FIFO_DEPTH-1 ); end end end // Infere SRL for storage. always @ (posedge ACLK) begin if ( cmd_b_push ) begin for (index = 0; index < C_FIFO_DEPTH-1 ; index = index + 1) begin data_srl[index+1] <= data_srl[index]; end data_srl[0] <= {cmd_b_error, cmd_b_id}; end end // Get current transaction info. assign {inject_error, current_id} = data_srl[search_addr_ptr]; // Assign outputs. assign cmd_b_addr = collapsed_addr_ptr; ///////////////////////////////////////////////////////////////////////////// // Search Command Queue: // // Search for matching valid command in queue. // // A command is found when an valid entry with correct ID is found. The queue // is search from the oldest entry, i.e. from a high value. // When new commands are pushed the search address has to be updated to always // start the search from the oldest available. // ///////////////////////////////////////////////////////////////////////////// // Handle search addr. always @ (posedge ACLK) begin if (ARESET) begin search_addr_ptr <= {C_FIFO_DEPTH_LOG{1'b1}}; end else begin if ( cmd_b_ready_i ) begin // Collapse addr when data is popped. search_addr_ptr <= collapsed_addr_ptr; end else if ( M_AXI_BVALID_I & cmd_b_valid & ~found_match & ~cmd_b_push ) begin // Skip non valid command. search_addr_ptr <= search_addr_ptr - 1; end else if ( cmd_b_push ) begin search_addr_ptr <= search_addr_ptr + 1; end end end // Check if searched command is valid and match ID (for existing response on MI side). assign matching_id = ( M_AXI_BID_I == current_id ); assign found_match = valid_cmd[search_addr_ptr] & matching_id & M_AXI_BVALID_I; assign use_match = found_match & S_AXI_BREADY; ///////////////////////////////////////////////////////////////////////////// // Track Used Commands: // // Actions that affect Valid Command: // * When a new command is pushed // => Shift valid vector one step // * When a command is used // => Clear corresponding valid bit // ///////////////////////////////////////////////////////////////////////////// // Valid command status is updated when a command is used or a new one is pushed. assign write_valid_cmd = cmd_b_push | cmd_b_ready_i; // Update the used command valid bit. always @ * begin updated_valid_cmd = valid_cmd; updated_valid_cmd[search_addr_ptr] = ~use_match; end // Shift valid vector when command is pushed. always @ * begin if ( cmd_b_push ) begin next_valid_cmd = {updated_valid_cmd[C_FIFO_DEPTH-3:0], 1'b1}; end else begin next_valid_cmd = updated_valid_cmd; end end // Valid signals for next cycle. always @ (posedge ACLK) begin if (ARESET) begin valid_cmd <= {C_FIFO_WIDTH{1'b0}}; end else if ( write_valid_cmd ) begin valid_cmd <= next_valid_cmd; end end // Detect oldest available command in Queue. always @ * begin // Default to empty. collapsed_addr_ptr = {C_FIFO_DEPTH_LOG{1'b1}}; for (index = 0; index < C_FIFO_DEPTH-2 ; index = index + 1) begin if ( next_valid_cmd[index] ) begin collapsed_addr_ptr = index; end end end ///////////////////////////////////////////////////////////////////////////// // Pipe incoming data: // // The B channel is piped to improve timing and avoid impact in search // mechanism due to late arriving signals. // ///////////////////////////////////////////////////////////////////////////// // Clock data. always @ (posedge ACLK) begin if (ARESET) begin M_AXI_BID_I <= {C_AXI_ID_WIDTH{1'b0}}; M_AXI_BRESP_I <= 2'b00; M_AXI_BUSER_I <= {C_AXI_BUSER_WIDTH{1'b0}}; M_AXI_BVALID_I <= 1'b0; end else begin if ( M_AXI_BREADY_I | ~M_AXI_BVALID_I ) begin M_AXI_BVALID_I <= 1'b0; end if (M_AXI_BVALID & ( M_AXI_BREADY_I | ~M_AXI_BVALID_I) ) begin M_AXI_BID_I <= M_AXI_BID; M_AXI_BRESP_I <= M_AXI_BRESP; M_AXI_BUSER_I <= M_AXI_BUSER; M_AXI_BVALID_I <= 1'b1; end end end // Generate ready to get new transaction. assign M_AXI_BREADY = M_AXI_BREADY_I | ~M_AXI_BVALID_I; ///////////////////////////////////////////////////////////////////////////// // Inject Error: // // BRESP is modified according to command information. // ///////////////////////////////////////////////////////////////////////////// // Inject error in response. always @ * begin if ( inject_error ) begin S_AXI_BRESP = C_RESP_SLVERROR; end else begin S_AXI_BRESP = M_AXI_BRESP_I; end end // Handle interrupt generation. always @ (posedge ACLK) begin if (ARESET) begin ERROR_TRIGGER <= 1'b0; ERROR_TRANSACTION_ID <= {C_AXI_ID_WIDTH{1'b0}}; end else begin if ( inject_error & cmd_b_ready_i ) begin ERROR_TRIGGER <= 1'b1; ERROR_TRANSACTION_ID <= M_AXI_BID_I; end else begin ERROR_TRIGGER <= 1'b0; end end end ///////////////////////////////////////////////////////////////////////////// // Transaction Throttling: // // Response is passed forward when a matching entry has been found in queue. // Both ready and valid are set when the command is completed. // ///////////////////////////////////////////////////////////////////////////// // Propagate masked valid. assign S_AXI_BVALID = M_AXI_BVALID_I & cmd_b_valid & found_match; // Return ready with push back. assign M_AXI_BREADY_I = cmd_b_valid & use_match; // Command has been handled. assign cmd_b_ready_i = M_AXI_BVALID_I & cmd_b_valid & use_match; assign cmd_b_ready = cmd_b_ready_i; ///////////////////////////////////////////////////////////////////////////// // Write Response Propagation: // // All information is simply forwarded on from MI- to SI-Side untouched. // ///////////////////////////////////////////////////////////////////////////// // 1:1 mapping. assign S_AXI_BID = M_AXI_BID_I; assign S_AXI_BUSER = M_AXI_BUSER_I; 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 Response Channel for ATC // // // Verilog-standard: Verilog 2001 //-------------------------------------------------------------------------- // // Structure: // b_atc // //-------------------------------------------------------------------------- `timescale 1ps/1ps module processing_system7_v5_5_b_atc # ( parameter C_FAMILY = "rtl", // FPGA Family. Current version: virtex6, spartan6 or later. parameter integer C_AXI_ID_WIDTH = 4, // Width of all ID signals on SI and MI side of checker. // Range: >= 1. parameter integer C_AXI_BUSER_WIDTH = 1, // Width of AWUSER signals. // Range: >= 1. parameter integer C_FIFO_DEPTH_LOG = 4 ) ( // Global Signals input wire ARESET, input wire ACLK, // Command Interface input wire cmd_b_push, input wire cmd_b_error, input wire [C_AXI_ID_WIDTH-1:0] cmd_b_id, output wire cmd_b_ready, output wire [C_FIFO_DEPTH_LOG-1:0] cmd_b_addr, output reg cmd_b_full, // Slave Interface Write Response Ports output wire [C_AXI_ID_WIDTH-1:0] S_AXI_BID, output reg [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, // Trigger detection output reg ERROR_TRIGGER, output reg [C_AXI_ID_WIDTH-1:0] ERROR_TRANSACTION_ID ); ///////////////////////////////////////////////////////////////////////////// // 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; // Command FIFO settings localparam C_FIFO_WIDTH = C_AXI_ID_WIDTH + 1; localparam C_FIFO_DEPTH = 2 ** C_FIFO_DEPTH_LOG; ///////////////////////////////////////////////////////////////////////////// // Variables for generating parameter controlled instances. ///////////////////////////////////////////////////////////////////////////// integer index; ///////////////////////////////////////////////////////////////////////////// // Functions ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Internal signals ///////////////////////////////////////////////////////////////////////////// // Command Queue. reg [C_FIFO_DEPTH_LOG-1:0] addr_ptr; reg [C_FIFO_WIDTH-1:0] data_srl[C_FIFO_DEPTH-1:0]; reg cmd_b_valid; wire cmd_b_ready_i; wire inject_error; wire [C_AXI_ID_WIDTH-1:0] current_id; // Search command. wire found_match; wire use_match; wire matching_id; // Manage valid command. wire write_valid_cmd; reg [C_FIFO_DEPTH-2:0] valid_cmd; reg [C_FIFO_DEPTH-2:0] updated_valid_cmd; reg [C_FIFO_DEPTH-2:0] next_valid_cmd; reg [C_FIFO_DEPTH_LOG-1:0] search_addr_ptr; reg [C_FIFO_DEPTH_LOG-1:0] collapsed_addr_ptr; // Pipelined data reg [C_AXI_ID_WIDTH-1:0] M_AXI_BID_I; reg [2-1:0] M_AXI_BRESP_I; reg [C_AXI_BUSER_WIDTH-1:0] M_AXI_BUSER_I; reg M_AXI_BVALID_I; wire M_AXI_BREADY_I; ///////////////////////////////////////////////////////////////////////////// // Command Queue: // // Keep track of depth of Queue to generate full flag. // // Also generate valid to mark pressence of commands in Queue. // // Maintain Queue and extract data from currently searched entry. // ///////////////////////////////////////////////////////////////////////////// // SRL FIFO Pointer. always @ (posedge ACLK) begin if (ARESET) begin addr_ptr <= {C_FIFO_DEPTH_LOG{1'b1}}; end else begin if ( cmd_b_push & ~cmd_b_ready_i ) begin // Pushing data increase length/addr. addr_ptr <= addr_ptr + 1; end else if ( cmd_b_ready_i ) begin // Collapse addr when data is popped. addr_ptr <= collapsed_addr_ptr; end end end // FIFO Flags. always @ (posedge ACLK) begin if (ARESET) begin cmd_b_full <= 1'b0; cmd_b_valid <= 1'b0; end else begin if ( cmd_b_push & ~cmd_b_ready_i ) begin cmd_b_full <= ( addr_ptr == C_FIFO_DEPTH-3 ); cmd_b_valid <= 1'b1; end else if ( ~cmd_b_push & cmd_b_ready_i ) begin cmd_b_full <= 1'b0; cmd_b_valid <= ( collapsed_addr_ptr != C_FIFO_DEPTH-1 ); end end end // Infere SRL for storage. always @ (posedge ACLK) begin if ( cmd_b_push ) begin for (index = 0; index < C_FIFO_DEPTH-1 ; index = index + 1) begin data_srl[index+1] <= data_srl[index]; end data_srl[0] <= {cmd_b_error, cmd_b_id}; end end // Get current transaction info. assign {inject_error, current_id} = data_srl[search_addr_ptr]; // Assign outputs. assign cmd_b_addr = collapsed_addr_ptr; ///////////////////////////////////////////////////////////////////////////// // Search Command Queue: // // Search for matching valid command in queue. // // A command is found when an valid entry with correct ID is found. The queue // is search from the oldest entry, i.e. from a high value. // When new commands are pushed the search address has to be updated to always // start the search from the oldest available. // ///////////////////////////////////////////////////////////////////////////// // Handle search addr. always @ (posedge ACLK) begin if (ARESET) begin search_addr_ptr <= {C_FIFO_DEPTH_LOG{1'b1}}; end else begin if ( cmd_b_ready_i ) begin // Collapse addr when data is popped. search_addr_ptr <= collapsed_addr_ptr; end else if ( M_AXI_BVALID_I & cmd_b_valid & ~found_match & ~cmd_b_push ) begin // Skip non valid command. search_addr_ptr <= search_addr_ptr - 1; end else if ( cmd_b_push ) begin search_addr_ptr <= search_addr_ptr + 1; end end end // Check if searched command is valid and match ID (for existing response on MI side). assign matching_id = ( M_AXI_BID_I == current_id ); assign found_match = valid_cmd[search_addr_ptr] & matching_id & M_AXI_BVALID_I; assign use_match = found_match & S_AXI_BREADY; ///////////////////////////////////////////////////////////////////////////// // Track Used Commands: // // Actions that affect Valid Command: // * When a new command is pushed // => Shift valid vector one step // * When a command is used // => Clear corresponding valid bit // ///////////////////////////////////////////////////////////////////////////// // Valid command status is updated when a command is used or a new one is pushed. assign write_valid_cmd = cmd_b_push | cmd_b_ready_i; // Update the used command valid bit. always @ * begin updated_valid_cmd = valid_cmd; updated_valid_cmd[search_addr_ptr] = ~use_match; end // Shift valid vector when command is pushed. always @ * begin if ( cmd_b_push ) begin next_valid_cmd = {updated_valid_cmd[C_FIFO_DEPTH-3:0], 1'b1}; end else begin next_valid_cmd = updated_valid_cmd; end end // Valid signals for next cycle. always @ (posedge ACLK) begin if (ARESET) begin valid_cmd <= {C_FIFO_WIDTH{1'b0}}; end else if ( write_valid_cmd ) begin valid_cmd <= next_valid_cmd; end end // Detect oldest available command in Queue. always @ * begin // Default to empty. collapsed_addr_ptr = {C_FIFO_DEPTH_LOG{1'b1}}; for (index = 0; index < C_FIFO_DEPTH-2 ; index = index + 1) begin if ( next_valid_cmd[index] ) begin collapsed_addr_ptr = index; end end end ///////////////////////////////////////////////////////////////////////////// // Pipe incoming data: // // The B channel is piped to improve timing and avoid impact in search // mechanism due to late arriving signals. // ///////////////////////////////////////////////////////////////////////////// // Clock data. always @ (posedge ACLK) begin if (ARESET) begin M_AXI_BID_I <= {C_AXI_ID_WIDTH{1'b0}}; M_AXI_BRESP_I <= 2'b00; M_AXI_BUSER_I <= {C_AXI_BUSER_WIDTH{1'b0}}; M_AXI_BVALID_I <= 1'b0; end else begin if ( M_AXI_BREADY_I | ~M_AXI_BVALID_I ) begin M_AXI_BVALID_I <= 1'b0; end if (M_AXI_BVALID & ( M_AXI_BREADY_I | ~M_AXI_BVALID_I) ) begin M_AXI_BID_I <= M_AXI_BID; M_AXI_BRESP_I <= M_AXI_BRESP; M_AXI_BUSER_I <= M_AXI_BUSER; M_AXI_BVALID_I <= 1'b1; end end end // Generate ready to get new transaction. assign M_AXI_BREADY = M_AXI_BREADY_I | ~M_AXI_BVALID_I; ///////////////////////////////////////////////////////////////////////////// // Inject Error: // // BRESP is modified according to command information. // ///////////////////////////////////////////////////////////////////////////// // Inject error in response. always @ * begin if ( inject_error ) begin S_AXI_BRESP = C_RESP_SLVERROR; end else begin S_AXI_BRESP = M_AXI_BRESP_I; end end // Handle interrupt generation. always @ (posedge ACLK) begin if (ARESET) begin ERROR_TRIGGER <= 1'b0; ERROR_TRANSACTION_ID <= {C_AXI_ID_WIDTH{1'b0}}; end else begin if ( inject_error & cmd_b_ready_i ) begin ERROR_TRIGGER <= 1'b1; ERROR_TRANSACTION_ID <= M_AXI_BID_I; end else begin ERROR_TRIGGER <= 1'b0; end end end ///////////////////////////////////////////////////////////////////////////// // Transaction Throttling: // // Response is passed forward when a matching entry has been found in queue. // Both ready and valid are set when the command is completed. // ///////////////////////////////////////////////////////////////////////////// // Propagate masked valid. assign S_AXI_BVALID = M_AXI_BVALID_I & cmd_b_valid & found_match; // Return ready with push back. assign M_AXI_BREADY_I = cmd_b_valid & use_match; // Command has been handled. assign cmd_b_ready_i = M_AXI_BVALID_I & cmd_b_valid & use_match; assign cmd_b_ready = cmd_b_ready_i; ///////////////////////////////////////////////////////////////////////////// // Write Response Propagation: // // All information is simply forwarded on from MI- to SI-Side untouched. // ///////////////////////////////////////////////////////////////////////////// // 1:1 mapping. assign S_AXI_BID = M_AXI_BID_I; assign S_AXI_BUSER = M_AXI_BUSER_I; endmodule
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 03/17/2016 05:20:59 PM // Design Name: // Module Name: Priority_Codec_32 // Project Name: // Target Devices: // Tool Versions: // Description: // // Dependencies: // // Revision: // Revision 0.01 - File Created // Additional Comments: // ////////////////////////////////////////////////////////////////////////////////// module Priority_Codec_32( input wire [25:0] Data_Dec_i, output reg [4:0] Data_Bin_o ); always @(Data_Dec_i) begin if(~Data_Dec_i[25]) begin Data_Bin_o = 5'b00000;//0 end else if(~Data_Dec_i[24]) begin Data_Bin_o = 5'b00001;//1 end else if(~Data_Dec_i[23]) begin Data_Bin_o = 5'b00010;//2 end else if(~Data_Dec_i[22]) begin Data_Bin_o = 5'b00011;//3 end else if(~Data_Dec_i[21]) begin Data_Bin_o = 5'b00100;//4 end else if(~Data_Dec_i[20]) begin Data_Bin_o = 5'b00101;//5 end else if(~Data_Dec_i[19]) begin Data_Bin_o = 5'b00110;//6 end else if(~Data_Dec_i[18]) begin Data_Bin_o = 5'b00111;//7 end else if(~Data_Dec_i[17]) begin Data_Bin_o = 5'b01000;//8 end else if(~Data_Dec_i[16]) begin Data_Bin_o = 5'b01001;//9 end else if(~Data_Dec_i[15]) begin Data_Bin_o = 5'b01010;//10 end else if(~Data_Dec_i[14]) begin Data_Bin_o = 5'b01011;//11 end else if(~Data_Dec_i[13]) begin Data_Bin_o = 5'b01100;//12 end else if(~Data_Dec_i[12]) begin Data_Bin_o = 5'b01101;//13 end else if(~Data_Dec_i[11]) begin Data_Bin_o = 5'b01110;//14 end else if(~Data_Dec_i[10]) begin Data_Bin_o = 5'b01111;//15 end else if(~Data_Dec_i[9]) begin Data_Bin_o = 5'b10000;//16 end else if(~Data_Dec_i[8]) begin Data_Bin_o = 5'b10001;//17 end else if(~Data_Dec_i[7]) begin Data_Bin_o = 5'b10010;//18 end else if(~Data_Dec_i[6]) begin Data_Bin_o = 5'b10011;//19 end else if(~Data_Dec_i[5]) begin Data_Bin_o = 5'b10100;//20 end else if(~Data_Dec_i[4]) begin Data_Bin_o = 5'b10101;//21 end else if(~Data_Dec_i[3]) begin Data_Bin_o = 5'b10110;//22 end else if(~Data_Dec_i[2]) begin Data_Bin_o = 5'b10111;//23 end else if(~Data_Dec_i[1]) begin Data_Bin_o = 5'b11000;//24 end else if(~Data_Dec_i[0]) begin Data_Bin_o = 5'b10101;//25 end else Data_Bin_o = 5'b00000;//zero value end endmodule
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 03/17/2016 05:20:59 PM // Design Name: // Module Name: Priority_Codec_32 // Project Name: // Target Devices: // Tool Versions: // Description: // // Dependencies: // // Revision: // Revision 0.01 - File Created // Additional Comments: // ////////////////////////////////////////////////////////////////////////////////// module Priority_Codec_32( input wire [25:0] Data_Dec_i, output reg [4:0] Data_Bin_o ); always @(Data_Dec_i) begin if(~Data_Dec_i[25]) begin Data_Bin_o = 5'b00000;//0 end else if(~Data_Dec_i[24]) begin Data_Bin_o = 5'b00001;//1 end else if(~Data_Dec_i[23]) begin Data_Bin_o = 5'b00010;//2 end else if(~Data_Dec_i[22]) begin Data_Bin_o = 5'b00011;//3 end else if(~Data_Dec_i[21]) begin Data_Bin_o = 5'b00100;//4 end else if(~Data_Dec_i[20]) begin Data_Bin_o = 5'b00101;//5 end else if(~Data_Dec_i[19]) begin Data_Bin_o = 5'b00110;//6 end else if(~Data_Dec_i[18]) begin Data_Bin_o = 5'b00111;//7 end else if(~Data_Dec_i[17]) begin Data_Bin_o = 5'b01000;//8 end else if(~Data_Dec_i[16]) begin Data_Bin_o = 5'b01001;//9 end else if(~Data_Dec_i[15]) begin Data_Bin_o = 5'b01010;//10 end else if(~Data_Dec_i[14]) begin Data_Bin_o = 5'b01011;//11 end else if(~Data_Dec_i[13]) begin Data_Bin_o = 5'b01100;//12 end else if(~Data_Dec_i[12]) begin Data_Bin_o = 5'b01101;//13 end else if(~Data_Dec_i[11]) begin Data_Bin_o = 5'b01110;//14 end else if(~Data_Dec_i[10]) begin Data_Bin_o = 5'b01111;//15 end else if(~Data_Dec_i[9]) begin Data_Bin_o = 5'b10000;//16 end else if(~Data_Dec_i[8]) begin Data_Bin_o = 5'b10001;//17 end else if(~Data_Dec_i[7]) begin Data_Bin_o = 5'b10010;//18 end else if(~Data_Dec_i[6]) begin Data_Bin_o = 5'b10011;//19 end else if(~Data_Dec_i[5]) begin Data_Bin_o = 5'b10100;//20 end else if(~Data_Dec_i[4]) begin Data_Bin_o = 5'b10101;//21 end else if(~Data_Dec_i[3]) begin Data_Bin_o = 5'b10110;//22 end else if(~Data_Dec_i[2]) begin Data_Bin_o = 5'b10111;//23 end else if(~Data_Dec_i[1]) begin Data_Bin_o = 5'b11000;//24 end else if(~Data_Dec_i[0]) begin Data_Bin_o = 5'b10101;//25 end else Data_Bin_o = 5'b00000;//zero value end endmodule
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 22:40:46 12/20/2010 // Design Name: // Module Name: clk_test // Project Name: // Target Devices: // Tool versions: // Description: // // Dependencies: // // Revision: // Revision 0.01 - File Created // Additional Comments: // ////////////////////////////////////////////////////////////////////////////////// module clk_test( input clk, input sysclk, output [31:0] snes_sysclk_freq ); reg [31:0] snes_sysclk_freq_r; assign snes_sysclk_freq = snes_sysclk_freq_r; reg [31:0] sysclk_counter; reg [31:0] sysclk_value; initial snes_sysclk_freq_r = 32'hFFFFFFFF; initial sysclk_counter = 0; initial sysclk_value = 0; reg [1:0] sysclk_sreg; always @(posedge clk) sysclk_sreg <= {sysclk_sreg[0], sysclk}; wire sysclk_rising = (sysclk_sreg == 2'b01); always @(posedge clk) begin if(sysclk_counter < 96000000) begin sysclk_counter <= sysclk_counter + 1; if(sysclk_rising) sysclk_value <= sysclk_value + 1; end else begin snes_sysclk_freq_r <= sysclk_value; sysclk_counter <= 0; sysclk_value <= 0; end end endmodule
// (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. //----------------------------------------------------------------------------- // // axi 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_vector2axi # ( /////////////////////////////////////////////////////////////////////////////// // 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 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, // Slave 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, // Slave 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, // Slave Interface Read Address Ports 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, // Slave 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, // payloads input wire [C_AWPAYLOAD_WIDTH-1:0] m_awpayload, input wire [C_WPAYLOAD_WIDTH-1:0] m_wpayload, output wire [C_BPAYLOAD_WIDTH-1:0] m_bpayload, input wire [C_ARPAYLOAD_WIDTH-1:0] m_arpayload, output wire [C_RPAYLOAD_WIDTH-1:0] m_rpayload ); //////////////////////////////////////////////////////////////////////////////// // Functions //////////////////////////////////////////////////////////////////////////////// `include "axi_infrastructure_v1_1_header.vh" //////////////////////////////////////////////////////////////////////////////// // Local parameters //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // Wires/Reg declarations //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // BEGIN RTL //////////////////////////////////////////////////////////////////////////////// // AXI4, AXI4LITE, AXI3 packing assign m_axi_awaddr = m_awpayload[G_AXI_AWADDR_INDEX+:G_AXI_AWADDR_WIDTH]; assign m_axi_awprot = m_awpayload[G_AXI_AWPROT_INDEX+:G_AXI_AWPROT_WIDTH]; assign m_axi_wdata = m_wpayload[G_AXI_WDATA_INDEX+:G_AXI_WDATA_WIDTH]; assign m_axi_wstrb = m_wpayload[G_AXI_WSTRB_INDEX+:G_AXI_WSTRB_WIDTH]; assign m_bpayload[G_AXI_BRESP_INDEX+:G_AXI_BRESP_WIDTH] = m_axi_bresp; assign m_axi_araddr = m_arpayload[G_AXI_ARADDR_INDEX+:G_AXI_ARADDR_WIDTH]; assign m_axi_arprot = m_arpayload[G_AXI_ARPROT_INDEX+:G_AXI_ARPROT_WIDTH]; assign m_rpayload[G_AXI_RDATA_INDEX+:G_AXI_RDATA_WIDTH] = m_axi_rdata; assign m_rpayload[G_AXI_RRESP_INDEX+:G_AXI_RRESP_WIDTH] = m_axi_rresp; generate if (C_AXI_PROTOCOL == 0 || C_AXI_PROTOCOL == 1) begin : gen_axi4_or_axi3_packing assign m_axi_awsize = m_awpayload[G_AXI_AWSIZE_INDEX+:G_AXI_AWSIZE_WIDTH] ; assign m_axi_awburst = m_awpayload[G_AXI_AWBURST_INDEX+:G_AXI_AWBURST_WIDTH]; assign m_axi_awcache = m_awpayload[G_AXI_AWCACHE_INDEX+:G_AXI_AWCACHE_WIDTH]; assign m_axi_awlen = m_awpayload[G_AXI_AWLEN_INDEX+:G_AXI_AWLEN_WIDTH] ; assign m_axi_awlock = m_awpayload[G_AXI_AWLOCK_INDEX+:G_AXI_AWLOCK_WIDTH] ; assign m_axi_awid = m_awpayload[G_AXI_AWID_INDEX+:G_AXI_AWID_WIDTH] ; assign m_axi_awqos = m_awpayload[G_AXI_AWQOS_INDEX+:G_AXI_AWQOS_WIDTH] ; assign m_axi_wlast = m_wpayload[G_AXI_WLAST_INDEX+:G_AXI_WLAST_WIDTH] ; if (C_AXI_PROTOCOL == 1) begin : gen_axi3_wid_packing assign m_axi_wid = m_wpayload[G_AXI_WID_INDEX+:G_AXI_WID_WIDTH] ; end else begin : gen_no_axi3_wid_packing assign m_axi_wid = 1'b0; end assign m_bpayload[G_AXI_BID_INDEX+:G_AXI_BID_WIDTH] = m_axi_bid; assign m_axi_arsize = m_arpayload[G_AXI_ARSIZE_INDEX+:G_AXI_ARSIZE_WIDTH] ; assign m_axi_arburst = m_arpayload[G_AXI_ARBURST_INDEX+:G_AXI_ARBURST_WIDTH]; assign m_axi_arcache = m_arpayload[G_AXI_ARCACHE_INDEX+:G_AXI_ARCACHE_WIDTH]; assign m_axi_arlen = m_arpayload[G_AXI_ARLEN_INDEX+:G_AXI_ARLEN_WIDTH] ; assign m_axi_arlock = m_arpayload[G_AXI_ARLOCK_INDEX+:G_AXI_ARLOCK_WIDTH] ; assign m_axi_arid = m_arpayload[G_AXI_ARID_INDEX+:G_AXI_ARID_WIDTH] ; assign m_axi_arqos = m_arpayload[G_AXI_ARQOS_INDEX+:G_AXI_ARQOS_WIDTH] ; assign m_rpayload[G_AXI_RLAST_INDEX+:G_AXI_RLAST_WIDTH] = m_axi_rlast; assign m_rpayload[G_AXI_RID_INDEX+:G_AXI_RID_WIDTH] = m_axi_rid ; if (C_AXI_SUPPORTS_REGION_SIGNALS == 1 && G_AXI_AWREGION_WIDTH > 0) begin : gen_region_signals assign m_axi_awregion = m_awpayload[G_AXI_AWREGION_INDEX+:G_AXI_AWREGION_WIDTH]; assign m_axi_arregion = m_arpayload[G_AXI_ARREGION_INDEX+:G_AXI_ARREGION_WIDTH]; end else begin : gen_no_region_signals assign m_axi_awregion = 'b0; assign m_axi_arregion = 'b0; end if (C_AXI_SUPPORTS_USER_SIGNALS == 1 && C_AXI_PROTOCOL != 2) begin : gen_user_signals assign m_axi_awuser = m_awpayload[G_AXI_AWUSER_INDEX+:G_AXI_AWUSER_WIDTH]; assign m_axi_wuser = m_wpayload[G_AXI_WUSER_INDEX+:G_AXI_WUSER_WIDTH] ; assign m_bpayload[G_AXI_BUSER_INDEX+:G_AXI_BUSER_WIDTH] = m_axi_buser ; assign m_axi_aruser = m_arpayload[G_AXI_ARUSER_INDEX+:G_AXI_ARUSER_WIDTH]; assign m_rpayload[G_AXI_RUSER_INDEX+:G_AXI_RUSER_WIDTH] = m_axi_ruser ; end else begin : gen_no_user_signals assign m_axi_awuser = 'b0; assign m_axi_wuser = 'b0; assign m_axi_aruser = 'b0; end end else begin : gen_axi4lite_packing assign m_axi_awsize = (C_AXI_DATA_WIDTH == 32) ? 3'd2 : 3'd3; assign m_axi_awburst = 'b0; assign m_axi_awcache = 'b0; assign m_axi_awlen = 'b0; assign m_axi_awlock = 'b0; assign m_axi_awid = 'b0; assign m_axi_awqos = 'b0; assign m_axi_wlast = 1'b1; assign m_axi_wid = 'b0; assign m_axi_arsize = (C_AXI_DATA_WIDTH == 32) ? 3'd2 : 3'd3; assign m_axi_arburst = 'b0; assign m_axi_arcache = 'b0; assign m_axi_arlen = 'b0; assign m_axi_arlock = 'b0; assign m_axi_arid = 'b0; assign m_axi_arqos = 'b0; assign m_axi_awregion = 'b0; assign m_axi_arregion = 'b0; assign m_axi_awuser = 'b0; assign m_axi_wuser = 'b0; assign m_axi_aruser = 'b0; end endgenerate endmodule `default_nettype wire
/*! * <b>Module:</b>ahci_fsm * @file ahci_fsm.v * @date 2016-01-10 * @author Andrey Filippov * * @brief AHCI host+port0 state machine * * @copyright Copyright (c) 2016 Elphel, Inc . * * <b>License:</b> * * ahci_fsm.v 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. * * ahci_fsm.v 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 module ahci_fsm /*#( // parameter PREFETCH_ALWAYS = 0, parameter READ_REG_LATENCY = 2, // 0 if reg_rdata is available with reg_re/reg_addr, 2 with re/regen // parameter READ_CT_LATENCY = 1, // 0 if ct_rdata is available with reg_re/reg_addr, 2 with re/regen parameter ADDRESS_BITS = 10 // number of memory address bits - now fixed. Low half - RO/RW/RWC,RW1 (2-cycle write), 2-nd just RW (single-cycle) ) */ ( input hba_rst, // @posedge mclk input mclk, // for command/status input was_hba_rst, // last reset was hba reset (not counting system reset) input was_port_rst, // last reset was port reset // Writing FSM program memory input aclk, input arst, input [17:0] pgm_ad, // @aclk, address/data to program the AHCI FSM input pgm_wa, // @aclk, address strobe to program the AHCI FSM input pgm_wd, // @aclk, data strobe to program the AHCI FSM // direct communication with transposrt, link and phy layers input [1:0] phy_ready, // goes up after comreset,cominit, align, ..., showing speed output syncesc_send, // Send sync escape input syncesc_send_done, // "SYNC escape until the interface is quiescent..." output comreset_send, // Not possible yet? input cominit_got, // asynchronously jumps to P:Cominit state output set_offline, // electrically idle // input x_rdy_collision, // X_RDY/X_RDY collision on interface output send_R_OK, // Should it be originated in this layer SM? output send_R_ERR, // Other signals.... // Communication with ahci_ctrl_stat (some are not needed) // update register inputs (will write to register memory current value of the corresponding register) output pfsm_started, // H: FSM done, P: FSM started (enable sensing pcmd_st_cleared) // update register inputs (will write to register memory current value of the corresponding register) // Removing - such updates are always done when startimng new state /// input update_pending, output update_all, // =fsm_jump[0] input update_busy, // valid same cycle as update_all // output update_gis, // these following individual may be unneeded - just use universal update_all // output update_pis, // output update_ssts, // output update_serr, // output update_pcmd, // output update_pci, /// input st01_pending, // software turned PxCMD.ST from 0 to 1 - detected in the loop /// input st10_pending, // software turned PxCMD.ST from 1 to 0 - generates port reset /// output st_pending_reset,// reset both st01_pending and st10_pending // PxCMD /// output pcmd_clear_icc, // clear PxCMD.ICC field /// output pcmd_esp, // external SATA port (just forward value) /// input pcmd_cr, // command list run - current output pcmd_cr_set, // command list run set output pcmd_cr_reset, // command list run reset // output pcmd_fr, // ahci_fis_receive:get_fis_busy /// output pcmd_clear_bsy_drq, // == ahci_fis_receive:clear_bsy_drq // Command List override, not yet implemented (optional), keeping @SuppressWarnings VEditor input pcmd_clo, //RW1, causes ahci_fis_receive:clear_bsy_drq, that in turn resets this bit /// output pcmd_clear_st, // RW clear ST (start) bit Seems it is software controlled only input pcmd_st, // current value input pcmd_st_cleared,// ST bit cleared by software; //clear_bsy_drq // Interrupt inputs output sirq_TFE, // RWC: Task File Error Status output sirq_IF, // RWC: Interface Fatal Error Status (sect. 6.1.2) output sirq_INF, // RWC: Interface Non-Fatal Error Status (sect. 6.1.2) output sirq_OF, // RWC: Overflow Status output sirq_PRC, // RO: PhyRdy changed Status output sirq_PC, // RO: Port Connect Change Status output sirq_DP, // RWC: Descriptor Processed with "I" bit on output sirq_UF, // RO: Unknown FIS output sirq_SDB, // RWC: Set Device Bits Interrupt - Set Device bits FIS with 'I' bit set output sirq_DS, // RWC: DMA Setup FIS Interrupt - DMA Setup FIS received with 'I' bit set output sirq_PS, // RWC: PIO Setup FIS Interrupt - PIO Setup FIS received with 'I' bit set output sirq_DHR, // RWC: D2H Register FIS Interrupt - D2H Register FIS received with 'I' bit set // SCR1:SError (only inputs that are not available in sirq_* ones //sirq_PC, //sirq_UF // 5.3.2.3 P:NotRunning.8 - can not be implemented now, keeping @SuppressWarnings VEditor input serr_diag_X, // value of PxSERR.DIAG.X // SCR0: SStatus output ssts_ipm_dnp, // device not present or communication not established output ssts_ipm_active, // device in active state output ssts_ipm_part, // device in partial state output ssts_ipm_slumb, // device in slumber state output ssts_ipm_devsleep, // device in DevSleep state output ssts_spd_dnp, // device not present or communication not established output ssts_spd_gen1, // Gen 1 rate negotiated output ssts_spd_gen2, // Gen 2 rate negotiated output ssts_spd_gen3, // Gen 3 rate negotiated output ssts_det_ndnp, // no device detected, phy communication not established output ssts_det_dnp, // device detected, but phy communication not established output ssts_det_dp, // device detected, phy communication established output ssts_det_offline, // device detected, phy communication established input [3:0] ssts_det, // current value of PxSSTS.DET // SCR2:SControl (written by software only) /// input [3:0] sctl_ipm, // Interface power management transitions allowed /// input [3:0] sctl_spd, // Interface maximal speed input [3:0] sctl_det, // Device detection initialization requested input sctl_det_changed, // Software had written new value to sctl_det output sctl_det_reset, // clear sctl_det_changed output hba_rst_done, // reset GHC.HR and other bits output pxci0_clear, // PxCI clear input pxci0, // pxCI current value // inputs from the DMA engine /// input dma_prd_done, // output (finished next prd) output dma_prd_irq_clear, // reset pending prd_irq input dma_prd_irq_pend, // prd interrupt pending. This is just a condition for irq - actual will be generated after FIS OK input dma_cmd_busy, // output reg (DMA engine is processing PRDs) /// input dma_cmd_done, // output (last PRD is over) output dma_cmd_abort, // try to abort a command input dma_abort_done, // if abort is not needed, will generate dma_abort_done just next cycle // Communication with ahci_fis_receive (some are unused) // Debug features input fis_first_invalid, // Some data available from FIFO, but not FIS head output fis_first_flush, // Skip FIFO data until empty or FIS head input fis_first_vld, // fis_first contains valid FIS header, reset by 'get_*' input [7:0] fis_type, // FIS type (low byte in the first FIS DWORD), valid with 'fis_first_vld' input [7:0] bist_bits, // bits that define built-in self test // Receiving FIS output get_dsfis, output get_psfis, output get_rfis, output get_sdbfis, output get_ufis, output get_data_fis, output get_ignore, // ignore whatever FIS (use for DMA activate too?) // input get_fis_busy, // busy processing FIS input get_fis_done, // done processing FIS (see fis_ok, fis_err, fis_ferr) input fis_ok, // FIS done, checksum OK reset by starting a new get FIS input fis_err, // FIS done, checksum ERROR reset by starting a new get FIS input fis_ferr, // FIS done, fatal error - FIS too long input fis_extra, // more data got from FIS than DMA can accept. Does not deny fis_ok. May have latency output set_update_sig, // when set, enables get_sig (and resets itself) /// input pUpdateSig, // state variable /// input sig_available, // device signature available output update_sig, // update signature // next commands use register address/data/we for 1 clock cycle - after next to command (commnd - t0, we - t2) output update_err_sts,// update PxTFD.STS and PxTFD.ERR from the last received regs d2h output update_pio, // update PxTFD.STS and PxTFD.ERR from pio_* (entry PIO:Update) output update_prdbc, // update PRDBC in registers output clear_bsy_drq, // clear PxTFD.STS.BSY and PxTFD.STS.DRQ, update output clear_bsy_set_drq, // clear PxTFD.STS.BSY and sets PxTFD.STS.DRQ, update output set_bsy, // set PxTFD.STS.BSY, update output set_sts_7f, // set PxTFD.STS = 0x7f, update output set_sts_80, // set PxTFD.STS = 0x80 (may be combined with set_sts_7f), update output clear_xfer_cntr, // clear pXferCntr (is it needed as a separate input)? output decr_dwcr, // decrement DMA Xfer counter after read // need pulse to 'update_prdbc' to write to registers output decr_dwcw, // decrement DMA Xfer counter after write // need pulse to 'update_prdbc' to write to registers // output [11:0] decr_DXC_dw, // decrement value (in DWORDs) input pxcmd_fre, // control bit enables saving FIS to memory input pPioXfer, // state variable input [7:0] tfd_sts, // Current PxTFD status field (updated after regFIS and SDB - certain fields) // tfd_sts[7] - BSY, tfd_sts[3] - DRQ, tfd_sts[0] - ERR /// input [7:0] tfd_err, // Current PxTFD error field (updated after regFIS and SDB) input fis_i, // value of "I" field in received regsD2H or SDB FIS /// input sdb_n, // value of "N" field in received SDB FIS input dma_a, // value of "A" field in received DMA Setup FIS /// input dma_d, // value of "D" field in received DMA Setup FIS input pio_i, // value of "I" field in received PIO Setup FIS input pio_d, // value of "D" field in received PIO Setup FIS /// input [7:0] pio_es, // value of PIO E_Status /// input sactive0, // bit 0 of sActive DWORD received in SDB FIS // Using even word count (will be rounded up), partial DWORD (last) will be handled by PRD length if needed /// input [31:2] xfer_cntr, // transfer counter in words for both DMA (31 bit) and PIO (lower 15 bits), updated after decr_dwc input xfer_cntr_zero,// valid next cycle // Communication with ahci_fis_transmit // Command pulses to execute states output fetch_cmd, // Enter p:FetchCmd, fetch command header (from the register memory, prefetch command FIS) // wait for either fetch_cmd_busy == 0 or pCmdToIssue ==1 after fetch_cmd output cfis_xmit, // transmit command (wait for dma_ct_busy == 0) output dx_xmit, // send FIS header DWORD, (just 0x46), then forward DMA data // transmit until error, 2048DWords or pDmaXferCnt output atapi_xmit, // tarsmit ATAPI command FIS input xmit_done, // input xmit_busy, output clearCmdToIssue, // From CFIS:SUCCESS input pCmdToIssue, // AHCI port variable // output dmaCntrZero, // DMA counter is zero - would be a duplicate to the one in receive module and dwords_sent output // input syncesc_recv, // These two inputs interrupt transmit // input xmit_err, // input [ 2:0] dx_err, // bit 0 - syncesc_recv, 1 - R_ERR (was xmit_err), 2 - X_RDY/X_RDY collision (valid @ xmit_err and later, reset by new command) /// input [15:0] ch_prdtl, // Physical region descriptor table length (in entries, 0 is 0) input ch_c, // Clear busy upon R_OK for this FIS input ch_b, // Built-in self test command input ch_r, // reset - may need to send SYNC escape before this command input ch_p, // prefetchable - only used with non-zero PRDTL or ATAPI bit set input ch_w, // Write: system memory -> device input ch_a, // ATAPI: 1 means device should send PIO setup FIS for ATAPI command input unsolicited_en, // enable processing of cominit_got and PxERR.DIAG.W interrupts from // this bit is reset at reset, set when PxSSTS.DET==3 or PxSCTL.DET==4 output reg [ 9:0] last_jump_addr // debug feature /// input [4:0] ch_cfl, // length of the command FIS in DW, 0 means none. 0 and 1 - illegal, // maximal is 16 (0x10) /// input [11:0] dwords_sent // number of DWORDs transmitted (up to 2048) ); `include "includes/ahci_localparams.vh" // @SuppressThisWarning VEditor : Unused localparams `include "includes/fis_types.vh" // @SuppressThisWarning VEditor : Some localparams unused // Reset addresses - later use generated localparam LABEL_POR = 11'h000; localparam LABEL_HBA_RST = 11'h002; localparam LABEL_PORT_RST = 11'h004; localparam LABEL_COMINIT = 11'h006; localparam LABEL_ST_CLEARED = 11'h008; wire tfd_bsy = tfd_sts[7]; wire tfd_drq = tfd_sts[3]; wire tfd_sts_err = tfd_sts[0]; reg [ 9:0] pgm_waddr; // wire pgm_ren; // wire pgm_regen; wire cond_met_w; // calculated from signals and program conditions decoder reg [ 9:0] pgm_jump_addr; reg [ 9:0] pgm_addr; wire [17:0] pgm_data; reg was_rst; // reg jump_r; reg [2:0] fsm_jump; wire fsm_next; // reg fsm_next_r; reg fsm_actions; // processing actions reg dis_actions; // disable actions during async jump reg fsm_act_busy; reg [1:0] fsm_transitions; // processing transitions reg fsm_preload; // read first sequence data (2 cycles for regen) // wire [7:0] precond_w = pgm_data[17:10]; // select what to use - cond_met_w valis after precond_w, same time as conditions // reg [7:0] conditions; // wire pre_jump_w = (|async_pend_r) ? async_ackn : |(cond_met_w & fsm_transitions[1]); wire pre_jump_w = (|async_pend_r) ? async_ackn : (cond_met_w & fsm_transitions[1]); wire fsm_act_done_w = get_fis_done || xmit_done || (syncesc_send_pend && syncesc_send_done) || dma_abort_done || asynq_rq; // cominit_got || pcmd_st_cleared reg fsm_act_done; // made later by 1 cycle so the new conditions are latched // TODO:check is enough ? Adding 1 extra reg fsm_act_pre_done; wire fsm_wait_act_w = pgm_data[16]; // this action requires waiting for done wire fsm_last_act_w = pgm_data[17]; wire fsm_pre_act_w = !dis_actions && fsm_actions && fsm_next; // use it as CS for generated actions (registered) reg [1:0] async_pend_r; // waiting to process cominit_got reg async_from_st; // change to multi-bit if there will be more sources for async transitions // wire asynq_rq = (cominit_got && unsolicited_cominit_en) || pcmd_st_cleared; wire asynq_rq = (cominit_got && unsolicited_en) || pcmd_st_cleared; // OK to wait for some time fsm_act_busy is supposed to never hang up wire async_ackn = !fsm_preload && async_pend_r[0] && ((fsm_actions && !update_busy && !fsm_act_busy) || fsm_transitions[0]); // OK to process async jump // reg x_rdy_collision_pend; reg syncesc_send_pend; // waiting for 'syncesc_send' confiramtion 'syncesc_send_done' reg [1:0] phy_ready_prev; // previous state of phy_ready / speed reg phy_ready_chng_r; // pulse when phy_ready changes wire phy_ready_chng_w = !hba_rst && !was_rst && (phy_ready != phy_ready_prev); reg was_last_action_r; // delay last action if it was fsm_wait_act; wire fsm_transitions_w = // next will be transitions processing (fsm_last_act_w && fsm_actions && fsm_next && !fsm_wait_act_w) || (fsm_act_busy && fsm_act_done && was_last_action_r); wire conditions_ce = // copy all conditions to the register so they will not change while iterating through them !fsm_transitions_w && !fsm_transitions[0]; // reg unsolicited_cominit_en; // allow unsolicited COMINITs // wire en_cominit; // en_cominit // New variable: reg pisn32; // pIssueSlot != 32 wire clear_pisn32; // additional clear when in P:NotRunning state assign fsm_next = (fsm_preload || (fsm_actions && !update_busy && !fsm_act_busy) || fsm_transitions[0]) && !async_pend_r[0]; // quiet if received cominit is pending assign update_all = fsm_jump[0]; assign ssts_ipm_dnp = phy_ready_chng_r && (phy_ready_prev == 0); // device not present or communication not established assign ssts_ipm_active = phy_ready_chng_r && (phy_ready_prev != 0); // device in active state assign ssts_ipm_part = 0; // device in partial state assign ssts_ipm_slumb = 0; // device in slumber state assign ssts_ipm_devsleep = 0; // device in DevSleep state assign ssts_spd_dnp = phy_ready_chng_r && (phy_ready_prev == 0); // device not present or communication not established assign ssts_spd_gen1 = phy_ready_chng_r && (phy_ready_prev == 1); // Gen 1 rate negotiated assign ssts_spd_gen2 = phy_ready_chng_r && (phy_ready_prev == 2); // Gen 2 rate negotiated assign ssts_spd_gen3 = phy_ready_chng_r && (phy_ready_prev == 3); // Gen 3 rate negotiated assign ssts_det_ndnp = phy_ready_chng_r && (phy_ready_prev == 0); // no device detected, phy communication not established // assign ssts_det_dnp = 0; // device detected, but phy communication not established assign ssts_det_dp = phy_ready_chng_r && (phy_ready_prev != 0); // device detected, phy communication established assign sirq_OF = 0; // RWC: Overflow Status (buffer overrun - should not happen, add?) assign sirq_PRC = phy_ready_chng_r; // RO: PhyRdy changed Status // Writing to the FSM program memory always @ (posedge aclk) begin if (arst) pgm_waddr <= 0; else if (pgm_wa) pgm_waddr <= pgm_ad[ 9:0]; else if (pgm_wd) pgm_waddr <= pgm_waddr + 1; end always @ (posedge mclk) begin if (hba_rst || pxci0_clear || clear_pisn32) pisn32 <= 0; else if (fetch_cmd) pisn32 <= 1; end always @ (posedge mclk) begin /// if (hba_rst) unsolicited_cominit_en <= !was_port_rst; // else if (en_cominit || comreset_send) unsolicited_cominit_en <= en_cominit; if (hba_rst) pgm_jump_addr <= (was_hba_rst || was_port_rst) ? (was_hba_rst? LABEL_HBA_RST:LABEL_PORT_RST) : LABEL_POR; // else if (async_pend_r[1]) pgm_jump_addr <= async_from_st? LABEL_ST_CLEARED : LABEL_COMINIT; else if (async_pend_r[0]) pgm_jump_addr <= async_from_st? LABEL_ST_CLEARED : LABEL_COMINIT; else if (fsm_transitions[0] && (!cond_met_w || !fsm_transitions[1])) pgm_jump_addr <= pgm_data[9:0]; was_rst <= hba_rst; /// fsm_act_done <= fsm_act_done_w; // delay by 1 clock cycle fsm_act_pre_done <= fsm_act_done_w; // delay by 1 clock cycle fsm_act_done <= fsm_act_pre_done; // TODO - verify delay by 2 is needed to latch fsm_jump <= {fsm_jump[1:0], pre_jump_w | (was_rst & ~hba_rst)}; if (fsm_jump[0]) pgm_addr <= pgm_jump_addr; else if (fsm_next) pgm_addr <= pgm_addr + 1; if (fsm_jump[0]) last_jump_addr <= pgm_jump_addr; // debug feature // if (hba_rst) conditions <= 0; // if (fsm_transitions[0]) conditions <= precond_w; if (hba_rst) fsm_actions <= 0; else if (fsm_jump[2]) fsm_actions <= 1; else if (fsm_last_act_w && fsm_next) fsm_actions <= 0; if (hba_rst) dis_actions <= 0; else if (|async_pend_r) dis_actions <= 1; else if (fsm_jump[2]) dis_actions <= 0; if (fsm_actions && fsm_next) was_last_action_r <= fsm_last_act_w; //// if (hba_rst || pre_jump_w) fsm_transitions <= 0; /// 2016.12.07 jumps were not disabled after async transitions, they came from the previously executed code if (hba_rst || pre_jump_w || dis_actions) fsm_transitions <= 0; else if (fsm_transitions_w) fsm_transitions <= 1; // else if ((fsm_last_act_w && fsm_actions && fsm_next && !fsm_wait_act_w) || // (fsm_act_busy && fsm_act_done && was_last_action_r) ) fsm_transitions <= 1; else fsm_transitions <= {fsm_transitions[0],fsm_transitions[0]}; if (hba_rst) fsm_preload <= 0; else fsm_preload <= |fsm_jump[1:0]; if (hba_rst) fsm_act_busy <= 0; else if (fsm_pre_act_w) fsm_act_busy <= fsm_wait_act_w; else if (fsm_act_done) fsm_act_busy <= 0; if (hba_rst) async_from_st <= 0; else if (pcmd_st_cleared) async_from_st <= 1; else if (asynq_rq) async_from_st <= 0; if (hba_rst) async_pend_r <= 0; /// else async_pend_r <= {async_pend_r[0], asynq_rq | (async_pend_r[0] & ~async_ackn)}; else async_pend_r <= {async_pend_r[0], (asynq_rq | async_pend_r[0]) & ~async_ackn}; // if (hba_rst || pcmd_cr_set) x_rdy_collision_pend <= 0; // else if (x_rdy_collision) x_rdy_collision_pend <= 1; if (hba_rst || syncesc_send_done) syncesc_send_pend <= 0; else if (syncesc_send) syncesc_send_pend <= 1; if (was_rst && !hba_rst && !was_hba_rst && !was_port_rst) phy_ready_prev <= 0; else if (phy_ready_chng_w) phy_ready_prev <= phy_ready; phy_ready_chng_r <= phy_ready_chng_w; end ram18p_var_w_var_r #( .REGISTERS(1), .LOG2WIDTH_WR(4), .LOG2WIDTH_RD(4) `include "includes/ahxi_fsm_code.vh" ) fsm_pgm_mem_i ( .rclk (mclk), // input .raddr (pgm_addr), // input[10:0] .ren (fsm_next), // input .regen (fsm_next), // input .data_out (pgm_data), // output[17:0] .wclk (aclk), // input .waddr (pgm_waddr), // input[10:0] .we (pgm_wd), // input .web (4'hf), // input[7:0] .data_in (pgm_ad) // input[17:0] ); action_decoder action_decoder_i ( .clk (mclk), // input .enable (fsm_pre_act_w), // input .data (pgm_data[10:0]), // input[10:0] // CTRL_STAT .PXSERR_DIAG_X (sirq_PC), // output reg .SIRQ_DHR (sirq_DHR), // output reg .SIRQ_DP (sirq_DP), // output reg .SIRQ_DS (sirq_DS), // output reg .SIRQ_IF (sirq_IF), // output reg .SIRQ_INF (sirq_INF), // output reg .SIRQ_PS (sirq_PS), // output reg .SIRQ_SDB (sirq_SDB), // output reg .SIRQ_TFE (sirq_TFE), // output reg .SIRQ_UF (sirq_UF), // output reg .PFSM_STARTED (pfsm_started), // output reg .PCMD_CR_CLEAR (pcmd_cr_reset), // output reg .PCMD_CR_SET (pcmd_cr_set), // output reg .PXCI0_CLEAR (pxci0_clear), // output reg .PXSSTS_DET_1 (ssts_det_dnp), // output reg .SSTS_DET_OFFLINE (ssts_det_offline), // output reg .SCTL_DET_CLEAR (sctl_det_reset), // output reg .HBA_RST_DONE (hba_rst_done), // output reg // FIS RECEIVE .SET_UPDATE_SIG (set_update_sig), // output reg .UPDATE_SIG (update_sig), // output reg .UPDATE_ERR_STS (update_err_sts), // output reg .UPDATE_PIO (update_pio), // output reg .UPDATE_PRDBC (update_prdbc), // output reg .CLEAR_BSY_DRQ (clear_bsy_drq), // output reg .CLEAR_BSY_SET_DRQ (clear_bsy_set_drq), // output reg .SET_BSY (set_bsy), // output reg .SET_STS_7F (set_sts_7f), // output reg .SET_STS_80 (set_sts_80), // output reg .XFER_CNTR_CLEAR (clear_xfer_cntr), // output reg .DECR_DWCR (decr_dwcr), // output reg .DECR_DWCW (decr_dwcw), // output reg .FIS_FIRST_FLUSH (fis_first_flush), // output reg // FIS_TRANSMIT .CLEAR_CMD_TO_ISSUE (clearCmdToIssue), // output reg // DMA .DMA_ABORT (dma_cmd_abort), // output reg .DMA_PRD_IRQ_CLEAR (dma_prd_irq_clear), // output reg // SATA TRANSPORT/LINK/PHY .XMIT_COMRESET (comreset_send), // output reg .SEND_SYNC_ESC (syncesc_send), // output reg .SET_OFFLINE (set_offline), // output reg .R_OK (send_R_OK), // output reg .R_ERR (send_R_ERR), // output reg // .EN_COMINIT (en_cominit), // output reg .EN_COMINIT (clear_pisn32), // output reg // FIS TRANSMIT/WAIT DONE .FETCH_CMD (fetch_cmd), // output reg .ATAPI_XMIT (atapi_xmit), // output reg .CFIS_XMIT (cfis_xmit), // output reg .DX_XMIT (dx_xmit), // output reg //FIS RECEIVE/WAIT DONE .GET_DATA_FIS (get_data_fis), // output reg .GET_DSFIS (get_dsfis), // output reg .GET_IGNORE (get_ignore), // output reg .GET_PSFIS (get_psfis), // output reg .GET_RFIS (get_rfis), // output reg .GET_SDBFIS (get_sdbfis), // output reg .GET_UFIS (get_ufis) // output reg ); // Condition inputs may be registered if needed condition_mux condition_mux_i ( .clk (mclk), // input .ce (conditions_ce), // input .sel (pgm_data[17:10]), // input[7:0] .condition (cond_met_w), // output //COMPOSITE .ST_NB_ND (pcmd_st && !tfd_bsy &&!tfd_drq), // input PxCMD.ST & !PxTFD.STS.BSY & !PxTFD.STS.DRQ // .PXCI0_NOT_CMDTOISSUE (pxci0 && !pCmdToIssue), // input pxci0 && !pCmdToIssue was pIssueSlot==32, -> p:SelectCmd .PXCI0_NOT_CMDTOISSUE (pxci0 && !pisn32), // input pxci0 && !pCmdToIssue was pIssueSlot==32, -> p:SelectCmd .PCTI_CTBAR_XCZ (pCmdToIssue && xfer_cntr_zero && ch_r ), // input pCmdToIssue && ch_r && xfer_cntr_zero .PCTI_XCZ (pCmdToIssue && xfer_cntr_zero), // input pCmdToIssue && xfer_cntr_zero .NST_D2HR (!pcmd_st && (fis_type == FIS_D2HR)), // input !ST && (FIS == FIS_D2HR) TODO: does it mean either BSY or DRQ are 1? .NPD_NCA (!pio_d && !ch_a), // input pio_d = 0 && ch_a == 0 .CHW_DMAA (ch_w && dma_a), // input ch_w && dma_a // CTRL_STAT .SCTL_DET_CHANGED_TO_4 (sctl_det_changed && (sctl_det == 4)), // input (requires sctl_det_reset after) .SCTL_DET_CHANGED_TO_1 (sctl_det_changed && (sctl_det == 1)), // input (requires sctl_det_reset after) .PXSSTS_DET_NE_3 (ssts_det != 3), // input ssts_det!=3, // device detected, phy communication not established .PXSSTS_DET_EQ_1 (ssts_det == 1), // input .NPCMD_FRE (!pxcmd_fre), // input !pcmd_fre (docs: goto P:NotRunning, but we need to clear FIFO) // FIS RECEIVE .FIS_OK (fis_ok), // input .FIS_ERR (fis_err), // input .FIS_FERR (fis_ferr), // input .FIS_EXTRA (fis_extra), // input .FIS_FIRST_INVALID (fis_first_invalid), // input .FR_D2HR (fis_first_vld && (fis_type == FIS_D2HR)), // input fis_first_vld & fis_type == 0x34 (D2H Register) .FIS_DATA (fis_first_vld && (fis_type == FIS_DATA)), // input fis_first_vld && (fis_type == 'h46) .FIS_ANY (fis_first_vld), // input .NB_ND_D2HR_PIO (((fis_type == FIS_D2HR) || (fis_type == FIS_PIOS)) && !tfd_bsy && !tfd_drq), // input ((FIS == FIS_D2HR) || (FIS == FIS_PIOS)) && !PxTFD.STS.BSY & !PxTFD.STS.DRQ .D2HR ( fis_type == FIS_D2HR), // input FIS == FIS_D2HR .SDB ( fis_type == FIS_SDB), // input .DMA_ACT ( fis_type == FIS_DMAA), // input .DMA_SETUP ( fis_type == FIS_DMAS), // input .BIST_ACT_FE (( fis_type == FIS_BIST) && (|bist_bits)), // input FIS == FIS_BIST && |bist_bits .BIST_ACT (( fis_type == FIS_BIST)), // input FIS == FIS_BIST# && !(|bist_bits) .PIO_SETUP ( fis_type == FIS_PIOS), // input .NB_ND (!tfd_bsy &&!tfd_drq), // input PxTFD.STS.BSY =’0’ and PxTFD.STS.DRQ =’0’ .TFD_STS_ERR ( tfd_sts_err), // input tfd_sts[0] .FIS_I (fis_i), // input .PIO_I (pio_i), // input .NPD (!pio_d), // input pio_d = 0 , "ch_a == 1" is not needed .PIOX (pPioXfer), // input .XFER0 (xfer_cntr_zero && !dma_cmd_busy), // input xfer_cntr_zero .PIOX_XFER0 (pPioXfer && xfer_cntr_zero &&!dma_cmd_busy), // input pPioXfer && xfer_cntr_zero // FIS_TRANSMIT .CTBAA_CTBAP (ch_a && ch_p), // input .CTBAP (ch_p), // input .CTBA_B (ch_b), // input .CTBA_C (ch_c), // input .TX_ERR (dx_err[1]), // input dx_err[1] (reset by new command) .SYNCESC_ERR (dx_err[0]), // input // DMA .DMA_PRD_IRQ_PEND (dma_prd_irq_pend), // input // SATA TRANSPORT/LINK/PHY .X_RDY_COLLISION (dx_err[2]) //x_rdy_collision_pend) // input ); /* output update_all, input update_busy, // valid same cycle as update_all Notes: Implement sync esc request/ackn in TL (available in LL) */ endmodule
`timescale 1ns / 1ps `include "WcaPortDefs.h" //grab register addresses. `define BURST_ZERO 9'h0 // Name: WcaUsbFx3IF.v // // Copyright(c) 2013 Loctronix Corporation // http://www.loctronix.com // // 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. module WcaUsbFx3IF( input clk_in, //Interface Clock Input input reset, //resets the interfaces. //Cypress Interface input flagA, //Flag A -- Current Thread Full input flagB, //Flag B -- Current Thread Empty input flagC, //Flag C input flagD, //Flag D //output nEpSwitch, // Thread assert switch output nSlcs, //FX-3 Chip Select (assert low), must be zero to control the Fx-3 output nPktEnd, //Packet end signal (active low) to write a short packet to FX3 slave FIFO. output [NBITS_ADDR-1:0] addr, // [1:0] 2 bit addressing mode, [4:0] 5 bit address mode. output nSlWr, //Fx-3 Write Strobe (active low) assert to perform write transfers from FPGA to FX3 FIFO output nSlRd, //Fx-3 Read Strobe (active low) assert to perform read transfers to FPGA from FX3 FIFO output nSlOe, //Fx-3 Output Enable (active low) assert causes FX-3 to drive data. Asserts before Read output clk, //Data bus clock. inout [31:0] data, //32bit data bus. inout [3:0] gpio, //Available GPIO Lines //Port Interface inout [31:0] pifData, // 32 bit port interface data bus. input [(NBITS_ADDR+1):0] pifCtrl, // {addr[NBITS_ADDR:0], iocmd[1:0] } output [6:0] pifStatus // I/O Status {fifo_full[0], fifo_empty[0], ioBusy, ioState[2:0], clk} ); parameter NBITS_ADDR = 2; parameter [9:0] BURST_COUNT = 9'h80; //default 128 (80h) DWORDS (512 bytes) USB 2.0, can increase to 256 (100h) DWORDS // (1024 bytes) for optimal USB 3.0 performance. `define LATENCY_ZERO 2'h0 `define LATENCY_ONE 2'h1 //Registers and wires reg nSlCs_i = 1'b1 ; reg nPktEnd_i = 1'b1 ; reg nSlRd_i = 1'b1; reg nSlOe_i = 1'b1; reg nSlWr_i = 1'b1 ; reg [2:0] ioState = `PIFSTAT_IDLE; reg ioBusy = 1'b0; //indicates IO State machine is busy. //Counters for state machine. reg [8:0] ctBurst = `BURST_ZERO; //Burst is maximum 512 (4 byte samples) = 2048 bytes reg [1:0] ctLatency = `LATENCY_ZERO; //************************************************** // Status and Control //************************************************** //Set up iostatus. assign pifStatus[6] = flagA; //Current Thread Full assign pifStatus[5] = flagB; //Current Thread Empty assign pifStatus[4] = ioBusy; //Current Thread Empty assign pifStatus[3:1] = ioState; WcaPassthrough pthruClk(.a(clk_in), .b(pifStatus[0])); //Set up address. assign addr = pifCtrl[NBITS_ADDR+1:2]; //************************************************** // Burst I/O State Machine //************************************************** assign nSlcs = nSlCs_i; assign nPktEnd = nPktEnd_i; assign nSlRd = nSlRd_i; assign nSlOe = nSlOe_i; assign nSlWr = nSlWr_i; always @(posedge clk_in) begin: PIFSTAT_State_Machine if( reset) begin ioBusy <= 1'b0; ioState <= `PIFSTAT_IDLE; end else //State machine Generates FX3 Slave interface signals. case (ioState) `PIFSTAT_IDLE: begin nPktEnd_i <= 1'b1; nSlOe_i <= 1'b1; nSlRd_i <= 1'b1; nSlWr_i <= 1'b1; nSlCs_i <= 1'b0; ctBurst <= `BURST_ZERO; ioBusy <= 1'b0; //FLAG A denotes full/empty (active low) on the current thread (full==write, empty==read); //If command is read and not empty buffer, start read op. if( (pifCtrl[1:0] == `PIFCMD_READ) && flagA) ioState <= `PIFSTAT_READ_BEGIN; //If command is write and not full buffer, start write op. else if( (pifCtrl[1:0] == `PIFCMD_WRITE) && flagA) ioState <= `PIFSTAT_WRITE_BEGIN; //else stay in this state. else ioState <= `PIFSTAT_IDLE; end `PIFSTAT_READ_BEGIN: begin nPktEnd_i <= 1'b1; nSlOe_i <= 1'b0; nSlRd_i <= 1'b0; nSlWr_i <= 1'b1; nSlCs_i <= 1'b0; ctBurst <= `BURST_ZERO; if(~ioBusy) begin ioBusy <= 1'b1; //Now doing a read, can't interrupt. ctLatency <= `READ_BEGIN_CYCLES; //2 cycles latency -1. end else //Stay in Begin Read until we passed latency. begin ctLatency <= ctLatency - `LATENCY_ONE; ioBusy <= 1'b1; if( ctLatency == `LATENCY_ZERO) ioState <= `PIFSTAT_READ; else ioState <= `PIFSTAT_READ_BEGIN; end end `PIFSTAT_READ: //Read a burst of data. begin nPktEnd_i <= 1'b1; nSlOe_i <= 1'b0; nSlRd_i <= 1'b0; nSlWr_i <= 1'b1; nSlCs_i <= 1'b0; ioBusy <= 1'b1; if( ctBurst < BURST_COUNT- 9'h1) begin ctBurst <= ctBurst + 9'h1; ioState <= `PIFSTAT_READ; end else //Transition to Idle. begin ioState <= `PIFSTAT_WAITEND; ctLatency <= `READ_WAIT_END_CYCLES; end end `PIFSTAT_WRITE_BEGIN: begin nPktEnd_i <= 1'b1; nSlOe_i <= 1'b1; nSlRd_i <= 1'b1; nSlWr_i <= 1'b0; nSlCs_i <= 1'b0; ctBurst <= `BURST_ZERO; ioState <= `PIFSTAT_WRITE; ioBusy <= 1'b1; /* if( ~ioBusy) begin ioBusy <= 1'b1; //Now doing a Write, can't interrupt. ctLatency = `LATENCY_ZERO; end else //Stay in Begin Write until we passed latency. begin ctLatency <= ctLatency - `LATENCY_ONE; ioBusy <= 1'b1; if( ctLatency == `LATENCY_ZERO) ioState <= PIFSTAT_WRITE; else ioState <= PIFSTAT_WRITE_BEGIN; end */ end `PIFSTAT_WRITE: //Write a burst of data. begin nPktEnd_i <= 1'b1; nSlOe_i <= 1'b1; nSlRd_i <= 1'b1; nSlCs_i <= 1'b0; ioBusy <= 1'b1; if( ctBurst < BURST_COUNT- 9'h1) begin ctBurst <= ctBurst + 9'h1; nSlWr_i <= 1'b0; ioState <= `PIFSTAT_WRITE; end else //Transition to Idle. begin ioState <= `PIFSTAT_WAITEND; ctLatency <= `WRITE_WAIT_END_CYCLES; nSlWr_i <= 1'b1; end end `PIFSTAT_WAITEND: begin nPktEnd_i <= 1'b1; nSlOe_i <= 1'b1; nSlRd_i <= 1'b1; nSlWr_i <= 1'b1; nSlCs_i <= 1'b0; ctBurst <= `BURST_ZERO; ioBusy <= 1'b1; if( ctLatency == `LATENCY_ZERO) ioState <= `PIFSTAT_IDLE; else ctLatency <= ctLatency - `LATENCY_ONE; end default: begin ioBusy <= 1'b0; ioState <= `PIFSTAT_IDLE; end endcase end //Tie the GPIO to high impedance since they are not used. assign gpio = 4'bz; //************************************ // CLOCK BUFFER //************************************ //Buffer the clock output so internal clock is not driving output pin. ODDR2 oddr_clk ( .D0(1'b1), .D1(1'b0), .C0 (clk_in), .C1(~clk_in), .Q(clk) ); //************************************ // Data Bus //************************************ //Map the input signals to the internal busses. //assign rbusData WcaPassthrough #(.width(32)) pthruData(.a(data), .b(pifData)); endmodule
`include "bsg_defines.v" module test_case #(parameter width_p, parameter banks_p) (input clk_i, input go_i, output finish_o); reg [width_p-1:0] lo; reg [width_p:0] in_r; wire [$clog2((2**width_p+banks_p-1)/banks_p)-1:0] index_lo; wire [`BSG_SAFE_CLOG2(banks_p)-1:0] bank_lo; // bsg_nonsynth_clock_gen #(.cycle_time_p(5)) clkgen (.o(clk)); bsg_hash_bank #(.banks_p(banks_p), .width_p(width_p)) hashme (/* .clk,*/ .i( in_r[width_p-1:0] ), // .i({in_r[1:0],in_r[5:2]}), .bank_o(bank_lo), .index_o(index_lo) ); bsg_hash_bank_reverse #(.banks_p(banks_p), .width_p(width_p)) unhashme (/* .clk,*/ .o( lo ), // .i({in_r[1:0],in_r[5:2]}), .bank_i(bank_lo), .index_i(index_lo) ); initial in_r = 0; reg finish_r; initial finish_r = 0; always @(posedge clk_i) begin if (!finish_r & go_i) begin in_r <= in_r + 1; finish_r <= in_r[width_p]; end end assign finish_o = finish_r; always @(negedge clk_i) begin // $display ("%b -> %b %b -> %b", in_r, bucket_lo, index_lo,lo); if (lo != in_r[width_p-1:0]) $display("(%3d,%3d) MISMATCH: %b -> %b %b -> %b",width_p,banks_p,in_r[width_p-1:0],bank_lo, index_lo, lo); else if (!finish_r & go_i) $display("(%3d,%3d) match: %b -> %b %b -> %b",width_p,banks_p,in_r[width_p-1:0],bank_lo, index_lo, lo); end endmodule // test_case module tb(input clk_i); localparam tests_p = 10; wire [tests_p-1:0] finish_lo; test_case #(6,1) tc61 (.clk_i,.finish_o(finish_lo[0]),.go_i(1)); test_case #(6,2) tc62 (.clk_i,.finish_o(finish_lo[1]),.go_i(finish_lo[0])); test_case #(6,3) tc63 (.clk_i,.finish_o(finish_lo[2]),.go_i(finish_lo[1])); test_case #(6,4) tc64 (.clk_i,.finish_o(finish_lo[3]),.go_i(finish_lo[2])); test_case #(6,6) tc66 (.clk_i,.finish_o(finish_lo[4]),.go_i(finish_lo[3])); test_case #(6,7) tc67 (.clk_i,.finish_o(finish_lo[5]),.go_i(finish_lo[4])); test_case #(8,7) tc87 (.clk_i,.finish_o(finish_lo[6]),.go_i(finish_lo[5])); test_case #(6,8) tc68 (.clk_i,.finish_o(finish_lo[7]),.go_i(finish_lo[6])); test_case #(6,12) tc612 (.clk_i,.finish_o(finish_lo[8]),.go_i(finish_lo[7])); test_case #(8,15) tc815 (.clk_i,.finish_o(finish_lo[9]),.go_i(finish_lo[8])); always @(*) if (&finish_lo) $finish(); endmodule
//***************************************************************************** // (c) Copyright 2009 - 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. // //***************************************************************************** // ____ ____ // / /\/ / // /___/ \ / Vendor : Xilinx // \ \ \/ Version : 4.0 // \ \ Application : MIG // / / Filename : bd_mig_7series_0_0.v // /___/ /\ Date Last Modified : $Date: 2011/06/02 08:35:03 $ // \ \ / \ Date Created : Fri Oct 14 2011 // \___\/\___\ // // Device : 7 Series // Design Name : DDR2 SDRAM // Purpose : // Wrapper module for the user design top level file. This module can be // instantiated in the system and interconnect as shown in example design // (example_top module). // Reference : // Revision History : //***************************************************************************** `timescale 1ps/1ps module bd_mig_7series_0_0 ( // Inouts inout [15:0] ddr2_dq, inout [1:0] ddr2_dqs_n, inout [1:0] ddr2_dqs_p, // Outputs output [12:0] ddr2_addr, output [2:0] ddr2_ba, output ddr2_ras_n, output ddr2_cas_n, output ddr2_we_n, output [0:0] ddr2_ck_p, output [0:0] ddr2_ck_n, output [0:0] ddr2_cke, output [0:0] ddr2_cs_n, output [1:0] ddr2_dm, output [0:0] ddr2_odt, // Inputs // Single-ended system clock input sys_clk_i, // Single-ended iodelayctrl clk (reference clock) input clk_ref_i, // user interface signals output ui_clk, output ui_clk_sync_rst, output ui_addn_clk_0, output ui_addn_clk_1, output ui_addn_clk_2, output ui_addn_clk_3, output ui_addn_clk_4, output mmcm_locked, input aresetn, output app_sr_active, output app_ref_ack, output app_zq_ack, // Slave Interface Write Address Ports input [3:0] s_axi_awid, input [31:0] s_axi_awaddr, input [7:0] s_axi_awlen, input [2:0] s_axi_awsize, input [1:0] s_axi_awburst, input [0:0] s_axi_awlock, input [3:0] s_axi_awcache, input [2:0] s_axi_awprot, input [3:0] s_axi_awqos, input s_axi_awvalid, output s_axi_awready, // Slave Interface Write Data Ports input [31:0] s_axi_wdata, input [3:0] s_axi_wstrb, input s_axi_wlast, input s_axi_wvalid, output s_axi_wready, // Slave Interface Write Response Ports input s_axi_bready, output [3:0] s_axi_bid, output [1:0] s_axi_bresp, output s_axi_bvalid, // Slave Interface Read Address Ports input [3:0] s_axi_arid, input [31:0] s_axi_araddr, input [7:0] s_axi_arlen, input [2:0] s_axi_arsize, input [1:0] s_axi_arburst, input [0:0] s_axi_arlock, input [3:0] s_axi_arcache, input [2:0] s_axi_arprot, input [3:0] s_axi_arqos, input s_axi_arvalid, output s_axi_arready, // Slave Interface Read Data Ports input s_axi_rready, output [3:0] s_axi_rid, output [31:0] s_axi_rdata, output [1:0] s_axi_rresp, output s_axi_rlast, output s_axi_rvalid, output init_calib_complete, input sys_rst ); // Start of IP top instance bd_mig_7series_0_0_mig u_bd_mig_7series_0_0_mig ( // Memory interface ports .ddr2_addr (ddr2_addr), .ddr2_ba (ddr2_ba), .ddr2_cas_n (ddr2_cas_n), .ddr2_ck_n (ddr2_ck_n), .ddr2_ck_p (ddr2_ck_p), .ddr2_cke (ddr2_cke), .ddr2_ras_n (ddr2_ras_n), .ddr2_we_n (ddr2_we_n), .ddr2_dq (ddr2_dq), .ddr2_dqs_n (ddr2_dqs_n), .ddr2_dqs_p (ddr2_dqs_p), .init_calib_complete (init_calib_complete), .ddr2_cs_n (ddr2_cs_n), .ddr2_dm (ddr2_dm), .ddr2_odt (ddr2_odt), // Application interface ports .ui_clk (ui_clk), .ui_clk_sync_rst (ui_clk_sync_rst), .ui_addn_clk_0 (ui_addn_clk_0), .ui_addn_clk_1 (ui_addn_clk_1), .ui_addn_clk_2 (ui_addn_clk_2), .ui_addn_clk_3 (ui_addn_clk_3), .ui_addn_clk_4 (ui_addn_clk_4), .mmcm_locked (mmcm_locked), .aresetn (aresetn), .app_sr_active (app_sr_active), .app_ref_ack (app_ref_ack), .app_zq_ack (app_zq_ack), // Slave Interface Write Address Ports .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_awvalid (s_axi_awvalid), .s_axi_awready (s_axi_awready), // 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_wvalid (s_axi_wvalid), .s_axi_wready (s_axi_wready), // Slave Interface Write Response Ports .s_axi_bid (s_axi_bid), .s_axi_bresp (s_axi_bresp), .s_axi_bvalid (s_axi_bvalid), .s_axi_bready (s_axi_bready), // Slave Interface Read Address Ports .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_arvalid (s_axi_arvalid), .s_axi_arready (s_axi_arready), // 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_rvalid (s_axi_rvalid), .s_axi_rready (s_axi_rready), // System Clock Ports .sys_clk_i (sys_clk_i), // Reference Clock Ports .clk_ref_i (clk_ref_i), .sys_rst (sys_rst) ); // End of IP top instance endmodule
/////////////////////////////////////////////////////////////////////////////// // vim:set shiftwidth=3 softtabstop=3 expandtab: // $Id: Modulo de decisión del firewall 2014-07 $ // // Module: decision.v // Project: FIREWALL DDOS // Description: Modulo encargado de realizar la decision en los // paquetes que ingresan de acuerdo a los resultados de comparacion // de las 2 TCAM implementadas. // // FUNCIONAMIENTO: // Se tienen tres buffers FIFO, dos para los resultados de la comparación // uno para el paquete completo. // Primeramente se concatenan resultados para la comparacion en un registro de 2 bits // comp_c <= {rtcam_usr,rtcam_bl} // La decicion de descarte de los paquetes sigue la siguiente lógica // comp_c val_dec Decision(ACCEPT ALL) Decision(DENY_ALL) // 00 0 PASS DENY // 01 1 DENY DENY // 10 2 PASS PASS // 11 3 DENY DENY // Como se puede observar en la tabla se realiza el analisis para los casos // en los que la politica del FIREWALL sea ACCEPT ALL o DENY ALL /////////////////////////////////////////////////////////////////////////////// `timescale 1ns/1ps module decision #( parameter DATA_WIDTH = 64, parameter DATA_WIDTH_TCAM = 1, parameter CTRL_WIDTH = DATA_WIDTH/8, parameter UDP_REG_SRC_WIDTH = 2 ) ( // Interfaz con los sub-modulos TCAM y con Input Arbiter input [DATA_WIDTH-1:0] in_data, input [CTRL_WIDTH-1:0] in_ctrl, input in_wr, output in_rdy, input in_data_usr, // input in_ctrl_rtcam_usr, input in_wr_usr, output in_rdy_usr, input in_data_bl, // input in_ctrl_rtcam_bl, input in_wr_bl, output in_rdy_bl, // Interfaz con OUTPUT PORT LOOKUP output [DATA_WIDTH-1:0] out_data, output [CTRL_WIDTH-1:0] out_ctrl, output out_wr, input out_rdy, // --- Register interface input reg_req_in, input reg_ack_in, input reg_rd_wr_L_in, input [`UDP_REG_ADDR_WIDTH-1:0] reg_addr_in, input [`CPCI_NF2_DATA_WIDTH-1:0] reg_data_in, input [UDP_REG_SRC_WIDTH-1:0] reg_src_in, output reg_req_out, output reg_ack_out, output reg_rd_wr_L_out, output [`UDP_REG_ADDR_WIDTH-1:0] reg_addr_out, output [`CPCI_NF2_DATA_WIDTH-1:0] reg_data_out, output [UDP_REG_SRC_WIDTH-1:0] reg_src_out, // misc input reset, input clk ); // Define the log2 function `LOG2_FUNC //------------------------- Signals------------------------------- wire [DATA_WIDTH-1:0] in_fifo_data; wire [CTRL_WIDTH-1:0] in_fifo_ctrl; wire in_fifo_nearly_full; wire in_fifo_empty; reg in_fifo_rd_en; reg out_wr_int; wire in_fifo_data_usr; wire in_fifo_rd_en_usr; wire in_fifo_nearly_full_usr; wire in_fifo_empty_usr; reg in_fifo_rd_en_usr; reg out_wr_int_usr; wire in_fifo_data_bl; wire in_fifo_rd_en_bl; wire in_fifo_nearly_full_bl; wire in_fifo_empty_bl; reg in_fifo_rd_en_bl; reg out_wr_int_bl; //------------------------- Local assignments ------------------------------- assign in_rdy = !in_fifo_nearly_full; assign out_wr = out_wr_int; assign out_data = in_fifo_data; assign out_ctrl = in_fifo_ctrl; assing in_rdy_usr = !in_fifo_nearly_full_usr; assing out_wr_usr = out_wr_int_usr; assign out_data_usr = in_fifo_data_usr; assing in_rdy_bl = !in_fifo_nearly_full_bl; assing out_wr_usr = out_wr_int_bl; assign out_data_usr = in_fifo_data_bl; //------------------------- Modules------------------------------- // Buffer para los paquetes fallthrough_small_fifo #( .WIDTH(CTRL_WIDTH+DATA_WIDTH), .MAX_DEPTH_BITS(4) ) input_fifo ( .din ({in_ctrl, in_data}), // Data in .wr_en (in_wr), // Write enable .rd_en (in_fifo_rd_en), // Read the next word .dout ({in_fifo_ctrl, in_fifo_data}), .full (), .nearly_full (in_fifo_nearly_full), .prog_full (), .empty (in_fifo_empty), .reset (reset), .clk (clk) ); // Buffer para resultados TCAM_USR small_fifo #( .WIDTH(DATA_WIDTH_TCAM), .MAX_DEPTH_BITS(4) ) tcam_usr_input_fifo ( .din (in_data_rtcam_usr), // Data in .wr_en (in_wr_rtcam_usr), // Write enable .rd_en (in_fifo_rd_en_usr), // Read the next word .dout (in_fifo_data_usr), .full (), .prog_full (), .nearly_full (in_fifo_nearly_full_usr), .empty (in_fifo_empty_usr), .reset (reset), .clk (clk) ); // Buffer para resultados TCAM_BL small_fifo #( .WIDTH(DATA_WIDTH_TCAM), .MAX_DEPTH_BITS(4) ) tcam_bl_input_fifo ( .din (in_data_rtcam_bl), // Data in .wr_en (in_wr_rtcam_bl), // Write enable .rd_en (in_fifo_rd_en_bl), // Read the next word .dout (in_fifo_data_bl), .full (), .prog_full (), .nearly_full (in_fifo_nearly_full_bl), .empty (in_fifo_empty_bl), .reset (reset), .clk (clk) ); // Registros genericos generic_regs #( .UDP_REG_SRC_WIDTH (UDP_REG_SRC_WIDTH), .TAG (0), // Tag -- eg. MODULE_TAG .REG_ADDR_WIDTH (1), // Width of block addresses .NUM_COUNTERS (0), // Number of counters .NUM_SOFTWARE_REGS (0), // Number of sw regs .NUM_HARDWARE_REGS (0) // Number of hw regs ) module_regs ( .reg_req_in (reg_req_in), .reg_ack_in (reg_ack_in), .reg_rd_wr_L_in (reg_rd_wr_L_in), .reg_addr_in (reg_addr_in), .reg_data_in (reg_data_in), .reg_src_in (reg_src_in), .reg_req_out (reg_req_out), .reg_ack_out (reg_ack_out), .reg_rd_wr_L_out (reg_rd_wr_L_out), .reg_addr_out (reg_addr_out), .reg_data_out (reg_data_out), .reg_src_out (reg_src_out), // --- counters interface .counter_updates (), .counter_decrement(), // --- SW regs interface .software_regs (), // --- HW regs interface .hardware_regs (), .clk (clk), .reset (reset) ); //------------------------- Logic------------------------------- always @(*) begin // Default values out_wr_int = 0; in_fifo_rd_en = 0; if (!in_fifo_empty && out_rdy) begin out_wr_int = 1; in_fifo_rd_en = 1; end end endmodule
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 2015/09/22 09:30:47 // Design Name: // Module Name: null_filter // Project Name: // Target Devices: // Tool Versions: // Description: // // Dependencies: // // Revision: // Revision 0.01 - File Created // Additional Comments: // ////////////////////////////////////////////////////////////////////////////////// module null_filter( vid_pData_I, vid_pHSync_I, vid_pVSync_I, vid_pVDE_I, PixelClk_I, vid_pData_O, vid_pHSync_O, vid_pVSync_O, vid_pVDE_O, PixelClk_O ); input [23:0] vid_pData_I; input vid_pHSync_I; input vid_pVSync_I; input vid_pVDE_I; input PixelClk_I; output [23:0] vid_pData_O; output vid_pHSync_O; output vid_pVSync_O; output vid_pVDE_O; output PixelClk_O; assign vid_pData_O = vid_pData_I; assign vid_pVSync_O = vid_pVSync_I; assign vid_pHSync_O = vid_pHSync_I; assign vid_pVDE_O = vid_pVDE_I; assign PixelClk_O = PixelClk_I; endmodule
//////////////////////////////////////////////////////////////////////////////// // Copyright (c) 1995-2010 Xilinx, Inc. All rights reserved. //////////////////////////////////////////////////////////////////////////////// // ____ ____ // / /\/ / // /___/ \ / Vendor: Xilinx // \ \ \/ Version : 12.4 // \ \ Application : xaw2verilog // / / Filename : master_clk.v // /___/ /\ Timestamp : 05/02/2013 05:55:56 // \ \ / \ // \___\/\___\ // //Command: xaw2verilog -intstyle C:/Users/rodriguj/Documents/proyectos_xilinx/ula_replacement_tests/test3/ipcore_dir/master_clk.xaw -st master_clk.v //Design Name: master_clk //Device: xc3s100e-4vq100 // // Module master_clk // Generated by Xilinx Architecture Wizard // Written for synthesis tool: XST // Period Jitter (unit interval) for block DCM_SP_INST = 0.04 UI // Period Jitter (Peak-to-Peak) for block DCM_SP_INST = 3.20 ns `timescale 1ns / 1ps module master_clk(CLKIN_IN, CLKDV_OUT, CLKFX_OUT, CLKIN_IBUFG_OUT, CLK0_OUT); input CLKIN_IN; output CLKDV_OUT; output CLKFX_OUT; output CLKIN_IBUFG_OUT; output CLK0_OUT; wire CLKDV_BUF; wire CLKFB_IN; wire CLKFX_BUF; wire CLKIN_IBUFG; wire CLK0_BUF; wire GND_BIT; assign GND_BIT = 0; assign CLKIN_IBUFG_OUT = CLKIN_IBUFG; assign CLK0_OUT = CLKFB_IN; BUFG CLKDV_BUFG_INST (.I(CLKDV_BUF), .O(CLKDV_OUT)); BUFG CLKFX_BUFG_INST (.I(CLKFX_BUF), .O(CLKFX_OUT)); IBUFG CLKIN_IBUFG_INST (.I(CLKIN_IN), .O(CLKIN_IBUFG)); BUFG CLK0_BUFG_INST (.I(CLK0_BUF), .O(CLKFB_IN)); DCM_SP #( .CLK_FEEDBACK("1X"), .CLKDV_DIVIDE(5.0), .CLKFX_DIVIDE(25), .CLKFX_MULTIPLY(7), .CLKIN_DIVIDE_BY_2("TRUE"), .CLKIN_PERIOD(20.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(CLKFX_BUF), .CLKFX180(), .CLK0(CLK0_BUF), .CLK2X(), .CLK2X180(), .CLK90(), .CLK180(), .CLK270(), .LOCKED(), .PSDONE(), .STATUS()); endmodule
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ `ifndef SKY130_FD_SC_HD__A32OI_4_V `define SKY130_FD_SC_HD__A32OI_4_V /** * a32oi: 3-input AND into first input, and 2-input AND into * 2nd input of 2-input NOR. * * Y = !((A1 & A2 & A3) | (B1 & B2)) * * Verilog wrapper for a32oi with size of 4 units. * * WARNING: This file is autogenerated, do not modify directly! */ `timescale 1ns / 1ps `default_nettype none `include "sky130_fd_sc_hd__a32oi.v" `ifdef USE_POWER_PINS /*********************************************************/ `celldefine module sky130_fd_sc_hd__a32oi_4 ( Y , A1 , A2 , A3 , B1 , B2 , VPWR, VGND, VPB , VNB ); output Y ; input A1 ; input A2 ; input A3 ; input B1 ; input B2 ; input VPWR; input VGND; input VPB ; input VNB ; sky130_fd_sc_hd__a32oi base ( .Y(Y), .A1(A1), .A2(A2), .A3(A3), .B1(B1), .B2(B2), .VPWR(VPWR), .VGND(VGND), .VPB(VPB), .VNB(VNB) ); endmodule `endcelldefine /*********************************************************/ `else // If not USE_POWER_PINS /*********************************************************/ `celldefine module sky130_fd_sc_hd__a32oi_4 ( Y , A1, A2, A3, B1, B2 ); output Y ; input A1; input A2; input A3; input B1; input B2; // Voltage supply signals supply1 VPWR; supply0 VGND; supply1 VPB ; supply0 VNB ; sky130_fd_sc_hd__a32oi base ( .Y(Y), .A1(A1), .A2(A2), .A3(A3), .B1(B1), .B2(B2) ); endmodule `endcelldefine /*********************************************************/ `endif // USE_POWER_PINS `default_nettype wire `endif // SKY130_FD_SC_HD__A32OI_4_V
//pf_hi_tester.v /* Distributed under the MIT license. Copyright (c) 2015 Dave McCoy ([email protected]) 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. */ /* Set the Vendor ID (Hexidecimal 64-bit Number) SDB_VENDOR_ID:0x800000000000C594 Set the Device ID (Hexcidecimal 32-bit Number) SDB_DEVICE_ID:0x800000000000C594 Set the version of the Core XX.XXX.XXX Example: 01.000.000 SDB_CORE_VERSION:00.000.001 Set the Device Name: 19 UNICODE characters SDB_NAME:pf_hi_tester Set the class of the device (16 bits) Set as 0 SDB_ABI_CLASS:0 Set the ABI Major Version: (8-bits) SDB_ABI_VERSION_MAJOR:0x0F Set the ABI Minor Version (8-bits) SDB_ABI_VERSION_MINOR:0 Set the Module URL (63 Unicode Characters) SDB_MODULE_URL:http://www.example.com Set the date of module YYYY/MM/DD SDB_DATE:2015/12/29 Device is executable (True/False) SDB_EXECUTABLE:True Device is readable (True/False) SDB_READABLE:True Device is writeable (True/False) SDB_WRITEABLE:True Device Size: Number of Registers SDB_SIZE:3 */ module pf_hi_tester ( input clk, input rst, //Add signals to control your device here //Wishbone Bus Signals input i_wbs_we, input i_wbs_cyc, input [3:0] i_wbs_sel, input [31:0] i_wbs_dat, input i_wbs_stb, output reg o_wbs_ack, output reg [31:0] o_wbs_dat, input [31:0] i_wbs_adr, //This interrupt can be controlled from this module or a submodule output reg o_wbs_int //output o_wbs_int ); //Local Parameters localparam ADDR_0 = 32'h00000000; localparam ADDR_1 = 32'h00000001; localparam ADDR_2 = 32'h00000002; //Local Registers/Wires //Submodules //Asynchronous Logic //Synchronous Logic always @ (posedge clk) begin if (rst) begin o_wbs_dat <= 32'h0; o_wbs_ack <= 0; o_wbs_int <= 0; end else begin //when the master acks our ack, then put our ack down if (o_wbs_ack && ~i_wbs_stb)begin o_wbs_ack <= 0; end if (i_wbs_stb && i_wbs_cyc) begin //master is requesting somethign if (!o_wbs_ack) begin if (i_wbs_we) begin //write request case (i_wbs_adr) 24'h0000FF: begin o_wbs_int <= 0; end 24'h001000: begin o_wbs_int <= i_wbs_dat[0]; end default: begin end endcase end else begin //read request o_wbs_dat <= i_wbs_adr; end o_wbs_ack <= 1; end end end end endmodule
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ `ifndef SKY130_FD_SC_MS__A221OI_4_V `define SKY130_FD_SC_MS__A221OI_4_V /** * a221oi: 2-input AND into first two inputs of 3-input NOR. * * Y = !((A1 & A2) | (B1 & B2) | C1) * * Verilog wrapper for a221oi with size of 4 units. * * WARNING: This file is autogenerated, do not modify directly! */ `timescale 1ns / 1ps `default_nettype none `include "sky130_fd_sc_ms__a221oi.v" `ifdef USE_POWER_PINS /*********************************************************/ `celldefine module sky130_fd_sc_ms__a221oi_4 ( Y , A1 , A2 , B1 , B2 , C1 , VPWR, VGND, VPB , VNB ); output Y ; input A1 ; input A2 ; input B1 ; input B2 ; input C1 ; input VPWR; input VGND; input VPB ; input VNB ; sky130_fd_sc_ms__a221oi base ( .Y(Y), .A1(A1), .A2(A2), .B1(B1), .B2(B2), .C1(C1), .VPWR(VPWR), .VGND(VGND), .VPB(VPB), .VNB(VNB) ); endmodule `endcelldefine /*********************************************************/ `else // If not USE_POWER_PINS /*********************************************************/ `celldefine module sky130_fd_sc_ms__a221oi_4 ( Y , A1, A2, B1, B2, C1 ); output Y ; input A1; input A2; input B1; input B2; input C1; // Voltage supply signals supply1 VPWR; supply0 VGND; supply1 VPB ; supply0 VNB ; sky130_fd_sc_ms__a221oi base ( .Y(Y), .A1(A1), .A2(A2), .B1(B1), .B2(B2), .C1(C1) ); endmodule `endcelldefine /*********************************************************/ `endif // USE_POWER_PINS `default_nettype wire `endif // SKY130_FD_SC_MS__A221OI_4_V
/** * fillbox_act.v: fillbox accelarator controle logic */ module fillbox_act ( input wire [27:0] vram, input wire [9:0] width, input wire [9:0] height, input wire start, output wire done, // AXI4 stuff input wire clk, input wire bready, output reg [27:0] awaddr, output reg burst_start, output reg [7:0] awlen, output reg [3:0] wstrb ); // X/Y axis state machine parameter IDLE = 2'h0, START = 2'h1, WAIT = 2'h2; localparam SCREEN_WIDTH = 28'd1280; reg [27:0] vram_y = 0; reg [10:0] offset = 0; reg [10:0] delta = 0; reg [9:0] width_work = 0; reg [9:0] height_work = 0; reg [9:0] expected_count = 0; reg [9:0] real_count = 0; reg [1:0] state_x = IDLE, state_y = IDLE; reg start_x = 0; reg end_x = 0; reg done_ff1 = 0; reg done_ff2 = 0; wire [27:0] awaddr_tmp = vram_y + {17'b0, offset}; assign done = done_ff1 && ~done_ff2; // end of accelarator action always @(posedge clk) begin done_ff2 <= done_ff1; done_ff1 <= (width_work == 10'd0 && height_work == 10'd0 && expected_count == real_count); awaddr <= {awaddr_tmp[27:2], 2'b0}; end // real access count always @(posedge clk) begin if (start_x == 'b0) real_count <= 10'd0; else if (bready) real_count <= real_count + 10'd1; else real_count <= real_count; end // Y axis action always @(posedge clk) begin case (state_y) IDLE: begin if (start) begin state_y <= START; height_work <= height; vram_y <= vram; end else begin state_y <= state_y; height_work <= height_work; vram_y <= vram_y; end start_x <= 'b0; end START: begin if (height_work == 10'd0) begin state_y <= IDLE; height_work <= 10'd0; vram_y <= vram_y; start_x <= 'b0; end else begin state_y <= WAIT; height_work <= height_work; vram_y <= vram_y; start_x <= 'b1; end end WAIT: begin if (end_x) begin state_y <= START; height_work <= height_work - 10'd1; vram_y <= vram_y + SCREEN_WIDTH; start_x <= 'b0; end else begin state_y <= state_y; height_work <= height_work; vram_y <= vram_y; start_x <= start_x; end end default: begin state_y <= IDLE; height_work <= height_work; vram_y <= vram_y; start_x <= 'b0; end endcase end // X axis action always @(posedge clk) begin if (start_x == 'b0) begin end_x <= 'b0; expected_count = 10'd0; width_work <= 10'd0; offset <= 11'd0; delta <= 11'd0; burst_start <= 'b0; awlen <= 8'd0; wstrb <= 4'b0000; state_x <= IDLE; end else begin case (state_x) IDLE: begin end_x <= 'b0; expected_count <= 10'd0; width_work <= width; offset <= 11'd0; delta <= 11'd0; burst_start <= 'b0; awlen <= 8'd0; wstrb <= 4'b0000; state_x <= START; end START: begin if (width_work == 10'd0) begin end_x <= 'b1; expected_count <= expected_count; width_work <= width_work; offset <= offset; delta <= delta; burst_start <= 'b0; awlen <= awlen; wstrb <= wstrb; state_x <= IDLE; end else begin if (awaddr_tmp[1]) begin // address not divisable by 4 // width_work greater than 0 width_work <= width_work - 10'd1; delta <= 11'd2; wstrb <= 4'b1100; awlen <= 8'd0; end else if (width_work == 10'd1) begin // address divisable by 4 // width_work equal to 1 width_work <= width_work - 10'd1; delta <= 11'd2; wstrb <= 4'b0011; awlen <= 8'd0; end else if (awaddr_tmp[2] || width_work <= 10'd3) begin // address not divisable by 8 // width_work greater than 1, less than 4 width_work <= width_work - 10'd2; delta <= 11'd4; wstrb <= 4'b1111; awlen <= 8'd0; end else if (awaddr_tmp[3] || width_work <= 10'd7) begin // address not divisable by 16 // width_work greater than 3, less than 8 width_work <= width_work - 10'd4; delta <= 11'd8; wstrb <= 4'b1111; awlen <= 8'd1; end else if (awaddr_tmp[4] || width_work <= 10'd15) begin // address not divisable by 32 // width_work greater than 7, less than 16 width_work <= width_work - 10'd8; delta <= 11'd16; wstrb <= 4'b1111; awlen <= 8'd3; end else if (awaddr_tmp[5] || width_work <= 10'd31) begin // address not divisable by 64 // width_work greater thean 15, less than 32 width_work <= width_work - 10'd16; delta <= 11'd32; wstrb <= 4'b1111; awlen <= 8'd7; end else begin // address divisable by 64 // width_work greater than 31 width_work <= width_work - 10'd32; delta <= 11'd64; wstrb <= 4'b1111; awlen <= 8'd15; end end_x <= 'b0; expected_count <= expected_count + 10'd1; offset <= offset; burst_start <= 'b1; state_x <= WAIT; end end WAIT: begin if (bready) begin offset <= offset + delta; delta <= 11'd0; state_x <= START; end else begin offset <= offset; delta <= delta; state_x <= state_x; end awlen <= awlen; wstrb <= wstrb; burst_start <= 'b0; end_x <= 'b0; expected_count <= expected_count; width_work <= width_work; end default: begin end_x <= 'b0; expected_count <= expected_count; width_work <= width_work; offset <= offset; delta <= delta; burst_start <= 'b0; awlen <= awlen; wstrb <= wstrb; state_x <= IDLE; end endcase end end endmodule
module L1_Cache #( parameter addr_width = 32, parameter cpu_data_width = 32, parameter mem_data_width = 256 ) ( input clk, input rst, // cpu side input [addr_width-1:0] cache_addr, input cache_cs, input cache_we, output cache_ack, input [cpu_data_width-1:0] cache_data_i, output [cpu_data_width-1:0] cache_data_o, // external memory side output [addr_width-1:0] dram_addr, output dram_cs, output dram_we, input dram_ack, input [mem_data_width-1:0] dram_data_o, output [mem_data_width-1:0] dram_data_i ); // address from CPU wire [21:0] addr_tag; wire [4:0] addr_index; wire [4:0] addr_offset; wire [2:0] block_offset = addr_offset[4:2]; // data from SRAM wire sram_valid; wire sram_dirty; wire [21:0] sram_tag; // tag SRAM related values wire cache_hit; // assign the internal bus, todo: parametrized assign addr_tag = cache_addr[31:10]; assign addr_index = cache_addr[9:5]; assign addr_offset = cache_addr[4:0]; assign sram_valid = tag_storage.data_o[23]; assign sram_dirty = tag_storage.data_o[22]; assign sram_tag = tag_storage.data_o[21:0]; assign cache_hit = ((addr_tag == sram_tag) && sram_valid) ? 1'b1 : 1'b0; assign dram_addr = {sram_tag, addr_index, 5'b0}; assign dram_data_i = data_storage.data_o; L1_Cache_Controller controller ( .clk (clk), .rst (rst), // interface to CPU .cache_cs (cache_cs), .cache_we (cache_we), .cache_ack (cache_ack), // interface to internal components .cache_hit (cache_hit), .sram_we (), .cache_valid (sram_valid), .cache_dirty_i (sram_dirty), .cache_dirty_o (), .sram_data_sel (), // interface to DRAM .dram_cs (dram_cs), .dram_we (dram_we), .dram_ack (dram_ack) ); SRAM #(.addr_width(5), .data_width(24), .mem_size(32)) tag_storage ( .clk (clk), .addr_i (addr_index), .cs (1'b1), .we (controller.sram_we), .data_i ({1'b1, controller.cache_dirty_o, addr_tag}), .data_o () ); Decoder_3to8 decoder ( .sel (block_offset), .out () ); Multiplexer4Way write_data_b1 ( .data_1 (data_storage.data_o[255:224]), .data_2 (data_storage.data_o[255:224]), .data_3 (cache_data_i), .data_4 (dram_data_o[255:224]), .sel ({decoder.out[0], controller.sram_data_sel}), .data_o (data_storage.data_i[255:224]) ); Multiplexer4Way write_data_b2 ( .data_1 (data_storage.data_o[223:192]), .data_2 (data_storage.data_o[223:192]), .data_3 (cache_data_i), .data_4 (dram_data_o[223:192]), .sel ({decoder.out[1], controller.sram_data_sel}), .data_o (data_storage.data_i[223:192]) ); Multiplexer4Way write_data_b3 ( .data_1 (data_storage.data_o[191:160]), .data_2 (data_storage.data_o[191:160]), .data_3 (cache_data_i), .data_4 (dram_data_o[191:160]), .sel ({decoder.out[2], controller.sram_data_sel}), .data_o (data_storage.data_i[191:160]) ); Multiplexer4Way write_data_b4 ( .data_1 (data_storage.data_o[159:128]), .data_2 (data_storage.data_o[159:128]), .data_3 (cache_data_i), .data_4 (dram_data_o[159:128]), .sel ({decoder.out[3], controller.sram_data_sel}), .data_o (data_storage.data_i[159:128]) ); Multiplexer4Way write_data_b5 ( .data_1 (data_storage.data_o[127:96]), .data_2 (data_storage.data_o[127:96]), .data_3 (cache_data_i), .data_4 (dram_data_o[127:96]), .sel ({decoder.out[4], controller.sram_data_sel}), .data_o (data_storage.data_i[127:96]) ); Multiplexer4Way write_data_b6 ( .data_1 (data_storage.data_o[95:64]), .data_2 (data_storage.data_o[95:64]), .data_3 (cache_data_i), .data_4 (dram_data_o[95:64]), .sel ({decoder.out[5], controller.sram_data_sel}), .data_o (data_storage.data_i[95:64]) ); Multiplexer4Way write_data_b7 ( .data_1 (data_storage.data_o[63:32]), .data_2 (data_storage.data_o[63:32]), .data_3 (cache_data_i), .data_4 (dram_data_o[63:32]), .sel ({decoder.out[6], controller.sram_data_sel}), .data_o (data_storage.data_i[63:32]) ); Multiplexer4Way write_data_b8 ( .data_1 (data_storage.data_o[31:0]), .data_2 (data_storage.data_o[31:0]), .data_3 (cache_data_i), .data_4 (dram_data_o[31:0]), .sel ({decoder.out[7], controller.sram_data_sel}), .data_o (data_storage.data_i[31:0]) ); SRAM #(.addr_width(5), .data_width(256), .mem_size(32)) data_storage ( .clk (clk), .addr_i (addr_index), .cs (1'b1), .we (controller.sram_we), .data_i (), .data_o () ); Multiplexer8Way read_data ( .data_1 (data_storage.data_o[255:224]), .data_2 (data_storage.data_o[223:192]), .data_3 (data_storage.data_o[191:160]), .data_4 (data_storage.data_o[159:128]), .data_5 (data_storage.data_o[127:96]), .data_6 (data_storage.data_o[95:64]), .data_7 (data_storage.data_o[63:32]), .data_8 (data_storage.data_o[31:0]), .sel (block_offset), .data_o (cache_data_o) ); endmodule
/* * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ `ifndef SKY130_FD_SC_MS__A41O_FUNCTIONAL_PP_V `define SKY130_FD_SC_MS__A41O_FUNCTIONAL_PP_V /** * a41o: 4-input AND into first input of 2-input OR. * * X = ((A1 & A2 & A3 & A4) | B1) * * Verilog simulation functional model. */ `timescale 1ns / 1ps `default_nettype none // Import user defined primitives. `include "../../models/udp_pwrgood_pp_pg/sky130_fd_sc_ms__udp_pwrgood_pp_pg.v" `celldefine module sky130_fd_sc_ms__a41o ( X , A1 , A2 , A3 , A4 , B1 , VPWR, VGND, VPB , VNB ); // Module ports output X ; input A1 ; input A2 ; input A3 ; input A4 ; input B1 ; input VPWR; input VGND; input VPB ; input VNB ; // Local signals wire and0_out ; wire or0_out_X ; wire pwrgood_pp0_out_X; // Name Output Other arguments and and0 (and0_out , A1, A2, A3, A4 ); or or0 (or0_out_X , and0_out, B1 ); sky130_fd_sc_ms__udp_pwrgood_pp$PG pwrgood_pp0 (pwrgood_pp0_out_X, or0_out_X, VPWR, VGND); buf buf0 (X , pwrgood_pp0_out_X ); endmodule `endcelldefine `default_nettype wire `endif // SKY130_FD_SC_MS__A41O_FUNCTIONAL_PP_V
/* * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ `ifndef SKY130_FD_SC_HDLL__XOR2_FUNCTIONAL_PP_V `define SKY130_FD_SC_HDLL__XOR2_FUNCTIONAL_PP_V /** * xor2: 2-input exclusive OR. * * X = A ^ B * * Verilog simulation functional model. */ `timescale 1ns / 1ps `default_nettype none // Import user defined primitives. `include "../../models/udp_pwrgood_pp_pg/sky130_fd_sc_hdll__udp_pwrgood_pp_pg.v" `celldefine module sky130_fd_sc_hdll__xor2 ( X , A , B , VPWR, VGND, VPB , VNB ); // Module ports output X ; input A ; input B ; input VPWR; input VGND; input VPB ; input VNB ; // Local signals wire xor0_out_X ; wire pwrgood_pp0_out_X; // Name Output Other arguments xor xor0 (xor0_out_X , B, A ); sky130_fd_sc_hdll__udp_pwrgood_pp$PG pwrgood_pp0 (pwrgood_pp0_out_X, xor0_out_X, VPWR, VGND); buf buf0 (X , pwrgood_pp0_out_X ); endmodule `endcelldefine `default_nettype wire `endif // SKY130_FD_SC_HDLL__XOR2_FUNCTIONAL_PP_V
/////////////////////////////////////////////////////////////////////////////// // (c) Copyright 2008 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. // // /////////////////////////////////////////////////////////////////////////////// // // STANDARD CC MODULE // // // Description: This module drives the Aurora module's Clock Compensation // interface. Clock Compensation sequences are generated according // to the requirements in the Aurora Protocol specification. // // This module supports Aurora Modules with any number of // 2-byte lanes and no User Flow Control. // /////////////////////////////////////////////////////////////////////////////// `timescale 1 ns / 1 ps (* core_generation_info = "aur1,aurora_8b10b_v5_1,{backchannel_mode=Sidebands, c_aurora_lanes=4, c_column_used=left, c_gt_clock_1=GTPD7, c_gt_clock_2=None, c_gt_loc_1=X, c_gt_loc_10=X, c_gt_loc_11=X, c_gt_loc_12=X, c_gt_loc_13=3, c_gt_loc_14=4, c_gt_loc_15=1, c_gt_loc_16=2, c_gt_loc_17=X, c_gt_loc_18=X, c_gt_loc_19=X, c_gt_loc_2=X, c_gt_loc_20=X, c_gt_loc_21=X, c_gt_loc_22=X, c_gt_loc_23=X, c_gt_loc_24=X, c_gt_loc_25=X, c_gt_loc_26=X, c_gt_loc_27=X, c_gt_loc_28=X, c_gt_loc_29=X, c_gt_loc_3=X, c_gt_loc_30=X, c_gt_loc_31=X, c_gt_loc_32=X, c_gt_loc_33=X, c_gt_loc_34=X, c_gt_loc_35=X, c_gt_loc_36=X, c_gt_loc_37=X, c_gt_loc_38=X, c_gt_loc_39=X, c_gt_loc_4=X, c_gt_loc_40=X, c_gt_loc_41=X, c_gt_loc_42=X, c_gt_loc_43=X, c_gt_loc_44=X, c_gt_loc_45=X, c_gt_loc_46=X, c_gt_loc_47=X, c_gt_loc_48=X, c_gt_loc_5=X, c_gt_loc_6=X, c_gt_loc_7=X, c_gt_loc_8=X, c_gt_loc_9=X, c_lane_width=2, c_line_rate=3.125, c_nfc=false, c_nfc_mode=IMM, c_refclk_frequency=156.25, c_simplex=false, c_simplex_mode=TX, c_stream=true, c_ufc=false, flow_mode=None, interface_mode=Streaming, dataflow_config=Duplex,}" *) module aur1_STANDARD_CC_MODULE ( RESET, //Clock Compensation Control Interface WARN_CC, DO_CC, //System Interface PLL_NOT_LOCKED, USER_CLK ); `define DLY #1 //***********************************Port Declarations******************************* //Clock Compensation Control Interface output WARN_CC; output DO_CC; //System Interface input PLL_NOT_LOCKED; input USER_CLK; input RESET; //**************************** External Register Declarations************************* reg WARN_CC; reg DO_CC; //************************** Internal Register Declarations ************************** reg [0:9] prepare_count_r; reg [0:5] cc_count_r; reg reset_r; reg [0:11] count_13d_srl_r; reg count_13d_flop_r; reg [0:14] count_16d_srl_r; reg count_16d_flop_r; reg [0:22] count_24d_srl_r; reg count_24d_flop_r; //*********************************Wire Declarations********************************** wire enable_cc_c; wire start_cc_c; wire inner_count_done_r; wire middle_count_done_c; wire cc_idle_count_done_c; //*********************************Main Body of Code********************************** //________________________Clock Correction State Machine__________________________ assign enable_cc_c = !RESET; // The clock correction state machine is a counter with three sections. The first // section counts out the idle period before a clock correction occurs. The second // section counts out a period when NFC and UFC operations should not be attempted // because they will not be completed. The last section counts out the cycles of // the clock correction sequence. // The inner count for the CC counter counts to 13. It is implemented using // an SRL16 and a flop // The SRL counts 12 bits of the count always @(posedge USER_CLK) if(RESET) count_13d_srl_r <= `DLY 12'b000000000000; else count_13d_srl_r <= `DLY {count_13d_flop_r, count_13d_srl_r[0:10]}; // The inner count is done when a 1 reaches the end of the SRL assign inner_count_done_r = count_13d_srl_r[11]; // The flop extends the shift register to 13 bits for counting. It is held at // zero while channel up is low to clear the register, and is seeded with a // single 1 when channel up transitions from 0 to 1 always @(posedge USER_CLK) if(RESET) count_13d_flop_r <= `DLY 1'b0; else if(enable_cc_c && reset_r) count_13d_flop_r <= `DLY 1'b1; else count_13d_flop_r <= `DLY inner_count_done_r; // The middle count for the CC counter counts to 16. Its count increments only // when the inner count is done. It is implemented using an SRL16 and a flop // The SRL counts 15 bits of the count. It is enabled only when the inner count // is done always @(posedge USER_CLK) if(RESET) count_16d_srl_r <= `DLY 15'b000000000000000; else if(inner_count_done_r|| !enable_cc_c) count_16d_srl_r <= `DLY {count_16d_flop_r, count_16d_srl_r[0:13]}; // The middle count is done when a 1 reaches the end of the SRL and the inner // count finishes assign middle_count_done_c = inner_count_done_r && count_16d_srl_r[14]; // The flop extends the shift register to 16 bits for counting. It is held at // zero while channel up is low to clear the register, and is seeded with a // single 1 when channel up transitions from 0 to 1 always @(posedge USER_CLK) if(RESET) count_16d_flop_r <= `DLY 1'b0; else if(enable_cc_c && reset_r) count_16d_flop_r <= `DLY 1'b1; else if(inner_count_done_r) count_16d_flop_r <= `DLY middle_count_done_c; // The outer count (aka the cc idle count) is done when it reaches 24. Its count // increments only when the middle count is done. It is implemented with 2 SRL16s // and a flop // The SRL counts 23 bits of the count. It is enabled only when the middle count is // done always @(posedge USER_CLK) if(RESET) count_24d_srl_r <= `DLY 23'b00000000000000000000000; else if(middle_count_done_c || !enable_cc_c) count_24d_srl_r <= `DLY {count_24d_flop_r, count_24d_srl_r[0:21]}; // The cc idle count is done when a 1 reaches the end of the SRL and the middle count finishes assign cc_idle_count_done_c = middle_count_done_c & count_24d_srl_r[22]; // The flop extends the shift register to 24 bits for counting. It is held at // zero while channel up is low to clear the register, and is seeded with a single // 1 when channel up transitions from 0 to 1 always @(posedge USER_CLK) if(RESET) count_24d_flop_r <= `DLY 1'b0; else if(enable_cc_c && reset_r) count_24d_flop_r <= `DLY 1'b1; else if(middle_count_done_c) count_24d_flop_r <= `DLY cc_idle_count_done_c; // For simulation, initialize prepare count to all zeros to simulate an SRL16 // after configuration. The circuit will also work is the init value includes // ones. initial prepare_count_r = 10'b0000000000; // Because UFC and CC sequences are not allowed to preempt one another, there // there is a warning signal to indicate an impending CC sequence. This signal // is used to prevent UFC messages from starting. // For 4 lanes we use a 4-cycle count. always @(posedge USER_CLK) if(RESET) prepare_count_r <= `DLY 10'b0000000000; else prepare_count_r <= `DLY {6'd0,cc_idle_count_done_c,prepare_count_r[6:8]}; // The state machine stays in the prepare_cc state from when the cc idle // count finishes, to when the prepare count has finished. While in this // state, UFC operations cannot start, which prevents them from having to // be pre-empted by CC sequences. always @(posedge USER_CLK) if(RESET) WARN_CC <= `DLY 1'b0; else if(cc_idle_count_done_c) WARN_CC <= `DLY 1'b1; else if(prepare_count_r[9]) WARN_CC <= `DLY 1'b0; // For simulation, init to zeros, to simulate an SRL after configuration. The circuit // will also operate if the SRL is not initialized to all zeros initial cc_count_r = 6'b000000; // Track the state of channel up on the previous cycle. We use this signal to determine // when to seed the shift register counters with ones always @(posedge USER_CLK) reset_r <= `DLY RESET; //Do a CC after enable_cc_c is asserted or CC_warning is complete. assign start_cc_c = prepare_count_r[9] || (enable_cc_c && reset_r); // This SRL counter keeps track of the number of cycles spent in the CC // sequence. It starts counting when the prepare_cc state ends, and // finishes counting after 6 cycles have passed. always @(posedge USER_CLK) if(RESET) cc_count_r <= `DLY 6'b000000; else cc_count_r <= `DLY {(!enable_cc_c|prepare_count_r[9]),cc_count_r[0:4]}; // The TX_LL module stays in the do_cc state for 6 cycles. It starts // when the prepare_cc state ends. always @(posedge USER_CLK) if(RESET) DO_CC <= `DLY 1'b0; else if(start_cc_c) DO_CC <= `DLY 1'b1; else if(cc_count_r) DO_CC <= `DLY 1'b1; else DO_CC <= `DLY 1'b0; endmodule
//====================================================================== // // trng_debug_ctrl.v // ----------------- // Debug and control module in the Cryptech TRNG. // // // Author: Joachim Strombergson // Copyright (c) 2014, Secworks Sweden AB // All rights reserved. // // Redistribution and use in source and binary forms, with or // without modification, are permitted provided that the following // conditions are met: // // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in // the documentation and/or other materials provided with the // distribution. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // //====================================================================== module trng_debug_ctrl( // Clock and reset. input wire clk, input wire reset_n, // Control. input wire cs, input wire we, // Data ports. input wire [7 : 0] address, input wire [31 : 0] write_data, output wire [31 : 0] read_data, output wire error, // Debug and control ports output wire csprng_debug_mode, output wire [4 : 0] csprng_num_rounds, output wire csprng_reseed, input wire csprng_error, output wire security_error ); //---------------------------------------------------------------- // Internal constant and parameter definitions. //---------------------------------------------------------------- parameter ADDR_NAME0 = 8'h00; parameter ADDR_NAME1 = 8'h01; parameter ADDR_VERSION = 8'h02; parameter CORE_NAME0 = 32'h73686132; // "sha2" parameter CORE_NAME1 = 32'h2d323536; // "-512" parameter CORE_VERSION = 32'h302e3830; // "0.80" //---------------------------------------------------------------- // Registers including update variables and write enable. //---------------------------------------------------------------- //---------------------------------------------------------------- // Wires. //---------------------------------------------------------------- reg [31 : 0] tmp_read_data; reg tmp_error; //---------------------------------------------------------------- // Concurrent connectivity for ports etc. //---------------------------------------------------------------- assign read_data = tmp_read_data; assign error = tmp_error; //---------------------------------------------------------------- // core instantiation. //---------------------------------------------------------------- //---------------------------------------------------------------- // reg_update // // Update functionality for all registers in the core. // All registers are positive edge triggered with synchronous // active low reset. All registers have write enable. //---------------------------------------------------------------- always @ (posedge clk) begin if (!reset_n) begin end else begin end end // reg_update //---------------------------------------------------------------- // api_logic // // Implementation of the api logic. If cs is enabled will either // try to write to or read from the internal registers. //---------------------------------------------------------------- always @* begin : api_logic tmp_read_data = 32'h00000000; tmp_error = 0; if (cs) begin if (we) begin case (address) // Write operations. default: begin tmp_error = 1; end endcase // case (address) end // if (we) else begin case (address) // Read operations. ADDR_NAME0: begin tmp_read_data = CORE_NAME0; end ADDR_NAME1: begin tmp_read_data = CORE_NAME1; end ADDR_VERSION: begin tmp_read_data = CORE_VERSION; end default: begin tmp_error = 1; end endcase // case (address) end end end // addr_decoder endmodule // trng_debug_ctrl //====================================================================== // EOF trng_debug_ctrl.v //======================================================================
/* * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ `ifndef SKY130_FD_SC_LP__BUSDRIVERNOVLP_FUNCTIONAL_V `define SKY130_FD_SC_LP__BUSDRIVERNOVLP_FUNCTIONAL_V /** * busdrivernovlp: Bus driver, enable gates pulldown only (pmoshvt * devices). * * Verilog simulation functional model. */ `timescale 1ns / 1ps `default_nettype none `celldefine module sky130_fd_sc_lp__busdrivernovlp ( Z , A , TE_B ); // Module ports output Z ; input A ; input TE_B; // Name Output Other arguments bufif0 bufif00 (Z , A, TE_B ); endmodule `endcelldefine `default_nettype wire `endif // SKY130_FD_SC_LP__BUSDRIVERNOVLP_FUNCTIONAL_V
module ARM_CU_ALU( input MFC , Reset , Clk , MEMSTORE,MEMLOAD, input [31:0] MEMDAT, output [7:0] MEMADD, output MFA,READ_WRITE,WORD_BYTE); wire[31:0] IR; wire IR_CU, RFLOAD, PCLOAD, SRLOAD, SRENABLED, ALUSTORE, MFA, WORD_BYTE, READ_WRITE, IRLOAD, MBRLOAD, MBRSTORE, MARLOAD; wire [4:0] opcode; wire [3:0] CU; reg [19:0] RSLCT; wire [31:0] Rn,Rm,Rs,PCout,Out; wire [3:0] SRIN, _SRIN,SROUT; wire SR29_OUT,S; wire[31:0] _B; //ControlUnit (output reg IR_CU, RFLOAD, PCLOAD, SRLOAD, SRENABLED, ALUSTORE, MFA, WORD_BYTE,READ_WRITE,IRLOAD,MBRLOAD,MBRSTORE,MARLOAD,output reg[4:0] opcode, output[3:0] CU, input MFC, Reset,Clk); ControlUnit cu(IR_CU, RFLOAD, PCLOAD, SRLOAD, SRENABLED, ALUSTORE, MFA, WORD_BYTE, READ_WRITE, IRLOAD, MBRLOAD, MBRSTORE, MARLOAD,opcode,CU,MFC,Reset,Clk,IR,SROUT); always@(IR or CU) begin RSLCT = {CU,IR[15:8],IR[3:0], IR[19:16]}; end //RegisterFile(input [31:0] in,Pcin,input [19:0] RSLCT,input Clk, RESET, LOADPC, LOAD,IR_CU, output [31:0] Rn,Rm,Rs,PCout); RegisterFile RF(Out,Out,RSLCT,Clk, Reset, PCLOAD, RFLOAD,IR_CU, Rn,Rm,Rs,PCout); //assign S = IR[20]&SRENABLED; assign _SRIN = {SROUT[3],SROUT[2],SR29_OUT,SROUT[0]}; //ARM_ALU(input wire [31:0] A,B,input wire[4:0] OP,input wire [3:0] FLAGS,output wire [31:0] Out,output wire [3:0] FLAGS_OUT, input wire S,ALU_OUT,); ARM_ALU alu(Rn,_B, opcode, _SRIN, Out,SRIN,IR[20],ALUSTORE); //BarrelShifter(input [31] Rs,Rm,IR,input SR29_IN,output SR29_OUT,output [31:0] Out); BarrelShifter bs(Rs,Rm,IR,SROUT[1],SR29_OUT,_B); //IR //module Register(input [31:0] IN,input Clk, Reset,Load,output [31:0] OUT); Register IRR( .IN(Out), .Clk(Clk), .Reset(Reset), .Load(IRLOAD), .OUT(IR)); //MBR //Register2Buff(inout [31:0] IN,IN2,input Clk, Reset,Load,Load2,Store,Store2); Register2Buff register( .IN(Out), .IN2(MEMDAT), .Clk(Clk), .Reset(Reset), .Load(MBRLOAD), .Load2(MEMLOAD), .Store(MBRSTORE), .Store2(MEMSTORE)); //MAR //module Register(input [31:0] IN,input Clk, Reset,Load,output [31:0] OUT); Register MAR( .IN(Out), .Clk(Clk), .Reset(Reset), .Load(MARLOAD), .OUT(MEMADD)); //SR //module Register(input [31:0] IN,input Clk, Reset,Load,output [31:0] OUT); Register SR( .IN(SRIN), .Clk(Clk), .Reset(Reset), .Load(IR[20]), .OUT(SROUT)); endmodule //iverilog ARM_ALU.v BarrelShifter.v Buffer32_32.v controlunit6.v Decoder4x16.v Multiplexer2x1_32b.v Register.v Register2.v RegisterFile.v Register2Buff.v ARM_CU_ALU.v
// (c) Copyright 1995-2015 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. // // DO NOT MODIFY THIS FILE. // IP VLNV: xilinx.com:ip:fifo_generator:12.0 // IP Revision: 2 `timescale 1ns/1ps (* DowngradeIPIdentifiedWarnings = "yes" *) module shd_fifo ( rst, wr_clk, rd_clk, din, wr_en, rd_en, dout, full, empty ); input wire rst; input wire wr_clk; input wire rd_clk; (* X_INTERFACE_INFO = "xilinx.com:interface:fifo_write:1.0 FIFO_WRITE WR_DATA" *) input wire [255 : 0] din; (* X_INTERFACE_INFO = "xilinx.com:interface:fifo_write:1.0 FIFO_WRITE WR_EN" *) input wire wr_en; (* X_INTERFACE_INFO = "xilinx.com:interface:fifo_read:1.0 FIFO_READ RD_EN" *) input wire rd_en; (* X_INTERFACE_INFO = "xilinx.com:interface:fifo_read:1.0 FIFO_READ RD_DATA" *) output wire [255 : 0] dout; (* X_INTERFACE_INFO = "xilinx.com:interface:fifo_write:1.0 FIFO_WRITE FULL" *) output wire full; (* X_INTERFACE_INFO = "xilinx.com:interface:fifo_read:1.0 FIFO_READ EMPTY" *) output wire empty; fifo_generator_v12_0 #( .C_COMMON_CLOCK(0), .C_COUNT_TYPE(0), .C_DATA_COUNT_WIDTH(9), .C_DEFAULT_VALUE("BlankString"), .C_DIN_WIDTH(256), .C_DOUT_RST_VAL("0"), .C_DOUT_WIDTH(256), .C_ENABLE_RLOCS(0), .C_FAMILY("virtex7"), .C_FULL_FLAGS_RST_VAL(1), .C_HAS_ALMOST_EMPTY(0), .C_HAS_ALMOST_FULL(0), .C_HAS_BACKUP(0), .C_HAS_DATA_COUNT(0), .C_HAS_INT_CLK(0), .C_HAS_MEMINIT_FILE(0), .C_HAS_OVERFLOW(0), .C_HAS_RD_DATA_COUNT(0), .C_HAS_RD_RST(0), .C_HAS_RST(1), .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(2), .C_INIT_WR_PNTR_VAL(0), .C_MEMORY_TYPE(1), .C_MIF_FILE_NAME("BlankString"), .C_OPTIMIZATION_MODE(0), .C_OVERFLOW_LOW(0), .C_PRELOAD_LATENCY(0), .C_PRELOAD_REGS(1), .C_PRIM_FIFO_TYPE("512x72"), .C_PROG_EMPTY_THRESH_ASSERT_VAL(4), .C_PROG_EMPTY_THRESH_NEGATE_VAL(5), .C_PROG_EMPTY_TYPE(0), .C_PROG_FULL_THRESH_ASSERT_VAL(511), .C_PROG_FULL_THRESH_NEGATE_VAL(510), .C_PROG_FULL_TYPE(0), .C_RD_DATA_COUNT_WIDTH(9), .C_RD_DEPTH(512), .C_RD_FREQ(1), .C_RD_PNTR_WIDTH(9), .C_UNDERFLOW_LOW(0), .C_USE_DOUT_RST(1), .C_USE_ECC(0), .C_USE_EMBEDDED_REG(0), .C_USE_PIPELINE_REG(0), .C_POWER_SAVING_MODE(0), .C_USE_FIFO16_FLAGS(0), .C_USE_FWFT_DATA_COUNT(0), .C_VALID_LOW(0), .C_WR_ACK_LOW(0), .C_WR_DATA_COUNT_WIDTH(9), .C_WR_DEPTH(512), .C_WR_FREQ(1), .C_WR_PNTR_WIDTH(9), .C_WR_RESPONSE_LATENCY(1), .C_MSGON_VAL(1), .C_ENABLE_RST_SYNC(1), .C_ERROR_INJECTION_TYPE(0), .C_SYNCHRONIZER_STAGE(2), .C_INTERFACE_TYPE(0), .C_AXI_TYPE(1), .C_HAS_AXI_WR_CHANNEL(1), .C_HAS_AXI_RD_CHANNEL(1), .C_HAS_SLAVE_CE(0), .C_HAS_MASTER_CE(0), .C_ADD_NGC_CONSTRAINT(0), .C_USE_COMMON_OVERFLOW(0), .C_USE_COMMON_UNDERFLOW(0), .C_USE_DEFAULT_SETTINGS(0), .C_AXI_ID_WIDTH(1), .C_AXI_ADDR_WIDTH(32), .C_AXI_DATA_WIDTH(64), .C_AXI_LEN_WIDTH(8), .C_AXI_LOCK_WIDTH(1), .C_HAS_AXI_ID(0), .C_HAS_AXI_AWUSER(0), .C_HAS_AXI_WUSER(0), .C_HAS_AXI_BUSER(0), .C_HAS_AXI_ARUSER(0), .C_HAS_AXI_RUSER(0), .C_AXI_ARUSER_WIDTH(1), .C_AXI_AWUSER_WIDTH(1), .C_AXI_WUSER_WIDTH(1), .C_AXI_BUSER_WIDTH(1), .C_AXI_RUSER_WIDTH(1), .C_HAS_AXIS_TDATA(1), .C_HAS_AXIS_TID(0), .C_HAS_AXIS_TDEST(0), .C_HAS_AXIS_TUSER(1), .C_HAS_AXIS_TREADY(1), .C_HAS_AXIS_TLAST(0), .C_HAS_AXIS_TSTRB(0), .C_HAS_AXIS_TKEEP(0), .C_AXIS_TDATA_WIDTH(8), .C_AXIS_TID_WIDTH(1), .C_AXIS_TDEST_WIDTH(1), .C_AXIS_TUSER_WIDTH(4), .C_AXIS_TSTRB_WIDTH(1), .C_AXIS_TKEEP_WIDTH(1), .C_WACH_TYPE(0), .C_WDCH_TYPE(0), .C_WRCH_TYPE(0), .C_RACH_TYPE(0), .C_RDCH_TYPE(0), .C_AXIS_TYPE(0), .C_IMPLEMENTATION_TYPE_WACH(1), .C_IMPLEMENTATION_TYPE_WDCH(1), .C_IMPLEMENTATION_TYPE_WRCH(1), .C_IMPLEMENTATION_TYPE_RACH(1), .C_IMPLEMENTATION_TYPE_RDCH(1), .C_IMPLEMENTATION_TYPE_AXIS(1), .C_APPLICATION_TYPE_WACH(0), .C_APPLICATION_TYPE_WDCH(0), .C_APPLICATION_TYPE_WRCH(0), .C_APPLICATION_TYPE_RACH(0), .C_APPLICATION_TYPE_RDCH(0), .C_APPLICATION_TYPE_AXIS(0), .C_PRIM_FIFO_TYPE_WACH("512x36"), .C_PRIM_FIFO_TYPE_WDCH("1kx36"), .C_PRIM_FIFO_TYPE_WRCH("512x36"), .C_PRIM_FIFO_TYPE_RACH("512x36"), .C_PRIM_FIFO_TYPE_RDCH("1kx36"), .C_PRIM_FIFO_TYPE_AXIS("1kx18"), .C_USE_ECC_WACH(0), .C_USE_ECC_WDCH(0), .C_USE_ECC_WRCH(0), .C_USE_ECC_RACH(0), .C_USE_ECC_RDCH(0), .C_USE_ECC_AXIS(0), .C_ERROR_INJECTION_TYPE_WACH(0), .C_ERROR_INJECTION_TYPE_WDCH(0), .C_ERROR_INJECTION_TYPE_WRCH(0), .C_ERROR_INJECTION_TYPE_RACH(0), .C_ERROR_INJECTION_TYPE_RDCH(0), .C_ERROR_INJECTION_TYPE_AXIS(0), .C_DIN_WIDTH_WACH(32), .C_DIN_WIDTH_WDCH(64), .C_DIN_WIDTH_WRCH(2), .C_DIN_WIDTH_RACH(32), .C_DIN_WIDTH_RDCH(64), .C_DIN_WIDTH_AXIS(1), .C_WR_DEPTH_WACH(16), .C_WR_DEPTH_WDCH(1024), .C_WR_DEPTH_WRCH(16), .C_WR_DEPTH_RACH(16), .C_WR_DEPTH_RDCH(1024), .C_WR_DEPTH_AXIS(1024), .C_WR_PNTR_WIDTH_WACH(4), .C_WR_PNTR_WIDTH_WDCH(10), .C_WR_PNTR_WIDTH_WRCH(4), .C_WR_PNTR_WIDTH_RACH(4), .C_WR_PNTR_WIDTH_RDCH(10), .C_WR_PNTR_WIDTH_AXIS(10), .C_HAS_DATA_COUNTS_WACH(0), .C_HAS_DATA_COUNTS_WDCH(0), .C_HAS_DATA_COUNTS_WRCH(0), .C_HAS_DATA_COUNTS_RACH(0), .C_HAS_DATA_COUNTS_RDCH(0), .C_HAS_DATA_COUNTS_AXIS(0), .C_HAS_PROG_FLAGS_WACH(0), .C_HAS_PROG_FLAGS_WDCH(0), .C_HAS_PROG_FLAGS_WRCH(0), .C_HAS_PROG_FLAGS_RACH(0), .C_HAS_PROG_FLAGS_RDCH(0), .C_HAS_PROG_FLAGS_AXIS(0), .C_PROG_FULL_TYPE_WACH(0), .C_PROG_FULL_TYPE_WDCH(0), .C_PROG_FULL_TYPE_WRCH(0), .C_PROG_FULL_TYPE_RACH(0), .C_PROG_FULL_TYPE_RDCH(0), .C_PROG_FULL_TYPE_AXIS(0), .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_ASSERT_VAL_RACH(1023), .C_PROG_FULL_THRESH_ASSERT_VAL_RDCH(1023), .C_PROG_FULL_THRESH_ASSERT_VAL_AXIS(1023), .C_PROG_EMPTY_TYPE_WACH(0), .C_PROG_EMPTY_TYPE_WDCH(0), .C_PROG_EMPTY_TYPE_WRCH(0), .C_PROG_EMPTY_TYPE_RACH(0), .C_PROG_EMPTY_TYPE_RDCH(0), .C_PROG_EMPTY_TYPE_AXIS(0), .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_ASSERT_VAL_RACH(1022), .C_PROG_EMPTY_THRESH_ASSERT_VAL_RDCH(1022), .C_PROG_EMPTY_THRESH_ASSERT_VAL_AXIS(1022), .C_REG_SLICE_MODE_WACH(0), .C_REG_SLICE_MODE_WDCH(0), .C_REG_SLICE_MODE_WRCH(0), .C_REG_SLICE_MODE_RACH(0), .C_REG_SLICE_MODE_RDCH(0), .C_REG_SLICE_MODE_AXIS(0) ) inst ( .backup(1'D0), .backup_marker(1'D0), .clk(1'D0), .rst(rst), .srst(1'D0), .wr_clk(wr_clk), .wr_rst(1'D0), .rd_clk(rd_clk), .rd_rst(1'D0), .din(din), .wr_en(wr_en), .rd_en(rd_en), .prog_empty_thresh(9'B0), .prog_empty_thresh_assert(9'B0), .prog_empty_thresh_negate(9'B0), .prog_full_thresh(9'B0), .prog_full_thresh_assert(9'B0), .prog_full_thresh_negate(9'B0), .int_clk(1'D0), .injectdbiterr(1'D0), .injectsbiterr(1'D0), .sleep(1'D0), .dout(dout), .full(full), .almost_full(), .wr_ack(), .overflow(), .empty(empty), .almost_empty(), .valid(), .underflow(), .data_count(), .rd_data_count(), .wr_data_count(), .prog_full(), .prog_empty(), .sbiterr(), .dbiterr(), .wr_rst_busy(), .rd_rst_busy(), .m_aclk(1'D0), .s_aclk(1'D0), .s_aresetn(1'D0), .m_aclk_en(1'D0), .s_aclk_en(1'D0), .s_axi_awid(1'B0), .s_axi_awaddr(32'B0), .s_axi_awlen(8'B0), .s_axi_awsize(3'B0), .s_axi_awburst(2'B0), .s_axi_awlock(1'B0), .s_axi_awcache(4'B0), .s_axi_awprot(3'B0), .s_axi_awqos(4'B0), .s_axi_awregion(4'B0), .s_axi_awuser(1'B0), .s_axi_awvalid(1'D0), .s_axi_awready(), .s_axi_wid(1'B0), .s_axi_wdata(64'B0), .s_axi_wstrb(8'B0), .s_axi_wlast(1'D0), .s_axi_wuser(1'B0), .s_axi_wvalid(1'D0), .s_axi_wready(), .s_axi_bid(), .s_axi_bresp(), .s_axi_buser(), .s_axi_bvalid(), .s_axi_bready(1'D0), .m_axi_awid(), .m_axi_awaddr(), .m_axi_awlen(), .m_axi_awsize(), .m_axi_awburst(), .m_axi_awlock(), .m_axi_awcache(), .m_axi_awprot(), .m_axi_awqos(), .m_axi_awregion(), .m_axi_awuser(), .m_axi_awvalid(), .m_axi_awready(1'D0), .m_axi_wid(), .m_axi_wdata(), .m_axi_wstrb(), .m_axi_wlast(), .m_axi_wuser(), .m_axi_wvalid(), .m_axi_wready(1'D0), .m_axi_bid(1'B0), .m_axi_bresp(2'B0), .m_axi_buser(1'B0), .m_axi_bvalid(1'D0), .m_axi_bready(), .s_axi_arid(1'B0), .s_axi_araddr(32'B0), .s_axi_arlen(8'B0), .s_axi_arsize(3'B0), .s_axi_arburst(2'B0), .s_axi_arlock(1'B0), .s_axi_arcache(4'B0), .s_axi_arprot(3'B0), .s_axi_arqos(4'B0), .s_axi_arregion(4'B0), .s_axi_aruser(1'B0), .s_axi_arvalid(1'D0), .s_axi_arready(), .s_axi_rid(), .s_axi_rdata(), .s_axi_rresp(), .s_axi_rlast(), .s_axi_ruser(), .s_axi_rvalid(), .s_axi_rready(1'D0), .m_axi_arid(), .m_axi_araddr(), .m_axi_arlen(), .m_axi_arsize(), .m_axi_arburst(), .m_axi_arlock(), .m_axi_arcache(), .m_axi_arprot(), .m_axi_arqos(), .m_axi_arregion(), .m_axi_aruser(), .m_axi_arvalid(), .m_axi_arready(1'D0), .m_axi_rid(1'B0), .m_axi_rdata(64'B0), .m_axi_rresp(2'B0), .m_axi_rlast(1'D0), .m_axi_ruser(1'B0), .m_axi_rvalid(1'D0), .m_axi_rready(), .s_axis_tvalid(1'D0), .s_axis_tready(), .s_axis_tdata(8'B0), .s_axis_tstrb(1'B0), .s_axis_tkeep(1'B0), .s_axis_tlast(1'D0), .s_axis_tid(1'B0), .s_axis_tdest(1'B0), .s_axis_tuser(4'B0), .m_axis_tvalid(), .m_axis_tready(1'D0), .m_axis_tdata(), .m_axis_tstrb(), .m_axis_tkeep(), .m_axis_tlast(), .m_axis_tid(), .m_axis_tdest(), .m_axis_tuser(), .axi_aw_injectsbiterr(1'D0), .axi_aw_injectdbiterr(1'D0), .axi_aw_prog_full_thresh(4'B0), .axi_aw_prog_empty_thresh(4'B0), .axi_aw_data_count(), .axi_aw_wr_data_count(), .axi_aw_rd_data_count(), .axi_aw_sbiterr(), .axi_aw_dbiterr(), .axi_aw_overflow(), .axi_aw_underflow(), .axi_aw_prog_full(), .axi_aw_prog_empty(), .axi_w_injectsbiterr(1'D0), .axi_w_injectdbiterr(1'D0), .axi_w_prog_full_thresh(10'B0), .axi_w_prog_empty_thresh(10'B0), .axi_w_data_count(), .axi_w_wr_data_count(), .axi_w_rd_data_count(), .axi_w_sbiterr(), .axi_w_dbiterr(), .axi_w_overflow(), .axi_w_underflow(), .axi_w_prog_full(), .axi_w_prog_empty(), .axi_b_injectsbiterr(1'D0), .axi_b_injectdbiterr(1'D0), .axi_b_prog_full_thresh(4'B0), .axi_b_prog_empty_thresh(4'B0), .axi_b_data_count(), .axi_b_wr_data_count(), .axi_b_rd_data_count(), .axi_b_sbiterr(), .axi_b_dbiterr(), .axi_b_overflow(), .axi_b_underflow(), .axi_b_prog_full(), .axi_b_prog_empty(), .axi_ar_injectsbiterr(1'D0), .axi_ar_injectdbiterr(1'D0), .axi_ar_prog_full_thresh(4'B0), .axi_ar_prog_empty_thresh(4'B0), .axi_ar_data_count(), .axi_ar_wr_data_count(), .axi_ar_rd_data_count(), .axi_ar_sbiterr(), .axi_ar_dbiterr(), .axi_ar_overflow(), .axi_ar_underflow(), .axi_ar_prog_full(), .axi_ar_prog_empty(), .axi_r_injectsbiterr(1'D0), .axi_r_injectdbiterr(1'D0), .axi_r_prog_full_thresh(10'B0), .axi_r_prog_empty_thresh(10'B0), .axi_r_data_count(), .axi_r_wr_data_count(), .axi_r_rd_data_count(), .axi_r_sbiterr(), .axi_r_dbiterr(), .axi_r_overflow(), .axi_r_underflow(), .axi_r_prog_full(), .axi_r_prog_empty(), .axis_injectsbiterr(1'D0), .axis_injectdbiterr(1'D0), .axis_prog_full_thresh(10'B0), .axis_prog_empty_thresh(10'B0), .axis_data_count(), .axis_wr_data_count(), .axis_rd_data_count(), .axis_sbiterr(), .axis_dbiterr(), .axis_overflow(), .axis_underflow(), .axis_prog_full(), .axis_prog_empty() ); endmodule
// Copyright 1986-2016 Xilinx, Inc. All Rights Reserved. // -------------------------------------------------------------------------------- // Tool Version: Vivado v.2016.4 (win64) Build 1733598 Wed Dec 14 22:35:39 MST 2016 // Date : Thu Feb 02 02:49:15 2017 // Host : TheMosass-PC running 64-bit major release (build 9200) // Command : write_verilog -force -mode funcsim -rename_top decalper_eb_ot_sdeen_pot_pi_dehcac_xnilix -prefix // decalper_eb_ot_sdeen_pot_pi_dehcac_xnilix_ design_1_processing_system7_0_0_sim_netlist.v // Design : design_1_processing_system7_0_0 // Purpose : This verilog netlist is a functional simulation representation of the design and should not be modified // or synthesized. This netlist cannot be used for SDF annotated simulation. // Device : xc7z010clg400-1 // -------------------------------------------------------------------------------- `timescale 1 ps / 1 ps (* CHECK_LICENSE_TYPE = "design_1_processing_system7_0_0,processing_system7_v5_5_processing_system7,{}" *) (* DowngradeIPIdentifiedWarnings = "yes" *) (* X_CORE_INFO = "processing_system7_v5_5_processing_system7,Vivado 2016.4" *) (* NotValidForBitStream *) module decalper_eb_ot_sdeen_pot_pi_dehcac_xnilix (I2C0_SDA_I, I2C0_SDA_O, I2C0_SDA_T, I2C0_SCL_I, I2C0_SCL_O, I2C0_SCL_T, SDIO0_WP, UART0_TX, UART0_RX, TTC0_WAVE0_OUT, TTC0_WAVE1_OUT, TTC0_WAVE2_OUT, USB0_PORT_INDCTL, USB0_VBUS_PWRSELECT, USB0_VBUS_PWRFAULT, M_AXI_GP0_ARVALID, M_AXI_GP0_AWVALID, M_AXI_GP0_BREADY, M_AXI_GP0_RREADY, M_AXI_GP0_WLAST, M_AXI_GP0_WVALID, M_AXI_GP0_ARID, M_AXI_GP0_AWID, M_AXI_GP0_WID, M_AXI_GP0_ARBURST, M_AXI_GP0_ARLOCK, M_AXI_GP0_ARSIZE, M_AXI_GP0_AWBURST, M_AXI_GP0_AWLOCK, M_AXI_GP0_AWSIZE, M_AXI_GP0_ARPROT, M_AXI_GP0_AWPROT, M_AXI_GP0_ARADDR, M_AXI_GP0_AWADDR, M_AXI_GP0_WDATA, M_AXI_GP0_ARCACHE, M_AXI_GP0_ARLEN, M_AXI_GP0_ARQOS, M_AXI_GP0_AWCACHE, M_AXI_GP0_AWLEN, M_AXI_GP0_AWQOS, M_AXI_GP0_WSTRB, M_AXI_GP0_ACLK, M_AXI_GP0_ARREADY, M_AXI_GP0_AWREADY, M_AXI_GP0_BVALID, M_AXI_GP0_RLAST, M_AXI_GP0_RVALID, M_AXI_GP0_WREADY, M_AXI_GP0_BID, M_AXI_GP0_RID, M_AXI_GP0_BRESP, M_AXI_GP0_RRESP, M_AXI_GP0_RDATA, IRQ_F2P, FCLK_CLK0, FCLK_RESET0_N, MIO, DDR_CAS_n, DDR_CKE, DDR_Clk_n, DDR_Clk, DDR_CS_n, DDR_DRSTB, DDR_ODT, DDR_RAS_n, DDR_WEB, DDR_BankAddr, DDR_Addr, DDR_VRN, DDR_VRP, DDR_DM, DDR_DQ, DDR_DQS_n, DDR_DQS, PS_SRSTB, PS_CLK, PS_PORB); (* X_INTERFACE_INFO = "xilinx.com:interface:iic:1.0 IIC_0 SDA_I" *) input I2C0_SDA_I; (* X_INTERFACE_INFO = "xilinx.com:interface:iic:1.0 IIC_0 SDA_O" *) output I2C0_SDA_O; (* X_INTERFACE_INFO = "xilinx.com:interface:iic:1.0 IIC_0 SDA_T" *) output I2C0_SDA_T; (* X_INTERFACE_INFO = "xilinx.com:interface:iic:1.0 IIC_0 SCL_I" *) input I2C0_SCL_I; (* X_INTERFACE_INFO = "xilinx.com:interface:iic:1.0 IIC_0 SCL_O" *) output I2C0_SCL_O; (* X_INTERFACE_INFO = "xilinx.com:interface:iic:1.0 IIC_0 SCL_T" *) output I2C0_SCL_T; (* X_INTERFACE_INFO = "xilinx.com:interface:sdio:1.0 SDIO_0 WP" *) input SDIO0_WP; (* X_INTERFACE_INFO = "xilinx.com:interface:uart:1.0 UART_0 TxD" *) output UART0_TX; (* X_INTERFACE_INFO = "xilinx.com:interface:uart:1.0 UART_0 RxD" *) input UART0_RX; output TTC0_WAVE0_OUT; output TTC0_WAVE1_OUT; output TTC0_WAVE2_OUT; (* X_INTERFACE_INFO = "xilinx.com:display_processing_system7:usbctrl:1.0 USBIND_0 PORT_INDCTL" *) output [1:0]USB0_PORT_INDCTL; (* X_INTERFACE_INFO = "xilinx.com:display_processing_system7:usbctrl:1.0 USBIND_0 VBUS_PWRSELECT" *) output USB0_VBUS_PWRSELECT; (* X_INTERFACE_INFO = "xilinx.com:display_processing_system7:usbctrl:1.0 USBIND_0 VBUS_PWRFAULT" *) input USB0_VBUS_PWRFAULT; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 ARVALID" *) output M_AXI_GP0_ARVALID; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 AWVALID" *) output M_AXI_GP0_AWVALID; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 BREADY" *) output M_AXI_GP0_BREADY; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 RREADY" *) output M_AXI_GP0_RREADY; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 WLAST" *) output M_AXI_GP0_WLAST; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 WVALID" *) output M_AXI_GP0_WVALID; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 ARID" *) output [11:0]M_AXI_GP0_ARID; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 AWID" *) output [11:0]M_AXI_GP0_AWID; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 WID" *) output [11:0]M_AXI_GP0_WID; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 ARBURST" *) output [1:0]M_AXI_GP0_ARBURST; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 ARLOCK" *) output [1:0]M_AXI_GP0_ARLOCK; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 ARSIZE" *) output [2:0]M_AXI_GP0_ARSIZE; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 AWBURST" *) output [1:0]M_AXI_GP0_AWBURST; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 AWLOCK" *) output [1:0]M_AXI_GP0_AWLOCK; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 AWSIZE" *) output [2:0]M_AXI_GP0_AWSIZE; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 ARPROT" *) output [2:0]M_AXI_GP0_ARPROT; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 AWPROT" *) output [2:0]M_AXI_GP0_AWPROT; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 ARADDR" *) output [31:0]M_AXI_GP0_ARADDR; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 AWADDR" *) output [31:0]M_AXI_GP0_AWADDR; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 WDATA" *) output [31:0]M_AXI_GP0_WDATA; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 ARCACHE" *) output [3:0]M_AXI_GP0_ARCACHE; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 ARLEN" *) output [3:0]M_AXI_GP0_ARLEN; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 ARQOS" *) output [3:0]M_AXI_GP0_ARQOS; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 AWCACHE" *) output [3:0]M_AXI_GP0_AWCACHE; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 AWLEN" *) output [3:0]M_AXI_GP0_AWLEN; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 AWQOS" *) output [3:0]M_AXI_GP0_AWQOS; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 WSTRB" *) output [3:0]M_AXI_GP0_WSTRB; (* X_INTERFACE_INFO = "xilinx.com:signal:clock:1.0 M_AXI_GP0_ACLK CLK" *) input M_AXI_GP0_ACLK; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 ARREADY" *) input M_AXI_GP0_ARREADY; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 AWREADY" *) input M_AXI_GP0_AWREADY; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 BVALID" *) input M_AXI_GP0_BVALID; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 RLAST" *) input M_AXI_GP0_RLAST; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 RVALID" *) input M_AXI_GP0_RVALID; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 WREADY" *) input M_AXI_GP0_WREADY; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 BID" *) input [11:0]M_AXI_GP0_BID; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 RID" *) input [11:0]M_AXI_GP0_RID; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 BRESP" *) input [1:0]M_AXI_GP0_BRESP; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 RRESP" *) input [1:0]M_AXI_GP0_RRESP; (* X_INTERFACE_INFO = "xilinx.com:interface:aximm:1.0 M_AXI_GP0 RDATA" *) input [31:0]M_AXI_GP0_RDATA; (* X_INTERFACE_INFO = "xilinx.com:signal:interrupt:1.0 IRQ_F2P INTERRUPT" *) input [0:0]IRQ_F2P; (* X_INTERFACE_INFO = "xilinx.com:signal:clock:1.0 FCLK_CLK0 CLK" *) output FCLK_CLK0; (* X_INTERFACE_INFO = "xilinx.com:signal:reset:1.0 FCLK_RESET0_N RST" *) output FCLK_RESET0_N; (* X_INTERFACE_INFO = "xilinx.com:display_processing_system7:fixedio:1.0 FIXED_IO MIO" *) inout [53:0]MIO; (* X_INTERFACE_INFO = "xilinx.com:interface:ddrx:1.0 DDR CAS_N" *) inout DDR_CAS_n; (* X_INTERFACE_INFO = "xilinx.com:interface:ddrx:1.0 DDR CKE" *) inout DDR_CKE; (* X_INTERFACE_INFO = "xilinx.com:interface:ddrx:1.0 DDR CK_N" *) inout DDR_Clk_n; (* X_INTERFACE_INFO = "xilinx.com:interface:ddrx:1.0 DDR CK_P" *) inout DDR_Clk; (* X_INTERFACE_INFO = "xilinx.com:interface:ddrx:1.0 DDR CS_N" *) inout DDR_CS_n; (* X_INTERFACE_INFO = "xilinx.com:interface:ddrx:1.0 DDR RESET_N" *) inout DDR_DRSTB; (* X_INTERFACE_INFO = "xilinx.com:interface:ddrx:1.0 DDR ODT" *) inout DDR_ODT; (* X_INTERFACE_INFO = "xilinx.com:interface:ddrx:1.0 DDR RAS_N" *) inout DDR_RAS_n; (* X_INTERFACE_INFO = "xilinx.com:interface:ddrx:1.0 DDR WE_N" *) inout DDR_WEB; (* X_INTERFACE_INFO = "xilinx.com:interface:ddrx:1.0 DDR BA" *) inout [2:0]DDR_BankAddr; (* X_INTERFACE_INFO = "xilinx.com:interface:ddrx:1.0 DDR ADDR" *) inout [14:0]DDR_Addr; (* X_INTERFACE_INFO = "xilinx.com:display_processing_system7:fixedio:1.0 FIXED_IO DDR_VRN" *) inout DDR_VRN; (* X_INTERFACE_INFO = "xilinx.com:display_processing_system7:fixedio:1.0 FIXED_IO DDR_VRP" *) inout DDR_VRP; (* X_INTERFACE_INFO = "xilinx.com:interface:ddrx:1.0 DDR DM" *) inout [3:0]DDR_DM; (* X_INTERFACE_INFO = "xilinx.com:interface:ddrx:1.0 DDR DQ" *) inout [31:0]DDR_DQ; (* X_INTERFACE_INFO = "xilinx.com:interface:ddrx:1.0 DDR DQS_N" *) inout [3:0]DDR_DQS_n; (* X_INTERFACE_INFO = "xilinx.com:interface:ddrx:1.0 DDR DQS_P" *) inout [3:0]DDR_DQS; (* X_INTERFACE_INFO = "xilinx.com:display_processing_system7:fixedio:1.0 FIXED_IO PS_SRSTB" *) inout PS_SRSTB; (* X_INTERFACE_INFO = "xilinx.com:display_processing_system7:fixedio:1.0 FIXED_IO PS_CLK" *) inout PS_CLK; (* X_INTERFACE_INFO = "xilinx.com:display_processing_system7:fixedio:1.0 FIXED_IO PS_PORB" *) inout PS_PORB; wire [14:0]DDR_Addr; wire [2:0]DDR_BankAddr; wire DDR_CAS_n; wire DDR_CKE; wire DDR_CS_n; wire DDR_Clk; wire DDR_Clk_n; wire [3:0]DDR_DM; wire [31:0]DDR_DQ; wire [3:0]DDR_DQS; wire [3:0]DDR_DQS_n; wire DDR_DRSTB; wire DDR_ODT; wire DDR_RAS_n; wire DDR_VRN; wire DDR_VRP; wire DDR_WEB; wire FCLK_CLK0; wire FCLK_RESET0_N; wire I2C0_SCL_I; wire I2C0_SCL_O; wire I2C0_SCL_T; wire I2C0_SDA_I; wire I2C0_SDA_O; wire I2C0_SDA_T; wire [0:0]IRQ_F2P; wire [53:0]MIO; wire M_AXI_GP0_ACLK; wire [31:0]M_AXI_GP0_ARADDR; wire [1:0]M_AXI_GP0_ARBURST; wire [3:0]M_AXI_GP0_ARCACHE; wire [11:0]M_AXI_GP0_ARID; wire [3:0]M_AXI_GP0_ARLEN; wire [1:0]M_AXI_GP0_ARLOCK; wire [2:0]M_AXI_GP0_ARPROT; wire [3:0]M_AXI_GP0_ARQOS; wire M_AXI_GP0_ARREADY; wire [2:0]M_AXI_GP0_ARSIZE; wire M_AXI_GP0_ARVALID; wire [31:0]M_AXI_GP0_AWADDR; wire [1:0]M_AXI_GP0_AWBURST; wire [3:0]M_AXI_GP0_AWCACHE; wire [11:0]M_AXI_GP0_AWID; wire [3:0]M_AXI_GP0_AWLEN; wire [1:0]M_AXI_GP0_AWLOCK; wire [2:0]M_AXI_GP0_AWPROT; wire [3:0]M_AXI_GP0_AWQOS; wire M_AXI_GP0_AWREADY; wire [2:0]M_AXI_GP0_AWSIZE; wire M_AXI_GP0_AWVALID; wire [11:0]M_AXI_GP0_BID; wire M_AXI_GP0_BREADY; wire [1:0]M_AXI_GP0_BRESP; wire M_AXI_GP0_BVALID; wire [31:0]M_AXI_GP0_RDATA; wire [11:0]M_AXI_GP0_RID; wire M_AXI_GP0_RLAST; wire M_AXI_GP0_RREADY; wire [1:0]M_AXI_GP0_RRESP; wire M_AXI_GP0_RVALID; wire [31:0]M_AXI_GP0_WDATA; wire [11:0]M_AXI_GP0_WID; wire M_AXI_GP0_WLAST; wire M_AXI_GP0_WREADY; wire [3:0]M_AXI_GP0_WSTRB; wire M_AXI_GP0_WVALID; wire PS_CLK; wire PS_PORB; wire PS_SRSTB; wire SDIO0_WP; wire TTC0_WAVE0_OUT; wire TTC0_WAVE1_OUT; wire TTC0_WAVE2_OUT; wire UART0_RX; wire UART0_TX; wire [1:0]USB0_PORT_INDCTL; wire USB0_VBUS_PWRFAULT; wire USB0_VBUS_PWRSELECT; wire NLW_inst_CAN0_PHY_TX_UNCONNECTED; wire NLW_inst_CAN1_PHY_TX_UNCONNECTED; wire NLW_inst_DMA0_DAVALID_UNCONNECTED; wire NLW_inst_DMA0_DRREADY_UNCONNECTED; wire NLW_inst_DMA0_RSTN_UNCONNECTED; wire NLW_inst_DMA1_DAVALID_UNCONNECTED; wire NLW_inst_DMA1_DRREADY_UNCONNECTED; wire NLW_inst_DMA1_RSTN_UNCONNECTED; wire NLW_inst_DMA2_DAVALID_UNCONNECTED; wire NLW_inst_DMA2_DRREADY_UNCONNECTED; wire NLW_inst_DMA2_RSTN_UNCONNECTED; wire NLW_inst_DMA3_DAVALID_UNCONNECTED; wire NLW_inst_DMA3_DRREADY_UNCONNECTED; wire NLW_inst_DMA3_RSTN_UNCONNECTED; wire NLW_inst_ENET0_GMII_TX_EN_UNCONNECTED; wire NLW_inst_ENET0_GMII_TX_ER_UNCONNECTED; wire NLW_inst_ENET0_MDIO_MDC_UNCONNECTED; wire NLW_inst_ENET0_MDIO_O_UNCONNECTED; wire NLW_inst_ENET0_MDIO_T_UNCONNECTED; wire NLW_inst_ENET0_PTP_DELAY_REQ_RX_UNCONNECTED; wire NLW_inst_ENET0_PTP_DELAY_REQ_TX_UNCONNECTED; wire NLW_inst_ENET0_PTP_PDELAY_REQ_RX_UNCONNECTED; wire NLW_inst_ENET0_PTP_PDELAY_REQ_TX_UNCONNECTED; wire NLW_inst_ENET0_PTP_PDELAY_RESP_RX_UNCONNECTED; wire NLW_inst_ENET0_PTP_PDELAY_RESP_TX_UNCONNECTED; wire NLW_inst_ENET0_PTP_SYNC_FRAME_RX_UNCONNECTED; wire NLW_inst_ENET0_PTP_SYNC_FRAME_TX_UNCONNECTED; wire NLW_inst_ENET0_SOF_RX_UNCONNECTED; wire NLW_inst_ENET0_SOF_TX_UNCONNECTED; wire NLW_inst_ENET1_GMII_TX_EN_UNCONNECTED; wire NLW_inst_ENET1_GMII_TX_ER_UNCONNECTED; wire NLW_inst_ENET1_MDIO_MDC_UNCONNECTED; wire NLW_inst_ENET1_MDIO_O_UNCONNECTED; wire NLW_inst_ENET1_MDIO_T_UNCONNECTED; wire NLW_inst_ENET1_PTP_DELAY_REQ_RX_UNCONNECTED; wire NLW_inst_ENET1_PTP_DELAY_REQ_TX_UNCONNECTED; wire NLW_inst_ENET1_PTP_PDELAY_REQ_RX_UNCONNECTED; wire NLW_inst_ENET1_PTP_PDELAY_REQ_TX_UNCONNECTED; wire NLW_inst_ENET1_PTP_PDELAY_RESP_RX_UNCONNECTED; wire NLW_inst_ENET1_PTP_PDELAY_RESP_TX_UNCONNECTED; wire NLW_inst_ENET1_PTP_SYNC_FRAME_RX_UNCONNECTED; wire NLW_inst_ENET1_PTP_SYNC_FRAME_TX_UNCONNECTED; wire NLW_inst_ENET1_SOF_RX_UNCONNECTED; wire NLW_inst_ENET1_SOF_TX_UNCONNECTED; wire NLW_inst_EVENT_EVENTO_UNCONNECTED; wire NLW_inst_FCLK_CLK1_UNCONNECTED; wire NLW_inst_FCLK_CLK2_UNCONNECTED; wire NLW_inst_FCLK_CLK3_UNCONNECTED; wire NLW_inst_FCLK_RESET1_N_UNCONNECTED; wire NLW_inst_FCLK_RESET2_N_UNCONNECTED; wire NLW_inst_FCLK_RESET3_N_UNCONNECTED; wire NLW_inst_FTMT_F2P_TRIGACK_0_UNCONNECTED; wire NLW_inst_FTMT_F2P_TRIGACK_1_UNCONNECTED; wire NLW_inst_FTMT_F2P_TRIGACK_2_UNCONNECTED; wire NLW_inst_FTMT_F2P_TRIGACK_3_UNCONNECTED; wire NLW_inst_FTMT_P2F_TRIG_0_UNCONNECTED; wire NLW_inst_FTMT_P2F_TRIG_1_UNCONNECTED; wire NLW_inst_FTMT_P2F_TRIG_2_UNCONNECTED; wire NLW_inst_FTMT_P2F_TRIG_3_UNCONNECTED; wire NLW_inst_I2C1_SCL_O_UNCONNECTED; wire NLW_inst_I2C1_SCL_T_UNCONNECTED; wire NLW_inst_I2C1_SDA_O_UNCONNECTED; wire NLW_inst_I2C1_SDA_T_UNCONNECTED; wire NLW_inst_IRQ_P2F_CAN0_UNCONNECTED; wire NLW_inst_IRQ_P2F_CAN1_UNCONNECTED; wire NLW_inst_IRQ_P2F_CTI_UNCONNECTED; wire NLW_inst_IRQ_P2F_DMAC0_UNCONNECTED; wire NLW_inst_IRQ_P2F_DMAC1_UNCONNECTED; wire NLW_inst_IRQ_P2F_DMAC2_UNCONNECTED; wire NLW_inst_IRQ_P2F_DMAC3_UNCONNECTED; wire NLW_inst_IRQ_P2F_DMAC4_UNCONNECTED; wire NLW_inst_IRQ_P2F_DMAC5_UNCONNECTED; wire NLW_inst_IRQ_P2F_DMAC6_UNCONNECTED; wire NLW_inst_IRQ_P2F_DMAC7_UNCONNECTED; wire NLW_inst_IRQ_P2F_DMAC_ABORT_UNCONNECTED; wire NLW_inst_IRQ_P2F_ENET0_UNCONNECTED; wire NLW_inst_IRQ_P2F_ENET1_UNCONNECTED; wire NLW_inst_IRQ_P2F_ENET_WAKE0_UNCONNECTED; wire NLW_inst_IRQ_P2F_ENET_WAKE1_UNCONNECTED; wire NLW_inst_IRQ_P2F_GPIO_UNCONNECTED; wire NLW_inst_IRQ_P2F_I2C0_UNCONNECTED; wire NLW_inst_IRQ_P2F_I2C1_UNCONNECTED; wire NLW_inst_IRQ_P2F_QSPI_UNCONNECTED; wire NLW_inst_IRQ_P2F_SDIO0_UNCONNECTED; wire NLW_inst_IRQ_P2F_SDIO1_UNCONNECTED; wire NLW_inst_IRQ_P2F_SMC_UNCONNECTED; wire NLW_inst_IRQ_P2F_SPI0_UNCONNECTED; wire NLW_inst_IRQ_P2F_SPI1_UNCONNECTED; wire NLW_inst_IRQ_P2F_UART0_UNCONNECTED; wire NLW_inst_IRQ_P2F_UART1_UNCONNECTED; wire NLW_inst_IRQ_P2F_USB0_UNCONNECTED; wire NLW_inst_IRQ_P2F_USB1_UNCONNECTED; wire NLW_inst_M_AXI_GP0_ARESETN_UNCONNECTED; wire NLW_inst_M_AXI_GP1_ARESETN_UNCONNECTED; wire NLW_inst_M_AXI_GP1_ARVALID_UNCONNECTED; wire NLW_inst_M_AXI_GP1_AWVALID_UNCONNECTED; wire NLW_inst_M_AXI_GP1_BREADY_UNCONNECTED; wire NLW_inst_M_AXI_GP1_RREADY_UNCONNECTED; wire NLW_inst_M_AXI_GP1_WLAST_UNCONNECTED; wire NLW_inst_M_AXI_GP1_WVALID_UNCONNECTED; wire NLW_inst_PJTAG_TDO_UNCONNECTED; wire NLW_inst_SDIO0_BUSPOW_UNCONNECTED; wire NLW_inst_SDIO0_CLK_UNCONNECTED; wire NLW_inst_SDIO0_CMD_O_UNCONNECTED; wire NLW_inst_SDIO0_CMD_T_UNCONNECTED; wire NLW_inst_SDIO0_LED_UNCONNECTED; wire NLW_inst_SDIO1_BUSPOW_UNCONNECTED; wire NLW_inst_SDIO1_CLK_UNCONNECTED; wire NLW_inst_SDIO1_CMD_O_UNCONNECTED; wire NLW_inst_SDIO1_CMD_T_UNCONNECTED; wire NLW_inst_SDIO1_LED_UNCONNECTED; wire NLW_inst_SPI0_MISO_O_UNCONNECTED; wire NLW_inst_SPI0_MISO_T_UNCONNECTED; wire NLW_inst_SPI0_MOSI_O_UNCONNECTED; wire NLW_inst_SPI0_MOSI_T_UNCONNECTED; wire NLW_inst_SPI0_SCLK_O_UNCONNECTED; wire NLW_inst_SPI0_SCLK_T_UNCONNECTED; wire NLW_inst_SPI0_SS1_O_UNCONNECTED; wire NLW_inst_SPI0_SS2_O_UNCONNECTED; wire NLW_inst_SPI0_SS_O_UNCONNECTED; wire NLW_inst_SPI0_SS_T_UNCONNECTED; wire NLW_inst_SPI1_MISO_O_UNCONNECTED; wire NLW_inst_SPI1_MISO_T_UNCONNECTED; wire NLW_inst_SPI1_MOSI_O_UNCONNECTED; wire NLW_inst_SPI1_MOSI_T_UNCONNECTED; wire NLW_inst_SPI1_SCLK_O_UNCONNECTED; wire NLW_inst_SPI1_SCLK_T_UNCONNECTED; wire NLW_inst_SPI1_SS1_O_UNCONNECTED; wire NLW_inst_SPI1_SS2_O_UNCONNECTED; wire NLW_inst_SPI1_SS_O_UNCONNECTED; wire NLW_inst_SPI1_SS_T_UNCONNECTED; wire NLW_inst_S_AXI_ACP_ARESETN_UNCONNECTED; wire NLW_inst_S_AXI_ACP_ARREADY_UNCONNECTED; wire NLW_inst_S_AXI_ACP_AWREADY_UNCONNECTED; wire NLW_inst_S_AXI_ACP_BVALID_UNCONNECTED; wire NLW_inst_S_AXI_ACP_RLAST_UNCONNECTED; wire NLW_inst_S_AXI_ACP_RVALID_UNCONNECTED; wire NLW_inst_S_AXI_ACP_WREADY_UNCONNECTED; wire NLW_inst_S_AXI_GP0_ARESETN_UNCONNECTED; wire NLW_inst_S_AXI_GP0_ARREADY_UNCONNECTED; wire NLW_inst_S_AXI_GP0_AWREADY_UNCONNECTED; wire NLW_inst_S_AXI_GP0_BVALID_UNCONNECTED; wire NLW_inst_S_AXI_GP0_RLAST_UNCONNECTED; wire NLW_inst_S_AXI_GP0_RVALID_UNCONNECTED; wire NLW_inst_S_AXI_GP0_WREADY_UNCONNECTED; wire NLW_inst_S_AXI_GP1_ARESETN_UNCONNECTED; wire NLW_inst_S_AXI_GP1_ARREADY_UNCONNECTED; wire NLW_inst_S_AXI_GP1_AWREADY_UNCONNECTED; wire NLW_inst_S_AXI_GP1_BVALID_UNCONNECTED; wire NLW_inst_S_AXI_GP1_RLAST_UNCONNECTED; wire NLW_inst_S_AXI_GP1_RVALID_UNCONNECTED; wire NLW_inst_S_AXI_GP1_WREADY_UNCONNECTED; wire NLW_inst_S_AXI_HP0_ARESETN_UNCONNECTED; wire NLW_inst_S_AXI_HP0_ARREADY_UNCONNECTED; wire NLW_inst_S_AXI_HP0_AWREADY_UNCONNECTED; wire NLW_inst_S_AXI_HP0_BVALID_UNCONNECTED; wire NLW_inst_S_AXI_HP0_RLAST_UNCONNECTED; wire NLW_inst_S_AXI_HP0_RVALID_UNCONNECTED; wire NLW_inst_S_AXI_HP0_WREADY_UNCONNECTED; wire NLW_inst_S_AXI_HP1_ARESETN_UNCONNECTED; wire NLW_inst_S_AXI_HP1_ARREADY_UNCONNECTED; wire NLW_inst_S_AXI_HP1_AWREADY_UNCONNECTED; wire NLW_inst_S_AXI_HP1_BVALID_UNCONNECTED; wire NLW_inst_S_AXI_HP1_RLAST_UNCONNECTED; wire NLW_inst_S_AXI_HP1_RVALID_UNCONNECTED; wire NLW_inst_S_AXI_HP1_WREADY_UNCONNECTED; wire NLW_inst_S_AXI_HP2_ARESETN_UNCONNECTED; wire NLW_inst_S_AXI_HP2_ARREADY_UNCONNECTED; wire NLW_inst_S_AXI_HP2_AWREADY_UNCONNECTED; wire NLW_inst_S_AXI_HP2_BVALID_UNCONNECTED; wire NLW_inst_S_AXI_HP2_RLAST_UNCONNECTED; wire NLW_inst_S_AXI_HP2_RVALID_UNCONNECTED; wire NLW_inst_S_AXI_HP2_WREADY_UNCONNECTED; wire NLW_inst_S_AXI_HP3_ARESETN_UNCONNECTED; wire NLW_inst_S_AXI_HP3_ARREADY_UNCONNECTED; wire NLW_inst_S_AXI_HP3_AWREADY_UNCONNECTED; wire NLW_inst_S_AXI_HP3_BVALID_UNCONNECTED; wire NLW_inst_S_AXI_HP3_RLAST_UNCONNECTED; wire NLW_inst_S_AXI_HP3_RVALID_UNCONNECTED; wire NLW_inst_S_AXI_HP3_WREADY_UNCONNECTED; wire NLW_inst_TRACE_CLK_OUT_UNCONNECTED; wire NLW_inst_TRACE_CTL_UNCONNECTED; wire NLW_inst_TTC1_WAVE0_OUT_UNCONNECTED; wire NLW_inst_TTC1_WAVE1_OUT_UNCONNECTED; wire NLW_inst_TTC1_WAVE2_OUT_UNCONNECTED; wire NLW_inst_UART0_DTRN_UNCONNECTED; wire NLW_inst_UART0_RTSN_UNCONNECTED; wire NLW_inst_UART1_DTRN_UNCONNECTED; wire NLW_inst_UART1_RTSN_UNCONNECTED; wire NLW_inst_UART1_TX_UNCONNECTED; wire NLW_inst_USB1_VBUS_PWRSELECT_UNCONNECTED; wire NLW_inst_WDT_RST_OUT_UNCONNECTED; wire [1:0]NLW_inst_DMA0_DATYPE_UNCONNECTED; wire [1:0]NLW_inst_DMA1_DATYPE_UNCONNECTED; wire [1:0]NLW_inst_DMA2_DATYPE_UNCONNECTED; wire [1:0]NLW_inst_DMA3_DATYPE_UNCONNECTED; wire [7:0]NLW_inst_ENET0_GMII_TXD_UNCONNECTED; wire [7:0]NLW_inst_ENET1_GMII_TXD_UNCONNECTED; wire [1:0]NLW_inst_EVENT_STANDBYWFE_UNCONNECTED; wire [1:0]NLW_inst_EVENT_STANDBYWFI_UNCONNECTED; wire [31:0]NLW_inst_FTMT_P2F_DEBUG_UNCONNECTED; wire [63:0]NLW_inst_GPIO_O_UNCONNECTED; wire [63:0]NLW_inst_GPIO_T_UNCONNECTED; wire [31:0]NLW_inst_M_AXI_GP1_ARADDR_UNCONNECTED; wire [1:0]NLW_inst_M_AXI_GP1_ARBURST_UNCONNECTED; wire [3:0]NLW_inst_M_AXI_GP1_ARCACHE_UNCONNECTED; wire [11:0]NLW_inst_M_AXI_GP1_ARID_UNCONNECTED; wire [3:0]NLW_inst_M_AXI_GP1_ARLEN_UNCONNECTED; wire [1:0]NLW_inst_M_AXI_GP1_ARLOCK_UNCONNECTED; wire [2:0]NLW_inst_M_AXI_GP1_ARPROT_UNCONNECTED; wire [3:0]NLW_inst_M_AXI_GP1_ARQOS_UNCONNECTED; wire [2:0]NLW_inst_M_AXI_GP1_ARSIZE_UNCONNECTED; wire [31:0]NLW_inst_M_AXI_GP1_AWADDR_UNCONNECTED; wire [1:0]NLW_inst_M_AXI_GP1_AWBURST_UNCONNECTED; wire [3:0]NLW_inst_M_AXI_GP1_AWCACHE_UNCONNECTED; wire [11:0]NLW_inst_M_AXI_GP1_AWID_UNCONNECTED; wire [3:0]NLW_inst_M_AXI_GP1_AWLEN_UNCONNECTED; wire [1:0]NLW_inst_M_AXI_GP1_AWLOCK_UNCONNECTED; wire [2:0]NLW_inst_M_AXI_GP1_AWPROT_UNCONNECTED; wire [3:0]NLW_inst_M_AXI_GP1_AWQOS_UNCONNECTED; wire [2:0]NLW_inst_M_AXI_GP1_AWSIZE_UNCONNECTED; wire [31:0]NLW_inst_M_AXI_GP1_WDATA_UNCONNECTED; wire [11:0]NLW_inst_M_AXI_GP1_WID_UNCONNECTED; wire [3:0]NLW_inst_M_AXI_GP1_WSTRB_UNCONNECTED; wire [2:0]NLW_inst_SDIO0_BUSVOLT_UNCONNECTED; wire [3:0]NLW_inst_SDIO0_DATA_O_UNCONNECTED; wire [3:0]NLW_inst_SDIO0_DATA_T_UNCONNECTED; wire [2:0]NLW_inst_SDIO1_BUSVOLT_UNCONNECTED; wire [3:0]NLW_inst_SDIO1_DATA_O_UNCONNECTED; wire [3:0]NLW_inst_SDIO1_DATA_T_UNCONNECTED; wire [2:0]NLW_inst_S_AXI_ACP_BID_UNCONNECTED; wire [1:0]NLW_inst_S_AXI_ACP_BRESP_UNCONNECTED; wire [63:0]NLW_inst_S_AXI_ACP_RDATA_UNCONNECTED; wire [2:0]NLW_inst_S_AXI_ACP_RID_UNCONNECTED; wire [1:0]NLW_inst_S_AXI_ACP_RRESP_UNCONNECTED; wire [5:0]NLW_inst_S_AXI_GP0_BID_UNCONNECTED; wire [1:0]NLW_inst_S_AXI_GP0_BRESP_UNCONNECTED; wire [31:0]NLW_inst_S_AXI_GP0_RDATA_UNCONNECTED; wire [5:0]NLW_inst_S_AXI_GP0_RID_UNCONNECTED; wire [1:0]NLW_inst_S_AXI_GP0_RRESP_UNCONNECTED; wire [5:0]NLW_inst_S_AXI_GP1_BID_UNCONNECTED; wire [1:0]NLW_inst_S_AXI_GP1_BRESP_UNCONNECTED; wire [31:0]NLW_inst_S_AXI_GP1_RDATA_UNCONNECTED; wire [5:0]NLW_inst_S_AXI_GP1_RID_UNCONNECTED; wire [1:0]NLW_inst_S_AXI_GP1_RRESP_UNCONNECTED; wire [5:0]NLW_inst_S_AXI_HP0_BID_UNCONNECTED; wire [1:0]NLW_inst_S_AXI_HP0_BRESP_UNCONNECTED; wire [2:0]NLW_inst_S_AXI_HP0_RACOUNT_UNCONNECTED; wire [7:0]NLW_inst_S_AXI_HP0_RCOUNT_UNCONNECTED; wire [63:0]NLW_inst_S_AXI_HP0_RDATA_UNCONNECTED; wire [5:0]NLW_inst_S_AXI_HP0_RID_UNCONNECTED; wire [1:0]NLW_inst_S_AXI_HP0_RRESP_UNCONNECTED; wire [5:0]NLW_inst_S_AXI_HP0_WACOUNT_UNCONNECTED; wire [7:0]NLW_inst_S_AXI_HP0_WCOUNT_UNCONNECTED; wire [5:0]NLW_inst_S_AXI_HP1_BID_UNCONNECTED; wire [1:0]NLW_inst_S_AXI_HP1_BRESP_UNCONNECTED; wire [2:0]NLW_inst_S_AXI_HP1_RACOUNT_UNCONNECTED; wire [7:0]NLW_inst_S_AXI_HP1_RCOUNT_UNCONNECTED; wire [63:0]NLW_inst_S_AXI_HP1_RDATA_UNCONNECTED; wire [5:0]NLW_inst_S_AXI_HP1_RID_UNCONNECTED; wire [1:0]NLW_inst_S_AXI_HP1_RRESP_UNCONNECTED; wire [5:0]NLW_inst_S_AXI_HP1_WACOUNT_UNCONNECTED; wire [7:0]NLW_inst_S_AXI_HP1_WCOUNT_UNCONNECTED; wire [5:0]NLW_inst_S_AXI_HP2_BID_UNCONNECTED; wire [1:0]NLW_inst_S_AXI_HP2_BRESP_UNCONNECTED; wire [2:0]NLW_inst_S_AXI_HP2_RACOUNT_UNCONNECTED; wire [7:0]NLW_inst_S_AXI_HP2_RCOUNT_UNCONNECTED; wire [63:0]NLW_inst_S_AXI_HP2_RDATA_UNCONNECTED; wire [5:0]NLW_inst_S_AXI_HP2_RID_UNCONNECTED; wire [1:0]NLW_inst_S_AXI_HP2_RRESP_UNCONNECTED; wire [5:0]NLW_inst_S_AXI_HP2_WACOUNT_UNCONNECTED; wire [7:0]NLW_inst_S_AXI_HP2_WCOUNT_UNCONNECTED; wire [5:0]NLW_inst_S_AXI_HP3_BID_UNCONNECTED; wire [1:0]NLW_inst_S_AXI_HP3_BRESP_UNCONNECTED; wire [2:0]NLW_inst_S_AXI_HP3_RACOUNT_UNCONNECTED; wire [7:0]NLW_inst_S_AXI_HP3_RCOUNT_UNCONNECTED; wire [63:0]NLW_inst_S_AXI_HP3_RDATA_UNCONNECTED; wire [5:0]NLW_inst_S_AXI_HP3_RID_UNCONNECTED; wire [1:0]NLW_inst_S_AXI_HP3_RRESP_UNCONNECTED; wire [5:0]NLW_inst_S_AXI_HP3_WACOUNT_UNCONNECTED; wire [7:0]NLW_inst_S_AXI_HP3_WCOUNT_UNCONNECTED; wire [1:0]NLW_inst_TRACE_DATA_UNCONNECTED; wire [1:0]NLW_inst_USB1_PORT_INDCTL_UNCONNECTED; PULLUP pullup_MIO_0 (.O(MIO[0])); PULLUP pullup_MIO_9 (.O(MIO[9])); PULLUP pullup_MIO_10 (.O(MIO[10])); PULLUP pullup_MIO_11 (.O(MIO[11])); PULLUP pullup_MIO_12 (.O(MIO[12])); PULLUP pullup_MIO_13 (.O(MIO[13])); PULLUP pullup_MIO_14 (.O(MIO[14])); PULLUP pullup_MIO_15 (.O(MIO[15])); PULLUP pullup_MIO_46 (.O(MIO[46])); (* C_DM_WIDTH = "4" *) (* C_DQS_WIDTH = "4" *) (* C_DQ_WIDTH = "32" *) (* C_EMIO_GPIO_WIDTH = "64" *) (* C_EN_EMIO_ENET0 = "0" *) (* C_EN_EMIO_ENET1 = "0" *) (* C_EN_EMIO_PJTAG = "0" *) (* C_EN_EMIO_TRACE = "0" *) (* C_FCLK_CLK0_BUF = "TRUE" *) (* C_FCLK_CLK1_BUF = "FALSE" *) (* C_FCLK_CLK2_BUF = "FALSE" *) (* C_FCLK_CLK3_BUF = "FALSE" *) (* C_GP0_EN_MODIFIABLE_TXN = "0" *) (* C_GP1_EN_MODIFIABLE_TXN = "0" *) (* C_INCLUDE_ACP_TRANS_CHECK = "0" *) (* C_INCLUDE_TRACE_BUFFER = "0" *) (* C_IRQ_F2P_MODE = "DIRECT" *) (* C_MIO_PRIMITIVE = "54" *) (* C_M_AXI_GP0_ENABLE_STATIC_REMAP = "0" *) (* C_M_AXI_GP0_ID_WIDTH = "12" *) (* C_M_AXI_GP0_THREAD_ID_WIDTH = "12" *) (* C_M_AXI_GP1_ENABLE_STATIC_REMAP = "0" *) (* C_M_AXI_GP1_ID_WIDTH = "12" *) (* C_M_AXI_GP1_THREAD_ID_WIDTH = "12" *) (* C_NUM_F2P_INTR_INPUTS = "1" *) (* C_PACKAGE_NAME = "clg400" *) (* C_PS7_SI_REV = "PRODUCTION" *) (* C_S_AXI_ACP_ARUSER_VAL = "31" *) (* C_S_AXI_ACP_AWUSER_VAL = "31" *) (* C_S_AXI_ACP_ID_WIDTH = "3" *) (* C_S_AXI_GP0_ID_WIDTH = "6" *) (* C_S_AXI_GP1_ID_WIDTH = "6" *) (* C_S_AXI_HP0_DATA_WIDTH = "64" *) (* C_S_AXI_HP0_ID_WIDTH = "6" *) (* C_S_AXI_HP1_DATA_WIDTH = "64" *) (* C_S_AXI_HP1_ID_WIDTH = "6" *) (* C_S_AXI_HP2_DATA_WIDTH = "64" *) (* C_S_AXI_HP2_ID_WIDTH = "6" *) (* C_S_AXI_HP3_DATA_WIDTH = "64" *) (* C_S_AXI_HP3_ID_WIDTH = "6" *) (* C_TRACE_BUFFER_CLOCK_DELAY = "12" *) (* C_TRACE_BUFFER_FIFO_SIZE = "128" *) (* C_TRACE_INTERNAL_WIDTH = "2" *) (* C_TRACE_PIPELINE_WIDTH = "8" *) (* C_USE_AXI_NONSECURE = "0" *) (* C_USE_DEFAULT_ACP_USER_VAL = "0" *) (* C_USE_M_AXI_GP0 = "1" *) (* C_USE_M_AXI_GP1 = "0" *) (* C_USE_S_AXI_ACP = "0" *) (* C_USE_S_AXI_GP0 = "0" *) (* C_USE_S_AXI_GP1 = "0" *) (* C_USE_S_AXI_HP0 = "0" *) (* C_USE_S_AXI_HP1 = "0" *) (* C_USE_S_AXI_HP2 = "0" *) (* C_USE_S_AXI_HP3 = "0" *) (* HW_HANDOFF = "design_1_processing_system7_0_0.hwdef" *) (* POWER = "<PROCESSOR name={system} numA9Cores={2} clockFreq={650} load={0.5} /><MEMORY name={code} memType={DDR3} dataWidth={32} clockFreq={525} readRate={0.5} writeRate={0.5} /><IO interface={GPIO_Bank_1} ioStandard={LVCMOS18} bidis={3} ioBank={Vcco_p1} clockFreq={1} usageRate={0.5} /><IO interface={GPIO_Bank_0} ioStandard={LVCMOS33} bidis={9} ioBank={Vcco_p0} clockFreq={1} usageRate={0.5} /><IO interface={Timer} ioStandard={} bidis={0} ioBank={} clockFreq={108.333336} usageRate={0.5} /><IO interface={I2C} ioStandard={} bidis={1} ioBank={} clockFreq={108.333336} usageRate={0.5} /><IO interface={UART} ioStandard={LVCMOS18} bidis={2} ioBank={Vcco_p1} clockFreq={100.000000} usageRate={0.5} /><IO interface={UART} ioStandard={} bidis={0} ioBank={} clockFreq={100.000000} usageRate={0.5} /><IO interface={SD} ioStandard={LVCMOS18} bidis={7} ioBank={Vcco_p1} clockFreq={50.000000} usageRate={0.5} /><IO interface={USB} ioStandard={LVCMOS18} bidis={12} ioBank={Vcco_p1} clockFreq={60} usageRate={0.5} /><IO interface={GigE} ioStandard={HSTL_I_18} bidis={14} ioBank={Vcco_p1} clockFreq={125.000000} usageRate={0.5} /><IO interface={QSPI} ioStandard={LVCMOS33} bidis={7} ioBank={Vcco_p0} clockFreq={200} usageRate={0.5} /><PLL domain={Processor} vco={1300.000} /><PLL domain={Memory} vco={1050.000} /><PLL domain={IO} vco={1000.000} /><AXI interface={M_AXI_GP0} dataWidth={32} clockFreq={100} usageRate={0.5} />/>" *) (* USE_TRACE_DATA_EDGE_DETECTOR = "0" *) decalper_eb_ot_sdeen_pot_pi_dehcac_xnilix_processing_system7_v5_5_processing_system7 inst (.CAN0_PHY_RX(1'b0), .CAN0_PHY_TX(NLW_inst_CAN0_PHY_TX_UNCONNECTED), .CAN1_PHY_RX(1'b0), .CAN1_PHY_TX(NLW_inst_CAN1_PHY_TX_UNCONNECTED), .Core0_nFIQ(1'b0), .Core0_nIRQ(1'b0), .Core1_nFIQ(1'b0), .Core1_nIRQ(1'b0), .DDR_ARB({1'b0,1'b0,1'b0,1'b0}), .DDR_Addr(DDR_Addr), .DDR_BankAddr(DDR_BankAddr), .DDR_CAS_n(DDR_CAS_n), .DDR_CKE(DDR_CKE), .DDR_CS_n(DDR_CS_n), .DDR_Clk(DDR_Clk), .DDR_Clk_n(DDR_Clk_n), .DDR_DM(DDR_DM), .DDR_DQ(DDR_DQ), .DDR_DQS(DDR_DQS), .DDR_DQS_n(DDR_DQS_n), .DDR_DRSTB(DDR_DRSTB), .DDR_ODT(DDR_ODT), .DDR_RAS_n(DDR_RAS_n), .DDR_VRN(DDR_VRN), .DDR_VRP(DDR_VRP), .DDR_WEB(DDR_WEB), .DMA0_ACLK(1'b0), .DMA0_DAREADY(1'b0), .DMA0_DATYPE(NLW_inst_DMA0_DATYPE_UNCONNECTED[1:0]), .DMA0_DAVALID(NLW_inst_DMA0_DAVALID_UNCONNECTED), .DMA0_DRLAST(1'b0), .DMA0_DRREADY(NLW_inst_DMA0_DRREADY_UNCONNECTED), .DMA0_DRTYPE({1'b0,1'b0}), .DMA0_DRVALID(1'b0), .DMA0_RSTN(NLW_inst_DMA0_RSTN_UNCONNECTED), .DMA1_ACLK(1'b0), .DMA1_DAREADY(1'b0), .DMA1_DATYPE(NLW_inst_DMA1_DATYPE_UNCONNECTED[1:0]), .DMA1_DAVALID(NLW_inst_DMA1_DAVALID_UNCONNECTED), .DMA1_DRLAST(1'b0), .DMA1_DRREADY(NLW_inst_DMA1_DRREADY_UNCONNECTED), .DMA1_DRTYPE({1'b0,1'b0}), .DMA1_DRVALID(1'b0), .DMA1_RSTN(NLW_inst_DMA1_RSTN_UNCONNECTED), .DMA2_ACLK(1'b0), .DMA2_DAREADY(1'b0), .DMA2_DATYPE(NLW_inst_DMA2_DATYPE_UNCONNECTED[1:0]), .DMA2_DAVALID(NLW_inst_DMA2_DAVALID_UNCONNECTED), .DMA2_DRLAST(1'b0), .DMA2_DRREADY(NLW_inst_DMA2_DRREADY_UNCONNECTED), .DMA2_DRTYPE({1'b0,1'b0}), .DMA2_DRVALID(1'b0), .DMA2_RSTN(NLW_inst_DMA2_RSTN_UNCONNECTED), .DMA3_ACLK(1'b0), .DMA3_DAREADY(1'b0), .DMA3_DATYPE(NLW_inst_DMA3_DATYPE_UNCONNECTED[1:0]), .DMA3_DAVALID(NLW_inst_DMA3_DAVALID_UNCONNECTED), .DMA3_DRLAST(1'b0), .DMA3_DRREADY(NLW_inst_DMA3_DRREADY_UNCONNECTED), .DMA3_DRTYPE({1'b0,1'b0}), .DMA3_DRVALID(1'b0), .DMA3_RSTN(NLW_inst_DMA3_RSTN_UNCONNECTED), .ENET0_EXT_INTIN(1'b0), .ENET0_GMII_COL(1'b0), .ENET0_GMII_CRS(1'b0), .ENET0_GMII_RXD({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .ENET0_GMII_RX_CLK(1'b0), .ENET0_GMII_RX_DV(1'b0), .ENET0_GMII_RX_ER(1'b0), .ENET0_GMII_TXD(NLW_inst_ENET0_GMII_TXD_UNCONNECTED[7:0]), .ENET0_GMII_TX_CLK(1'b0), .ENET0_GMII_TX_EN(NLW_inst_ENET0_GMII_TX_EN_UNCONNECTED), .ENET0_GMII_TX_ER(NLW_inst_ENET0_GMII_TX_ER_UNCONNECTED), .ENET0_MDIO_I(1'b0), .ENET0_MDIO_MDC(NLW_inst_ENET0_MDIO_MDC_UNCONNECTED), .ENET0_MDIO_O(NLW_inst_ENET0_MDIO_O_UNCONNECTED), .ENET0_MDIO_T(NLW_inst_ENET0_MDIO_T_UNCONNECTED), .ENET0_PTP_DELAY_REQ_RX(NLW_inst_ENET0_PTP_DELAY_REQ_RX_UNCONNECTED), .ENET0_PTP_DELAY_REQ_TX(NLW_inst_ENET0_PTP_DELAY_REQ_TX_UNCONNECTED), .ENET0_PTP_PDELAY_REQ_RX(NLW_inst_ENET0_PTP_PDELAY_REQ_RX_UNCONNECTED), .ENET0_PTP_PDELAY_REQ_TX(NLW_inst_ENET0_PTP_PDELAY_REQ_TX_UNCONNECTED), .ENET0_PTP_PDELAY_RESP_RX(NLW_inst_ENET0_PTP_PDELAY_RESP_RX_UNCONNECTED), .ENET0_PTP_PDELAY_RESP_TX(NLW_inst_ENET0_PTP_PDELAY_RESP_TX_UNCONNECTED), .ENET0_PTP_SYNC_FRAME_RX(NLW_inst_ENET0_PTP_SYNC_FRAME_RX_UNCONNECTED), .ENET0_PTP_SYNC_FRAME_TX(NLW_inst_ENET0_PTP_SYNC_FRAME_TX_UNCONNECTED), .ENET0_SOF_RX(NLW_inst_ENET0_SOF_RX_UNCONNECTED), .ENET0_SOF_TX(NLW_inst_ENET0_SOF_TX_UNCONNECTED), .ENET1_EXT_INTIN(1'b0), .ENET1_GMII_COL(1'b0), .ENET1_GMII_CRS(1'b0), .ENET1_GMII_RXD({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .ENET1_GMII_RX_CLK(1'b0), .ENET1_GMII_RX_DV(1'b0), .ENET1_GMII_RX_ER(1'b0), .ENET1_GMII_TXD(NLW_inst_ENET1_GMII_TXD_UNCONNECTED[7:0]), .ENET1_GMII_TX_CLK(1'b0), .ENET1_GMII_TX_EN(NLW_inst_ENET1_GMII_TX_EN_UNCONNECTED), .ENET1_GMII_TX_ER(NLW_inst_ENET1_GMII_TX_ER_UNCONNECTED), .ENET1_MDIO_I(1'b0), .ENET1_MDIO_MDC(NLW_inst_ENET1_MDIO_MDC_UNCONNECTED), .ENET1_MDIO_O(NLW_inst_ENET1_MDIO_O_UNCONNECTED), .ENET1_MDIO_T(NLW_inst_ENET1_MDIO_T_UNCONNECTED), .ENET1_PTP_DELAY_REQ_RX(NLW_inst_ENET1_PTP_DELAY_REQ_RX_UNCONNECTED), .ENET1_PTP_DELAY_REQ_TX(NLW_inst_ENET1_PTP_DELAY_REQ_TX_UNCONNECTED), .ENET1_PTP_PDELAY_REQ_RX(NLW_inst_ENET1_PTP_PDELAY_REQ_RX_UNCONNECTED), .ENET1_PTP_PDELAY_REQ_TX(NLW_inst_ENET1_PTP_PDELAY_REQ_TX_UNCONNECTED), .ENET1_PTP_PDELAY_RESP_RX(NLW_inst_ENET1_PTP_PDELAY_RESP_RX_UNCONNECTED), .ENET1_PTP_PDELAY_RESP_TX(NLW_inst_ENET1_PTP_PDELAY_RESP_TX_UNCONNECTED), .ENET1_PTP_SYNC_FRAME_RX(NLW_inst_ENET1_PTP_SYNC_FRAME_RX_UNCONNECTED), .ENET1_PTP_SYNC_FRAME_TX(NLW_inst_ENET1_PTP_SYNC_FRAME_TX_UNCONNECTED), .ENET1_SOF_RX(NLW_inst_ENET1_SOF_RX_UNCONNECTED), .ENET1_SOF_TX(NLW_inst_ENET1_SOF_TX_UNCONNECTED), .EVENT_EVENTI(1'b0), .EVENT_EVENTO(NLW_inst_EVENT_EVENTO_UNCONNECTED), .EVENT_STANDBYWFE(NLW_inst_EVENT_STANDBYWFE_UNCONNECTED[1:0]), .EVENT_STANDBYWFI(NLW_inst_EVENT_STANDBYWFI_UNCONNECTED[1:0]), .FCLK_CLK0(FCLK_CLK0), .FCLK_CLK1(NLW_inst_FCLK_CLK1_UNCONNECTED), .FCLK_CLK2(NLW_inst_FCLK_CLK2_UNCONNECTED), .FCLK_CLK3(NLW_inst_FCLK_CLK3_UNCONNECTED), .FCLK_CLKTRIG0_N(1'b0), .FCLK_CLKTRIG1_N(1'b0), .FCLK_CLKTRIG2_N(1'b0), .FCLK_CLKTRIG3_N(1'b0), .FCLK_RESET0_N(FCLK_RESET0_N), .FCLK_RESET1_N(NLW_inst_FCLK_RESET1_N_UNCONNECTED), .FCLK_RESET2_N(NLW_inst_FCLK_RESET2_N_UNCONNECTED), .FCLK_RESET3_N(NLW_inst_FCLK_RESET3_N_UNCONNECTED), .FPGA_IDLE_N(1'b0), .FTMD_TRACEIN_ATID({1'b0,1'b0,1'b0,1'b0}), .FTMD_TRACEIN_CLK(1'b0), .FTMD_TRACEIN_DATA({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .FTMD_TRACEIN_VALID(1'b0), .FTMT_F2P_DEBUG({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .FTMT_F2P_TRIGACK_0(NLW_inst_FTMT_F2P_TRIGACK_0_UNCONNECTED), .FTMT_F2P_TRIGACK_1(NLW_inst_FTMT_F2P_TRIGACK_1_UNCONNECTED), .FTMT_F2P_TRIGACK_2(NLW_inst_FTMT_F2P_TRIGACK_2_UNCONNECTED), .FTMT_F2P_TRIGACK_3(NLW_inst_FTMT_F2P_TRIGACK_3_UNCONNECTED), .FTMT_F2P_TRIG_0(1'b0), .FTMT_F2P_TRIG_1(1'b0), .FTMT_F2P_TRIG_2(1'b0), .FTMT_F2P_TRIG_3(1'b0), .FTMT_P2F_DEBUG(NLW_inst_FTMT_P2F_DEBUG_UNCONNECTED[31:0]), .FTMT_P2F_TRIGACK_0(1'b0), .FTMT_P2F_TRIGACK_1(1'b0), .FTMT_P2F_TRIGACK_2(1'b0), .FTMT_P2F_TRIGACK_3(1'b0), .FTMT_P2F_TRIG_0(NLW_inst_FTMT_P2F_TRIG_0_UNCONNECTED), .FTMT_P2F_TRIG_1(NLW_inst_FTMT_P2F_TRIG_1_UNCONNECTED), .FTMT_P2F_TRIG_2(NLW_inst_FTMT_P2F_TRIG_2_UNCONNECTED), .FTMT_P2F_TRIG_3(NLW_inst_FTMT_P2F_TRIG_3_UNCONNECTED), .GPIO_I({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .GPIO_O(NLW_inst_GPIO_O_UNCONNECTED[63:0]), .GPIO_T(NLW_inst_GPIO_T_UNCONNECTED[63:0]), .I2C0_SCL_I(I2C0_SCL_I), .I2C0_SCL_O(I2C0_SCL_O), .I2C0_SCL_T(I2C0_SCL_T), .I2C0_SDA_I(I2C0_SDA_I), .I2C0_SDA_O(I2C0_SDA_O), .I2C0_SDA_T(I2C0_SDA_T), .I2C1_SCL_I(1'b0), .I2C1_SCL_O(NLW_inst_I2C1_SCL_O_UNCONNECTED), .I2C1_SCL_T(NLW_inst_I2C1_SCL_T_UNCONNECTED), .I2C1_SDA_I(1'b0), .I2C1_SDA_O(NLW_inst_I2C1_SDA_O_UNCONNECTED), .I2C1_SDA_T(NLW_inst_I2C1_SDA_T_UNCONNECTED), .IRQ_F2P(IRQ_F2P), .IRQ_P2F_CAN0(NLW_inst_IRQ_P2F_CAN0_UNCONNECTED), .IRQ_P2F_CAN1(NLW_inst_IRQ_P2F_CAN1_UNCONNECTED), .IRQ_P2F_CTI(NLW_inst_IRQ_P2F_CTI_UNCONNECTED), .IRQ_P2F_DMAC0(NLW_inst_IRQ_P2F_DMAC0_UNCONNECTED), .IRQ_P2F_DMAC1(NLW_inst_IRQ_P2F_DMAC1_UNCONNECTED), .IRQ_P2F_DMAC2(NLW_inst_IRQ_P2F_DMAC2_UNCONNECTED), .IRQ_P2F_DMAC3(NLW_inst_IRQ_P2F_DMAC3_UNCONNECTED), .IRQ_P2F_DMAC4(NLW_inst_IRQ_P2F_DMAC4_UNCONNECTED), .IRQ_P2F_DMAC5(NLW_inst_IRQ_P2F_DMAC5_UNCONNECTED), .IRQ_P2F_DMAC6(NLW_inst_IRQ_P2F_DMAC6_UNCONNECTED), .IRQ_P2F_DMAC7(NLW_inst_IRQ_P2F_DMAC7_UNCONNECTED), .IRQ_P2F_DMAC_ABORT(NLW_inst_IRQ_P2F_DMAC_ABORT_UNCONNECTED), .IRQ_P2F_ENET0(NLW_inst_IRQ_P2F_ENET0_UNCONNECTED), .IRQ_P2F_ENET1(NLW_inst_IRQ_P2F_ENET1_UNCONNECTED), .IRQ_P2F_ENET_WAKE0(NLW_inst_IRQ_P2F_ENET_WAKE0_UNCONNECTED), .IRQ_P2F_ENET_WAKE1(NLW_inst_IRQ_P2F_ENET_WAKE1_UNCONNECTED), .IRQ_P2F_GPIO(NLW_inst_IRQ_P2F_GPIO_UNCONNECTED), .IRQ_P2F_I2C0(NLW_inst_IRQ_P2F_I2C0_UNCONNECTED), .IRQ_P2F_I2C1(NLW_inst_IRQ_P2F_I2C1_UNCONNECTED), .IRQ_P2F_QSPI(NLW_inst_IRQ_P2F_QSPI_UNCONNECTED), .IRQ_P2F_SDIO0(NLW_inst_IRQ_P2F_SDIO0_UNCONNECTED), .IRQ_P2F_SDIO1(NLW_inst_IRQ_P2F_SDIO1_UNCONNECTED), .IRQ_P2F_SMC(NLW_inst_IRQ_P2F_SMC_UNCONNECTED), .IRQ_P2F_SPI0(NLW_inst_IRQ_P2F_SPI0_UNCONNECTED), .IRQ_P2F_SPI1(NLW_inst_IRQ_P2F_SPI1_UNCONNECTED), .IRQ_P2F_UART0(NLW_inst_IRQ_P2F_UART0_UNCONNECTED), .IRQ_P2F_UART1(NLW_inst_IRQ_P2F_UART1_UNCONNECTED), .IRQ_P2F_USB0(NLW_inst_IRQ_P2F_USB0_UNCONNECTED), .IRQ_P2F_USB1(NLW_inst_IRQ_P2F_USB1_UNCONNECTED), .MIO(MIO), .M_AXI_GP0_ACLK(M_AXI_GP0_ACLK), .M_AXI_GP0_ARADDR(M_AXI_GP0_ARADDR), .M_AXI_GP0_ARBURST(M_AXI_GP0_ARBURST), .M_AXI_GP0_ARCACHE(M_AXI_GP0_ARCACHE), .M_AXI_GP0_ARESETN(NLW_inst_M_AXI_GP0_ARESETN_UNCONNECTED), .M_AXI_GP0_ARID(M_AXI_GP0_ARID), .M_AXI_GP0_ARLEN(M_AXI_GP0_ARLEN), .M_AXI_GP0_ARLOCK(M_AXI_GP0_ARLOCK), .M_AXI_GP0_ARPROT(M_AXI_GP0_ARPROT), .M_AXI_GP0_ARQOS(M_AXI_GP0_ARQOS), .M_AXI_GP0_ARREADY(M_AXI_GP0_ARREADY), .M_AXI_GP0_ARSIZE(M_AXI_GP0_ARSIZE), .M_AXI_GP0_ARVALID(M_AXI_GP0_ARVALID), .M_AXI_GP0_AWADDR(M_AXI_GP0_AWADDR), .M_AXI_GP0_AWBURST(M_AXI_GP0_AWBURST), .M_AXI_GP0_AWCACHE(M_AXI_GP0_AWCACHE), .M_AXI_GP0_AWID(M_AXI_GP0_AWID), .M_AXI_GP0_AWLEN(M_AXI_GP0_AWLEN), .M_AXI_GP0_AWLOCK(M_AXI_GP0_AWLOCK), .M_AXI_GP0_AWPROT(M_AXI_GP0_AWPROT), .M_AXI_GP0_AWQOS(M_AXI_GP0_AWQOS), .M_AXI_GP0_AWREADY(M_AXI_GP0_AWREADY), .M_AXI_GP0_AWSIZE(M_AXI_GP0_AWSIZE), .M_AXI_GP0_AWVALID(M_AXI_GP0_AWVALID), .M_AXI_GP0_BID(M_AXI_GP0_BID), .M_AXI_GP0_BREADY(M_AXI_GP0_BREADY), .M_AXI_GP0_BRESP(M_AXI_GP0_BRESP), .M_AXI_GP0_BVALID(M_AXI_GP0_BVALID), .M_AXI_GP0_RDATA(M_AXI_GP0_RDATA), .M_AXI_GP0_RID(M_AXI_GP0_RID), .M_AXI_GP0_RLAST(M_AXI_GP0_RLAST), .M_AXI_GP0_RREADY(M_AXI_GP0_RREADY), .M_AXI_GP0_RRESP(M_AXI_GP0_RRESP), .M_AXI_GP0_RVALID(M_AXI_GP0_RVALID), .M_AXI_GP0_WDATA(M_AXI_GP0_WDATA), .M_AXI_GP0_WID(M_AXI_GP0_WID), .M_AXI_GP0_WLAST(M_AXI_GP0_WLAST), .M_AXI_GP0_WREADY(M_AXI_GP0_WREADY), .M_AXI_GP0_WSTRB(M_AXI_GP0_WSTRB), .M_AXI_GP0_WVALID(M_AXI_GP0_WVALID), .M_AXI_GP1_ACLK(1'b0), .M_AXI_GP1_ARADDR(NLW_inst_M_AXI_GP1_ARADDR_UNCONNECTED[31:0]), .M_AXI_GP1_ARBURST(NLW_inst_M_AXI_GP1_ARBURST_UNCONNECTED[1:0]), .M_AXI_GP1_ARCACHE(NLW_inst_M_AXI_GP1_ARCACHE_UNCONNECTED[3:0]), .M_AXI_GP1_ARESETN(NLW_inst_M_AXI_GP1_ARESETN_UNCONNECTED), .M_AXI_GP1_ARID(NLW_inst_M_AXI_GP1_ARID_UNCONNECTED[11:0]), .M_AXI_GP1_ARLEN(NLW_inst_M_AXI_GP1_ARLEN_UNCONNECTED[3:0]), .M_AXI_GP1_ARLOCK(NLW_inst_M_AXI_GP1_ARLOCK_UNCONNECTED[1:0]), .M_AXI_GP1_ARPROT(NLW_inst_M_AXI_GP1_ARPROT_UNCONNECTED[2:0]), .M_AXI_GP1_ARQOS(NLW_inst_M_AXI_GP1_ARQOS_UNCONNECTED[3:0]), .M_AXI_GP1_ARREADY(1'b0), .M_AXI_GP1_ARSIZE(NLW_inst_M_AXI_GP1_ARSIZE_UNCONNECTED[2:0]), .M_AXI_GP1_ARVALID(NLW_inst_M_AXI_GP1_ARVALID_UNCONNECTED), .M_AXI_GP1_AWADDR(NLW_inst_M_AXI_GP1_AWADDR_UNCONNECTED[31:0]), .M_AXI_GP1_AWBURST(NLW_inst_M_AXI_GP1_AWBURST_UNCONNECTED[1:0]), .M_AXI_GP1_AWCACHE(NLW_inst_M_AXI_GP1_AWCACHE_UNCONNECTED[3:0]), .M_AXI_GP1_AWID(NLW_inst_M_AXI_GP1_AWID_UNCONNECTED[11:0]), .M_AXI_GP1_AWLEN(NLW_inst_M_AXI_GP1_AWLEN_UNCONNECTED[3:0]), .M_AXI_GP1_AWLOCK(NLW_inst_M_AXI_GP1_AWLOCK_UNCONNECTED[1:0]), .M_AXI_GP1_AWPROT(NLW_inst_M_AXI_GP1_AWPROT_UNCONNECTED[2:0]), .M_AXI_GP1_AWQOS(NLW_inst_M_AXI_GP1_AWQOS_UNCONNECTED[3:0]), .M_AXI_GP1_AWREADY(1'b0), .M_AXI_GP1_AWSIZE(NLW_inst_M_AXI_GP1_AWSIZE_UNCONNECTED[2:0]), .M_AXI_GP1_AWVALID(NLW_inst_M_AXI_GP1_AWVALID_UNCONNECTED), .M_AXI_GP1_BID({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .M_AXI_GP1_BREADY(NLW_inst_M_AXI_GP1_BREADY_UNCONNECTED), .M_AXI_GP1_BRESP({1'b0,1'b0}), .M_AXI_GP1_BVALID(1'b0), .M_AXI_GP1_RDATA({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .M_AXI_GP1_RID({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .M_AXI_GP1_RLAST(1'b0), .M_AXI_GP1_RREADY(NLW_inst_M_AXI_GP1_RREADY_UNCONNECTED), .M_AXI_GP1_RRESP({1'b0,1'b0}), .M_AXI_GP1_RVALID(1'b0), .M_AXI_GP1_WDATA(NLW_inst_M_AXI_GP1_WDATA_UNCONNECTED[31:0]), .M_AXI_GP1_WID(NLW_inst_M_AXI_GP1_WID_UNCONNECTED[11:0]), .M_AXI_GP1_WLAST(NLW_inst_M_AXI_GP1_WLAST_UNCONNECTED), .M_AXI_GP1_WREADY(1'b0), .M_AXI_GP1_WSTRB(NLW_inst_M_AXI_GP1_WSTRB_UNCONNECTED[3:0]), .M_AXI_GP1_WVALID(NLW_inst_M_AXI_GP1_WVALID_UNCONNECTED), .PJTAG_TCK(1'b0), .PJTAG_TDI(1'b0), .PJTAG_TDO(NLW_inst_PJTAG_TDO_UNCONNECTED), .PJTAG_TMS(1'b0), .PS_CLK(PS_CLK), .PS_PORB(PS_PORB), .PS_SRSTB(PS_SRSTB), .SDIO0_BUSPOW(NLW_inst_SDIO0_BUSPOW_UNCONNECTED), .SDIO0_BUSVOLT(NLW_inst_SDIO0_BUSVOLT_UNCONNECTED[2:0]), .SDIO0_CDN(1'b0), .SDIO0_CLK(NLW_inst_SDIO0_CLK_UNCONNECTED), .SDIO0_CLK_FB(1'b0), .SDIO0_CMD_I(1'b0), .SDIO0_CMD_O(NLW_inst_SDIO0_CMD_O_UNCONNECTED), .SDIO0_CMD_T(NLW_inst_SDIO0_CMD_T_UNCONNECTED), .SDIO0_DATA_I({1'b0,1'b0,1'b0,1'b0}), .SDIO0_DATA_O(NLW_inst_SDIO0_DATA_O_UNCONNECTED[3:0]), .SDIO0_DATA_T(NLW_inst_SDIO0_DATA_T_UNCONNECTED[3:0]), .SDIO0_LED(NLW_inst_SDIO0_LED_UNCONNECTED), .SDIO0_WP(SDIO0_WP), .SDIO1_BUSPOW(NLW_inst_SDIO1_BUSPOW_UNCONNECTED), .SDIO1_BUSVOLT(NLW_inst_SDIO1_BUSVOLT_UNCONNECTED[2:0]), .SDIO1_CDN(1'b0), .SDIO1_CLK(NLW_inst_SDIO1_CLK_UNCONNECTED), .SDIO1_CLK_FB(1'b0), .SDIO1_CMD_I(1'b0), .SDIO1_CMD_O(NLW_inst_SDIO1_CMD_O_UNCONNECTED), .SDIO1_CMD_T(NLW_inst_SDIO1_CMD_T_UNCONNECTED), .SDIO1_DATA_I({1'b0,1'b0,1'b0,1'b0}), .SDIO1_DATA_O(NLW_inst_SDIO1_DATA_O_UNCONNECTED[3:0]), .SDIO1_DATA_T(NLW_inst_SDIO1_DATA_T_UNCONNECTED[3:0]), .SDIO1_LED(NLW_inst_SDIO1_LED_UNCONNECTED), .SDIO1_WP(1'b0), .SPI0_MISO_I(1'b0), .SPI0_MISO_O(NLW_inst_SPI0_MISO_O_UNCONNECTED), .SPI0_MISO_T(NLW_inst_SPI0_MISO_T_UNCONNECTED), .SPI0_MOSI_I(1'b0), .SPI0_MOSI_O(NLW_inst_SPI0_MOSI_O_UNCONNECTED), .SPI0_MOSI_T(NLW_inst_SPI0_MOSI_T_UNCONNECTED), .SPI0_SCLK_I(1'b0), .SPI0_SCLK_O(NLW_inst_SPI0_SCLK_O_UNCONNECTED), .SPI0_SCLK_T(NLW_inst_SPI0_SCLK_T_UNCONNECTED), .SPI0_SS1_O(NLW_inst_SPI0_SS1_O_UNCONNECTED), .SPI0_SS2_O(NLW_inst_SPI0_SS2_O_UNCONNECTED), .SPI0_SS_I(1'b0), .SPI0_SS_O(NLW_inst_SPI0_SS_O_UNCONNECTED), .SPI0_SS_T(NLW_inst_SPI0_SS_T_UNCONNECTED), .SPI1_MISO_I(1'b0), .SPI1_MISO_O(NLW_inst_SPI1_MISO_O_UNCONNECTED), .SPI1_MISO_T(NLW_inst_SPI1_MISO_T_UNCONNECTED), .SPI1_MOSI_I(1'b0), .SPI1_MOSI_O(NLW_inst_SPI1_MOSI_O_UNCONNECTED), .SPI1_MOSI_T(NLW_inst_SPI1_MOSI_T_UNCONNECTED), .SPI1_SCLK_I(1'b0), .SPI1_SCLK_O(NLW_inst_SPI1_SCLK_O_UNCONNECTED), .SPI1_SCLK_T(NLW_inst_SPI1_SCLK_T_UNCONNECTED), .SPI1_SS1_O(NLW_inst_SPI1_SS1_O_UNCONNECTED), .SPI1_SS2_O(NLW_inst_SPI1_SS2_O_UNCONNECTED), .SPI1_SS_I(1'b0), .SPI1_SS_O(NLW_inst_SPI1_SS_O_UNCONNECTED), .SPI1_SS_T(NLW_inst_SPI1_SS_T_UNCONNECTED), .SRAM_INTIN(1'b0), .S_AXI_ACP_ACLK(1'b0), .S_AXI_ACP_ARADDR({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_ACP_ARBURST({1'b0,1'b0}), .S_AXI_ACP_ARCACHE({1'b0,1'b0,1'b0,1'b0}), .S_AXI_ACP_ARESETN(NLW_inst_S_AXI_ACP_ARESETN_UNCONNECTED), .S_AXI_ACP_ARID({1'b0,1'b0,1'b0}), .S_AXI_ACP_ARLEN({1'b0,1'b0,1'b0,1'b0}), .S_AXI_ACP_ARLOCK({1'b0,1'b0}), .S_AXI_ACP_ARPROT({1'b0,1'b0,1'b0}), .S_AXI_ACP_ARQOS({1'b0,1'b0,1'b0,1'b0}), .S_AXI_ACP_ARREADY(NLW_inst_S_AXI_ACP_ARREADY_UNCONNECTED), .S_AXI_ACP_ARSIZE({1'b0,1'b0,1'b0}), .S_AXI_ACP_ARUSER({1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_ACP_ARVALID(1'b0), .S_AXI_ACP_AWADDR({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_ACP_AWBURST({1'b0,1'b0}), .S_AXI_ACP_AWCACHE({1'b0,1'b0,1'b0,1'b0}), .S_AXI_ACP_AWID({1'b0,1'b0,1'b0}), .S_AXI_ACP_AWLEN({1'b0,1'b0,1'b0,1'b0}), .S_AXI_ACP_AWLOCK({1'b0,1'b0}), .S_AXI_ACP_AWPROT({1'b0,1'b0,1'b0}), .S_AXI_ACP_AWQOS({1'b0,1'b0,1'b0,1'b0}), .S_AXI_ACP_AWREADY(NLW_inst_S_AXI_ACP_AWREADY_UNCONNECTED), .S_AXI_ACP_AWSIZE({1'b0,1'b0,1'b0}), .S_AXI_ACP_AWUSER({1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_ACP_AWVALID(1'b0), .S_AXI_ACP_BID(NLW_inst_S_AXI_ACP_BID_UNCONNECTED[2:0]), .S_AXI_ACP_BREADY(1'b0), .S_AXI_ACP_BRESP(NLW_inst_S_AXI_ACP_BRESP_UNCONNECTED[1:0]), .S_AXI_ACP_BVALID(NLW_inst_S_AXI_ACP_BVALID_UNCONNECTED), .S_AXI_ACP_RDATA(NLW_inst_S_AXI_ACP_RDATA_UNCONNECTED[63:0]), .S_AXI_ACP_RID(NLW_inst_S_AXI_ACP_RID_UNCONNECTED[2:0]), .S_AXI_ACP_RLAST(NLW_inst_S_AXI_ACP_RLAST_UNCONNECTED), .S_AXI_ACP_RREADY(1'b0), .S_AXI_ACP_RRESP(NLW_inst_S_AXI_ACP_RRESP_UNCONNECTED[1:0]), .S_AXI_ACP_RVALID(NLW_inst_S_AXI_ACP_RVALID_UNCONNECTED), .S_AXI_ACP_WDATA({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_ACP_WID({1'b0,1'b0,1'b0}), .S_AXI_ACP_WLAST(1'b0), .S_AXI_ACP_WREADY(NLW_inst_S_AXI_ACP_WREADY_UNCONNECTED), .S_AXI_ACP_WSTRB({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_ACP_WVALID(1'b0), .S_AXI_GP0_ACLK(1'b0), .S_AXI_GP0_ARADDR({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_GP0_ARBURST({1'b0,1'b0}), .S_AXI_GP0_ARCACHE({1'b0,1'b0,1'b0,1'b0}), .S_AXI_GP0_ARESETN(NLW_inst_S_AXI_GP0_ARESETN_UNCONNECTED), .S_AXI_GP0_ARID({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_GP0_ARLEN({1'b0,1'b0,1'b0,1'b0}), .S_AXI_GP0_ARLOCK({1'b0,1'b0}), .S_AXI_GP0_ARPROT({1'b0,1'b0,1'b0}), .S_AXI_GP0_ARQOS({1'b0,1'b0,1'b0,1'b0}), .S_AXI_GP0_ARREADY(NLW_inst_S_AXI_GP0_ARREADY_UNCONNECTED), .S_AXI_GP0_ARSIZE({1'b0,1'b0,1'b0}), .S_AXI_GP0_ARVALID(1'b0), .S_AXI_GP0_AWADDR({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_GP0_AWBURST({1'b0,1'b0}), .S_AXI_GP0_AWCACHE({1'b0,1'b0,1'b0,1'b0}), .S_AXI_GP0_AWID({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_GP0_AWLEN({1'b0,1'b0,1'b0,1'b0}), .S_AXI_GP0_AWLOCK({1'b0,1'b0}), .S_AXI_GP0_AWPROT({1'b0,1'b0,1'b0}), .S_AXI_GP0_AWQOS({1'b0,1'b0,1'b0,1'b0}), .S_AXI_GP0_AWREADY(NLW_inst_S_AXI_GP0_AWREADY_UNCONNECTED), .S_AXI_GP0_AWSIZE({1'b0,1'b0,1'b0}), .S_AXI_GP0_AWVALID(1'b0), .S_AXI_GP0_BID(NLW_inst_S_AXI_GP0_BID_UNCONNECTED[5:0]), .S_AXI_GP0_BREADY(1'b0), .S_AXI_GP0_BRESP(NLW_inst_S_AXI_GP0_BRESP_UNCONNECTED[1:0]), .S_AXI_GP0_BVALID(NLW_inst_S_AXI_GP0_BVALID_UNCONNECTED), .S_AXI_GP0_RDATA(NLW_inst_S_AXI_GP0_RDATA_UNCONNECTED[31:0]), .S_AXI_GP0_RID(NLW_inst_S_AXI_GP0_RID_UNCONNECTED[5:0]), .S_AXI_GP0_RLAST(NLW_inst_S_AXI_GP0_RLAST_UNCONNECTED), .S_AXI_GP0_RREADY(1'b0), .S_AXI_GP0_RRESP(NLW_inst_S_AXI_GP0_RRESP_UNCONNECTED[1:0]), .S_AXI_GP0_RVALID(NLW_inst_S_AXI_GP0_RVALID_UNCONNECTED), .S_AXI_GP0_WDATA({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_GP0_WID({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_GP0_WLAST(1'b0), .S_AXI_GP0_WREADY(NLW_inst_S_AXI_GP0_WREADY_UNCONNECTED), .S_AXI_GP0_WSTRB({1'b0,1'b0,1'b0,1'b0}), .S_AXI_GP0_WVALID(1'b0), .S_AXI_GP1_ACLK(1'b0), .S_AXI_GP1_ARADDR({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_GP1_ARBURST({1'b0,1'b0}), .S_AXI_GP1_ARCACHE({1'b0,1'b0,1'b0,1'b0}), .S_AXI_GP1_ARESETN(NLW_inst_S_AXI_GP1_ARESETN_UNCONNECTED), .S_AXI_GP1_ARID({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_GP1_ARLEN({1'b0,1'b0,1'b0,1'b0}), .S_AXI_GP1_ARLOCK({1'b0,1'b0}), .S_AXI_GP1_ARPROT({1'b0,1'b0,1'b0}), .S_AXI_GP1_ARQOS({1'b0,1'b0,1'b0,1'b0}), .S_AXI_GP1_ARREADY(NLW_inst_S_AXI_GP1_ARREADY_UNCONNECTED), .S_AXI_GP1_ARSIZE({1'b0,1'b0,1'b0}), .S_AXI_GP1_ARVALID(1'b0), .S_AXI_GP1_AWADDR({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_GP1_AWBURST({1'b0,1'b0}), .S_AXI_GP1_AWCACHE({1'b0,1'b0,1'b0,1'b0}), .S_AXI_GP1_AWID({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_GP1_AWLEN({1'b0,1'b0,1'b0,1'b0}), .S_AXI_GP1_AWLOCK({1'b0,1'b0}), .S_AXI_GP1_AWPROT({1'b0,1'b0,1'b0}), .S_AXI_GP1_AWQOS({1'b0,1'b0,1'b0,1'b0}), .S_AXI_GP1_AWREADY(NLW_inst_S_AXI_GP1_AWREADY_UNCONNECTED), .S_AXI_GP1_AWSIZE({1'b0,1'b0,1'b0}), .S_AXI_GP1_AWVALID(1'b0), .S_AXI_GP1_BID(NLW_inst_S_AXI_GP1_BID_UNCONNECTED[5:0]), .S_AXI_GP1_BREADY(1'b0), .S_AXI_GP1_BRESP(NLW_inst_S_AXI_GP1_BRESP_UNCONNECTED[1:0]), .S_AXI_GP1_BVALID(NLW_inst_S_AXI_GP1_BVALID_UNCONNECTED), .S_AXI_GP1_RDATA(NLW_inst_S_AXI_GP1_RDATA_UNCONNECTED[31:0]), .S_AXI_GP1_RID(NLW_inst_S_AXI_GP1_RID_UNCONNECTED[5:0]), .S_AXI_GP1_RLAST(NLW_inst_S_AXI_GP1_RLAST_UNCONNECTED), .S_AXI_GP1_RREADY(1'b0), .S_AXI_GP1_RRESP(NLW_inst_S_AXI_GP1_RRESP_UNCONNECTED[1:0]), .S_AXI_GP1_RVALID(NLW_inst_S_AXI_GP1_RVALID_UNCONNECTED), .S_AXI_GP1_WDATA({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_GP1_WID({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_GP1_WLAST(1'b0), .S_AXI_GP1_WREADY(NLW_inst_S_AXI_GP1_WREADY_UNCONNECTED), .S_AXI_GP1_WSTRB({1'b0,1'b0,1'b0,1'b0}), .S_AXI_GP1_WVALID(1'b0), .S_AXI_HP0_ACLK(1'b0), .S_AXI_HP0_ARADDR({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP0_ARBURST({1'b0,1'b0}), .S_AXI_HP0_ARCACHE({1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP0_ARESETN(NLW_inst_S_AXI_HP0_ARESETN_UNCONNECTED), .S_AXI_HP0_ARID({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP0_ARLEN({1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP0_ARLOCK({1'b0,1'b0}), .S_AXI_HP0_ARPROT({1'b0,1'b0,1'b0}), .S_AXI_HP0_ARQOS({1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP0_ARREADY(NLW_inst_S_AXI_HP0_ARREADY_UNCONNECTED), .S_AXI_HP0_ARSIZE({1'b0,1'b0,1'b0}), .S_AXI_HP0_ARVALID(1'b0), .S_AXI_HP0_AWADDR({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP0_AWBURST({1'b0,1'b0}), .S_AXI_HP0_AWCACHE({1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP0_AWID({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP0_AWLEN({1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP0_AWLOCK({1'b0,1'b0}), .S_AXI_HP0_AWPROT({1'b0,1'b0,1'b0}), .S_AXI_HP0_AWQOS({1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP0_AWREADY(NLW_inst_S_AXI_HP0_AWREADY_UNCONNECTED), .S_AXI_HP0_AWSIZE({1'b0,1'b0,1'b0}), .S_AXI_HP0_AWVALID(1'b0), .S_AXI_HP0_BID(NLW_inst_S_AXI_HP0_BID_UNCONNECTED[5:0]), .S_AXI_HP0_BREADY(1'b0), .S_AXI_HP0_BRESP(NLW_inst_S_AXI_HP0_BRESP_UNCONNECTED[1:0]), .S_AXI_HP0_BVALID(NLW_inst_S_AXI_HP0_BVALID_UNCONNECTED), .S_AXI_HP0_RACOUNT(NLW_inst_S_AXI_HP0_RACOUNT_UNCONNECTED[2:0]), .S_AXI_HP0_RCOUNT(NLW_inst_S_AXI_HP0_RCOUNT_UNCONNECTED[7:0]), .S_AXI_HP0_RDATA(NLW_inst_S_AXI_HP0_RDATA_UNCONNECTED[63:0]), .S_AXI_HP0_RDISSUECAP1_EN(1'b0), .S_AXI_HP0_RID(NLW_inst_S_AXI_HP0_RID_UNCONNECTED[5:0]), .S_AXI_HP0_RLAST(NLW_inst_S_AXI_HP0_RLAST_UNCONNECTED), .S_AXI_HP0_RREADY(1'b0), .S_AXI_HP0_RRESP(NLW_inst_S_AXI_HP0_RRESP_UNCONNECTED[1:0]), .S_AXI_HP0_RVALID(NLW_inst_S_AXI_HP0_RVALID_UNCONNECTED), .S_AXI_HP0_WACOUNT(NLW_inst_S_AXI_HP0_WACOUNT_UNCONNECTED[5:0]), .S_AXI_HP0_WCOUNT(NLW_inst_S_AXI_HP0_WCOUNT_UNCONNECTED[7:0]), .S_AXI_HP0_WDATA({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP0_WID({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP0_WLAST(1'b0), .S_AXI_HP0_WREADY(NLW_inst_S_AXI_HP0_WREADY_UNCONNECTED), .S_AXI_HP0_WRISSUECAP1_EN(1'b0), .S_AXI_HP0_WSTRB({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP0_WVALID(1'b0), .S_AXI_HP1_ACLK(1'b0), .S_AXI_HP1_ARADDR({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP1_ARBURST({1'b0,1'b0}), .S_AXI_HP1_ARCACHE({1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP1_ARESETN(NLW_inst_S_AXI_HP1_ARESETN_UNCONNECTED), .S_AXI_HP1_ARID({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP1_ARLEN({1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP1_ARLOCK({1'b0,1'b0}), .S_AXI_HP1_ARPROT({1'b0,1'b0,1'b0}), .S_AXI_HP1_ARQOS({1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP1_ARREADY(NLW_inst_S_AXI_HP1_ARREADY_UNCONNECTED), .S_AXI_HP1_ARSIZE({1'b0,1'b0,1'b0}), .S_AXI_HP1_ARVALID(1'b0), .S_AXI_HP1_AWADDR({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP1_AWBURST({1'b0,1'b0}), .S_AXI_HP1_AWCACHE({1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP1_AWID({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP1_AWLEN({1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP1_AWLOCK({1'b0,1'b0}), .S_AXI_HP1_AWPROT({1'b0,1'b0,1'b0}), .S_AXI_HP1_AWQOS({1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP1_AWREADY(NLW_inst_S_AXI_HP1_AWREADY_UNCONNECTED), .S_AXI_HP1_AWSIZE({1'b0,1'b0,1'b0}), .S_AXI_HP1_AWVALID(1'b0), .S_AXI_HP1_BID(NLW_inst_S_AXI_HP1_BID_UNCONNECTED[5:0]), .S_AXI_HP1_BREADY(1'b0), .S_AXI_HP1_BRESP(NLW_inst_S_AXI_HP1_BRESP_UNCONNECTED[1:0]), .S_AXI_HP1_BVALID(NLW_inst_S_AXI_HP1_BVALID_UNCONNECTED), .S_AXI_HP1_RACOUNT(NLW_inst_S_AXI_HP1_RACOUNT_UNCONNECTED[2:0]), .S_AXI_HP1_RCOUNT(NLW_inst_S_AXI_HP1_RCOUNT_UNCONNECTED[7:0]), .S_AXI_HP1_RDATA(NLW_inst_S_AXI_HP1_RDATA_UNCONNECTED[63:0]), .S_AXI_HP1_RDISSUECAP1_EN(1'b0), .S_AXI_HP1_RID(NLW_inst_S_AXI_HP1_RID_UNCONNECTED[5:0]), .S_AXI_HP1_RLAST(NLW_inst_S_AXI_HP1_RLAST_UNCONNECTED), .S_AXI_HP1_RREADY(1'b0), .S_AXI_HP1_RRESP(NLW_inst_S_AXI_HP1_RRESP_UNCONNECTED[1:0]), .S_AXI_HP1_RVALID(NLW_inst_S_AXI_HP1_RVALID_UNCONNECTED), .S_AXI_HP1_WACOUNT(NLW_inst_S_AXI_HP1_WACOUNT_UNCONNECTED[5:0]), .S_AXI_HP1_WCOUNT(NLW_inst_S_AXI_HP1_WCOUNT_UNCONNECTED[7:0]), .S_AXI_HP1_WDATA({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP1_WID({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP1_WLAST(1'b0), .S_AXI_HP1_WREADY(NLW_inst_S_AXI_HP1_WREADY_UNCONNECTED), .S_AXI_HP1_WRISSUECAP1_EN(1'b0), .S_AXI_HP1_WSTRB({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP1_WVALID(1'b0), .S_AXI_HP2_ACLK(1'b0), .S_AXI_HP2_ARADDR({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP2_ARBURST({1'b0,1'b0}), .S_AXI_HP2_ARCACHE({1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP2_ARESETN(NLW_inst_S_AXI_HP2_ARESETN_UNCONNECTED), .S_AXI_HP2_ARID({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP2_ARLEN({1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP2_ARLOCK({1'b0,1'b0}), .S_AXI_HP2_ARPROT({1'b0,1'b0,1'b0}), .S_AXI_HP2_ARQOS({1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP2_ARREADY(NLW_inst_S_AXI_HP2_ARREADY_UNCONNECTED), .S_AXI_HP2_ARSIZE({1'b0,1'b0,1'b0}), .S_AXI_HP2_ARVALID(1'b0), .S_AXI_HP2_AWADDR({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP2_AWBURST({1'b0,1'b0}), .S_AXI_HP2_AWCACHE({1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP2_AWID({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP2_AWLEN({1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP2_AWLOCK({1'b0,1'b0}), .S_AXI_HP2_AWPROT({1'b0,1'b0,1'b0}), .S_AXI_HP2_AWQOS({1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP2_AWREADY(NLW_inst_S_AXI_HP2_AWREADY_UNCONNECTED), .S_AXI_HP2_AWSIZE({1'b0,1'b0,1'b0}), .S_AXI_HP2_AWVALID(1'b0), .S_AXI_HP2_BID(NLW_inst_S_AXI_HP2_BID_UNCONNECTED[5:0]), .S_AXI_HP2_BREADY(1'b0), .S_AXI_HP2_BRESP(NLW_inst_S_AXI_HP2_BRESP_UNCONNECTED[1:0]), .S_AXI_HP2_BVALID(NLW_inst_S_AXI_HP2_BVALID_UNCONNECTED), .S_AXI_HP2_RACOUNT(NLW_inst_S_AXI_HP2_RACOUNT_UNCONNECTED[2:0]), .S_AXI_HP2_RCOUNT(NLW_inst_S_AXI_HP2_RCOUNT_UNCONNECTED[7:0]), .S_AXI_HP2_RDATA(NLW_inst_S_AXI_HP2_RDATA_UNCONNECTED[63:0]), .S_AXI_HP2_RDISSUECAP1_EN(1'b0), .S_AXI_HP2_RID(NLW_inst_S_AXI_HP2_RID_UNCONNECTED[5:0]), .S_AXI_HP2_RLAST(NLW_inst_S_AXI_HP2_RLAST_UNCONNECTED), .S_AXI_HP2_RREADY(1'b0), .S_AXI_HP2_RRESP(NLW_inst_S_AXI_HP2_RRESP_UNCONNECTED[1:0]), .S_AXI_HP2_RVALID(NLW_inst_S_AXI_HP2_RVALID_UNCONNECTED), .S_AXI_HP2_WACOUNT(NLW_inst_S_AXI_HP2_WACOUNT_UNCONNECTED[5:0]), .S_AXI_HP2_WCOUNT(NLW_inst_S_AXI_HP2_WCOUNT_UNCONNECTED[7:0]), .S_AXI_HP2_WDATA({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP2_WID({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP2_WLAST(1'b0), .S_AXI_HP2_WREADY(NLW_inst_S_AXI_HP2_WREADY_UNCONNECTED), .S_AXI_HP2_WRISSUECAP1_EN(1'b0), .S_AXI_HP2_WSTRB({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP2_WVALID(1'b0), .S_AXI_HP3_ACLK(1'b0), .S_AXI_HP3_ARADDR({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP3_ARBURST({1'b0,1'b0}), .S_AXI_HP3_ARCACHE({1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP3_ARESETN(NLW_inst_S_AXI_HP3_ARESETN_UNCONNECTED), .S_AXI_HP3_ARID({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP3_ARLEN({1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP3_ARLOCK({1'b0,1'b0}), .S_AXI_HP3_ARPROT({1'b0,1'b0,1'b0}), .S_AXI_HP3_ARQOS({1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP3_ARREADY(NLW_inst_S_AXI_HP3_ARREADY_UNCONNECTED), .S_AXI_HP3_ARSIZE({1'b0,1'b0,1'b0}), .S_AXI_HP3_ARVALID(1'b0), .S_AXI_HP3_AWADDR({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP3_AWBURST({1'b0,1'b0}), .S_AXI_HP3_AWCACHE({1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP3_AWID({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP3_AWLEN({1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP3_AWLOCK({1'b0,1'b0}), .S_AXI_HP3_AWPROT({1'b0,1'b0,1'b0}), .S_AXI_HP3_AWQOS({1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP3_AWREADY(NLW_inst_S_AXI_HP3_AWREADY_UNCONNECTED), .S_AXI_HP3_AWSIZE({1'b0,1'b0,1'b0}), .S_AXI_HP3_AWVALID(1'b0), .S_AXI_HP3_BID(NLW_inst_S_AXI_HP3_BID_UNCONNECTED[5:0]), .S_AXI_HP3_BREADY(1'b0), .S_AXI_HP3_BRESP(NLW_inst_S_AXI_HP3_BRESP_UNCONNECTED[1:0]), .S_AXI_HP3_BVALID(NLW_inst_S_AXI_HP3_BVALID_UNCONNECTED), .S_AXI_HP3_RACOUNT(NLW_inst_S_AXI_HP3_RACOUNT_UNCONNECTED[2:0]), .S_AXI_HP3_RCOUNT(NLW_inst_S_AXI_HP3_RCOUNT_UNCONNECTED[7:0]), .S_AXI_HP3_RDATA(NLW_inst_S_AXI_HP3_RDATA_UNCONNECTED[63:0]), .S_AXI_HP3_RDISSUECAP1_EN(1'b0), .S_AXI_HP3_RID(NLW_inst_S_AXI_HP3_RID_UNCONNECTED[5:0]), .S_AXI_HP3_RLAST(NLW_inst_S_AXI_HP3_RLAST_UNCONNECTED), .S_AXI_HP3_RREADY(1'b0), .S_AXI_HP3_RRESP(NLW_inst_S_AXI_HP3_RRESP_UNCONNECTED[1:0]), .S_AXI_HP3_RVALID(NLW_inst_S_AXI_HP3_RVALID_UNCONNECTED), .S_AXI_HP3_WACOUNT(NLW_inst_S_AXI_HP3_WACOUNT_UNCONNECTED[5:0]), .S_AXI_HP3_WCOUNT(NLW_inst_S_AXI_HP3_WCOUNT_UNCONNECTED[7:0]), .S_AXI_HP3_WDATA({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP3_WID({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP3_WLAST(1'b0), .S_AXI_HP3_WREADY(NLW_inst_S_AXI_HP3_WREADY_UNCONNECTED), .S_AXI_HP3_WRISSUECAP1_EN(1'b0), .S_AXI_HP3_WSTRB({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .S_AXI_HP3_WVALID(1'b0), .TRACE_CLK(1'b0), .TRACE_CLK_OUT(NLW_inst_TRACE_CLK_OUT_UNCONNECTED), .TRACE_CTL(NLW_inst_TRACE_CTL_UNCONNECTED), .TRACE_DATA(NLW_inst_TRACE_DATA_UNCONNECTED[1:0]), .TTC0_CLK0_IN(1'b0), .TTC0_CLK1_IN(1'b0), .TTC0_CLK2_IN(1'b0), .TTC0_WAVE0_OUT(TTC0_WAVE0_OUT), .TTC0_WAVE1_OUT(TTC0_WAVE1_OUT), .TTC0_WAVE2_OUT(TTC0_WAVE2_OUT), .TTC1_CLK0_IN(1'b0), .TTC1_CLK1_IN(1'b0), .TTC1_CLK2_IN(1'b0), .TTC1_WAVE0_OUT(NLW_inst_TTC1_WAVE0_OUT_UNCONNECTED), .TTC1_WAVE1_OUT(NLW_inst_TTC1_WAVE1_OUT_UNCONNECTED), .TTC1_WAVE2_OUT(NLW_inst_TTC1_WAVE2_OUT_UNCONNECTED), .UART0_CTSN(1'b0), .UART0_DCDN(1'b0), .UART0_DSRN(1'b0), .UART0_DTRN(NLW_inst_UART0_DTRN_UNCONNECTED), .UART0_RIN(1'b0), .UART0_RTSN(NLW_inst_UART0_RTSN_UNCONNECTED), .UART0_RX(UART0_RX), .UART0_TX(UART0_TX), .UART1_CTSN(1'b0), .UART1_DCDN(1'b0), .UART1_DSRN(1'b0), .UART1_DTRN(NLW_inst_UART1_DTRN_UNCONNECTED), .UART1_RIN(1'b0), .UART1_RTSN(NLW_inst_UART1_RTSN_UNCONNECTED), .UART1_RX(1'b1), .UART1_TX(NLW_inst_UART1_TX_UNCONNECTED), .USB0_PORT_INDCTL(USB0_PORT_INDCTL), .USB0_VBUS_PWRFAULT(USB0_VBUS_PWRFAULT), .USB0_VBUS_PWRSELECT(USB0_VBUS_PWRSELECT), .USB1_PORT_INDCTL(NLW_inst_USB1_PORT_INDCTL_UNCONNECTED[1:0]), .USB1_VBUS_PWRFAULT(1'b0), .USB1_VBUS_PWRSELECT(NLW_inst_USB1_VBUS_PWRSELECT_UNCONNECTED), .WDT_CLK_IN(1'b0), .WDT_RST_OUT(NLW_inst_WDT_RST_OUT_UNCONNECTED)); endmodule (* C_DM_WIDTH = "4" *) (* C_DQS_WIDTH = "4" *) (* C_DQ_WIDTH = "32" *) (* C_EMIO_GPIO_WIDTH = "64" *) (* C_EN_EMIO_ENET0 = "0" *) (* C_EN_EMIO_ENET1 = "0" *) (* C_EN_EMIO_PJTAG = "0" *) (* C_EN_EMIO_TRACE = "0" *) (* C_FCLK_CLK0_BUF = "TRUE" *) (* C_FCLK_CLK1_BUF = "FALSE" *) (* C_FCLK_CLK2_BUF = "FALSE" *) (* C_FCLK_CLK3_BUF = "FALSE" *) (* C_GP0_EN_MODIFIABLE_TXN = "0" *) (* C_GP1_EN_MODIFIABLE_TXN = "0" *) (* C_INCLUDE_ACP_TRANS_CHECK = "0" *) (* C_INCLUDE_TRACE_BUFFER = "0" *) (* C_IRQ_F2P_MODE = "DIRECT" *) (* C_MIO_PRIMITIVE = "54" *) (* C_M_AXI_GP0_ENABLE_STATIC_REMAP = "0" *) (* C_M_AXI_GP0_ID_WIDTH = "12" *) (* C_M_AXI_GP0_THREAD_ID_WIDTH = "12" *) (* C_M_AXI_GP1_ENABLE_STATIC_REMAP = "0" *) (* C_M_AXI_GP1_ID_WIDTH = "12" *) (* C_M_AXI_GP1_THREAD_ID_WIDTH = "12" *) (* C_NUM_F2P_INTR_INPUTS = "1" *) (* C_PACKAGE_NAME = "clg400" *) (* C_PS7_SI_REV = "PRODUCTION" *) (* C_S_AXI_ACP_ARUSER_VAL = "31" *) (* C_S_AXI_ACP_AWUSER_VAL = "31" *) (* C_S_AXI_ACP_ID_WIDTH = "3" *) (* C_S_AXI_GP0_ID_WIDTH = "6" *) (* C_S_AXI_GP1_ID_WIDTH = "6" *) (* C_S_AXI_HP0_DATA_WIDTH = "64" *) (* C_S_AXI_HP0_ID_WIDTH = "6" *) (* C_S_AXI_HP1_DATA_WIDTH = "64" *) (* C_S_AXI_HP1_ID_WIDTH = "6" *) (* C_S_AXI_HP2_DATA_WIDTH = "64" *) (* C_S_AXI_HP2_ID_WIDTH = "6" *) (* C_S_AXI_HP3_DATA_WIDTH = "64" *) (* C_S_AXI_HP3_ID_WIDTH = "6" *) (* C_TRACE_BUFFER_CLOCK_DELAY = "12" *) (* C_TRACE_BUFFER_FIFO_SIZE = "128" *) (* C_TRACE_INTERNAL_WIDTH = "2" *) (* C_TRACE_PIPELINE_WIDTH = "8" *) (* C_USE_AXI_NONSECURE = "0" *) (* C_USE_DEFAULT_ACP_USER_VAL = "0" *) (* C_USE_M_AXI_GP0 = "1" *) (* C_USE_M_AXI_GP1 = "0" *) (* C_USE_S_AXI_ACP = "0" *) (* C_USE_S_AXI_GP0 = "0" *) (* C_USE_S_AXI_GP1 = "0" *) (* C_USE_S_AXI_HP0 = "0" *) (* C_USE_S_AXI_HP1 = "0" *) (* C_USE_S_AXI_HP2 = "0" *) (* C_USE_S_AXI_HP3 = "0" *) (* HW_HANDOFF = "design_1_processing_system7_0_0.hwdef" *) (* POWER = "<PROCESSOR name={system} numA9Cores={2} clockFreq={650} load={0.5} /><MEMORY name={code} memType={DDR3} dataWidth={32} clockFreq={525} readRate={0.5} writeRate={0.5} /><IO interface={GPIO_Bank_1} ioStandard={LVCMOS18} bidis={3} ioBank={Vcco_p1} clockFreq={1} usageRate={0.5} /><IO interface={GPIO_Bank_0} ioStandard={LVCMOS33} bidis={9} ioBank={Vcco_p0} clockFreq={1} usageRate={0.5} /><IO interface={Timer} ioStandard={} bidis={0} ioBank={} clockFreq={108.333336} usageRate={0.5} /><IO interface={I2C} ioStandard={} bidis={1} ioBank={} clockFreq={108.333336} usageRate={0.5} /><IO interface={UART} ioStandard={LVCMOS18} bidis={2} ioBank={Vcco_p1} clockFreq={100.000000} usageRate={0.5} /><IO interface={UART} ioStandard={} bidis={0} ioBank={} clockFreq={100.000000} usageRate={0.5} /><IO interface={SD} ioStandard={LVCMOS18} bidis={7} ioBank={Vcco_p1} clockFreq={50.000000} usageRate={0.5} /><IO interface={USB} ioStandard={LVCMOS18} bidis={12} ioBank={Vcco_p1} clockFreq={60} usageRate={0.5} /><IO interface={GigE} ioStandard={HSTL_I_18} bidis={14} ioBank={Vcco_p1} clockFreq={125.000000} usageRate={0.5} /><IO interface={QSPI} ioStandard={LVCMOS33} bidis={7} ioBank={Vcco_p0} clockFreq={200} usageRate={0.5} /><PLL domain={Processor} vco={1300.000} /><PLL domain={Memory} vco={1050.000} /><PLL domain={IO} vco={1000.000} /><AXI interface={M_AXI_GP0} dataWidth={32} clockFreq={100} usageRate={0.5} />/>" *) (* USE_TRACE_DATA_EDGE_DETECTOR = "0" *) module decalper_eb_ot_sdeen_pot_pi_dehcac_xnilix_processing_system7_v5_5_processing_system7 (CAN0_PHY_TX, CAN0_PHY_RX, CAN1_PHY_TX, CAN1_PHY_RX, ENET0_GMII_TX_EN, ENET0_GMII_TX_ER, ENET0_MDIO_MDC, ENET0_MDIO_O, ENET0_MDIO_T, ENET0_PTP_DELAY_REQ_RX, ENET0_PTP_DELAY_REQ_TX, ENET0_PTP_PDELAY_REQ_RX, ENET0_PTP_PDELAY_REQ_TX, ENET0_PTP_PDELAY_RESP_RX, ENET0_PTP_PDELAY_RESP_TX, ENET0_PTP_SYNC_FRAME_RX, ENET0_PTP_SYNC_FRAME_TX, ENET0_SOF_RX, ENET0_SOF_TX, ENET0_GMII_TXD, ENET0_GMII_COL, ENET0_GMII_CRS, ENET0_GMII_RX_CLK, ENET0_GMII_RX_DV, ENET0_GMII_RX_ER, ENET0_GMII_TX_CLK, ENET0_MDIO_I, ENET0_EXT_INTIN, ENET0_GMII_RXD, ENET1_GMII_TX_EN, ENET1_GMII_TX_ER, ENET1_MDIO_MDC, ENET1_MDIO_O, ENET1_MDIO_T, ENET1_PTP_DELAY_REQ_RX, ENET1_PTP_DELAY_REQ_TX, ENET1_PTP_PDELAY_REQ_RX, ENET1_PTP_PDELAY_REQ_TX, ENET1_PTP_PDELAY_RESP_RX, ENET1_PTP_PDELAY_RESP_TX, ENET1_PTP_SYNC_FRAME_RX, ENET1_PTP_SYNC_FRAME_TX, ENET1_SOF_RX, ENET1_SOF_TX, ENET1_GMII_TXD, ENET1_GMII_COL, ENET1_GMII_CRS, ENET1_GMII_RX_CLK, ENET1_GMII_RX_DV, ENET1_GMII_RX_ER, ENET1_GMII_TX_CLK, ENET1_MDIO_I, ENET1_EXT_INTIN, ENET1_GMII_RXD, GPIO_I, GPIO_O, GPIO_T, I2C0_SDA_I, I2C0_SDA_O, I2C0_SDA_T, I2C0_SCL_I, I2C0_SCL_O, I2C0_SCL_T, I2C1_SDA_I, I2C1_SDA_O, I2C1_SDA_T, I2C1_SCL_I, I2C1_SCL_O, I2C1_SCL_T, PJTAG_TCK, PJTAG_TMS, PJTAG_TDI, PJTAG_TDO, SDIO0_CLK, SDIO0_CLK_FB, SDIO0_CMD_O, SDIO0_CMD_I, SDIO0_CMD_T, SDIO0_DATA_I, SDIO0_DATA_O, SDIO0_DATA_T, SDIO0_LED, SDIO0_CDN, SDIO0_WP, SDIO0_BUSPOW, SDIO0_BUSVOLT, SDIO1_CLK, SDIO1_CLK_FB, SDIO1_CMD_O, SDIO1_CMD_I, SDIO1_CMD_T, SDIO1_DATA_I, SDIO1_DATA_O, SDIO1_DATA_T, SDIO1_LED, SDIO1_CDN, SDIO1_WP, SDIO1_BUSPOW, SDIO1_BUSVOLT, SPI0_SCLK_I, SPI0_SCLK_O, SPI0_SCLK_T, SPI0_MOSI_I, SPI0_MOSI_O, SPI0_MOSI_T, SPI0_MISO_I, SPI0_MISO_O, SPI0_MISO_T, SPI0_SS_I, SPI0_SS_O, SPI0_SS1_O, SPI0_SS2_O, SPI0_SS_T, SPI1_SCLK_I, SPI1_SCLK_O, SPI1_SCLK_T, SPI1_MOSI_I, SPI1_MOSI_O, SPI1_MOSI_T, SPI1_MISO_I, SPI1_MISO_O, SPI1_MISO_T, SPI1_SS_I, SPI1_SS_O, SPI1_SS1_O, SPI1_SS2_O, SPI1_SS_T, UART0_DTRN, UART0_RTSN, UART0_TX, UART0_CTSN, UART0_DCDN, UART0_DSRN, UART0_RIN, UART0_RX, UART1_DTRN, UART1_RTSN, UART1_TX, UART1_CTSN, UART1_DCDN, UART1_DSRN, UART1_RIN, UART1_RX, TTC0_WAVE0_OUT, TTC0_WAVE1_OUT, TTC0_WAVE2_OUT, TTC0_CLK0_IN, TTC0_CLK1_IN, TTC0_CLK2_IN, TTC1_WAVE0_OUT, TTC1_WAVE1_OUT, TTC1_WAVE2_OUT, TTC1_CLK0_IN, TTC1_CLK1_IN, TTC1_CLK2_IN, WDT_CLK_IN, WDT_RST_OUT, TRACE_CLK, TRACE_CTL, TRACE_DATA, TRACE_CLK_OUT, USB0_PORT_INDCTL, USB0_VBUS_PWRSELECT, USB0_VBUS_PWRFAULT, USB1_PORT_INDCTL, USB1_VBUS_PWRSELECT, USB1_VBUS_PWRFAULT, SRAM_INTIN, M_AXI_GP0_ARESETN, M_AXI_GP0_ARVALID, M_AXI_GP0_AWVALID, M_AXI_GP0_BREADY, M_AXI_GP0_RREADY, M_AXI_GP0_WLAST, M_AXI_GP0_WVALID, M_AXI_GP0_ARID, M_AXI_GP0_AWID, M_AXI_GP0_WID, M_AXI_GP0_ARBURST, M_AXI_GP0_ARLOCK, M_AXI_GP0_ARSIZE, M_AXI_GP0_AWBURST, M_AXI_GP0_AWLOCK, M_AXI_GP0_AWSIZE, M_AXI_GP0_ARPROT, M_AXI_GP0_AWPROT, M_AXI_GP0_ARADDR, M_AXI_GP0_AWADDR, M_AXI_GP0_WDATA, M_AXI_GP0_ARCACHE, M_AXI_GP0_ARLEN, M_AXI_GP0_ARQOS, M_AXI_GP0_AWCACHE, M_AXI_GP0_AWLEN, M_AXI_GP0_AWQOS, M_AXI_GP0_WSTRB, M_AXI_GP0_ACLK, M_AXI_GP0_ARREADY, M_AXI_GP0_AWREADY, M_AXI_GP0_BVALID, M_AXI_GP0_RLAST, M_AXI_GP0_RVALID, M_AXI_GP0_WREADY, M_AXI_GP0_BID, M_AXI_GP0_RID, M_AXI_GP0_BRESP, M_AXI_GP0_RRESP, M_AXI_GP0_RDATA, M_AXI_GP1_ARESETN, M_AXI_GP1_ARVALID, M_AXI_GP1_AWVALID, M_AXI_GP1_BREADY, M_AXI_GP1_RREADY, M_AXI_GP1_WLAST, M_AXI_GP1_WVALID, M_AXI_GP1_ARID, M_AXI_GP1_AWID, M_AXI_GP1_WID, M_AXI_GP1_ARBURST, M_AXI_GP1_ARLOCK, M_AXI_GP1_ARSIZE, M_AXI_GP1_AWBURST, M_AXI_GP1_AWLOCK, M_AXI_GP1_AWSIZE, M_AXI_GP1_ARPROT, M_AXI_GP1_AWPROT, M_AXI_GP1_ARADDR, M_AXI_GP1_AWADDR, M_AXI_GP1_WDATA, M_AXI_GP1_ARCACHE, M_AXI_GP1_ARLEN, M_AXI_GP1_ARQOS, M_AXI_GP1_AWCACHE, M_AXI_GP1_AWLEN, M_AXI_GP1_AWQOS, M_AXI_GP1_WSTRB, M_AXI_GP1_ACLK, M_AXI_GP1_ARREADY, M_AXI_GP1_AWREADY, M_AXI_GP1_BVALID, M_AXI_GP1_RLAST, M_AXI_GP1_RVALID, M_AXI_GP1_WREADY, M_AXI_GP1_BID, M_AXI_GP1_RID, M_AXI_GP1_BRESP, M_AXI_GP1_RRESP, M_AXI_GP1_RDATA, S_AXI_GP0_ARESETN, S_AXI_GP0_ARREADY, S_AXI_GP0_AWREADY, S_AXI_GP0_BVALID, S_AXI_GP0_RLAST, S_AXI_GP0_RVALID, S_AXI_GP0_WREADY, S_AXI_GP0_BRESP, S_AXI_GP0_RRESP, S_AXI_GP0_RDATA, S_AXI_GP0_BID, S_AXI_GP0_RID, S_AXI_GP0_ACLK, S_AXI_GP0_ARVALID, S_AXI_GP0_AWVALID, S_AXI_GP0_BREADY, S_AXI_GP0_RREADY, S_AXI_GP0_WLAST, S_AXI_GP0_WVALID, S_AXI_GP0_ARBURST, S_AXI_GP0_ARLOCK, S_AXI_GP0_ARSIZE, S_AXI_GP0_AWBURST, S_AXI_GP0_AWLOCK, S_AXI_GP0_AWSIZE, S_AXI_GP0_ARPROT, S_AXI_GP0_AWPROT, S_AXI_GP0_ARADDR, S_AXI_GP0_AWADDR, S_AXI_GP0_WDATA, S_AXI_GP0_ARCACHE, S_AXI_GP0_ARLEN, S_AXI_GP0_ARQOS, S_AXI_GP0_AWCACHE, S_AXI_GP0_AWLEN, S_AXI_GP0_AWQOS, S_AXI_GP0_WSTRB, S_AXI_GP0_ARID, S_AXI_GP0_AWID, S_AXI_GP0_WID, S_AXI_GP1_ARESETN, S_AXI_GP1_ARREADY, S_AXI_GP1_AWREADY, S_AXI_GP1_BVALID, S_AXI_GP1_RLAST, S_AXI_GP1_RVALID, S_AXI_GP1_WREADY, S_AXI_GP1_BRESP, S_AXI_GP1_RRESP, S_AXI_GP1_RDATA, S_AXI_GP1_BID, S_AXI_GP1_RID, S_AXI_GP1_ACLK, S_AXI_GP1_ARVALID, S_AXI_GP1_AWVALID, S_AXI_GP1_BREADY, S_AXI_GP1_RREADY, S_AXI_GP1_WLAST, S_AXI_GP1_WVALID, S_AXI_GP1_ARBURST, S_AXI_GP1_ARLOCK, S_AXI_GP1_ARSIZE, S_AXI_GP1_AWBURST, S_AXI_GP1_AWLOCK, S_AXI_GP1_AWSIZE, S_AXI_GP1_ARPROT, S_AXI_GP1_AWPROT, S_AXI_GP1_ARADDR, S_AXI_GP1_AWADDR, S_AXI_GP1_WDATA, S_AXI_GP1_ARCACHE, S_AXI_GP1_ARLEN, S_AXI_GP1_ARQOS, S_AXI_GP1_AWCACHE, S_AXI_GP1_AWLEN, S_AXI_GP1_AWQOS, S_AXI_GP1_WSTRB, S_AXI_GP1_ARID, S_AXI_GP1_AWID, S_AXI_GP1_WID, S_AXI_ACP_ARESETN, S_AXI_ACP_ARREADY, S_AXI_ACP_AWREADY, S_AXI_ACP_BVALID, S_AXI_ACP_RLAST, S_AXI_ACP_RVALID, S_AXI_ACP_WREADY, S_AXI_ACP_BRESP, S_AXI_ACP_RRESP, S_AXI_ACP_BID, S_AXI_ACP_RID, S_AXI_ACP_RDATA, S_AXI_ACP_ACLK, S_AXI_ACP_ARVALID, S_AXI_ACP_AWVALID, S_AXI_ACP_BREADY, S_AXI_ACP_RREADY, S_AXI_ACP_WLAST, S_AXI_ACP_WVALID, S_AXI_ACP_ARID, S_AXI_ACP_ARPROT, S_AXI_ACP_AWID, S_AXI_ACP_AWPROT, S_AXI_ACP_WID, S_AXI_ACP_ARADDR, S_AXI_ACP_AWADDR, S_AXI_ACP_ARCACHE, S_AXI_ACP_ARLEN, S_AXI_ACP_ARQOS, S_AXI_ACP_AWCACHE, S_AXI_ACP_AWLEN, S_AXI_ACP_AWQOS, S_AXI_ACP_ARBURST, S_AXI_ACP_ARLOCK, S_AXI_ACP_ARSIZE, S_AXI_ACP_AWBURST, S_AXI_ACP_AWLOCK, S_AXI_ACP_AWSIZE, S_AXI_ACP_ARUSER, S_AXI_ACP_AWUSER, S_AXI_ACP_WDATA, S_AXI_ACP_WSTRB, S_AXI_HP0_ARESETN, S_AXI_HP0_ARREADY, S_AXI_HP0_AWREADY, S_AXI_HP0_BVALID, S_AXI_HP0_RLAST, S_AXI_HP0_RVALID, S_AXI_HP0_WREADY, S_AXI_HP0_BRESP, S_AXI_HP0_RRESP, S_AXI_HP0_BID, S_AXI_HP0_RID, S_AXI_HP0_RDATA, S_AXI_HP0_RCOUNT, S_AXI_HP0_WCOUNT, S_AXI_HP0_RACOUNT, S_AXI_HP0_WACOUNT, S_AXI_HP0_ACLK, S_AXI_HP0_ARVALID, S_AXI_HP0_AWVALID, S_AXI_HP0_BREADY, S_AXI_HP0_RDISSUECAP1_EN, S_AXI_HP0_RREADY, S_AXI_HP0_WLAST, S_AXI_HP0_WRISSUECAP1_EN, S_AXI_HP0_WVALID, S_AXI_HP0_ARBURST, S_AXI_HP0_ARLOCK, S_AXI_HP0_ARSIZE, S_AXI_HP0_AWBURST, S_AXI_HP0_AWLOCK, S_AXI_HP0_AWSIZE, S_AXI_HP0_ARPROT, S_AXI_HP0_AWPROT, S_AXI_HP0_ARADDR, S_AXI_HP0_AWADDR, S_AXI_HP0_ARCACHE, S_AXI_HP0_ARLEN, S_AXI_HP0_ARQOS, S_AXI_HP0_AWCACHE, S_AXI_HP0_AWLEN, S_AXI_HP0_AWQOS, S_AXI_HP0_ARID, S_AXI_HP0_AWID, S_AXI_HP0_WID, S_AXI_HP0_WDATA, S_AXI_HP0_WSTRB, S_AXI_HP1_ARESETN, S_AXI_HP1_ARREADY, S_AXI_HP1_AWREADY, S_AXI_HP1_BVALID, S_AXI_HP1_RLAST, S_AXI_HP1_RVALID, S_AXI_HP1_WREADY, S_AXI_HP1_BRESP, S_AXI_HP1_RRESP, S_AXI_HP1_BID, S_AXI_HP1_RID, S_AXI_HP1_RDATA, S_AXI_HP1_RCOUNT, S_AXI_HP1_WCOUNT, S_AXI_HP1_RACOUNT, S_AXI_HP1_WACOUNT, S_AXI_HP1_ACLK, S_AXI_HP1_ARVALID, S_AXI_HP1_AWVALID, S_AXI_HP1_BREADY, S_AXI_HP1_RDISSUECAP1_EN, S_AXI_HP1_RREADY, S_AXI_HP1_WLAST, S_AXI_HP1_WRISSUECAP1_EN, S_AXI_HP1_WVALID, S_AXI_HP1_ARBURST, S_AXI_HP1_ARLOCK, S_AXI_HP1_ARSIZE, S_AXI_HP1_AWBURST, S_AXI_HP1_AWLOCK, S_AXI_HP1_AWSIZE, S_AXI_HP1_ARPROT, S_AXI_HP1_AWPROT, S_AXI_HP1_ARADDR, S_AXI_HP1_AWADDR, S_AXI_HP1_ARCACHE, S_AXI_HP1_ARLEN, S_AXI_HP1_ARQOS, S_AXI_HP1_AWCACHE, S_AXI_HP1_AWLEN, S_AXI_HP1_AWQOS, S_AXI_HP1_ARID, S_AXI_HP1_AWID, S_AXI_HP1_WID, S_AXI_HP1_WDATA, S_AXI_HP1_WSTRB, S_AXI_HP2_ARESETN, S_AXI_HP2_ARREADY, S_AXI_HP2_AWREADY, S_AXI_HP2_BVALID, S_AXI_HP2_RLAST, S_AXI_HP2_RVALID, S_AXI_HP2_WREADY, S_AXI_HP2_BRESP, S_AXI_HP2_RRESP, S_AXI_HP2_BID, S_AXI_HP2_RID, S_AXI_HP2_RDATA, S_AXI_HP2_RCOUNT, S_AXI_HP2_WCOUNT, S_AXI_HP2_RACOUNT, S_AXI_HP2_WACOUNT, S_AXI_HP2_ACLK, S_AXI_HP2_ARVALID, S_AXI_HP2_AWVALID, S_AXI_HP2_BREADY, S_AXI_HP2_RDISSUECAP1_EN, S_AXI_HP2_RREADY, S_AXI_HP2_WLAST, S_AXI_HP2_WRISSUECAP1_EN, S_AXI_HP2_WVALID, S_AXI_HP2_ARBURST, S_AXI_HP2_ARLOCK, S_AXI_HP2_ARSIZE, S_AXI_HP2_AWBURST, S_AXI_HP2_AWLOCK, S_AXI_HP2_AWSIZE, S_AXI_HP2_ARPROT, S_AXI_HP2_AWPROT, S_AXI_HP2_ARADDR, S_AXI_HP2_AWADDR, S_AXI_HP2_ARCACHE, S_AXI_HP2_ARLEN, S_AXI_HP2_ARQOS, S_AXI_HP2_AWCACHE, S_AXI_HP2_AWLEN, S_AXI_HP2_AWQOS, S_AXI_HP2_ARID, S_AXI_HP2_AWID, S_AXI_HP2_WID, S_AXI_HP2_WDATA, S_AXI_HP2_WSTRB, S_AXI_HP3_ARESETN, S_AXI_HP3_ARREADY, S_AXI_HP3_AWREADY, S_AXI_HP3_BVALID, S_AXI_HP3_RLAST, S_AXI_HP3_RVALID, S_AXI_HP3_WREADY, S_AXI_HP3_BRESP, S_AXI_HP3_RRESP, S_AXI_HP3_BID, S_AXI_HP3_RID, S_AXI_HP3_RDATA, S_AXI_HP3_RCOUNT, S_AXI_HP3_WCOUNT, S_AXI_HP3_RACOUNT, S_AXI_HP3_WACOUNT, S_AXI_HP3_ACLK, S_AXI_HP3_ARVALID, S_AXI_HP3_AWVALID, S_AXI_HP3_BREADY, S_AXI_HP3_RDISSUECAP1_EN, S_AXI_HP3_RREADY, S_AXI_HP3_WLAST, S_AXI_HP3_WRISSUECAP1_EN, S_AXI_HP3_WVALID, S_AXI_HP3_ARBURST, S_AXI_HP3_ARLOCK, S_AXI_HP3_ARSIZE, S_AXI_HP3_AWBURST, S_AXI_HP3_AWLOCK, S_AXI_HP3_AWSIZE, S_AXI_HP3_ARPROT, S_AXI_HP3_AWPROT, S_AXI_HP3_ARADDR, S_AXI_HP3_AWADDR, S_AXI_HP3_ARCACHE, S_AXI_HP3_ARLEN, S_AXI_HP3_ARQOS, S_AXI_HP3_AWCACHE, S_AXI_HP3_AWLEN, S_AXI_HP3_AWQOS, S_AXI_HP3_ARID, S_AXI_HP3_AWID, S_AXI_HP3_WID, S_AXI_HP3_WDATA, S_AXI_HP3_WSTRB, IRQ_P2F_DMAC_ABORT, IRQ_P2F_DMAC0, IRQ_P2F_DMAC1, IRQ_P2F_DMAC2, IRQ_P2F_DMAC3, IRQ_P2F_DMAC4, IRQ_P2F_DMAC5, IRQ_P2F_DMAC6, IRQ_P2F_DMAC7, IRQ_P2F_SMC, IRQ_P2F_QSPI, IRQ_P2F_CTI, IRQ_P2F_GPIO, IRQ_P2F_USB0, IRQ_P2F_ENET0, IRQ_P2F_ENET_WAKE0, IRQ_P2F_SDIO0, IRQ_P2F_I2C0, IRQ_P2F_SPI0, IRQ_P2F_UART0, IRQ_P2F_CAN0, IRQ_P2F_USB1, IRQ_P2F_ENET1, IRQ_P2F_ENET_WAKE1, IRQ_P2F_SDIO1, IRQ_P2F_I2C1, IRQ_P2F_SPI1, IRQ_P2F_UART1, IRQ_P2F_CAN1, IRQ_F2P, Core0_nFIQ, Core0_nIRQ, Core1_nFIQ, Core1_nIRQ, DMA0_DATYPE, DMA0_DAVALID, DMA0_DRREADY, DMA0_RSTN, DMA1_DATYPE, DMA1_DAVALID, DMA1_DRREADY, DMA1_RSTN, DMA2_DATYPE, DMA2_DAVALID, DMA2_DRREADY, DMA2_RSTN, DMA3_DATYPE, DMA3_DAVALID, DMA3_DRREADY, DMA3_RSTN, DMA0_ACLK, DMA0_DAREADY, DMA0_DRLAST, DMA0_DRVALID, DMA1_ACLK, DMA1_DAREADY, DMA1_DRLAST, DMA1_DRVALID, DMA2_ACLK, DMA2_DAREADY, DMA2_DRLAST, DMA2_DRVALID, DMA3_ACLK, DMA3_DAREADY, DMA3_DRLAST, DMA3_DRVALID, DMA0_DRTYPE, DMA1_DRTYPE, DMA2_DRTYPE, DMA3_DRTYPE, FCLK_CLK3, FCLK_CLK2, FCLK_CLK1, FCLK_CLK0, FCLK_CLKTRIG3_N, FCLK_CLKTRIG2_N, FCLK_CLKTRIG1_N, FCLK_CLKTRIG0_N, FCLK_RESET3_N, FCLK_RESET2_N, FCLK_RESET1_N, FCLK_RESET0_N, FTMD_TRACEIN_DATA, FTMD_TRACEIN_VALID, FTMD_TRACEIN_CLK, FTMD_TRACEIN_ATID, FTMT_F2P_TRIG_0, FTMT_F2P_TRIGACK_0, FTMT_F2P_TRIG_1, FTMT_F2P_TRIGACK_1, FTMT_F2P_TRIG_2, FTMT_F2P_TRIGACK_2, FTMT_F2P_TRIG_3, FTMT_F2P_TRIGACK_3, FTMT_F2P_DEBUG, FTMT_P2F_TRIGACK_0, FTMT_P2F_TRIG_0, FTMT_P2F_TRIGACK_1, FTMT_P2F_TRIG_1, FTMT_P2F_TRIGACK_2, FTMT_P2F_TRIG_2, FTMT_P2F_TRIGACK_3, FTMT_P2F_TRIG_3, FTMT_P2F_DEBUG, FPGA_IDLE_N, EVENT_EVENTO, EVENT_STANDBYWFE, EVENT_STANDBYWFI, EVENT_EVENTI, DDR_ARB, MIO, DDR_CAS_n, DDR_CKE, DDR_Clk_n, DDR_Clk, DDR_CS_n, DDR_DRSTB, DDR_ODT, DDR_RAS_n, DDR_WEB, DDR_BankAddr, DDR_Addr, DDR_VRN, DDR_VRP, DDR_DM, DDR_DQ, DDR_DQS_n, DDR_DQS, PS_SRSTB, PS_CLK, PS_PORB); output CAN0_PHY_TX; input CAN0_PHY_RX; output CAN1_PHY_TX; input CAN1_PHY_RX; output ENET0_GMII_TX_EN; output ENET0_GMII_TX_ER; output ENET0_MDIO_MDC; output ENET0_MDIO_O; output ENET0_MDIO_T; output ENET0_PTP_DELAY_REQ_RX; output ENET0_PTP_DELAY_REQ_TX; output ENET0_PTP_PDELAY_REQ_RX; output ENET0_PTP_PDELAY_REQ_TX; output ENET0_PTP_PDELAY_RESP_RX; output ENET0_PTP_PDELAY_RESP_TX; output ENET0_PTP_SYNC_FRAME_RX; output ENET0_PTP_SYNC_FRAME_TX; output ENET0_SOF_RX; output ENET0_SOF_TX; output [7:0]ENET0_GMII_TXD; input ENET0_GMII_COL; input ENET0_GMII_CRS; input ENET0_GMII_RX_CLK; input ENET0_GMII_RX_DV; input ENET0_GMII_RX_ER; input ENET0_GMII_TX_CLK; input ENET0_MDIO_I; input ENET0_EXT_INTIN; input [7:0]ENET0_GMII_RXD; output ENET1_GMII_TX_EN; output ENET1_GMII_TX_ER; output ENET1_MDIO_MDC; output ENET1_MDIO_O; output ENET1_MDIO_T; output ENET1_PTP_DELAY_REQ_RX; output ENET1_PTP_DELAY_REQ_TX; output ENET1_PTP_PDELAY_REQ_RX; output ENET1_PTP_PDELAY_REQ_TX; output ENET1_PTP_PDELAY_RESP_RX; output ENET1_PTP_PDELAY_RESP_TX; output ENET1_PTP_SYNC_FRAME_RX; output ENET1_PTP_SYNC_FRAME_TX; output ENET1_SOF_RX; output ENET1_SOF_TX; output [7:0]ENET1_GMII_TXD; input ENET1_GMII_COL; input ENET1_GMII_CRS; input ENET1_GMII_RX_CLK; input ENET1_GMII_RX_DV; input ENET1_GMII_RX_ER; input ENET1_GMII_TX_CLK; input ENET1_MDIO_I; input ENET1_EXT_INTIN; input [7:0]ENET1_GMII_RXD; input [63:0]GPIO_I; output [63:0]GPIO_O; output [63:0]GPIO_T; input I2C0_SDA_I; output I2C0_SDA_O; output I2C0_SDA_T; input I2C0_SCL_I; output I2C0_SCL_O; output I2C0_SCL_T; input I2C1_SDA_I; output I2C1_SDA_O; output I2C1_SDA_T; input I2C1_SCL_I; output I2C1_SCL_O; output I2C1_SCL_T; input PJTAG_TCK; input PJTAG_TMS; input PJTAG_TDI; output PJTAG_TDO; output SDIO0_CLK; input SDIO0_CLK_FB; output SDIO0_CMD_O; input SDIO0_CMD_I; output SDIO0_CMD_T; input [3:0]SDIO0_DATA_I; output [3:0]SDIO0_DATA_O; output [3:0]SDIO0_DATA_T; output SDIO0_LED; input SDIO0_CDN; input SDIO0_WP; output SDIO0_BUSPOW; output [2:0]SDIO0_BUSVOLT; output SDIO1_CLK; input SDIO1_CLK_FB; output SDIO1_CMD_O; input SDIO1_CMD_I; output SDIO1_CMD_T; input [3:0]SDIO1_DATA_I; output [3:0]SDIO1_DATA_O; output [3:0]SDIO1_DATA_T; output SDIO1_LED; input SDIO1_CDN; input SDIO1_WP; output SDIO1_BUSPOW; output [2:0]SDIO1_BUSVOLT; input SPI0_SCLK_I; output SPI0_SCLK_O; output SPI0_SCLK_T; input SPI0_MOSI_I; output SPI0_MOSI_O; output SPI0_MOSI_T; input SPI0_MISO_I; output SPI0_MISO_O; output SPI0_MISO_T; input SPI0_SS_I; output SPI0_SS_O; output SPI0_SS1_O; output SPI0_SS2_O; output SPI0_SS_T; input SPI1_SCLK_I; output SPI1_SCLK_O; output SPI1_SCLK_T; input SPI1_MOSI_I; output SPI1_MOSI_O; output SPI1_MOSI_T; input SPI1_MISO_I; output SPI1_MISO_O; output SPI1_MISO_T; input SPI1_SS_I; output SPI1_SS_O; output SPI1_SS1_O; output SPI1_SS2_O; output SPI1_SS_T; output UART0_DTRN; output UART0_RTSN; output UART0_TX; input UART0_CTSN; input UART0_DCDN; input UART0_DSRN; input UART0_RIN; input UART0_RX; output UART1_DTRN; output UART1_RTSN; output UART1_TX; input UART1_CTSN; input UART1_DCDN; input UART1_DSRN; input UART1_RIN; input UART1_RX; output TTC0_WAVE0_OUT; output TTC0_WAVE1_OUT; output TTC0_WAVE2_OUT; input TTC0_CLK0_IN; input TTC0_CLK1_IN; input TTC0_CLK2_IN; output TTC1_WAVE0_OUT; output TTC1_WAVE1_OUT; output TTC1_WAVE2_OUT; input TTC1_CLK0_IN; input TTC1_CLK1_IN; input TTC1_CLK2_IN; input WDT_CLK_IN; output WDT_RST_OUT; input TRACE_CLK; output TRACE_CTL; output [1:0]TRACE_DATA; output TRACE_CLK_OUT; output [1:0]USB0_PORT_INDCTL; output USB0_VBUS_PWRSELECT; input USB0_VBUS_PWRFAULT; output [1:0]USB1_PORT_INDCTL; output USB1_VBUS_PWRSELECT; input USB1_VBUS_PWRFAULT; input SRAM_INTIN; output M_AXI_GP0_ARESETN; output M_AXI_GP0_ARVALID; output M_AXI_GP0_AWVALID; output M_AXI_GP0_BREADY; output M_AXI_GP0_RREADY; output M_AXI_GP0_WLAST; output M_AXI_GP0_WVALID; output [11:0]M_AXI_GP0_ARID; output [11:0]M_AXI_GP0_AWID; output [11:0]M_AXI_GP0_WID; output [1:0]M_AXI_GP0_ARBURST; output [1:0]M_AXI_GP0_ARLOCK; output [2:0]M_AXI_GP0_ARSIZE; output [1:0]M_AXI_GP0_AWBURST; output [1:0]M_AXI_GP0_AWLOCK; output [2:0]M_AXI_GP0_AWSIZE; output [2:0]M_AXI_GP0_ARPROT; output [2:0]M_AXI_GP0_AWPROT; output [31:0]M_AXI_GP0_ARADDR; output [31:0]M_AXI_GP0_AWADDR; output [31:0]M_AXI_GP0_WDATA; output [3:0]M_AXI_GP0_ARCACHE; output [3:0]M_AXI_GP0_ARLEN; output [3:0]M_AXI_GP0_ARQOS; output [3:0]M_AXI_GP0_AWCACHE; output [3:0]M_AXI_GP0_AWLEN; output [3:0]M_AXI_GP0_AWQOS; output [3:0]M_AXI_GP0_WSTRB; input M_AXI_GP0_ACLK; input M_AXI_GP0_ARREADY; input M_AXI_GP0_AWREADY; input M_AXI_GP0_BVALID; input M_AXI_GP0_RLAST; input M_AXI_GP0_RVALID; input M_AXI_GP0_WREADY; input [11:0]M_AXI_GP0_BID; input [11:0]M_AXI_GP0_RID; input [1:0]M_AXI_GP0_BRESP; input [1:0]M_AXI_GP0_RRESP; input [31:0]M_AXI_GP0_RDATA; output M_AXI_GP1_ARESETN; output M_AXI_GP1_ARVALID; output M_AXI_GP1_AWVALID; output M_AXI_GP1_BREADY; output M_AXI_GP1_RREADY; output M_AXI_GP1_WLAST; output M_AXI_GP1_WVALID; output [11:0]M_AXI_GP1_ARID; output [11:0]M_AXI_GP1_AWID; output [11:0]M_AXI_GP1_WID; output [1:0]M_AXI_GP1_ARBURST; output [1:0]M_AXI_GP1_ARLOCK; output [2:0]M_AXI_GP1_ARSIZE; output [1:0]M_AXI_GP1_AWBURST; output [1:0]M_AXI_GP1_AWLOCK; output [2:0]M_AXI_GP1_AWSIZE; output [2:0]M_AXI_GP1_ARPROT; output [2:0]M_AXI_GP1_AWPROT; output [31:0]M_AXI_GP1_ARADDR; output [31:0]M_AXI_GP1_AWADDR; output [31:0]M_AXI_GP1_WDATA; output [3:0]M_AXI_GP1_ARCACHE; output [3:0]M_AXI_GP1_ARLEN; output [3:0]M_AXI_GP1_ARQOS; output [3:0]M_AXI_GP1_AWCACHE; output [3:0]M_AXI_GP1_AWLEN; output [3:0]M_AXI_GP1_AWQOS; output [3:0]M_AXI_GP1_WSTRB; input M_AXI_GP1_ACLK; input M_AXI_GP1_ARREADY; input M_AXI_GP1_AWREADY; input M_AXI_GP1_BVALID; input M_AXI_GP1_RLAST; input M_AXI_GP1_RVALID; input M_AXI_GP1_WREADY; input [11:0]M_AXI_GP1_BID; input [11:0]M_AXI_GP1_RID; input [1:0]M_AXI_GP1_BRESP; input [1:0]M_AXI_GP1_RRESP; input [31:0]M_AXI_GP1_RDATA; output S_AXI_GP0_ARESETN; output S_AXI_GP0_ARREADY; output S_AXI_GP0_AWREADY; output S_AXI_GP0_BVALID; output S_AXI_GP0_RLAST; output S_AXI_GP0_RVALID; output S_AXI_GP0_WREADY; output [1:0]S_AXI_GP0_BRESP; output [1:0]S_AXI_GP0_RRESP; output [31:0]S_AXI_GP0_RDATA; output [5:0]S_AXI_GP0_BID; output [5:0]S_AXI_GP0_RID; input S_AXI_GP0_ACLK; input S_AXI_GP0_ARVALID; input S_AXI_GP0_AWVALID; input S_AXI_GP0_BREADY; input S_AXI_GP0_RREADY; input S_AXI_GP0_WLAST; input S_AXI_GP0_WVALID; input [1:0]S_AXI_GP0_ARBURST; input [1:0]S_AXI_GP0_ARLOCK; input [2:0]S_AXI_GP0_ARSIZE; input [1:0]S_AXI_GP0_AWBURST; input [1:0]S_AXI_GP0_AWLOCK; input [2:0]S_AXI_GP0_AWSIZE; input [2:0]S_AXI_GP0_ARPROT; input [2:0]S_AXI_GP0_AWPROT; input [31:0]S_AXI_GP0_ARADDR; input [31:0]S_AXI_GP0_AWADDR; input [31:0]S_AXI_GP0_WDATA; input [3:0]S_AXI_GP0_ARCACHE; input [3:0]S_AXI_GP0_ARLEN; input [3:0]S_AXI_GP0_ARQOS; input [3:0]S_AXI_GP0_AWCACHE; input [3:0]S_AXI_GP0_AWLEN; input [3:0]S_AXI_GP0_AWQOS; input [3:0]S_AXI_GP0_WSTRB; input [5:0]S_AXI_GP0_ARID; input [5:0]S_AXI_GP0_AWID; input [5:0]S_AXI_GP0_WID; output S_AXI_GP1_ARESETN; output S_AXI_GP1_ARREADY; output S_AXI_GP1_AWREADY; output S_AXI_GP1_BVALID; output S_AXI_GP1_RLAST; output S_AXI_GP1_RVALID; output S_AXI_GP1_WREADY; output [1:0]S_AXI_GP1_BRESP; output [1:0]S_AXI_GP1_RRESP; output [31:0]S_AXI_GP1_RDATA; output [5:0]S_AXI_GP1_BID; output [5:0]S_AXI_GP1_RID; input S_AXI_GP1_ACLK; input S_AXI_GP1_ARVALID; input S_AXI_GP1_AWVALID; input S_AXI_GP1_BREADY; input S_AXI_GP1_RREADY; input S_AXI_GP1_WLAST; input S_AXI_GP1_WVALID; input [1:0]S_AXI_GP1_ARBURST; input [1:0]S_AXI_GP1_ARLOCK; input [2:0]S_AXI_GP1_ARSIZE; input [1:0]S_AXI_GP1_AWBURST; input [1:0]S_AXI_GP1_AWLOCK; input [2:0]S_AXI_GP1_AWSIZE; input [2:0]S_AXI_GP1_ARPROT; input [2:0]S_AXI_GP1_AWPROT; input [31:0]S_AXI_GP1_ARADDR; input [31:0]S_AXI_GP1_AWADDR; input [31:0]S_AXI_GP1_WDATA; input [3:0]S_AXI_GP1_ARCACHE; input [3:0]S_AXI_GP1_ARLEN; input [3:0]S_AXI_GP1_ARQOS; input [3:0]S_AXI_GP1_AWCACHE; input [3:0]S_AXI_GP1_AWLEN; input [3:0]S_AXI_GP1_AWQOS; input [3:0]S_AXI_GP1_WSTRB; input [5:0]S_AXI_GP1_ARID; input [5:0]S_AXI_GP1_AWID; input [5:0]S_AXI_GP1_WID; output S_AXI_ACP_ARESETN; output S_AXI_ACP_ARREADY; output S_AXI_ACP_AWREADY; output S_AXI_ACP_BVALID; output S_AXI_ACP_RLAST; output S_AXI_ACP_RVALID; output S_AXI_ACP_WREADY; output [1:0]S_AXI_ACP_BRESP; output [1:0]S_AXI_ACP_RRESP; output [2:0]S_AXI_ACP_BID; output [2:0]S_AXI_ACP_RID; output [63:0]S_AXI_ACP_RDATA; input S_AXI_ACP_ACLK; input S_AXI_ACP_ARVALID; input S_AXI_ACP_AWVALID; input S_AXI_ACP_BREADY; input S_AXI_ACP_RREADY; input S_AXI_ACP_WLAST; input S_AXI_ACP_WVALID; input [2:0]S_AXI_ACP_ARID; input [2:0]S_AXI_ACP_ARPROT; input [2:0]S_AXI_ACP_AWID; input [2:0]S_AXI_ACP_AWPROT; input [2:0]S_AXI_ACP_WID; input [31:0]S_AXI_ACP_ARADDR; input [31:0]S_AXI_ACP_AWADDR; input [3:0]S_AXI_ACP_ARCACHE; input [3:0]S_AXI_ACP_ARLEN; input [3:0]S_AXI_ACP_ARQOS; input [3:0]S_AXI_ACP_AWCACHE; input [3:0]S_AXI_ACP_AWLEN; input [3:0]S_AXI_ACP_AWQOS; input [1:0]S_AXI_ACP_ARBURST; input [1:0]S_AXI_ACP_ARLOCK; input [2:0]S_AXI_ACP_ARSIZE; input [1:0]S_AXI_ACP_AWBURST; input [1:0]S_AXI_ACP_AWLOCK; input [2:0]S_AXI_ACP_AWSIZE; input [4:0]S_AXI_ACP_ARUSER; input [4:0]S_AXI_ACP_AWUSER; input [63:0]S_AXI_ACP_WDATA; input [7:0]S_AXI_ACP_WSTRB; output S_AXI_HP0_ARESETN; output S_AXI_HP0_ARREADY; output S_AXI_HP0_AWREADY; output S_AXI_HP0_BVALID; output S_AXI_HP0_RLAST; output S_AXI_HP0_RVALID; output S_AXI_HP0_WREADY; output [1:0]S_AXI_HP0_BRESP; output [1:0]S_AXI_HP0_RRESP; output [5:0]S_AXI_HP0_BID; output [5:0]S_AXI_HP0_RID; output [63:0]S_AXI_HP0_RDATA; output [7:0]S_AXI_HP0_RCOUNT; output [7:0]S_AXI_HP0_WCOUNT; output [2:0]S_AXI_HP0_RACOUNT; output [5:0]S_AXI_HP0_WACOUNT; input S_AXI_HP0_ACLK; input S_AXI_HP0_ARVALID; input S_AXI_HP0_AWVALID; input S_AXI_HP0_BREADY; input S_AXI_HP0_RDISSUECAP1_EN; input S_AXI_HP0_RREADY; input S_AXI_HP0_WLAST; input S_AXI_HP0_WRISSUECAP1_EN; input S_AXI_HP0_WVALID; input [1:0]S_AXI_HP0_ARBURST; input [1:0]S_AXI_HP0_ARLOCK; input [2:0]S_AXI_HP0_ARSIZE; input [1:0]S_AXI_HP0_AWBURST; input [1:0]S_AXI_HP0_AWLOCK; input [2:0]S_AXI_HP0_AWSIZE; input [2:0]S_AXI_HP0_ARPROT; input [2:0]S_AXI_HP0_AWPROT; input [31:0]S_AXI_HP0_ARADDR; input [31:0]S_AXI_HP0_AWADDR; input [3:0]S_AXI_HP0_ARCACHE; input [3:0]S_AXI_HP0_ARLEN; input [3:0]S_AXI_HP0_ARQOS; input [3:0]S_AXI_HP0_AWCACHE; input [3:0]S_AXI_HP0_AWLEN; input [3:0]S_AXI_HP0_AWQOS; input [5:0]S_AXI_HP0_ARID; input [5:0]S_AXI_HP0_AWID; input [5:0]S_AXI_HP0_WID; input [63:0]S_AXI_HP0_WDATA; input [7:0]S_AXI_HP0_WSTRB; output S_AXI_HP1_ARESETN; output S_AXI_HP1_ARREADY; output S_AXI_HP1_AWREADY; output S_AXI_HP1_BVALID; output S_AXI_HP1_RLAST; output S_AXI_HP1_RVALID; output S_AXI_HP1_WREADY; output [1:0]S_AXI_HP1_BRESP; output [1:0]S_AXI_HP1_RRESP; output [5:0]S_AXI_HP1_BID; output [5:0]S_AXI_HP1_RID; output [63:0]S_AXI_HP1_RDATA; output [7:0]S_AXI_HP1_RCOUNT; output [7:0]S_AXI_HP1_WCOUNT; output [2:0]S_AXI_HP1_RACOUNT; output [5:0]S_AXI_HP1_WACOUNT; input S_AXI_HP1_ACLK; input S_AXI_HP1_ARVALID; input S_AXI_HP1_AWVALID; input S_AXI_HP1_BREADY; input S_AXI_HP1_RDISSUECAP1_EN; input S_AXI_HP1_RREADY; input S_AXI_HP1_WLAST; input S_AXI_HP1_WRISSUECAP1_EN; input S_AXI_HP1_WVALID; input [1:0]S_AXI_HP1_ARBURST; input [1:0]S_AXI_HP1_ARLOCK; input [2:0]S_AXI_HP1_ARSIZE; input [1:0]S_AXI_HP1_AWBURST; input [1:0]S_AXI_HP1_AWLOCK; input [2:0]S_AXI_HP1_AWSIZE; input [2:0]S_AXI_HP1_ARPROT; input [2:0]S_AXI_HP1_AWPROT; input [31:0]S_AXI_HP1_ARADDR; input [31:0]S_AXI_HP1_AWADDR; input [3:0]S_AXI_HP1_ARCACHE; input [3:0]S_AXI_HP1_ARLEN; input [3:0]S_AXI_HP1_ARQOS; input [3:0]S_AXI_HP1_AWCACHE; input [3:0]S_AXI_HP1_AWLEN; input [3:0]S_AXI_HP1_AWQOS; input [5:0]S_AXI_HP1_ARID; input [5:0]S_AXI_HP1_AWID; input [5:0]S_AXI_HP1_WID; input [63:0]S_AXI_HP1_WDATA; input [7:0]S_AXI_HP1_WSTRB; output S_AXI_HP2_ARESETN; output S_AXI_HP2_ARREADY; output S_AXI_HP2_AWREADY; output S_AXI_HP2_BVALID; output S_AXI_HP2_RLAST; output S_AXI_HP2_RVALID; output S_AXI_HP2_WREADY; output [1:0]S_AXI_HP2_BRESP; output [1:0]S_AXI_HP2_RRESP; output [5:0]S_AXI_HP2_BID; output [5:0]S_AXI_HP2_RID; output [63:0]S_AXI_HP2_RDATA; output [7:0]S_AXI_HP2_RCOUNT; output [7:0]S_AXI_HP2_WCOUNT; output [2:0]S_AXI_HP2_RACOUNT; output [5:0]S_AXI_HP2_WACOUNT; input S_AXI_HP2_ACLK; input S_AXI_HP2_ARVALID; input S_AXI_HP2_AWVALID; input S_AXI_HP2_BREADY; input S_AXI_HP2_RDISSUECAP1_EN; input S_AXI_HP2_RREADY; input S_AXI_HP2_WLAST; input S_AXI_HP2_WRISSUECAP1_EN; input S_AXI_HP2_WVALID; input [1:0]S_AXI_HP2_ARBURST; input [1:0]S_AXI_HP2_ARLOCK; input [2:0]S_AXI_HP2_ARSIZE; input [1:0]S_AXI_HP2_AWBURST; input [1:0]S_AXI_HP2_AWLOCK; input [2:0]S_AXI_HP2_AWSIZE; input [2:0]S_AXI_HP2_ARPROT; input [2:0]S_AXI_HP2_AWPROT; input [31:0]S_AXI_HP2_ARADDR; input [31:0]S_AXI_HP2_AWADDR; input [3:0]S_AXI_HP2_ARCACHE; input [3:0]S_AXI_HP2_ARLEN; input [3:0]S_AXI_HP2_ARQOS; input [3:0]S_AXI_HP2_AWCACHE; input [3:0]S_AXI_HP2_AWLEN; input [3:0]S_AXI_HP2_AWQOS; input [5:0]S_AXI_HP2_ARID; input [5:0]S_AXI_HP2_AWID; input [5:0]S_AXI_HP2_WID; input [63:0]S_AXI_HP2_WDATA; input [7:0]S_AXI_HP2_WSTRB; output S_AXI_HP3_ARESETN; output S_AXI_HP3_ARREADY; output S_AXI_HP3_AWREADY; output S_AXI_HP3_BVALID; output S_AXI_HP3_RLAST; output S_AXI_HP3_RVALID; output S_AXI_HP3_WREADY; output [1:0]S_AXI_HP3_BRESP; output [1:0]S_AXI_HP3_RRESP; output [5:0]S_AXI_HP3_BID; output [5:0]S_AXI_HP3_RID; output [63:0]S_AXI_HP3_RDATA; output [7:0]S_AXI_HP3_RCOUNT; output [7:0]S_AXI_HP3_WCOUNT; output [2:0]S_AXI_HP3_RACOUNT; output [5:0]S_AXI_HP3_WACOUNT; input S_AXI_HP3_ACLK; input S_AXI_HP3_ARVALID; input S_AXI_HP3_AWVALID; input S_AXI_HP3_BREADY; input S_AXI_HP3_RDISSUECAP1_EN; input S_AXI_HP3_RREADY; input S_AXI_HP3_WLAST; input S_AXI_HP3_WRISSUECAP1_EN; input S_AXI_HP3_WVALID; input [1:0]S_AXI_HP3_ARBURST; input [1:0]S_AXI_HP3_ARLOCK; input [2:0]S_AXI_HP3_ARSIZE; input [1:0]S_AXI_HP3_AWBURST; input [1:0]S_AXI_HP3_AWLOCK; input [2:0]S_AXI_HP3_AWSIZE; input [2:0]S_AXI_HP3_ARPROT; input [2:0]S_AXI_HP3_AWPROT; input [31:0]S_AXI_HP3_ARADDR; input [31:0]S_AXI_HP3_AWADDR; input [3:0]S_AXI_HP3_ARCACHE; input [3:0]S_AXI_HP3_ARLEN; input [3:0]S_AXI_HP3_ARQOS; input [3:0]S_AXI_HP3_AWCACHE; input [3:0]S_AXI_HP3_AWLEN; input [3:0]S_AXI_HP3_AWQOS; input [5:0]S_AXI_HP3_ARID; input [5:0]S_AXI_HP3_AWID; input [5:0]S_AXI_HP3_WID; input [63:0]S_AXI_HP3_WDATA; input [7:0]S_AXI_HP3_WSTRB; output IRQ_P2F_DMAC_ABORT; output IRQ_P2F_DMAC0; output IRQ_P2F_DMAC1; output IRQ_P2F_DMAC2; output IRQ_P2F_DMAC3; output IRQ_P2F_DMAC4; output IRQ_P2F_DMAC5; output IRQ_P2F_DMAC6; output IRQ_P2F_DMAC7; output IRQ_P2F_SMC; output IRQ_P2F_QSPI; output IRQ_P2F_CTI; output IRQ_P2F_GPIO; output IRQ_P2F_USB0; output IRQ_P2F_ENET0; output IRQ_P2F_ENET_WAKE0; output IRQ_P2F_SDIO0; output IRQ_P2F_I2C0; output IRQ_P2F_SPI0; output IRQ_P2F_UART0; output IRQ_P2F_CAN0; output IRQ_P2F_USB1; output IRQ_P2F_ENET1; output IRQ_P2F_ENET_WAKE1; output IRQ_P2F_SDIO1; output IRQ_P2F_I2C1; output IRQ_P2F_SPI1; output IRQ_P2F_UART1; output IRQ_P2F_CAN1; input [0:0]IRQ_F2P; input Core0_nFIQ; input Core0_nIRQ; input Core1_nFIQ; input Core1_nIRQ; output [1:0]DMA0_DATYPE; output DMA0_DAVALID; output DMA0_DRREADY; output DMA0_RSTN; output [1:0]DMA1_DATYPE; output DMA1_DAVALID; output DMA1_DRREADY; output DMA1_RSTN; output [1:0]DMA2_DATYPE; output DMA2_DAVALID; output DMA2_DRREADY; output DMA2_RSTN; output [1:0]DMA3_DATYPE; output DMA3_DAVALID; output DMA3_DRREADY; output DMA3_RSTN; input DMA0_ACLK; input DMA0_DAREADY; input DMA0_DRLAST; input DMA0_DRVALID; input DMA1_ACLK; input DMA1_DAREADY; input DMA1_DRLAST; input DMA1_DRVALID; input DMA2_ACLK; input DMA2_DAREADY; input DMA2_DRLAST; input DMA2_DRVALID; input DMA3_ACLK; input DMA3_DAREADY; input DMA3_DRLAST; input DMA3_DRVALID; input [1:0]DMA0_DRTYPE; input [1:0]DMA1_DRTYPE; input [1:0]DMA2_DRTYPE; input [1:0]DMA3_DRTYPE; output FCLK_CLK3; output FCLK_CLK2; output FCLK_CLK1; output FCLK_CLK0; input FCLK_CLKTRIG3_N; input FCLK_CLKTRIG2_N; input FCLK_CLKTRIG1_N; input FCLK_CLKTRIG0_N; output FCLK_RESET3_N; output FCLK_RESET2_N; output FCLK_RESET1_N; output FCLK_RESET0_N; input [31:0]FTMD_TRACEIN_DATA; input FTMD_TRACEIN_VALID; input FTMD_TRACEIN_CLK; input [3:0]FTMD_TRACEIN_ATID; input FTMT_F2P_TRIG_0; output FTMT_F2P_TRIGACK_0; input FTMT_F2P_TRIG_1; output FTMT_F2P_TRIGACK_1; input FTMT_F2P_TRIG_2; output FTMT_F2P_TRIGACK_2; input FTMT_F2P_TRIG_3; output FTMT_F2P_TRIGACK_3; input [31:0]FTMT_F2P_DEBUG; input FTMT_P2F_TRIGACK_0; output FTMT_P2F_TRIG_0; input FTMT_P2F_TRIGACK_1; output FTMT_P2F_TRIG_1; input FTMT_P2F_TRIGACK_2; output FTMT_P2F_TRIG_2; input FTMT_P2F_TRIGACK_3; output FTMT_P2F_TRIG_3; output [31:0]FTMT_P2F_DEBUG; input FPGA_IDLE_N; output EVENT_EVENTO; output [1:0]EVENT_STANDBYWFE; output [1:0]EVENT_STANDBYWFI; input EVENT_EVENTI; input [3:0]DDR_ARB; inout [53:0]MIO; inout DDR_CAS_n; inout DDR_CKE; inout DDR_Clk_n; inout DDR_Clk; inout DDR_CS_n; inout DDR_DRSTB; inout DDR_ODT; inout DDR_RAS_n; inout DDR_WEB; inout [2:0]DDR_BankAddr; inout [14:0]DDR_Addr; inout DDR_VRN; inout DDR_VRP; inout [3:0]DDR_DM; inout [31:0]DDR_DQ; inout [3:0]DDR_DQS_n; inout [3:0]DDR_DQS; inout PS_SRSTB; inout PS_CLK; inout PS_PORB; wire \<const0> ; wire CAN0_PHY_RX; wire CAN0_PHY_TX; wire CAN1_PHY_RX; wire CAN1_PHY_TX; wire Core0_nFIQ; wire Core0_nIRQ; wire Core1_nFIQ; wire Core1_nIRQ; wire [3:0]DDR_ARB; wire [14:0]DDR_Addr; wire [2:0]DDR_BankAddr; wire DDR_CAS_n; wire DDR_CKE; wire DDR_CS_n; wire DDR_Clk; wire DDR_Clk_n; wire [3:0]DDR_DM; wire [31:0]DDR_DQ; wire [3:0]DDR_DQS; wire [3:0]DDR_DQS_n; wire DDR_DRSTB; wire DDR_ODT; wire DDR_RAS_n; wire DDR_VRN; wire DDR_VRP; wire DDR_WEB; wire DMA0_ACLK; wire DMA0_DAREADY; wire [1:0]DMA0_DATYPE; wire DMA0_DAVALID; wire DMA0_DRLAST; wire DMA0_DRREADY; wire [1:0]DMA0_DRTYPE; wire DMA0_DRVALID; wire DMA0_RSTN; wire DMA1_ACLK; wire DMA1_DAREADY; wire [1:0]DMA1_DATYPE; wire DMA1_DAVALID; wire DMA1_DRLAST; wire DMA1_DRREADY; wire [1:0]DMA1_DRTYPE; wire DMA1_DRVALID; wire DMA1_RSTN; wire DMA2_ACLK; wire DMA2_DAREADY; wire [1:0]DMA2_DATYPE; wire DMA2_DAVALID; wire DMA2_DRLAST; wire DMA2_DRREADY; wire [1:0]DMA2_DRTYPE; wire DMA2_DRVALID; wire DMA2_RSTN; wire DMA3_ACLK; wire DMA3_DAREADY; wire [1:0]DMA3_DATYPE; wire DMA3_DAVALID; wire DMA3_DRLAST; wire DMA3_DRREADY; wire [1:0]DMA3_DRTYPE; wire DMA3_DRVALID; wire DMA3_RSTN; wire ENET0_EXT_INTIN; wire ENET0_GMII_RX_CLK; wire ENET0_GMII_TX_CLK; wire ENET0_MDIO_I; wire ENET0_MDIO_MDC; wire ENET0_MDIO_O; wire ENET0_MDIO_T; wire ENET0_MDIO_T_n; wire ENET0_PTP_DELAY_REQ_RX; wire ENET0_PTP_DELAY_REQ_TX; wire ENET0_PTP_PDELAY_REQ_RX; wire ENET0_PTP_PDELAY_REQ_TX; wire ENET0_PTP_PDELAY_RESP_RX; wire ENET0_PTP_PDELAY_RESP_TX; wire ENET0_PTP_SYNC_FRAME_RX; wire ENET0_PTP_SYNC_FRAME_TX; wire ENET0_SOF_RX; wire ENET0_SOF_TX; wire ENET1_EXT_INTIN; wire ENET1_GMII_RX_CLK; wire ENET1_GMII_TX_CLK; wire ENET1_MDIO_I; wire ENET1_MDIO_MDC; wire ENET1_MDIO_O; wire ENET1_MDIO_T; wire ENET1_MDIO_T_n; wire ENET1_PTP_DELAY_REQ_RX; wire ENET1_PTP_DELAY_REQ_TX; wire ENET1_PTP_PDELAY_REQ_RX; wire ENET1_PTP_PDELAY_REQ_TX; wire ENET1_PTP_PDELAY_RESP_RX; wire ENET1_PTP_PDELAY_RESP_TX; wire ENET1_PTP_SYNC_FRAME_RX; wire ENET1_PTP_SYNC_FRAME_TX; wire ENET1_SOF_RX; wire ENET1_SOF_TX; wire EVENT_EVENTI; wire EVENT_EVENTO; wire [1:0]EVENT_STANDBYWFE; wire [1:0]EVENT_STANDBYWFI; wire FCLK_CLK0; wire FCLK_CLK1; wire FCLK_CLK2; wire FCLK_CLK3; wire [0:0]FCLK_CLK_unbuffered; wire FCLK_RESET0_N; wire FCLK_RESET1_N; wire FCLK_RESET2_N; wire FCLK_RESET3_N; wire FPGA_IDLE_N; wire FTMD_TRACEIN_CLK; wire [31:0]FTMT_F2P_DEBUG; wire FTMT_F2P_TRIGACK_0; wire FTMT_F2P_TRIGACK_1; wire FTMT_F2P_TRIGACK_2; wire FTMT_F2P_TRIGACK_3; wire FTMT_F2P_TRIG_0; wire FTMT_F2P_TRIG_1; wire FTMT_F2P_TRIG_2; wire FTMT_F2P_TRIG_3; wire [31:0]FTMT_P2F_DEBUG; wire FTMT_P2F_TRIGACK_0; wire FTMT_P2F_TRIGACK_1; wire FTMT_P2F_TRIGACK_2; wire FTMT_P2F_TRIGACK_3; wire FTMT_P2F_TRIG_0; wire FTMT_P2F_TRIG_1; wire FTMT_P2F_TRIG_2; wire FTMT_P2F_TRIG_3; wire [63:0]GPIO_I; wire [63:0]GPIO_O; wire [63:0]GPIO_T; wire I2C0_SCL_I; wire I2C0_SCL_O; wire I2C0_SCL_T; wire I2C0_SCL_T_n; wire I2C0_SDA_I; wire I2C0_SDA_O; wire I2C0_SDA_T; wire I2C0_SDA_T_n; wire I2C1_SCL_I; wire I2C1_SCL_O; wire I2C1_SCL_T; wire I2C1_SCL_T_n; wire I2C1_SDA_I; wire I2C1_SDA_O; wire I2C1_SDA_T; wire I2C1_SDA_T_n; wire [0:0]IRQ_F2P; wire IRQ_P2F_CAN0; wire IRQ_P2F_CAN1; wire IRQ_P2F_CTI; wire IRQ_P2F_DMAC0; wire IRQ_P2F_DMAC1; wire IRQ_P2F_DMAC2; wire IRQ_P2F_DMAC3; wire IRQ_P2F_DMAC4; wire IRQ_P2F_DMAC5; wire IRQ_P2F_DMAC6; wire IRQ_P2F_DMAC7; wire IRQ_P2F_DMAC_ABORT; wire IRQ_P2F_ENET0; wire IRQ_P2F_ENET1; wire IRQ_P2F_ENET_WAKE0; wire IRQ_P2F_ENET_WAKE1; wire IRQ_P2F_GPIO; wire IRQ_P2F_I2C0; wire IRQ_P2F_I2C1; wire IRQ_P2F_QSPI; wire IRQ_P2F_SDIO0; wire IRQ_P2F_SDIO1; wire IRQ_P2F_SMC; wire IRQ_P2F_SPI0; wire IRQ_P2F_SPI1; wire IRQ_P2F_UART0; wire IRQ_P2F_UART1; wire IRQ_P2F_USB0; wire IRQ_P2F_USB1; wire [53:0]MIO; wire M_AXI_GP0_ACLK; wire [31:0]M_AXI_GP0_ARADDR; wire [1:0]M_AXI_GP0_ARBURST; wire [3:0]M_AXI_GP0_ARCACHE; wire M_AXI_GP0_ARESETN; wire [11:0]M_AXI_GP0_ARID; wire [3:0]M_AXI_GP0_ARLEN; wire [1:0]M_AXI_GP0_ARLOCK; wire [2:0]M_AXI_GP0_ARPROT; wire [3:0]M_AXI_GP0_ARQOS; wire M_AXI_GP0_ARREADY; wire [1:0]\^M_AXI_GP0_ARSIZE ; wire M_AXI_GP0_ARVALID; wire [31:0]M_AXI_GP0_AWADDR; wire [1:0]M_AXI_GP0_AWBURST; wire [3:0]M_AXI_GP0_AWCACHE; wire [11:0]M_AXI_GP0_AWID; wire [3:0]M_AXI_GP0_AWLEN; wire [1:0]M_AXI_GP0_AWLOCK; wire [2:0]M_AXI_GP0_AWPROT; wire [3:0]M_AXI_GP0_AWQOS; wire M_AXI_GP0_AWREADY; wire [1:0]\^M_AXI_GP0_AWSIZE ; wire M_AXI_GP0_AWVALID; wire [11:0]M_AXI_GP0_BID; wire M_AXI_GP0_BREADY; wire [1:0]M_AXI_GP0_BRESP; wire M_AXI_GP0_BVALID; wire [31:0]M_AXI_GP0_RDATA; wire [11:0]M_AXI_GP0_RID; wire M_AXI_GP0_RLAST; wire M_AXI_GP0_RREADY; wire [1:0]M_AXI_GP0_RRESP; wire M_AXI_GP0_RVALID; wire [31:0]M_AXI_GP0_WDATA; wire [11:0]M_AXI_GP0_WID; wire M_AXI_GP0_WLAST; wire M_AXI_GP0_WREADY; wire [3:0]M_AXI_GP0_WSTRB; wire M_AXI_GP0_WVALID; wire M_AXI_GP1_ACLK; wire [31:0]M_AXI_GP1_ARADDR; wire [1:0]M_AXI_GP1_ARBURST; wire [3:0]M_AXI_GP1_ARCACHE; wire M_AXI_GP1_ARESETN; wire [11:0]M_AXI_GP1_ARID; wire [3:0]M_AXI_GP1_ARLEN; wire [1:0]M_AXI_GP1_ARLOCK; wire [2:0]M_AXI_GP1_ARPROT; wire [3:0]M_AXI_GP1_ARQOS; wire M_AXI_GP1_ARREADY; wire [1:0]\^M_AXI_GP1_ARSIZE ; wire M_AXI_GP1_ARVALID; wire [31:0]M_AXI_GP1_AWADDR; wire [1:0]M_AXI_GP1_AWBURST; wire [3:0]M_AXI_GP1_AWCACHE; wire [11:0]M_AXI_GP1_AWID; wire [3:0]M_AXI_GP1_AWLEN; wire [1:0]M_AXI_GP1_AWLOCK; wire [2:0]M_AXI_GP1_AWPROT; wire [3:0]M_AXI_GP1_AWQOS; wire M_AXI_GP1_AWREADY; wire [1:0]\^M_AXI_GP1_AWSIZE ; wire M_AXI_GP1_AWVALID; wire [11:0]M_AXI_GP1_BID; wire M_AXI_GP1_BREADY; wire [1:0]M_AXI_GP1_BRESP; wire M_AXI_GP1_BVALID; wire [31:0]M_AXI_GP1_RDATA; wire [11:0]M_AXI_GP1_RID; wire M_AXI_GP1_RLAST; wire M_AXI_GP1_RREADY; wire [1:0]M_AXI_GP1_RRESP; wire M_AXI_GP1_RVALID; wire [31:0]M_AXI_GP1_WDATA; wire [11:0]M_AXI_GP1_WID; wire M_AXI_GP1_WLAST; wire M_AXI_GP1_WREADY; wire [3:0]M_AXI_GP1_WSTRB; wire M_AXI_GP1_WVALID; wire PJTAG_TCK; wire PJTAG_TDI; wire PJTAG_TMS; wire PS_CLK; wire PS_PORB; wire PS_SRSTB; wire SDIO0_BUSPOW; wire [2:0]SDIO0_BUSVOLT; wire SDIO0_CDN; wire SDIO0_CLK; wire SDIO0_CLK_FB; wire SDIO0_CMD_I; wire SDIO0_CMD_O; wire SDIO0_CMD_T; wire SDIO0_CMD_T_n; wire [3:0]SDIO0_DATA_I; wire [3:0]SDIO0_DATA_O; wire [3:0]SDIO0_DATA_T; wire [3:0]SDIO0_DATA_T_n; wire SDIO0_LED; wire SDIO0_WP; wire SDIO1_BUSPOW; wire [2:0]SDIO1_BUSVOLT; wire SDIO1_CDN; wire SDIO1_CLK; wire SDIO1_CLK_FB; wire SDIO1_CMD_I; wire SDIO1_CMD_O; wire SDIO1_CMD_T; wire SDIO1_CMD_T_n; wire [3:0]SDIO1_DATA_I; wire [3:0]SDIO1_DATA_O; wire [3:0]SDIO1_DATA_T; wire [3:0]SDIO1_DATA_T_n; wire SDIO1_LED; wire SDIO1_WP; wire SPI0_MISO_I; wire SPI0_MISO_O; wire SPI0_MISO_T; wire SPI0_MISO_T_n; wire SPI0_MOSI_I; wire SPI0_MOSI_O; wire SPI0_MOSI_T; wire SPI0_MOSI_T_n; wire SPI0_SCLK_I; wire SPI0_SCLK_O; wire SPI0_SCLK_T; wire SPI0_SCLK_T_n; wire SPI0_SS1_O; wire SPI0_SS2_O; wire SPI0_SS_I; wire SPI0_SS_O; wire SPI0_SS_T; wire SPI0_SS_T_n; wire SPI1_MISO_I; wire SPI1_MISO_O; wire SPI1_MISO_T; wire SPI1_MISO_T_n; wire SPI1_MOSI_I; wire SPI1_MOSI_O; wire SPI1_MOSI_T; wire SPI1_MOSI_T_n; wire SPI1_SCLK_I; wire SPI1_SCLK_O; wire SPI1_SCLK_T; wire SPI1_SCLK_T_n; wire SPI1_SS1_O; wire SPI1_SS2_O; wire SPI1_SS_I; wire SPI1_SS_O; wire SPI1_SS_T; wire SPI1_SS_T_n; wire SRAM_INTIN; wire S_AXI_ACP_ACLK; wire [31:0]S_AXI_ACP_ARADDR; wire [1:0]S_AXI_ACP_ARBURST; wire [3:0]S_AXI_ACP_ARCACHE; wire S_AXI_ACP_ARESETN; wire [2:0]S_AXI_ACP_ARID; wire [3:0]S_AXI_ACP_ARLEN; wire [1:0]S_AXI_ACP_ARLOCK; wire [2:0]S_AXI_ACP_ARPROT; wire [3:0]S_AXI_ACP_ARQOS; wire S_AXI_ACP_ARREADY; wire [2:0]S_AXI_ACP_ARSIZE; wire [4:0]S_AXI_ACP_ARUSER; wire S_AXI_ACP_ARVALID; wire [31:0]S_AXI_ACP_AWADDR; wire [1:0]S_AXI_ACP_AWBURST; wire [3:0]S_AXI_ACP_AWCACHE; wire [2:0]S_AXI_ACP_AWID; wire [3:0]S_AXI_ACP_AWLEN; wire [1:0]S_AXI_ACP_AWLOCK; wire [2:0]S_AXI_ACP_AWPROT; wire [3:0]S_AXI_ACP_AWQOS; wire S_AXI_ACP_AWREADY; wire [2:0]S_AXI_ACP_AWSIZE; wire [4:0]S_AXI_ACP_AWUSER; wire S_AXI_ACP_AWVALID; wire [2:0]S_AXI_ACP_BID; wire S_AXI_ACP_BREADY; wire [1:0]S_AXI_ACP_BRESP; wire S_AXI_ACP_BVALID; wire [63:0]S_AXI_ACP_RDATA; wire [2:0]S_AXI_ACP_RID; wire S_AXI_ACP_RLAST; wire S_AXI_ACP_RREADY; wire [1:0]S_AXI_ACP_RRESP; wire S_AXI_ACP_RVALID; wire [63:0]S_AXI_ACP_WDATA; wire [2:0]S_AXI_ACP_WID; wire S_AXI_ACP_WLAST; wire S_AXI_ACP_WREADY; wire [7:0]S_AXI_ACP_WSTRB; wire S_AXI_ACP_WVALID; wire S_AXI_GP0_ACLK; wire [31:0]S_AXI_GP0_ARADDR; wire [1:0]S_AXI_GP0_ARBURST; wire [3:0]S_AXI_GP0_ARCACHE; wire S_AXI_GP0_ARESETN; wire [5:0]S_AXI_GP0_ARID; wire [3:0]S_AXI_GP0_ARLEN; wire [1:0]S_AXI_GP0_ARLOCK; wire [2:0]S_AXI_GP0_ARPROT; wire [3:0]S_AXI_GP0_ARQOS; wire S_AXI_GP0_ARREADY; wire [2:0]S_AXI_GP0_ARSIZE; wire S_AXI_GP0_ARVALID; wire [31:0]S_AXI_GP0_AWADDR; wire [1:0]S_AXI_GP0_AWBURST; wire [3:0]S_AXI_GP0_AWCACHE; wire [5:0]S_AXI_GP0_AWID; wire [3:0]S_AXI_GP0_AWLEN; wire [1:0]S_AXI_GP0_AWLOCK; wire [2:0]S_AXI_GP0_AWPROT; wire [3:0]S_AXI_GP0_AWQOS; wire S_AXI_GP0_AWREADY; wire [2:0]S_AXI_GP0_AWSIZE; wire S_AXI_GP0_AWVALID; wire [5:0]S_AXI_GP0_BID; wire S_AXI_GP0_BREADY; wire [1:0]S_AXI_GP0_BRESP; wire S_AXI_GP0_BVALID; wire [31:0]S_AXI_GP0_RDATA; wire [5:0]S_AXI_GP0_RID; wire S_AXI_GP0_RLAST; wire S_AXI_GP0_RREADY; wire [1:0]S_AXI_GP0_RRESP; wire S_AXI_GP0_RVALID; wire [31:0]S_AXI_GP0_WDATA; wire [5:0]S_AXI_GP0_WID; wire S_AXI_GP0_WLAST; wire S_AXI_GP0_WREADY; wire [3:0]S_AXI_GP0_WSTRB; wire S_AXI_GP0_WVALID; wire S_AXI_GP1_ACLK; wire [31:0]S_AXI_GP1_ARADDR; wire [1:0]S_AXI_GP1_ARBURST; wire [3:0]S_AXI_GP1_ARCACHE; wire S_AXI_GP1_ARESETN; wire [5:0]S_AXI_GP1_ARID; wire [3:0]S_AXI_GP1_ARLEN; wire [1:0]S_AXI_GP1_ARLOCK; wire [2:0]S_AXI_GP1_ARPROT; wire [3:0]S_AXI_GP1_ARQOS; wire S_AXI_GP1_ARREADY; wire [2:0]S_AXI_GP1_ARSIZE; wire S_AXI_GP1_ARVALID; wire [31:0]S_AXI_GP1_AWADDR; wire [1:0]S_AXI_GP1_AWBURST; wire [3:0]S_AXI_GP1_AWCACHE; wire [5:0]S_AXI_GP1_AWID; wire [3:0]S_AXI_GP1_AWLEN; wire [1:0]S_AXI_GP1_AWLOCK; wire [2:0]S_AXI_GP1_AWPROT; wire [3:0]S_AXI_GP1_AWQOS; wire S_AXI_GP1_AWREADY; wire [2:0]S_AXI_GP1_AWSIZE; wire S_AXI_GP1_AWVALID; wire [5:0]S_AXI_GP1_BID; wire S_AXI_GP1_BREADY; wire [1:0]S_AXI_GP1_BRESP; wire S_AXI_GP1_BVALID; wire [31:0]S_AXI_GP1_RDATA; wire [5:0]S_AXI_GP1_RID; wire S_AXI_GP1_RLAST; wire S_AXI_GP1_RREADY; wire [1:0]S_AXI_GP1_RRESP; wire S_AXI_GP1_RVALID; wire [31:0]S_AXI_GP1_WDATA; wire [5:0]S_AXI_GP1_WID; wire S_AXI_GP1_WLAST; wire S_AXI_GP1_WREADY; wire [3:0]S_AXI_GP1_WSTRB; wire S_AXI_GP1_WVALID; wire S_AXI_HP0_ACLK; wire [31:0]S_AXI_HP0_ARADDR; wire [1:0]S_AXI_HP0_ARBURST; wire [3:0]S_AXI_HP0_ARCACHE; wire S_AXI_HP0_ARESETN; wire [5:0]S_AXI_HP0_ARID; wire [3:0]S_AXI_HP0_ARLEN; wire [1:0]S_AXI_HP0_ARLOCK; wire [2:0]S_AXI_HP0_ARPROT; wire [3:0]S_AXI_HP0_ARQOS; wire S_AXI_HP0_ARREADY; wire [2:0]S_AXI_HP0_ARSIZE; wire S_AXI_HP0_ARVALID; wire [31:0]S_AXI_HP0_AWADDR; wire [1:0]S_AXI_HP0_AWBURST; wire [3:0]S_AXI_HP0_AWCACHE; wire [5:0]S_AXI_HP0_AWID; wire [3:0]S_AXI_HP0_AWLEN; wire [1:0]S_AXI_HP0_AWLOCK; wire [2:0]S_AXI_HP0_AWPROT; wire [3:0]S_AXI_HP0_AWQOS; wire S_AXI_HP0_AWREADY; wire [2:0]S_AXI_HP0_AWSIZE; wire S_AXI_HP0_AWVALID; wire [5:0]S_AXI_HP0_BID; wire S_AXI_HP0_BREADY; wire [1:0]S_AXI_HP0_BRESP; wire S_AXI_HP0_BVALID; wire [2:0]S_AXI_HP0_RACOUNT; wire [7:0]S_AXI_HP0_RCOUNT; wire [63:0]S_AXI_HP0_RDATA; wire S_AXI_HP0_RDISSUECAP1_EN; wire [5:0]S_AXI_HP0_RID; wire S_AXI_HP0_RLAST; wire S_AXI_HP0_RREADY; wire [1:0]S_AXI_HP0_RRESP; wire S_AXI_HP0_RVALID; wire [5:0]S_AXI_HP0_WACOUNT; wire [7:0]S_AXI_HP0_WCOUNT; wire [63:0]S_AXI_HP0_WDATA; wire [5:0]S_AXI_HP0_WID; wire S_AXI_HP0_WLAST; wire S_AXI_HP0_WREADY; wire S_AXI_HP0_WRISSUECAP1_EN; wire [7:0]S_AXI_HP0_WSTRB; wire S_AXI_HP0_WVALID; wire S_AXI_HP1_ACLK; wire [31:0]S_AXI_HP1_ARADDR; wire [1:0]S_AXI_HP1_ARBURST; wire [3:0]S_AXI_HP1_ARCACHE; wire S_AXI_HP1_ARESETN; wire [5:0]S_AXI_HP1_ARID; wire [3:0]S_AXI_HP1_ARLEN; wire [1:0]S_AXI_HP1_ARLOCK; wire [2:0]S_AXI_HP1_ARPROT; wire [3:0]S_AXI_HP1_ARQOS; wire S_AXI_HP1_ARREADY; wire [2:0]S_AXI_HP1_ARSIZE; wire S_AXI_HP1_ARVALID; wire [31:0]S_AXI_HP1_AWADDR; wire [1:0]S_AXI_HP1_AWBURST; wire [3:0]S_AXI_HP1_AWCACHE; wire [5:0]S_AXI_HP1_AWID; wire [3:0]S_AXI_HP1_AWLEN; wire [1:0]S_AXI_HP1_AWLOCK; wire [2:0]S_AXI_HP1_AWPROT; wire [3:0]S_AXI_HP1_AWQOS; wire S_AXI_HP1_AWREADY; wire [2:0]S_AXI_HP1_AWSIZE; wire S_AXI_HP1_AWVALID; wire [5:0]S_AXI_HP1_BID; wire S_AXI_HP1_BREADY; wire [1:0]S_AXI_HP1_BRESP; wire S_AXI_HP1_BVALID; wire [2:0]S_AXI_HP1_RACOUNT; wire [7:0]S_AXI_HP1_RCOUNT; wire [63:0]S_AXI_HP1_RDATA; wire S_AXI_HP1_RDISSUECAP1_EN; wire [5:0]S_AXI_HP1_RID; wire S_AXI_HP1_RLAST; wire S_AXI_HP1_RREADY; wire [1:0]S_AXI_HP1_RRESP; wire S_AXI_HP1_RVALID; wire [5:0]S_AXI_HP1_WACOUNT; wire [7:0]S_AXI_HP1_WCOUNT; wire [63:0]S_AXI_HP1_WDATA; wire [5:0]S_AXI_HP1_WID; wire S_AXI_HP1_WLAST; wire S_AXI_HP1_WREADY; wire S_AXI_HP1_WRISSUECAP1_EN; wire [7:0]S_AXI_HP1_WSTRB; wire S_AXI_HP1_WVALID; wire S_AXI_HP2_ACLK; wire [31:0]S_AXI_HP2_ARADDR; wire [1:0]S_AXI_HP2_ARBURST; wire [3:0]S_AXI_HP2_ARCACHE; wire S_AXI_HP2_ARESETN; wire [5:0]S_AXI_HP2_ARID; wire [3:0]S_AXI_HP2_ARLEN; wire [1:0]S_AXI_HP2_ARLOCK; wire [2:0]S_AXI_HP2_ARPROT; wire [3:0]S_AXI_HP2_ARQOS; wire S_AXI_HP2_ARREADY; wire [2:0]S_AXI_HP2_ARSIZE; wire S_AXI_HP2_ARVALID; wire [31:0]S_AXI_HP2_AWADDR; wire [1:0]S_AXI_HP2_AWBURST; wire [3:0]S_AXI_HP2_AWCACHE; wire [5:0]S_AXI_HP2_AWID; wire [3:0]S_AXI_HP2_AWLEN; wire [1:0]S_AXI_HP2_AWLOCK; wire [2:0]S_AXI_HP2_AWPROT; wire [3:0]S_AXI_HP2_AWQOS; wire S_AXI_HP2_AWREADY; wire [2:0]S_AXI_HP2_AWSIZE; wire S_AXI_HP2_AWVALID; wire [5:0]S_AXI_HP2_BID; wire S_AXI_HP2_BREADY; wire [1:0]S_AXI_HP2_BRESP; wire S_AXI_HP2_BVALID; wire [2:0]S_AXI_HP2_RACOUNT; wire [7:0]S_AXI_HP2_RCOUNT; wire [63:0]S_AXI_HP2_RDATA; wire S_AXI_HP2_RDISSUECAP1_EN; wire [5:0]S_AXI_HP2_RID; wire S_AXI_HP2_RLAST; wire S_AXI_HP2_RREADY; wire [1:0]S_AXI_HP2_RRESP; wire S_AXI_HP2_RVALID; wire [5:0]S_AXI_HP2_WACOUNT; wire [7:0]S_AXI_HP2_WCOUNT; wire [63:0]S_AXI_HP2_WDATA; wire [5:0]S_AXI_HP2_WID; wire S_AXI_HP2_WLAST; wire S_AXI_HP2_WREADY; wire S_AXI_HP2_WRISSUECAP1_EN; wire [7:0]S_AXI_HP2_WSTRB; wire S_AXI_HP2_WVALID; wire S_AXI_HP3_ACLK; wire [31:0]S_AXI_HP3_ARADDR; wire [1:0]S_AXI_HP3_ARBURST; wire [3:0]S_AXI_HP3_ARCACHE; wire S_AXI_HP3_ARESETN; wire [5:0]S_AXI_HP3_ARID; wire [3:0]S_AXI_HP3_ARLEN; wire [1:0]S_AXI_HP3_ARLOCK; wire [2:0]S_AXI_HP3_ARPROT; wire [3:0]S_AXI_HP3_ARQOS; wire S_AXI_HP3_ARREADY; wire [2:0]S_AXI_HP3_ARSIZE; wire S_AXI_HP3_ARVALID; wire [31:0]S_AXI_HP3_AWADDR; wire [1:0]S_AXI_HP3_AWBURST; wire [3:0]S_AXI_HP3_AWCACHE; wire [5:0]S_AXI_HP3_AWID; wire [3:0]S_AXI_HP3_AWLEN; wire [1:0]S_AXI_HP3_AWLOCK; wire [2:0]S_AXI_HP3_AWPROT; wire [3:0]S_AXI_HP3_AWQOS; wire S_AXI_HP3_AWREADY; wire [2:0]S_AXI_HP3_AWSIZE; wire S_AXI_HP3_AWVALID; wire [5:0]S_AXI_HP3_BID; wire S_AXI_HP3_BREADY; wire [1:0]S_AXI_HP3_BRESP; wire S_AXI_HP3_BVALID; wire [2:0]S_AXI_HP3_RACOUNT; wire [7:0]S_AXI_HP3_RCOUNT; wire [63:0]S_AXI_HP3_RDATA; wire S_AXI_HP3_RDISSUECAP1_EN; wire [5:0]S_AXI_HP3_RID; wire S_AXI_HP3_RLAST; wire S_AXI_HP3_RREADY; wire [1:0]S_AXI_HP3_RRESP; wire S_AXI_HP3_RVALID; wire [5:0]S_AXI_HP3_WACOUNT; wire [7:0]S_AXI_HP3_WCOUNT; wire [63:0]S_AXI_HP3_WDATA; wire [5:0]S_AXI_HP3_WID; wire S_AXI_HP3_WLAST; wire S_AXI_HP3_WREADY; wire S_AXI_HP3_WRISSUECAP1_EN; wire [7:0]S_AXI_HP3_WSTRB; wire S_AXI_HP3_WVALID; wire TRACE_CLK; (* RTL_KEEP = "true" *) wire \TRACE_CTL_PIPE[0] ; (* RTL_KEEP = "true" *) wire \TRACE_CTL_PIPE[1] ; (* RTL_KEEP = "true" *) wire \TRACE_CTL_PIPE[2] ; (* RTL_KEEP = "true" *) wire \TRACE_CTL_PIPE[3] ; (* RTL_KEEP = "true" *) wire \TRACE_CTL_PIPE[4] ; (* RTL_KEEP = "true" *) wire \TRACE_CTL_PIPE[5] ; (* RTL_KEEP = "true" *) wire \TRACE_CTL_PIPE[6] ; (* RTL_KEEP = "true" *) wire \TRACE_CTL_PIPE[7] ; (* RTL_KEEP = "true" *) wire [1:0]\TRACE_DATA_PIPE[0] ; (* RTL_KEEP = "true" *) wire [1:0]\TRACE_DATA_PIPE[1] ; (* RTL_KEEP = "true" *) wire [1:0]\TRACE_DATA_PIPE[2] ; (* RTL_KEEP = "true" *) wire [1:0]\TRACE_DATA_PIPE[3] ; (* RTL_KEEP = "true" *) wire [1:0]\TRACE_DATA_PIPE[4] ; (* RTL_KEEP = "true" *) wire [1:0]\TRACE_DATA_PIPE[5] ; (* RTL_KEEP = "true" *) wire [1:0]\TRACE_DATA_PIPE[6] ; (* RTL_KEEP = "true" *) wire [1:0]\TRACE_DATA_PIPE[7] ; wire TTC0_CLK0_IN; wire TTC0_CLK1_IN; wire TTC0_CLK2_IN; wire TTC0_WAVE0_OUT; wire TTC0_WAVE1_OUT; wire TTC0_WAVE2_OUT; wire TTC1_CLK0_IN; wire TTC1_CLK1_IN; wire TTC1_CLK2_IN; wire TTC1_WAVE0_OUT; wire TTC1_WAVE1_OUT; wire TTC1_WAVE2_OUT; wire UART0_CTSN; wire UART0_DCDN; wire UART0_DSRN; wire UART0_DTRN; wire UART0_RIN; wire UART0_RTSN; wire UART0_RX; wire UART0_TX; wire UART1_CTSN; wire UART1_DCDN; wire UART1_DSRN; wire UART1_DTRN; wire UART1_RIN; wire UART1_RTSN; wire UART1_RX; wire UART1_TX; wire [1:0]USB0_PORT_INDCTL; wire USB0_VBUS_PWRFAULT; wire USB0_VBUS_PWRSELECT; wire [1:0]USB1_PORT_INDCTL; wire USB1_VBUS_PWRFAULT; wire USB1_VBUS_PWRSELECT; wire WDT_CLK_IN; wire WDT_RST_OUT; wire [14:0]buffered_DDR_Addr; wire [2:0]buffered_DDR_BankAddr; wire buffered_DDR_CAS_n; wire buffered_DDR_CKE; wire buffered_DDR_CS_n; wire buffered_DDR_Clk; wire buffered_DDR_Clk_n; wire [3:0]buffered_DDR_DM; wire [31:0]buffered_DDR_DQ; wire [3:0]buffered_DDR_DQS; wire [3:0]buffered_DDR_DQS_n; wire buffered_DDR_DRSTB; wire buffered_DDR_ODT; wire buffered_DDR_RAS_n; wire buffered_DDR_VRN; wire buffered_DDR_VRP; wire buffered_DDR_WEB; wire [53:0]buffered_MIO; wire buffered_PS_CLK; wire buffered_PS_PORB; wire buffered_PS_SRSTB; wire [63:0]gpio_out_t_n; wire NLW_PS7_i_EMIOENET0GMIITXEN_UNCONNECTED; wire NLW_PS7_i_EMIOENET0GMIITXER_UNCONNECTED; wire NLW_PS7_i_EMIOENET1GMIITXEN_UNCONNECTED; wire NLW_PS7_i_EMIOENET1GMIITXER_UNCONNECTED; wire NLW_PS7_i_EMIOPJTAGTDO_UNCONNECTED; wire NLW_PS7_i_EMIOPJTAGTDTN_UNCONNECTED; wire NLW_PS7_i_EMIOTRACECTL_UNCONNECTED; wire [7:0]NLW_PS7_i_EMIOENET0GMIITXD_UNCONNECTED; wire [7:0]NLW_PS7_i_EMIOENET1GMIITXD_UNCONNECTED; wire [31:0]NLW_PS7_i_EMIOTRACEDATA_UNCONNECTED; assign ENET0_GMII_TXD[7] = \<const0> ; assign ENET0_GMII_TXD[6] = \<const0> ; assign ENET0_GMII_TXD[5] = \<const0> ; assign ENET0_GMII_TXD[4] = \<const0> ; assign ENET0_GMII_TXD[3] = \<const0> ; assign ENET0_GMII_TXD[2] = \<const0> ; assign ENET0_GMII_TXD[1] = \<const0> ; assign ENET0_GMII_TXD[0] = \<const0> ; assign ENET0_GMII_TX_EN = \<const0> ; assign ENET0_GMII_TX_ER = \<const0> ; assign ENET1_GMII_TXD[7] = \<const0> ; assign ENET1_GMII_TXD[6] = \<const0> ; assign ENET1_GMII_TXD[5] = \<const0> ; assign ENET1_GMII_TXD[4] = \<const0> ; assign ENET1_GMII_TXD[3] = \<const0> ; assign ENET1_GMII_TXD[2] = \<const0> ; assign ENET1_GMII_TXD[1] = \<const0> ; assign ENET1_GMII_TXD[0] = \<const0> ; assign ENET1_GMII_TX_EN = \<const0> ; assign ENET1_GMII_TX_ER = \<const0> ; assign M_AXI_GP0_ARSIZE[2] = \<const0> ; assign M_AXI_GP0_ARSIZE[1:0] = \^M_AXI_GP0_ARSIZE [1:0]; assign M_AXI_GP0_AWSIZE[2] = \<const0> ; assign M_AXI_GP0_AWSIZE[1:0] = \^M_AXI_GP0_AWSIZE [1:0]; assign M_AXI_GP1_ARSIZE[2] = \<const0> ; assign M_AXI_GP1_ARSIZE[1:0] = \^M_AXI_GP1_ARSIZE [1:0]; assign M_AXI_GP1_AWSIZE[2] = \<const0> ; assign M_AXI_GP1_AWSIZE[1:0] = \^M_AXI_GP1_AWSIZE [1:0]; assign PJTAG_TDO = \<const0> ; assign TRACE_CLK_OUT = \<const0> ; assign TRACE_CTL = \TRACE_CTL_PIPE[0] ; assign TRACE_DATA[1:0] = \TRACE_DATA_PIPE[0] ; (* BOX_TYPE = "PRIMITIVE" *) BIBUF DDR_CAS_n_BIBUF (.IO(buffered_DDR_CAS_n), .PAD(DDR_CAS_n)); (* BOX_TYPE = "PRIMITIVE" *) BIBUF DDR_CKE_BIBUF (.IO(buffered_DDR_CKE), .PAD(DDR_CKE)); (* BOX_TYPE = "PRIMITIVE" *) BIBUF DDR_CS_n_BIBUF (.IO(buffered_DDR_CS_n), .PAD(DDR_CS_n)); (* BOX_TYPE = "PRIMITIVE" *) BIBUF DDR_Clk_BIBUF (.IO(buffered_DDR_Clk), .PAD(DDR_Clk)); (* BOX_TYPE = "PRIMITIVE" *) BIBUF DDR_Clk_n_BIBUF (.IO(buffered_DDR_Clk_n), .PAD(DDR_Clk_n)); (* BOX_TYPE = "PRIMITIVE" *) BIBUF DDR_DRSTB_BIBUF (.IO(buffered_DDR_DRSTB), .PAD(DDR_DRSTB)); (* BOX_TYPE = "PRIMITIVE" *) BIBUF DDR_ODT_BIBUF (.IO(buffered_DDR_ODT), .PAD(DDR_ODT)); (* BOX_TYPE = "PRIMITIVE" *) BIBUF DDR_RAS_n_BIBUF (.IO(buffered_DDR_RAS_n), .PAD(DDR_RAS_n)); (* BOX_TYPE = "PRIMITIVE" *) BIBUF DDR_VRN_BIBUF (.IO(buffered_DDR_VRN), .PAD(DDR_VRN)); (* BOX_TYPE = "PRIMITIVE" *) BIBUF DDR_VRP_BIBUF (.IO(buffered_DDR_VRP), .PAD(DDR_VRP)); (* BOX_TYPE = "PRIMITIVE" *) BIBUF DDR_WEB_BIBUF (.IO(buffered_DDR_WEB), .PAD(DDR_WEB)); LUT1 #( .INIT(2'h1)) ENET0_MDIO_T_INST_0 (.I0(ENET0_MDIO_T_n), .O(ENET0_MDIO_T)); LUT1 #( .INIT(2'h1)) ENET1_MDIO_T_INST_0 (.I0(ENET1_MDIO_T_n), .O(ENET1_MDIO_T)); GND GND (.G(\<const0> )); LUT1 #( .INIT(2'h1)) \GPIO_T[0]_INST_0 (.I0(gpio_out_t_n[0]), .O(GPIO_T[0])); LUT1 #( .INIT(2'h1)) \GPIO_T[10]_INST_0 (.I0(gpio_out_t_n[10]), .O(GPIO_T[10])); LUT1 #( .INIT(2'h1)) \GPIO_T[11]_INST_0 (.I0(gpio_out_t_n[11]), .O(GPIO_T[11])); LUT1 #( .INIT(2'h1)) \GPIO_T[12]_INST_0 (.I0(gpio_out_t_n[12]), .O(GPIO_T[12])); LUT1 #( .INIT(2'h1)) \GPIO_T[13]_INST_0 (.I0(gpio_out_t_n[13]), .O(GPIO_T[13])); LUT1 #( .INIT(2'h1)) \GPIO_T[14]_INST_0 (.I0(gpio_out_t_n[14]), .O(GPIO_T[14])); LUT1 #( .INIT(2'h1)) \GPIO_T[15]_INST_0 (.I0(gpio_out_t_n[15]), .O(GPIO_T[15])); LUT1 #( .INIT(2'h1)) \GPIO_T[16]_INST_0 (.I0(gpio_out_t_n[16]), .O(GPIO_T[16])); LUT1 #( .INIT(2'h1)) \GPIO_T[17]_INST_0 (.I0(gpio_out_t_n[17]), .O(GPIO_T[17])); LUT1 #( .INIT(2'h1)) \GPIO_T[18]_INST_0 (.I0(gpio_out_t_n[18]), .O(GPIO_T[18])); LUT1 #( .INIT(2'h1)) \GPIO_T[19]_INST_0 (.I0(gpio_out_t_n[19]), .O(GPIO_T[19])); LUT1 #( .INIT(2'h1)) \GPIO_T[1]_INST_0 (.I0(gpio_out_t_n[1]), .O(GPIO_T[1])); LUT1 #( .INIT(2'h1)) \GPIO_T[20]_INST_0 (.I0(gpio_out_t_n[20]), .O(GPIO_T[20])); LUT1 #( .INIT(2'h1)) \GPIO_T[21]_INST_0 (.I0(gpio_out_t_n[21]), .O(GPIO_T[21])); LUT1 #( .INIT(2'h1)) \GPIO_T[22]_INST_0 (.I0(gpio_out_t_n[22]), .O(GPIO_T[22])); LUT1 #( .INIT(2'h1)) \GPIO_T[23]_INST_0 (.I0(gpio_out_t_n[23]), .O(GPIO_T[23])); LUT1 #( .INIT(2'h1)) \GPIO_T[24]_INST_0 (.I0(gpio_out_t_n[24]), .O(GPIO_T[24])); LUT1 #( .INIT(2'h1)) \GPIO_T[25]_INST_0 (.I0(gpio_out_t_n[25]), .O(GPIO_T[25])); LUT1 #( .INIT(2'h1)) \GPIO_T[26]_INST_0 (.I0(gpio_out_t_n[26]), .O(GPIO_T[26])); LUT1 #( .INIT(2'h1)) \GPIO_T[27]_INST_0 (.I0(gpio_out_t_n[27]), .O(GPIO_T[27])); LUT1 #( .INIT(2'h1)) \GPIO_T[28]_INST_0 (.I0(gpio_out_t_n[28]), .O(GPIO_T[28])); LUT1 #( .INIT(2'h1)) \GPIO_T[29]_INST_0 (.I0(gpio_out_t_n[29]), .O(GPIO_T[29])); LUT1 #( .INIT(2'h1)) \GPIO_T[2]_INST_0 (.I0(gpio_out_t_n[2]), .O(GPIO_T[2])); LUT1 #( .INIT(2'h1)) \GPIO_T[30]_INST_0 (.I0(gpio_out_t_n[30]), .O(GPIO_T[30])); LUT1 #( .INIT(2'h1)) \GPIO_T[31]_INST_0 (.I0(gpio_out_t_n[31]), .O(GPIO_T[31])); LUT1 #( .INIT(2'h1)) \GPIO_T[32]_INST_0 (.I0(gpio_out_t_n[32]), .O(GPIO_T[32])); LUT1 #( .INIT(2'h1)) \GPIO_T[33]_INST_0 (.I0(gpio_out_t_n[33]), .O(GPIO_T[33])); LUT1 #( .INIT(2'h1)) \GPIO_T[34]_INST_0 (.I0(gpio_out_t_n[34]), .O(GPIO_T[34])); LUT1 #( .INIT(2'h1)) \GPIO_T[35]_INST_0 (.I0(gpio_out_t_n[35]), .O(GPIO_T[35])); LUT1 #( .INIT(2'h1)) \GPIO_T[36]_INST_0 (.I0(gpio_out_t_n[36]), .O(GPIO_T[36])); LUT1 #( .INIT(2'h1)) \GPIO_T[37]_INST_0 (.I0(gpio_out_t_n[37]), .O(GPIO_T[37])); LUT1 #( .INIT(2'h1)) \GPIO_T[38]_INST_0 (.I0(gpio_out_t_n[38]), .O(GPIO_T[38])); LUT1 #( .INIT(2'h1)) \GPIO_T[39]_INST_0 (.I0(gpio_out_t_n[39]), .O(GPIO_T[39])); LUT1 #( .INIT(2'h1)) \GPIO_T[3]_INST_0 (.I0(gpio_out_t_n[3]), .O(GPIO_T[3])); LUT1 #( .INIT(2'h1)) \GPIO_T[40]_INST_0 (.I0(gpio_out_t_n[40]), .O(GPIO_T[40])); LUT1 #( .INIT(2'h1)) \GPIO_T[41]_INST_0 (.I0(gpio_out_t_n[41]), .O(GPIO_T[41])); LUT1 #( .INIT(2'h1)) \GPIO_T[42]_INST_0 (.I0(gpio_out_t_n[42]), .O(GPIO_T[42])); LUT1 #( .INIT(2'h1)) \GPIO_T[43]_INST_0 (.I0(gpio_out_t_n[43]), .O(GPIO_T[43])); LUT1 #( .INIT(2'h1)) \GPIO_T[44]_INST_0 (.I0(gpio_out_t_n[44]), .O(GPIO_T[44])); LUT1 #( .INIT(2'h1)) \GPIO_T[45]_INST_0 (.I0(gpio_out_t_n[45]), .O(GPIO_T[45])); LUT1 #( .INIT(2'h1)) \GPIO_T[46]_INST_0 (.I0(gpio_out_t_n[46]), .O(GPIO_T[46])); LUT1 #( .INIT(2'h1)) \GPIO_T[47]_INST_0 (.I0(gpio_out_t_n[47]), .O(GPIO_T[47])); LUT1 #( .INIT(2'h1)) \GPIO_T[48]_INST_0 (.I0(gpio_out_t_n[48]), .O(GPIO_T[48])); LUT1 #( .INIT(2'h1)) \GPIO_T[49]_INST_0 (.I0(gpio_out_t_n[49]), .O(GPIO_T[49])); LUT1 #( .INIT(2'h1)) \GPIO_T[4]_INST_0 (.I0(gpio_out_t_n[4]), .O(GPIO_T[4])); LUT1 #( .INIT(2'h1)) \GPIO_T[50]_INST_0 (.I0(gpio_out_t_n[50]), .O(GPIO_T[50])); LUT1 #( .INIT(2'h1)) \GPIO_T[51]_INST_0 (.I0(gpio_out_t_n[51]), .O(GPIO_T[51])); LUT1 #( .INIT(2'h1)) \GPIO_T[52]_INST_0 (.I0(gpio_out_t_n[52]), .O(GPIO_T[52])); LUT1 #( .INIT(2'h1)) \GPIO_T[53]_INST_0 (.I0(gpio_out_t_n[53]), .O(GPIO_T[53])); LUT1 #( .INIT(2'h1)) \GPIO_T[54]_INST_0 (.I0(gpio_out_t_n[54]), .O(GPIO_T[54])); LUT1 #( .INIT(2'h1)) \GPIO_T[55]_INST_0 (.I0(gpio_out_t_n[55]), .O(GPIO_T[55])); LUT1 #( .INIT(2'h1)) \GPIO_T[56]_INST_0 (.I0(gpio_out_t_n[56]), .O(GPIO_T[56])); LUT1 #( .INIT(2'h1)) \GPIO_T[57]_INST_0 (.I0(gpio_out_t_n[57]), .O(GPIO_T[57])); LUT1 #( .INIT(2'h1)) \GPIO_T[58]_INST_0 (.I0(gpio_out_t_n[58]), .O(GPIO_T[58])); LUT1 #( .INIT(2'h1)) \GPIO_T[59]_INST_0 (.I0(gpio_out_t_n[59]), .O(GPIO_T[59])); LUT1 #( .INIT(2'h1)) \GPIO_T[5]_INST_0 (.I0(gpio_out_t_n[5]), .O(GPIO_T[5])); LUT1 #( .INIT(2'h1)) \GPIO_T[60]_INST_0 (.I0(gpio_out_t_n[60]), .O(GPIO_T[60])); LUT1 #( .INIT(2'h1)) \GPIO_T[61]_INST_0 (.I0(gpio_out_t_n[61]), .O(GPIO_T[61])); LUT1 #( .INIT(2'h1)) \GPIO_T[62]_INST_0 (.I0(gpio_out_t_n[62]), .O(GPIO_T[62])); LUT1 #( .INIT(2'h1)) \GPIO_T[63]_INST_0 (.I0(gpio_out_t_n[63]), .O(GPIO_T[63])); LUT1 #( .INIT(2'h1)) \GPIO_T[6]_INST_0 (.I0(gpio_out_t_n[6]), .O(GPIO_T[6])); LUT1 #( .INIT(2'h1)) \GPIO_T[7]_INST_0 (.I0(gpio_out_t_n[7]), .O(GPIO_T[7])); LUT1 #( .INIT(2'h1)) \GPIO_T[8]_INST_0 (.I0(gpio_out_t_n[8]), .O(GPIO_T[8])); LUT1 #( .INIT(2'h1)) \GPIO_T[9]_INST_0 (.I0(gpio_out_t_n[9]), .O(GPIO_T[9])); LUT1 #( .INIT(2'h1)) I2C0_SCL_T_INST_0 (.I0(I2C0_SCL_T_n), .O(I2C0_SCL_T)); LUT1 #( .INIT(2'h1)) I2C0_SDA_T_INST_0 (.I0(I2C0_SDA_T_n), .O(I2C0_SDA_T)); LUT1 #( .INIT(2'h1)) I2C1_SCL_T_INST_0 (.I0(I2C1_SCL_T_n), .O(I2C1_SCL_T)); LUT1 #( .INIT(2'h1)) I2C1_SDA_T_INST_0 (.I0(I2C1_SDA_T_n), .O(I2C1_SDA_T)); (* BOX_TYPE = "PRIMITIVE" *) PS7 PS7_i (.DDRA(buffered_DDR_Addr), .DDRARB(DDR_ARB), .DDRBA(buffered_DDR_BankAddr), .DDRCASB(buffered_DDR_CAS_n), .DDRCKE(buffered_DDR_CKE), .DDRCKN(buffered_DDR_Clk_n), .DDRCKP(buffered_DDR_Clk), .DDRCSB(buffered_DDR_CS_n), .DDRDM(buffered_DDR_DM), .DDRDQ(buffered_DDR_DQ), .DDRDQSN(buffered_DDR_DQS_n), .DDRDQSP(buffered_DDR_DQS), .DDRDRSTB(buffered_DDR_DRSTB), .DDRODT(buffered_DDR_ODT), .DDRRASB(buffered_DDR_RAS_n), .DDRVRN(buffered_DDR_VRN), .DDRVRP(buffered_DDR_VRP), .DDRWEB(buffered_DDR_WEB), .DMA0ACLK(DMA0_ACLK), .DMA0DAREADY(DMA0_DAREADY), .DMA0DATYPE(DMA0_DATYPE), .DMA0DAVALID(DMA0_DAVALID), .DMA0DRLAST(DMA0_DRLAST), .DMA0DRREADY(DMA0_DRREADY), .DMA0DRTYPE(DMA0_DRTYPE), .DMA0DRVALID(DMA0_DRVALID), .DMA0RSTN(DMA0_RSTN), .DMA1ACLK(DMA1_ACLK), .DMA1DAREADY(DMA1_DAREADY), .DMA1DATYPE(DMA1_DATYPE), .DMA1DAVALID(DMA1_DAVALID), .DMA1DRLAST(DMA1_DRLAST), .DMA1DRREADY(DMA1_DRREADY), .DMA1DRTYPE(DMA1_DRTYPE), .DMA1DRVALID(DMA1_DRVALID), .DMA1RSTN(DMA1_RSTN), .DMA2ACLK(DMA2_ACLK), .DMA2DAREADY(DMA2_DAREADY), .DMA2DATYPE(DMA2_DATYPE), .DMA2DAVALID(DMA2_DAVALID), .DMA2DRLAST(DMA2_DRLAST), .DMA2DRREADY(DMA2_DRREADY), .DMA2DRTYPE(DMA2_DRTYPE), .DMA2DRVALID(DMA2_DRVALID), .DMA2RSTN(DMA2_RSTN), .DMA3ACLK(DMA3_ACLK), .DMA3DAREADY(DMA3_DAREADY), .DMA3DATYPE(DMA3_DATYPE), .DMA3DAVALID(DMA3_DAVALID), .DMA3DRLAST(DMA3_DRLAST), .DMA3DRREADY(DMA3_DRREADY), .DMA3DRTYPE(DMA3_DRTYPE), .DMA3DRVALID(DMA3_DRVALID), .DMA3RSTN(DMA3_RSTN), .EMIOCAN0PHYRX(CAN0_PHY_RX), .EMIOCAN0PHYTX(CAN0_PHY_TX), .EMIOCAN1PHYRX(CAN1_PHY_RX), .EMIOCAN1PHYTX(CAN1_PHY_TX), .EMIOENET0EXTINTIN(ENET0_EXT_INTIN), .EMIOENET0GMIICOL(1'b0), .EMIOENET0GMIICRS(1'b0), .EMIOENET0GMIIRXCLK(ENET0_GMII_RX_CLK), .EMIOENET0GMIIRXD({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .EMIOENET0GMIIRXDV(1'b0), .EMIOENET0GMIIRXER(1'b0), .EMIOENET0GMIITXCLK(ENET0_GMII_TX_CLK), .EMIOENET0GMIITXD(NLW_PS7_i_EMIOENET0GMIITXD_UNCONNECTED[7:0]), .EMIOENET0GMIITXEN(NLW_PS7_i_EMIOENET0GMIITXEN_UNCONNECTED), .EMIOENET0GMIITXER(NLW_PS7_i_EMIOENET0GMIITXER_UNCONNECTED), .EMIOENET0MDIOI(ENET0_MDIO_I), .EMIOENET0MDIOMDC(ENET0_MDIO_MDC), .EMIOENET0MDIOO(ENET0_MDIO_O), .EMIOENET0MDIOTN(ENET0_MDIO_T_n), .EMIOENET0PTPDELAYREQRX(ENET0_PTP_DELAY_REQ_RX), .EMIOENET0PTPDELAYREQTX(ENET0_PTP_DELAY_REQ_TX), .EMIOENET0PTPPDELAYREQRX(ENET0_PTP_PDELAY_REQ_RX), .EMIOENET0PTPPDELAYREQTX(ENET0_PTP_PDELAY_REQ_TX), .EMIOENET0PTPPDELAYRESPRX(ENET0_PTP_PDELAY_RESP_RX), .EMIOENET0PTPPDELAYRESPTX(ENET0_PTP_PDELAY_RESP_TX), .EMIOENET0PTPSYNCFRAMERX(ENET0_PTP_SYNC_FRAME_RX), .EMIOENET0PTPSYNCFRAMETX(ENET0_PTP_SYNC_FRAME_TX), .EMIOENET0SOFRX(ENET0_SOF_RX), .EMIOENET0SOFTX(ENET0_SOF_TX), .EMIOENET1EXTINTIN(ENET1_EXT_INTIN), .EMIOENET1GMIICOL(1'b0), .EMIOENET1GMIICRS(1'b0), .EMIOENET1GMIIRXCLK(ENET1_GMII_RX_CLK), .EMIOENET1GMIIRXD({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .EMIOENET1GMIIRXDV(1'b0), .EMIOENET1GMIIRXER(1'b0), .EMIOENET1GMIITXCLK(ENET1_GMII_TX_CLK), .EMIOENET1GMIITXD(NLW_PS7_i_EMIOENET1GMIITXD_UNCONNECTED[7:0]), .EMIOENET1GMIITXEN(NLW_PS7_i_EMIOENET1GMIITXEN_UNCONNECTED), .EMIOENET1GMIITXER(NLW_PS7_i_EMIOENET1GMIITXER_UNCONNECTED), .EMIOENET1MDIOI(ENET1_MDIO_I), .EMIOENET1MDIOMDC(ENET1_MDIO_MDC), .EMIOENET1MDIOO(ENET1_MDIO_O), .EMIOENET1MDIOTN(ENET1_MDIO_T_n), .EMIOENET1PTPDELAYREQRX(ENET1_PTP_DELAY_REQ_RX), .EMIOENET1PTPDELAYREQTX(ENET1_PTP_DELAY_REQ_TX), .EMIOENET1PTPPDELAYREQRX(ENET1_PTP_PDELAY_REQ_RX), .EMIOENET1PTPPDELAYREQTX(ENET1_PTP_PDELAY_REQ_TX), .EMIOENET1PTPPDELAYRESPRX(ENET1_PTP_PDELAY_RESP_RX), .EMIOENET1PTPPDELAYRESPTX(ENET1_PTP_PDELAY_RESP_TX), .EMIOENET1PTPSYNCFRAMERX(ENET1_PTP_SYNC_FRAME_RX), .EMIOENET1PTPSYNCFRAMETX(ENET1_PTP_SYNC_FRAME_TX), .EMIOENET1SOFRX(ENET1_SOF_RX), .EMIOENET1SOFTX(ENET1_SOF_TX), .EMIOGPIOI(GPIO_I), .EMIOGPIOO(GPIO_O), .EMIOGPIOTN(gpio_out_t_n), .EMIOI2C0SCLI(I2C0_SCL_I), .EMIOI2C0SCLO(I2C0_SCL_O), .EMIOI2C0SCLTN(I2C0_SCL_T_n), .EMIOI2C0SDAI(I2C0_SDA_I), .EMIOI2C0SDAO(I2C0_SDA_O), .EMIOI2C0SDATN(I2C0_SDA_T_n), .EMIOI2C1SCLI(I2C1_SCL_I), .EMIOI2C1SCLO(I2C1_SCL_O), .EMIOI2C1SCLTN(I2C1_SCL_T_n), .EMIOI2C1SDAI(I2C1_SDA_I), .EMIOI2C1SDAO(I2C1_SDA_O), .EMIOI2C1SDATN(I2C1_SDA_T_n), .EMIOPJTAGTCK(PJTAG_TCK), .EMIOPJTAGTDI(PJTAG_TDI), .EMIOPJTAGTDO(NLW_PS7_i_EMIOPJTAGTDO_UNCONNECTED), .EMIOPJTAGTDTN(NLW_PS7_i_EMIOPJTAGTDTN_UNCONNECTED), .EMIOPJTAGTMS(PJTAG_TMS), .EMIOSDIO0BUSPOW(SDIO0_BUSPOW), .EMIOSDIO0BUSVOLT(SDIO0_BUSVOLT), .EMIOSDIO0CDN(SDIO0_CDN), .EMIOSDIO0CLK(SDIO0_CLK), .EMIOSDIO0CLKFB(SDIO0_CLK_FB), .EMIOSDIO0CMDI(SDIO0_CMD_I), .EMIOSDIO0CMDO(SDIO0_CMD_O), .EMIOSDIO0CMDTN(SDIO0_CMD_T_n), .EMIOSDIO0DATAI(SDIO0_DATA_I), .EMIOSDIO0DATAO(SDIO0_DATA_O), .EMIOSDIO0DATATN(SDIO0_DATA_T_n), .EMIOSDIO0LED(SDIO0_LED), .EMIOSDIO0WP(SDIO0_WP), .EMIOSDIO1BUSPOW(SDIO1_BUSPOW), .EMIOSDIO1BUSVOLT(SDIO1_BUSVOLT), .EMIOSDIO1CDN(SDIO1_CDN), .EMIOSDIO1CLK(SDIO1_CLK), .EMIOSDIO1CLKFB(SDIO1_CLK_FB), .EMIOSDIO1CMDI(SDIO1_CMD_I), .EMIOSDIO1CMDO(SDIO1_CMD_O), .EMIOSDIO1CMDTN(SDIO1_CMD_T_n), .EMIOSDIO1DATAI(SDIO1_DATA_I), .EMIOSDIO1DATAO(SDIO1_DATA_O), .EMIOSDIO1DATATN(SDIO1_DATA_T_n), .EMIOSDIO1LED(SDIO1_LED), .EMIOSDIO1WP(SDIO1_WP), .EMIOSPI0MI(SPI0_MISO_I), .EMIOSPI0MO(SPI0_MOSI_O), .EMIOSPI0MOTN(SPI0_MOSI_T_n), .EMIOSPI0SCLKI(SPI0_SCLK_I), .EMIOSPI0SCLKO(SPI0_SCLK_O), .EMIOSPI0SCLKTN(SPI0_SCLK_T_n), .EMIOSPI0SI(SPI0_MOSI_I), .EMIOSPI0SO(SPI0_MISO_O), .EMIOSPI0SSIN(SPI0_SS_I), .EMIOSPI0SSNTN(SPI0_SS_T_n), .EMIOSPI0SSON({SPI0_SS2_O,SPI0_SS1_O,SPI0_SS_O}), .EMIOSPI0STN(SPI0_MISO_T_n), .EMIOSPI1MI(SPI1_MISO_I), .EMIOSPI1MO(SPI1_MOSI_O), .EMIOSPI1MOTN(SPI1_MOSI_T_n), .EMIOSPI1SCLKI(SPI1_SCLK_I), .EMIOSPI1SCLKO(SPI1_SCLK_O), .EMIOSPI1SCLKTN(SPI1_SCLK_T_n), .EMIOSPI1SI(SPI1_MOSI_I), .EMIOSPI1SO(SPI1_MISO_O), .EMIOSPI1SSIN(SPI1_SS_I), .EMIOSPI1SSNTN(SPI1_SS_T_n), .EMIOSPI1SSON({SPI1_SS2_O,SPI1_SS1_O,SPI1_SS_O}), .EMIOSPI1STN(SPI1_MISO_T_n), .EMIOSRAMINTIN(SRAM_INTIN), .EMIOTRACECLK(TRACE_CLK), .EMIOTRACECTL(NLW_PS7_i_EMIOTRACECTL_UNCONNECTED), .EMIOTRACEDATA(NLW_PS7_i_EMIOTRACEDATA_UNCONNECTED[31:0]), .EMIOTTC0CLKI({TTC0_CLK2_IN,TTC0_CLK1_IN,TTC0_CLK0_IN}), .EMIOTTC0WAVEO({TTC0_WAVE2_OUT,TTC0_WAVE1_OUT,TTC0_WAVE0_OUT}), .EMIOTTC1CLKI({TTC1_CLK2_IN,TTC1_CLK1_IN,TTC1_CLK0_IN}), .EMIOTTC1WAVEO({TTC1_WAVE2_OUT,TTC1_WAVE1_OUT,TTC1_WAVE0_OUT}), .EMIOUART0CTSN(UART0_CTSN), .EMIOUART0DCDN(UART0_DCDN), .EMIOUART0DSRN(UART0_DSRN), .EMIOUART0DTRN(UART0_DTRN), .EMIOUART0RIN(UART0_RIN), .EMIOUART0RTSN(UART0_RTSN), .EMIOUART0RX(UART0_RX), .EMIOUART0TX(UART0_TX), .EMIOUART1CTSN(UART1_CTSN), .EMIOUART1DCDN(UART1_DCDN), .EMIOUART1DSRN(UART1_DSRN), .EMIOUART1DTRN(UART1_DTRN), .EMIOUART1RIN(UART1_RIN), .EMIOUART1RTSN(UART1_RTSN), .EMIOUART1RX(UART1_RX), .EMIOUART1TX(UART1_TX), .EMIOUSB0PORTINDCTL(USB0_PORT_INDCTL), .EMIOUSB0VBUSPWRFAULT(USB0_VBUS_PWRFAULT), .EMIOUSB0VBUSPWRSELECT(USB0_VBUS_PWRSELECT), .EMIOUSB1PORTINDCTL(USB1_PORT_INDCTL), .EMIOUSB1VBUSPWRFAULT(USB1_VBUS_PWRFAULT), .EMIOUSB1VBUSPWRSELECT(USB1_VBUS_PWRSELECT), .EMIOWDTCLKI(WDT_CLK_IN), .EMIOWDTRSTO(WDT_RST_OUT), .EVENTEVENTI(EVENT_EVENTI), .EVENTEVENTO(EVENT_EVENTO), .EVENTSTANDBYWFE(EVENT_STANDBYWFE), .EVENTSTANDBYWFI(EVENT_STANDBYWFI), .FCLKCLK({FCLK_CLK3,FCLK_CLK2,FCLK_CLK1,FCLK_CLK_unbuffered}), .FCLKCLKTRIGN({1'b0,1'b0,1'b0,1'b0}), .FCLKRESETN({FCLK_RESET3_N,FCLK_RESET2_N,FCLK_RESET1_N,FCLK_RESET0_N}), .FPGAIDLEN(FPGA_IDLE_N), .FTMDTRACEINATID({1'b0,1'b0,1'b0,1'b0}), .FTMDTRACEINCLOCK(FTMD_TRACEIN_CLK), .FTMDTRACEINDATA({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0}), .FTMDTRACEINVALID(1'b0), .FTMTF2PDEBUG(FTMT_F2P_DEBUG), .FTMTF2PTRIG({FTMT_F2P_TRIG_3,FTMT_F2P_TRIG_2,FTMT_F2P_TRIG_1,FTMT_F2P_TRIG_0}), .FTMTF2PTRIGACK({FTMT_F2P_TRIGACK_3,FTMT_F2P_TRIGACK_2,FTMT_F2P_TRIGACK_1,FTMT_F2P_TRIGACK_0}), .FTMTP2FDEBUG(FTMT_P2F_DEBUG), .FTMTP2FTRIG({FTMT_P2F_TRIG_3,FTMT_P2F_TRIG_2,FTMT_P2F_TRIG_1,FTMT_P2F_TRIG_0}), .FTMTP2FTRIGACK({FTMT_P2F_TRIGACK_3,FTMT_P2F_TRIGACK_2,FTMT_P2F_TRIGACK_1,FTMT_P2F_TRIGACK_0}), .IRQF2P({Core1_nFIQ,Core0_nFIQ,Core1_nIRQ,Core0_nIRQ,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,IRQ_F2P}), .IRQP2F({IRQ_P2F_DMAC_ABORT,IRQ_P2F_DMAC7,IRQ_P2F_DMAC6,IRQ_P2F_DMAC5,IRQ_P2F_DMAC4,IRQ_P2F_DMAC3,IRQ_P2F_DMAC2,IRQ_P2F_DMAC1,IRQ_P2F_DMAC0,IRQ_P2F_SMC,IRQ_P2F_QSPI,IRQ_P2F_CTI,IRQ_P2F_GPIO,IRQ_P2F_USB0,IRQ_P2F_ENET0,IRQ_P2F_ENET_WAKE0,IRQ_P2F_SDIO0,IRQ_P2F_I2C0,IRQ_P2F_SPI0,IRQ_P2F_UART0,IRQ_P2F_CAN0,IRQ_P2F_USB1,IRQ_P2F_ENET1,IRQ_P2F_ENET_WAKE1,IRQ_P2F_SDIO1,IRQ_P2F_I2C1,IRQ_P2F_SPI1,IRQ_P2F_UART1,IRQ_P2F_CAN1}), .MAXIGP0ACLK(M_AXI_GP0_ACLK), .MAXIGP0ARADDR(M_AXI_GP0_ARADDR), .MAXIGP0ARBURST(M_AXI_GP0_ARBURST), .MAXIGP0ARCACHE(M_AXI_GP0_ARCACHE), .MAXIGP0ARESETN(M_AXI_GP0_ARESETN), .MAXIGP0ARID(M_AXI_GP0_ARID), .MAXIGP0ARLEN(M_AXI_GP0_ARLEN), .MAXIGP0ARLOCK(M_AXI_GP0_ARLOCK), .MAXIGP0ARPROT(M_AXI_GP0_ARPROT), .MAXIGP0ARQOS(M_AXI_GP0_ARQOS), .MAXIGP0ARREADY(M_AXI_GP0_ARREADY), .MAXIGP0ARSIZE(\^M_AXI_GP0_ARSIZE ), .MAXIGP0ARVALID(M_AXI_GP0_ARVALID), .MAXIGP0AWADDR(M_AXI_GP0_AWADDR), .MAXIGP0AWBURST(M_AXI_GP0_AWBURST), .MAXIGP0AWCACHE(M_AXI_GP0_AWCACHE), .MAXIGP0AWID(M_AXI_GP0_AWID), .MAXIGP0AWLEN(M_AXI_GP0_AWLEN), .MAXIGP0AWLOCK(M_AXI_GP0_AWLOCK), .MAXIGP0AWPROT(M_AXI_GP0_AWPROT), .MAXIGP0AWQOS(M_AXI_GP0_AWQOS), .MAXIGP0AWREADY(M_AXI_GP0_AWREADY), .MAXIGP0AWSIZE(\^M_AXI_GP0_AWSIZE ), .MAXIGP0AWVALID(M_AXI_GP0_AWVALID), .MAXIGP0BID(M_AXI_GP0_BID), .MAXIGP0BREADY(M_AXI_GP0_BREADY), .MAXIGP0BRESP(M_AXI_GP0_BRESP), .MAXIGP0BVALID(M_AXI_GP0_BVALID), .MAXIGP0RDATA(M_AXI_GP0_RDATA), .MAXIGP0RID(M_AXI_GP0_RID), .MAXIGP0RLAST(M_AXI_GP0_RLAST), .MAXIGP0RREADY(M_AXI_GP0_RREADY), .MAXIGP0RRESP(M_AXI_GP0_RRESP), .MAXIGP0RVALID(M_AXI_GP0_RVALID), .MAXIGP0WDATA(M_AXI_GP0_WDATA), .MAXIGP0WID(M_AXI_GP0_WID), .MAXIGP0WLAST(M_AXI_GP0_WLAST), .MAXIGP0WREADY(M_AXI_GP0_WREADY), .MAXIGP0WSTRB(M_AXI_GP0_WSTRB), .MAXIGP0WVALID(M_AXI_GP0_WVALID), .MAXIGP1ACLK(M_AXI_GP1_ACLK), .MAXIGP1ARADDR(M_AXI_GP1_ARADDR), .MAXIGP1ARBURST(M_AXI_GP1_ARBURST), .MAXIGP1ARCACHE(M_AXI_GP1_ARCACHE), .MAXIGP1ARESETN(M_AXI_GP1_ARESETN), .MAXIGP1ARID(M_AXI_GP1_ARID), .MAXIGP1ARLEN(M_AXI_GP1_ARLEN), .MAXIGP1ARLOCK(M_AXI_GP1_ARLOCK), .MAXIGP1ARPROT(M_AXI_GP1_ARPROT), .MAXIGP1ARQOS(M_AXI_GP1_ARQOS), .MAXIGP1ARREADY(M_AXI_GP1_ARREADY), .MAXIGP1ARSIZE(\^M_AXI_GP1_ARSIZE ), .MAXIGP1ARVALID(M_AXI_GP1_ARVALID), .MAXIGP1AWADDR(M_AXI_GP1_AWADDR), .MAXIGP1AWBURST(M_AXI_GP1_AWBURST), .MAXIGP1AWCACHE(M_AXI_GP1_AWCACHE), .MAXIGP1AWID(M_AXI_GP1_AWID), .MAXIGP1AWLEN(M_AXI_GP1_AWLEN), .MAXIGP1AWLOCK(M_AXI_GP1_AWLOCK), .MAXIGP1AWPROT(M_AXI_GP1_AWPROT), .MAXIGP1AWQOS(M_AXI_GP1_AWQOS), .MAXIGP1AWREADY(M_AXI_GP1_AWREADY), .MAXIGP1AWSIZE(\^M_AXI_GP1_AWSIZE ), .MAXIGP1AWVALID(M_AXI_GP1_AWVALID), .MAXIGP1BID(M_AXI_GP1_BID), .MAXIGP1BREADY(M_AXI_GP1_BREADY), .MAXIGP1BRESP(M_AXI_GP1_BRESP), .MAXIGP1BVALID(M_AXI_GP1_BVALID), .MAXIGP1RDATA(M_AXI_GP1_RDATA), .MAXIGP1RID(M_AXI_GP1_RID), .MAXIGP1RLAST(M_AXI_GP1_RLAST), .MAXIGP1RREADY(M_AXI_GP1_RREADY), .MAXIGP1RRESP(M_AXI_GP1_RRESP), .MAXIGP1RVALID(M_AXI_GP1_RVALID), .MAXIGP1WDATA(M_AXI_GP1_WDATA), .MAXIGP1WID(M_AXI_GP1_WID), .MAXIGP1WLAST(M_AXI_GP1_WLAST), .MAXIGP1WREADY(M_AXI_GP1_WREADY), .MAXIGP1WSTRB(M_AXI_GP1_WSTRB), .MAXIGP1WVALID(M_AXI_GP1_WVALID), .MIO(buffered_MIO), .PSCLK(buffered_PS_CLK), .PSPORB(buffered_PS_PORB), .PSSRSTB(buffered_PS_SRSTB), .SAXIACPACLK(S_AXI_ACP_ACLK), .SAXIACPARADDR(S_AXI_ACP_ARADDR), .SAXIACPARBURST(S_AXI_ACP_ARBURST), .SAXIACPARCACHE(S_AXI_ACP_ARCACHE), .SAXIACPARESETN(S_AXI_ACP_ARESETN), .SAXIACPARID(S_AXI_ACP_ARID), .SAXIACPARLEN(S_AXI_ACP_ARLEN), .SAXIACPARLOCK(S_AXI_ACP_ARLOCK), .SAXIACPARPROT(S_AXI_ACP_ARPROT), .SAXIACPARQOS(S_AXI_ACP_ARQOS), .SAXIACPARREADY(S_AXI_ACP_ARREADY), .SAXIACPARSIZE(S_AXI_ACP_ARSIZE[1:0]), .SAXIACPARUSER(S_AXI_ACP_ARUSER), .SAXIACPARVALID(S_AXI_ACP_ARVALID), .SAXIACPAWADDR(S_AXI_ACP_AWADDR), .SAXIACPAWBURST(S_AXI_ACP_AWBURST), .SAXIACPAWCACHE(S_AXI_ACP_AWCACHE), .SAXIACPAWID(S_AXI_ACP_AWID), .SAXIACPAWLEN(S_AXI_ACP_AWLEN), .SAXIACPAWLOCK(S_AXI_ACP_AWLOCK), .SAXIACPAWPROT(S_AXI_ACP_AWPROT), .SAXIACPAWQOS(S_AXI_ACP_AWQOS), .SAXIACPAWREADY(S_AXI_ACP_AWREADY), .SAXIACPAWSIZE(S_AXI_ACP_AWSIZE[1:0]), .SAXIACPAWUSER(S_AXI_ACP_AWUSER), .SAXIACPAWVALID(S_AXI_ACP_AWVALID), .SAXIACPBID(S_AXI_ACP_BID), .SAXIACPBREADY(S_AXI_ACP_BREADY), .SAXIACPBRESP(S_AXI_ACP_BRESP), .SAXIACPBVALID(S_AXI_ACP_BVALID), .SAXIACPRDATA(S_AXI_ACP_RDATA), .SAXIACPRID(S_AXI_ACP_RID), .SAXIACPRLAST(S_AXI_ACP_RLAST), .SAXIACPRREADY(S_AXI_ACP_RREADY), .SAXIACPRRESP(S_AXI_ACP_RRESP), .SAXIACPRVALID(S_AXI_ACP_RVALID), .SAXIACPWDATA(S_AXI_ACP_WDATA), .SAXIACPWID(S_AXI_ACP_WID), .SAXIACPWLAST(S_AXI_ACP_WLAST), .SAXIACPWREADY(S_AXI_ACP_WREADY), .SAXIACPWSTRB(S_AXI_ACP_WSTRB), .SAXIACPWVALID(S_AXI_ACP_WVALID), .SAXIGP0ACLK(S_AXI_GP0_ACLK), .SAXIGP0ARADDR(S_AXI_GP0_ARADDR), .SAXIGP0ARBURST(S_AXI_GP0_ARBURST), .SAXIGP0ARCACHE(S_AXI_GP0_ARCACHE), .SAXIGP0ARESETN(S_AXI_GP0_ARESETN), .SAXIGP0ARID(S_AXI_GP0_ARID), .SAXIGP0ARLEN(S_AXI_GP0_ARLEN), .SAXIGP0ARLOCK(S_AXI_GP0_ARLOCK), .SAXIGP0ARPROT(S_AXI_GP0_ARPROT), .SAXIGP0ARQOS(S_AXI_GP0_ARQOS), .SAXIGP0ARREADY(S_AXI_GP0_ARREADY), .SAXIGP0ARSIZE(S_AXI_GP0_ARSIZE[1:0]), .SAXIGP0ARVALID(S_AXI_GP0_ARVALID), .SAXIGP0AWADDR(S_AXI_GP0_AWADDR), .SAXIGP0AWBURST(S_AXI_GP0_AWBURST), .SAXIGP0AWCACHE(S_AXI_GP0_AWCACHE), .SAXIGP0AWID(S_AXI_GP0_AWID), .SAXIGP0AWLEN(S_AXI_GP0_AWLEN), .SAXIGP0AWLOCK(S_AXI_GP0_AWLOCK), .SAXIGP0AWPROT(S_AXI_GP0_AWPROT), .SAXIGP0AWQOS(S_AXI_GP0_AWQOS), .SAXIGP0AWREADY(S_AXI_GP0_AWREADY), .SAXIGP0AWSIZE(S_AXI_GP0_AWSIZE[1:0]), .SAXIGP0AWVALID(S_AXI_GP0_AWVALID), .SAXIGP0BID(S_AXI_GP0_BID), .SAXIGP0BREADY(S_AXI_GP0_BREADY), .SAXIGP0BRESP(S_AXI_GP0_BRESP), .SAXIGP0BVALID(S_AXI_GP0_BVALID), .SAXIGP0RDATA(S_AXI_GP0_RDATA), .SAXIGP0RID(S_AXI_GP0_RID), .SAXIGP0RLAST(S_AXI_GP0_RLAST), .SAXIGP0RREADY(S_AXI_GP0_RREADY), .SAXIGP0RRESP(S_AXI_GP0_RRESP), .SAXIGP0RVALID(S_AXI_GP0_RVALID), .SAXIGP0WDATA(S_AXI_GP0_WDATA), .SAXIGP0WID(S_AXI_GP0_WID), .SAXIGP0WLAST(S_AXI_GP0_WLAST), .SAXIGP0WREADY(S_AXI_GP0_WREADY), .SAXIGP0WSTRB(S_AXI_GP0_WSTRB), .SAXIGP0WVALID(S_AXI_GP0_WVALID), .SAXIGP1ACLK(S_AXI_GP1_ACLK), .SAXIGP1ARADDR(S_AXI_GP1_ARADDR), .SAXIGP1ARBURST(S_AXI_GP1_ARBURST), .SAXIGP1ARCACHE(S_AXI_GP1_ARCACHE), .SAXIGP1ARESETN(S_AXI_GP1_ARESETN), .SAXIGP1ARID(S_AXI_GP1_ARID), .SAXIGP1ARLEN(S_AXI_GP1_ARLEN), .SAXIGP1ARLOCK(S_AXI_GP1_ARLOCK), .SAXIGP1ARPROT(S_AXI_GP1_ARPROT), .SAXIGP1ARQOS(S_AXI_GP1_ARQOS), .SAXIGP1ARREADY(S_AXI_GP1_ARREADY), .SAXIGP1ARSIZE(S_AXI_GP1_ARSIZE[1:0]), .SAXIGP1ARVALID(S_AXI_GP1_ARVALID), .SAXIGP1AWADDR(S_AXI_GP1_AWADDR), .SAXIGP1AWBURST(S_AXI_GP1_AWBURST), .SAXIGP1AWCACHE(S_AXI_GP1_AWCACHE), .SAXIGP1AWID(S_AXI_GP1_AWID), .SAXIGP1AWLEN(S_AXI_GP1_AWLEN), .SAXIGP1AWLOCK(S_AXI_GP1_AWLOCK), .SAXIGP1AWPROT(S_AXI_GP1_AWPROT), .SAXIGP1AWQOS(S_AXI_GP1_AWQOS), .SAXIGP1AWREADY(S_AXI_GP1_AWREADY), .SAXIGP1AWSIZE(S_AXI_GP1_AWSIZE[1:0]), .SAXIGP1AWVALID(S_AXI_GP1_AWVALID), .SAXIGP1BID(S_AXI_GP1_BID), .SAXIGP1BREADY(S_AXI_GP1_BREADY), .SAXIGP1BRESP(S_AXI_GP1_BRESP), .SAXIGP1BVALID(S_AXI_GP1_BVALID), .SAXIGP1RDATA(S_AXI_GP1_RDATA), .SAXIGP1RID(S_AXI_GP1_RID), .SAXIGP1RLAST(S_AXI_GP1_RLAST), .SAXIGP1RREADY(S_AXI_GP1_RREADY), .SAXIGP1RRESP(S_AXI_GP1_RRESP), .SAXIGP1RVALID(S_AXI_GP1_RVALID), .SAXIGP1WDATA(S_AXI_GP1_WDATA), .SAXIGP1WID(S_AXI_GP1_WID), .SAXIGP1WLAST(S_AXI_GP1_WLAST), .SAXIGP1WREADY(S_AXI_GP1_WREADY), .SAXIGP1WSTRB(S_AXI_GP1_WSTRB), .SAXIGP1WVALID(S_AXI_GP1_WVALID), .SAXIHP0ACLK(S_AXI_HP0_ACLK), .SAXIHP0ARADDR(S_AXI_HP0_ARADDR), .SAXIHP0ARBURST(S_AXI_HP0_ARBURST), .SAXIHP0ARCACHE(S_AXI_HP0_ARCACHE), .SAXIHP0ARESETN(S_AXI_HP0_ARESETN), .SAXIHP0ARID(S_AXI_HP0_ARID), .SAXIHP0ARLEN(S_AXI_HP0_ARLEN), .SAXIHP0ARLOCK(S_AXI_HP0_ARLOCK), .SAXIHP0ARPROT(S_AXI_HP0_ARPROT), .SAXIHP0ARQOS(S_AXI_HP0_ARQOS), .SAXIHP0ARREADY(S_AXI_HP0_ARREADY), .SAXIHP0ARSIZE(S_AXI_HP0_ARSIZE[1:0]), .SAXIHP0ARVALID(S_AXI_HP0_ARVALID), .SAXIHP0AWADDR(S_AXI_HP0_AWADDR), .SAXIHP0AWBURST(S_AXI_HP0_AWBURST), .SAXIHP0AWCACHE(S_AXI_HP0_AWCACHE), .SAXIHP0AWID(S_AXI_HP0_AWID), .SAXIHP0AWLEN(S_AXI_HP0_AWLEN), .SAXIHP0AWLOCK(S_AXI_HP0_AWLOCK), .SAXIHP0AWPROT(S_AXI_HP0_AWPROT), .SAXIHP0AWQOS(S_AXI_HP0_AWQOS), .SAXIHP0AWREADY(S_AXI_HP0_AWREADY), .SAXIHP0AWSIZE(S_AXI_HP0_AWSIZE[1:0]), .SAXIHP0AWVALID(S_AXI_HP0_AWVALID), .SAXIHP0BID(S_AXI_HP0_BID), .SAXIHP0BREADY(S_AXI_HP0_BREADY), .SAXIHP0BRESP(S_AXI_HP0_BRESP), .SAXIHP0BVALID(S_AXI_HP0_BVALID), .SAXIHP0RACOUNT(S_AXI_HP0_RACOUNT), .SAXIHP0RCOUNT(S_AXI_HP0_RCOUNT), .SAXIHP0RDATA(S_AXI_HP0_RDATA), .SAXIHP0RDISSUECAP1EN(S_AXI_HP0_RDISSUECAP1_EN), .SAXIHP0RID(S_AXI_HP0_RID), .SAXIHP0RLAST(S_AXI_HP0_RLAST), .SAXIHP0RREADY(S_AXI_HP0_RREADY), .SAXIHP0RRESP(S_AXI_HP0_RRESP), .SAXIHP0RVALID(S_AXI_HP0_RVALID), .SAXIHP0WACOUNT(S_AXI_HP0_WACOUNT), .SAXIHP0WCOUNT(S_AXI_HP0_WCOUNT), .SAXIHP0WDATA(S_AXI_HP0_WDATA), .SAXIHP0WID(S_AXI_HP0_WID), .SAXIHP0WLAST(S_AXI_HP0_WLAST), .SAXIHP0WREADY(S_AXI_HP0_WREADY), .SAXIHP0WRISSUECAP1EN(S_AXI_HP0_WRISSUECAP1_EN), .SAXIHP0WSTRB(S_AXI_HP0_WSTRB), .SAXIHP0WVALID(S_AXI_HP0_WVALID), .SAXIHP1ACLK(S_AXI_HP1_ACLK), .SAXIHP1ARADDR(S_AXI_HP1_ARADDR), .SAXIHP1ARBURST(S_AXI_HP1_ARBURST), .SAXIHP1ARCACHE(S_AXI_HP1_ARCACHE), .SAXIHP1ARESETN(S_AXI_HP1_ARESETN), .SAXIHP1ARID(S_AXI_HP1_ARID), .SAXIHP1ARLEN(S_AXI_HP1_ARLEN), .SAXIHP1ARLOCK(S_AXI_HP1_ARLOCK), .SAXIHP1ARPROT(S_AXI_HP1_ARPROT), .SAXIHP1ARQOS(S_AXI_HP1_ARQOS), .SAXIHP1ARREADY(S_AXI_HP1_ARREADY), .SAXIHP1ARSIZE(S_AXI_HP1_ARSIZE[1:0]), .SAXIHP1ARVALID(S_AXI_HP1_ARVALID), .SAXIHP1AWADDR(S_AXI_HP1_AWADDR), .SAXIHP1AWBURST(S_AXI_HP1_AWBURST), .SAXIHP1AWCACHE(S_AXI_HP1_AWCACHE), .SAXIHP1AWID(S_AXI_HP1_AWID), .SAXIHP1AWLEN(S_AXI_HP1_AWLEN), .SAXIHP1AWLOCK(S_AXI_HP1_AWLOCK), .SAXIHP1AWPROT(S_AXI_HP1_AWPROT), .SAXIHP1AWQOS(S_AXI_HP1_AWQOS), .SAXIHP1AWREADY(S_AXI_HP1_AWREADY), .SAXIHP1AWSIZE(S_AXI_HP1_AWSIZE[1:0]), .SAXIHP1AWVALID(S_AXI_HP1_AWVALID), .SAXIHP1BID(S_AXI_HP1_BID), .SAXIHP1BREADY(S_AXI_HP1_BREADY), .SAXIHP1BRESP(S_AXI_HP1_BRESP), .SAXIHP1BVALID(S_AXI_HP1_BVALID), .SAXIHP1RACOUNT(S_AXI_HP1_RACOUNT), .SAXIHP1RCOUNT(S_AXI_HP1_RCOUNT), .SAXIHP1RDATA(S_AXI_HP1_RDATA), .SAXIHP1RDISSUECAP1EN(S_AXI_HP1_RDISSUECAP1_EN), .SAXIHP1RID(S_AXI_HP1_RID), .SAXIHP1RLAST(S_AXI_HP1_RLAST), .SAXIHP1RREADY(S_AXI_HP1_RREADY), .SAXIHP1RRESP(S_AXI_HP1_RRESP), .SAXIHP1RVALID(S_AXI_HP1_RVALID), .SAXIHP1WACOUNT(S_AXI_HP1_WACOUNT), .SAXIHP1WCOUNT(S_AXI_HP1_WCOUNT), .SAXIHP1WDATA(S_AXI_HP1_WDATA), .SAXIHP1WID(S_AXI_HP1_WID), .SAXIHP1WLAST(S_AXI_HP1_WLAST), .SAXIHP1WREADY(S_AXI_HP1_WREADY), .SAXIHP1WRISSUECAP1EN(S_AXI_HP1_WRISSUECAP1_EN), .SAXIHP1WSTRB(S_AXI_HP1_WSTRB), .SAXIHP1WVALID(S_AXI_HP1_WVALID), .SAXIHP2ACLK(S_AXI_HP2_ACLK), .SAXIHP2ARADDR(S_AXI_HP2_ARADDR), .SAXIHP2ARBURST(S_AXI_HP2_ARBURST), .SAXIHP2ARCACHE(S_AXI_HP2_ARCACHE), .SAXIHP2ARESETN(S_AXI_HP2_ARESETN), .SAXIHP2ARID(S_AXI_HP2_ARID), .SAXIHP2ARLEN(S_AXI_HP2_ARLEN), .SAXIHP2ARLOCK(S_AXI_HP2_ARLOCK), .SAXIHP2ARPROT(S_AXI_HP2_ARPROT), .SAXIHP2ARQOS(S_AXI_HP2_ARQOS), .SAXIHP2ARREADY(S_AXI_HP2_ARREADY), .SAXIHP2ARSIZE(S_AXI_HP2_ARSIZE[1:0]), .SAXIHP2ARVALID(S_AXI_HP2_ARVALID), .SAXIHP2AWADDR(S_AXI_HP2_AWADDR), .SAXIHP2AWBURST(S_AXI_HP2_AWBURST), .SAXIHP2AWCACHE(S_AXI_HP2_AWCACHE), .SAXIHP2AWID(S_AXI_HP2_AWID), .SAXIHP2AWLEN(S_AXI_HP2_AWLEN), .SAXIHP2AWLOCK(S_AXI_HP2_AWLOCK), .SAXIHP2AWPROT(S_AXI_HP2_AWPROT), .SAXIHP2AWQOS(S_AXI_HP2_AWQOS), .SAXIHP2AWREADY(S_AXI_HP2_AWREADY), .SAXIHP2AWSIZE(S_AXI_HP2_AWSIZE[1:0]), .SAXIHP2AWVALID(S_AXI_HP2_AWVALID), .SAXIHP2BID(S_AXI_HP2_BID), .SAXIHP2BREADY(S_AXI_HP2_BREADY), .SAXIHP2BRESP(S_AXI_HP2_BRESP), .SAXIHP2BVALID(S_AXI_HP2_BVALID), .SAXIHP2RACOUNT(S_AXI_HP2_RACOUNT), .SAXIHP2RCOUNT(S_AXI_HP2_RCOUNT), .SAXIHP2RDATA(S_AXI_HP2_RDATA), .SAXIHP2RDISSUECAP1EN(S_AXI_HP2_RDISSUECAP1_EN), .SAXIHP2RID(S_AXI_HP2_RID), .SAXIHP2RLAST(S_AXI_HP2_RLAST), .SAXIHP2RREADY(S_AXI_HP2_RREADY), .SAXIHP2RRESP(S_AXI_HP2_RRESP), .SAXIHP2RVALID(S_AXI_HP2_RVALID), .SAXIHP2WACOUNT(S_AXI_HP2_WACOUNT), .SAXIHP2WCOUNT(S_AXI_HP2_WCOUNT), .SAXIHP2WDATA(S_AXI_HP2_WDATA), .SAXIHP2WID(S_AXI_HP2_WID), .SAXIHP2WLAST(S_AXI_HP2_WLAST), .SAXIHP2WREADY(S_AXI_HP2_WREADY), .SAXIHP2WRISSUECAP1EN(S_AXI_HP2_WRISSUECAP1_EN), .SAXIHP2WSTRB(S_AXI_HP2_WSTRB), .SAXIHP2WVALID(S_AXI_HP2_WVALID), .SAXIHP3ACLK(S_AXI_HP3_ACLK), .SAXIHP3ARADDR(S_AXI_HP3_ARADDR), .SAXIHP3ARBURST(S_AXI_HP3_ARBURST), .SAXIHP3ARCACHE(S_AXI_HP3_ARCACHE), .SAXIHP3ARESETN(S_AXI_HP3_ARESETN), .SAXIHP3ARID(S_AXI_HP3_ARID), .SAXIHP3ARLEN(S_AXI_HP3_ARLEN), .SAXIHP3ARLOCK(S_AXI_HP3_ARLOCK), .SAXIHP3ARPROT(S_AXI_HP3_ARPROT), .SAXIHP3ARQOS(S_AXI_HP3_ARQOS), .SAXIHP3ARREADY(S_AXI_HP3_ARREADY), .SAXIHP3ARSIZE(S_AXI_HP3_ARSIZE[1:0]), .SAXIHP3ARVALID(S_AXI_HP3_ARVALID), .SAXIHP3AWADDR(S_AXI_HP3_AWADDR), .SAXIHP3AWBURST(S_AXI_HP3_AWBURST), .SAXIHP3AWCACHE(S_AXI_HP3_AWCACHE), .SAXIHP3AWID(S_AXI_HP3_AWID), .SAXIHP3AWLEN(S_AXI_HP3_AWLEN), .SAXIHP3AWLOCK(S_AXI_HP3_AWLOCK), .SAXIHP3AWPROT(S_AXI_HP3_AWPROT), .SAXIHP3AWQOS(S_AXI_HP3_AWQOS), .SAXIHP3AWREADY(S_AXI_HP3_AWREADY), .SAXIHP3AWSIZE(S_AXI_HP3_AWSIZE[1:0]), .SAXIHP3AWVALID(S_AXI_HP3_AWVALID), .SAXIHP3BID(S_AXI_HP3_BID), .SAXIHP3BREADY(S_AXI_HP3_BREADY), .SAXIHP3BRESP(S_AXI_HP3_BRESP), .SAXIHP3BVALID(S_AXI_HP3_BVALID), .SAXIHP3RACOUNT(S_AXI_HP3_RACOUNT), .SAXIHP3RCOUNT(S_AXI_HP3_RCOUNT), .SAXIHP3RDATA(S_AXI_HP3_RDATA), .SAXIHP3RDISSUECAP1EN(S_AXI_HP3_RDISSUECAP1_EN), .SAXIHP3RID(S_AXI_HP3_RID), .SAXIHP3RLAST(S_AXI_HP3_RLAST), .SAXIHP3RREADY(S_AXI_HP3_RREADY), .SAXIHP3RRESP(S_AXI_HP3_RRESP), .SAXIHP3RVALID(S_AXI_HP3_RVALID), .SAXIHP3WACOUNT(S_AXI_HP3_WACOUNT), .SAXIHP3WCOUNT(S_AXI_HP3_WCOUNT), .SAXIHP3WDATA(S_AXI_HP3_WDATA), .SAXIHP3WID(S_AXI_HP3_WID), .SAXIHP3WLAST(S_AXI_HP3_WLAST), .SAXIHP3WREADY(S_AXI_HP3_WREADY), .SAXIHP3WRISSUECAP1EN(S_AXI_HP3_WRISSUECAP1_EN), .SAXIHP3WSTRB(S_AXI_HP3_WSTRB), .SAXIHP3WVALID(S_AXI_HP3_WVALID)); (* BOX_TYPE = "PRIMITIVE" *) BIBUF PS_CLK_BIBUF (.IO(buffered_PS_CLK), .PAD(PS_CLK)); (* BOX_TYPE = "PRIMITIVE" *) BIBUF PS_PORB_BIBUF (.IO(buffered_PS_PORB), .PAD(PS_PORB)); (* BOX_TYPE = "PRIMITIVE" *) BIBUF PS_SRSTB_BIBUF (.IO(buffered_PS_SRSTB), .PAD(PS_SRSTB)); LUT1 #( .INIT(2'h1)) SDIO0_CMD_T_INST_0 (.I0(SDIO0_CMD_T_n), .O(SDIO0_CMD_T)); LUT1 #( .INIT(2'h1)) \SDIO0_DATA_T[0]_INST_0 (.I0(SDIO0_DATA_T_n[0]), .O(SDIO0_DATA_T[0])); LUT1 #( .INIT(2'h1)) \SDIO0_DATA_T[1]_INST_0 (.I0(SDIO0_DATA_T_n[1]), .O(SDIO0_DATA_T[1])); LUT1 #( .INIT(2'h1)) \SDIO0_DATA_T[2]_INST_0 (.I0(SDIO0_DATA_T_n[2]), .O(SDIO0_DATA_T[2])); LUT1 #( .INIT(2'h1)) \SDIO0_DATA_T[3]_INST_0 (.I0(SDIO0_DATA_T_n[3]), .O(SDIO0_DATA_T[3])); LUT1 #( .INIT(2'h1)) SDIO1_CMD_T_INST_0 (.I0(SDIO1_CMD_T_n), .O(SDIO1_CMD_T)); LUT1 #( .INIT(2'h1)) \SDIO1_DATA_T[0]_INST_0 (.I0(SDIO1_DATA_T_n[0]), .O(SDIO1_DATA_T[0])); LUT1 #( .INIT(2'h1)) \SDIO1_DATA_T[1]_INST_0 (.I0(SDIO1_DATA_T_n[1]), .O(SDIO1_DATA_T[1])); LUT1 #( .INIT(2'h1)) \SDIO1_DATA_T[2]_INST_0 (.I0(SDIO1_DATA_T_n[2]), .O(SDIO1_DATA_T[2])); LUT1 #( .INIT(2'h1)) \SDIO1_DATA_T[3]_INST_0 (.I0(SDIO1_DATA_T_n[3]), .O(SDIO1_DATA_T[3])); LUT1 #( .INIT(2'h1)) SPI0_MISO_T_INST_0 (.I0(SPI0_MISO_T_n), .O(SPI0_MISO_T)); LUT1 #( .INIT(2'h1)) SPI0_MOSI_T_INST_0 (.I0(SPI0_MOSI_T_n), .O(SPI0_MOSI_T)); LUT1 #( .INIT(2'h1)) SPI0_SCLK_T_INST_0 (.I0(SPI0_SCLK_T_n), .O(SPI0_SCLK_T)); LUT1 #( .INIT(2'h1)) SPI0_SS_T_INST_0 (.I0(SPI0_SS_T_n), .O(SPI0_SS_T)); LUT1 #( .INIT(2'h1)) SPI1_MISO_T_INST_0 (.I0(SPI1_MISO_T_n), .O(SPI1_MISO_T)); LUT1 #( .INIT(2'h1)) SPI1_MOSI_T_INST_0 (.I0(SPI1_MOSI_T_n), .O(SPI1_MOSI_T)); LUT1 #( .INIT(2'h1)) SPI1_SCLK_T_INST_0 (.I0(SPI1_SCLK_T_n), .O(SPI1_SCLK_T)); LUT1 #( .INIT(2'h1)) SPI1_SS_T_INST_0 (.I0(SPI1_SS_T_n), .O(SPI1_SS_T)); (* BOX_TYPE = "PRIMITIVE" *) BUFG \buffer_fclk_clk_0.FCLK_CLK_0_BUFG (.I(FCLK_CLK_unbuffered), .O(FCLK_CLK0)); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[0].MIO_BIBUF (.IO(buffered_MIO[0]), .PAD(MIO[0])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[10].MIO_BIBUF (.IO(buffered_MIO[10]), .PAD(MIO[10])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[11].MIO_BIBUF (.IO(buffered_MIO[11]), .PAD(MIO[11])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[12].MIO_BIBUF (.IO(buffered_MIO[12]), .PAD(MIO[12])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[13].MIO_BIBUF (.IO(buffered_MIO[13]), .PAD(MIO[13])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[14].MIO_BIBUF (.IO(buffered_MIO[14]), .PAD(MIO[14])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[15].MIO_BIBUF (.IO(buffered_MIO[15]), .PAD(MIO[15])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[16].MIO_BIBUF (.IO(buffered_MIO[16]), .PAD(MIO[16])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[17].MIO_BIBUF (.IO(buffered_MIO[17]), .PAD(MIO[17])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[18].MIO_BIBUF (.IO(buffered_MIO[18]), .PAD(MIO[18])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[19].MIO_BIBUF (.IO(buffered_MIO[19]), .PAD(MIO[19])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[1].MIO_BIBUF (.IO(buffered_MIO[1]), .PAD(MIO[1])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[20].MIO_BIBUF (.IO(buffered_MIO[20]), .PAD(MIO[20])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[21].MIO_BIBUF (.IO(buffered_MIO[21]), .PAD(MIO[21])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[22].MIO_BIBUF (.IO(buffered_MIO[22]), .PAD(MIO[22])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[23].MIO_BIBUF (.IO(buffered_MIO[23]), .PAD(MIO[23])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[24].MIO_BIBUF (.IO(buffered_MIO[24]), .PAD(MIO[24])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[25].MIO_BIBUF (.IO(buffered_MIO[25]), .PAD(MIO[25])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[26].MIO_BIBUF (.IO(buffered_MIO[26]), .PAD(MIO[26])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[27].MIO_BIBUF (.IO(buffered_MIO[27]), .PAD(MIO[27])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[28].MIO_BIBUF (.IO(buffered_MIO[28]), .PAD(MIO[28])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[29].MIO_BIBUF (.IO(buffered_MIO[29]), .PAD(MIO[29])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[2].MIO_BIBUF (.IO(buffered_MIO[2]), .PAD(MIO[2])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[30].MIO_BIBUF (.IO(buffered_MIO[30]), .PAD(MIO[30])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[31].MIO_BIBUF (.IO(buffered_MIO[31]), .PAD(MIO[31])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[32].MIO_BIBUF (.IO(buffered_MIO[32]), .PAD(MIO[32])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[33].MIO_BIBUF (.IO(buffered_MIO[33]), .PAD(MIO[33])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[34].MIO_BIBUF (.IO(buffered_MIO[34]), .PAD(MIO[34])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[35].MIO_BIBUF (.IO(buffered_MIO[35]), .PAD(MIO[35])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[36].MIO_BIBUF (.IO(buffered_MIO[36]), .PAD(MIO[36])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[37].MIO_BIBUF (.IO(buffered_MIO[37]), .PAD(MIO[37])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[38].MIO_BIBUF (.IO(buffered_MIO[38]), .PAD(MIO[38])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[39].MIO_BIBUF (.IO(buffered_MIO[39]), .PAD(MIO[39])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[3].MIO_BIBUF (.IO(buffered_MIO[3]), .PAD(MIO[3])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[40].MIO_BIBUF (.IO(buffered_MIO[40]), .PAD(MIO[40])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[41].MIO_BIBUF (.IO(buffered_MIO[41]), .PAD(MIO[41])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[42].MIO_BIBUF (.IO(buffered_MIO[42]), .PAD(MIO[42])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[43].MIO_BIBUF (.IO(buffered_MIO[43]), .PAD(MIO[43])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[44].MIO_BIBUF (.IO(buffered_MIO[44]), .PAD(MIO[44])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[45].MIO_BIBUF (.IO(buffered_MIO[45]), .PAD(MIO[45])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[46].MIO_BIBUF (.IO(buffered_MIO[46]), .PAD(MIO[46])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[47].MIO_BIBUF (.IO(buffered_MIO[47]), .PAD(MIO[47])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[48].MIO_BIBUF (.IO(buffered_MIO[48]), .PAD(MIO[48])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[49].MIO_BIBUF (.IO(buffered_MIO[49]), .PAD(MIO[49])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[4].MIO_BIBUF (.IO(buffered_MIO[4]), .PAD(MIO[4])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[50].MIO_BIBUF (.IO(buffered_MIO[50]), .PAD(MIO[50])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[51].MIO_BIBUF (.IO(buffered_MIO[51]), .PAD(MIO[51])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[52].MIO_BIBUF (.IO(buffered_MIO[52]), .PAD(MIO[52])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[53].MIO_BIBUF (.IO(buffered_MIO[53]), .PAD(MIO[53])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[5].MIO_BIBUF (.IO(buffered_MIO[5]), .PAD(MIO[5])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[6].MIO_BIBUF (.IO(buffered_MIO[6]), .PAD(MIO[6])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[7].MIO_BIBUF (.IO(buffered_MIO[7]), .PAD(MIO[7])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[8].MIO_BIBUF (.IO(buffered_MIO[8]), .PAD(MIO[8])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk13[9].MIO_BIBUF (.IO(buffered_MIO[9]), .PAD(MIO[9])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk14[0].DDR_BankAddr_BIBUF (.IO(buffered_DDR_BankAddr[0]), .PAD(DDR_BankAddr[0])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk14[1].DDR_BankAddr_BIBUF (.IO(buffered_DDR_BankAddr[1]), .PAD(DDR_BankAddr[1])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk14[2].DDR_BankAddr_BIBUF (.IO(buffered_DDR_BankAddr[2]), .PAD(DDR_BankAddr[2])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk15[0].DDR_Addr_BIBUF (.IO(buffered_DDR_Addr[0]), .PAD(DDR_Addr[0])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk15[10].DDR_Addr_BIBUF (.IO(buffered_DDR_Addr[10]), .PAD(DDR_Addr[10])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk15[11].DDR_Addr_BIBUF (.IO(buffered_DDR_Addr[11]), .PAD(DDR_Addr[11])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk15[12].DDR_Addr_BIBUF (.IO(buffered_DDR_Addr[12]), .PAD(DDR_Addr[12])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk15[13].DDR_Addr_BIBUF (.IO(buffered_DDR_Addr[13]), .PAD(DDR_Addr[13])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk15[14].DDR_Addr_BIBUF (.IO(buffered_DDR_Addr[14]), .PAD(DDR_Addr[14])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk15[1].DDR_Addr_BIBUF (.IO(buffered_DDR_Addr[1]), .PAD(DDR_Addr[1])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk15[2].DDR_Addr_BIBUF (.IO(buffered_DDR_Addr[2]), .PAD(DDR_Addr[2])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk15[3].DDR_Addr_BIBUF (.IO(buffered_DDR_Addr[3]), .PAD(DDR_Addr[3])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk15[4].DDR_Addr_BIBUF (.IO(buffered_DDR_Addr[4]), .PAD(DDR_Addr[4])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk15[5].DDR_Addr_BIBUF (.IO(buffered_DDR_Addr[5]), .PAD(DDR_Addr[5])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk15[6].DDR_Addr_BIBUF (.IO(buffered_DDR_Addr[6]), .PAD(DDR_Addr[6])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk15[7].DDR_Addr_BIBUF (.IO(buffered_DDR_Addr[7]), .PAD(DDR_Addr[7])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk15[8].DDR_Addr_BIBUF (.IO(buffered_DDR_Addr[8]), .PAD(DDR_Addr[8])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk15[9].DDR_Addr_BIBUF (.IO(buffered_DDR_Addr[9]), .PAD(DDR_Addr[9])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk16[0].DDR_DM_BIBUF (.IO(buffered_DDR_DM[0]), .PAD(DDR_DM[0])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk16[1].DDR_DM_BIBUF (.IO(buffered_DDR_DM[1]), .PAD(DDR_DM[1])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk16[2].DDR_DM_BIBUF (.IO(buffered_DDR_DM[2]), .PAD(DDR_DM[2])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk16[3].DDR_DM_BIBUF (.IO(buffered_DDR_DM[3]), .PAD(DDR_DM[3])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[0].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[0]), .PAD(DDR_DQ[0])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[10].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[10]), .PAD(DDR_DQ[10])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[11].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[11]), .PAD(DDR_DQ[11])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[12].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[12]), .PAD(DDR_DQ[12])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[13].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[13]), .PAD(DDR_DQ[13])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[14].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[14]), .PAD(DDR_DQ[14])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[15].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[15]), .PAD(DDR_DQ[15])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[16].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[16]), .PAD(DDR_DQ[16])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[17].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[17]), .PAD(DDR_DQ[17])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[18].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[18]), .PAD(DDR_DQ[18])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[19].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[19]), .PAD(DDR_DQ[19])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[1].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[1]), .PAD(DDR_DQ[1])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[20].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[20]), .PAD(DDR_DQ[20])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[21].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[21]), .PAD(DDR_DQ[21])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[22].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[22]), .PAD(DDR_DQ[22])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[23].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[23]), .PAD(DDR_DQ[23])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[24].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[24]), .PAD(DDR_DQ[24])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[25].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[25]), .PAD(DDR_DQ[25])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[26].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[26]), .PAD(DDR_DQ[26])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[27].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[27]), .PAD(DDR_DQ[27])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[28].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[28]), .PAD(DDR_DQ[28])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[29].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[29]), .PAD(DDR_DQ[29])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[2].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[2]), .PAD(DDR_DQ[2])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[30].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[30]), .PAD(DDR_DQ[30])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[31].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[31]), .PAD(DDR_DQ[31])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[3].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[3]), .PAD(DDR_DQ[3])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[4].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[4]), .PAD(DDR_DQ[4])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[5].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[5]), .PAD(DDR_DQ[5])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[6].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[6]), .PAD(DDR_DQ[6])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[7].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[7]), .PAD(DDR_DQ[7])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[8].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[8]), .PAD(DDR_DQ[8])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk17[9].DDR_DQ_BIBUF (.IO(buffered_DDR_DQ[9]), .PAD(DDR_DQ[9])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk18[0].DDR_DQS_n_BIBUF (.IO(buffered_DDR_DQS_n[0]), .PAD(DDR_DQS_n[0])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk18[1].DDR_DQS_n_BIBUF (.IO(buffered_DDR_DQS_n[1]), .PAD(DDR_DQS_n[1])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk18[2].DDR_DQS_n_BIBUF (.IO(buffered_DDR_DQS_n[2]), .PAD(DDR_DQS_n[2])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk18[3].DDR_DQS_n_BIBUF (.IO(buffered_DDR_DQS_n[3]), .PAD(DDR_DQS_n[3])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk19[0].DDR_DQS_BIBUF (.IO(buffered_DDR_DQS[0]), .PAD(DDR_DQS[0])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk19[1].DDR_DQS_BIBUF (.IO(buffered_DDR_DQS[1]), .PAD(DDR_DQS[1])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk19[2].DDR_DQS_BIBUF (.IO(buffered_DDR_DQS[2]), .PAD(DDR_DQS[2])); (* BOX_TYPE = "PRIMITIVE" *) BIBUF \genblk19[3].DDR_DQS_BIBUF (.IO(buffered_DDR_DQS[3]), .PAD(DDR_DQS[3])); LUT1 #( .INIT(2'h2)) i_0 (.I0(1'b0), .O(\TRACE_CTL_PIPE[0] )); LUT1 #( .INIT(2'h2)) i_1 (.I0(1'b0), .O(\TRACE_DATA_PIPE[0] [1])); LUT1 #( .INIT(2'h2)) i_10 (.I0(1'b0), .O(\TRACE_DATA_PIPE[7] [1])); LUT1 #( .INIT(2'h2)) i_11 (.I0(1'b0), .O(\TRACE_DATA_PIPE[7] [0])); LUT1 #( .INIT(2'h2)) i_12 (.I0(1'b0), .O(\TRACE_DATA_PIPE[6] [1])); LUT1 #( .INIT(2'h2)) i_13 (.I0(1'b0), .O(\TRACE_DATA_PIPE[6] [0])); LUT1 #( .INIT(2'h2)) i_14 (.I0(1'b0), .O(\TRACE_DATA_PIPE[5] [1])); LUT1 #( .INIT(2'h2)) i_15 (.I0(1'b0), .O(\TRACE_DATA_PIPE[5] [0])); LUT1 #( .INIT(2'h2)) i_16 (.I0(1'b0), .O(\TRACE_DATA_PIPE[4] [1])); LUT1 #( .INIT(2'h2)) i_17 (.I0(1'b0), .O(\TRACE_DATA_PIPE[4] [0])); LUT1 #( .INIT(2'h2)) i_18 (.I0(1'b0), .O(\TRACE_DATA_PIPE[3] [1])); LUT1 #( .INIT(2'h2)) i_19 (.I0(1'b0), .O(\TRACE_DATA_PIPE[3] [0])); LUT1 #( .INIT(2'h2)) i_2 (.I0(1'b0), .O(\TRACE_DATA_PIPE[0] [0])); LUT1 #( .INIT(2'h2)) i_20 (.I0(1'b0), .O(\TRACE_DATA_PIPE[2] [1])); LUT1 #( .INIT(2'h2)) i_21 (.I0(1'b0), .O(\TRACE_DATA_PIPE[2] [0])); LUT1 #( .INIT(2'h2)) i_22 (.I0(1'b0), .O(\TRACE_DATA_PIPE[1] [1])); LUT1 #( .INIT(2'h2)) i_23 (.I0(1'b0), .O(\TRACE_DATA_PIPE[1] [0])); LUT1 #( .INIT(2'h2)) i_3 (.I0(1'b0), .O(\TRACE_CTL_PIPE[7] )); LUT1 #( .INIT(2'h2)) i_4 (.I0(1'b0), .O(\TRACE_CTL_PIPE[6] )); LUT1 #( .INIT(2'h2)) i_5 (.I0(1'b0), .O(\TRACE_CTL_PIPE[5] )); LUT1 #( .INIT(2'h2)) i_6 (.I0(1'b0), .O(\TRACE_CTL_PIPE[4] )); LUT1 #( .INIT(2'h2)) i_7 (.I0(1'b0), .O(\TRACE_CTL_PIPE[3] )); LUT1 #( .INIT(2'h2)) i_8 (.I0(1'b0), .O(\TRACE_CTL_PIPE[2] )); LUT1 #( .INIT(2'h2)) i_9 (.I0(1'b0), .O(\TRACE_CTL_PIPE[1] )); endmodule `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 (weak1, weak0) GSR = GSR_int; assign (weak1, 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
/*------------------------------------------------------------------------------ Purpose Pipeline: ñontrol sequence of instructions. All instructions have two stages: 1) Fetch; 2) Execute. Branch instructions may have additional stage: 3) Memory issue instruction of branch address. Memory instructions additional stages defined by Wishbone interface and pipeline will be stallen (pl_stall_mem) until ending memory operation. Multiply and divide instructions stall pipeline (pl_stall_multdiv) until endinding of calculation. ------------------------------------------------------------------------------*/ module mips_pipeline ( input clk, input rst, input pl_stall_mem, input pl_stall_branch, input pl_stall_multdiv, input pl_stall_eret, input exception, output[5:0] ifield_fstage_opcode, output[4:0] ifield_fstage_d, output[4:0] ifield_fstage_t, output[4:0] ifield_fstage_s, output[4:0] ifield_fstage_shift, output[5:0] ifield_fstage_func, input pmem_cmdok, input[31:0] pmem_cmd, input pmem_branch_ended, input alu_multdiv_ready, output reg pl_cause_bd, output reg pl_pcpause ); reg[31:0] pl_instr_fstage; reg[31:0] pl_instr_fstage_d; reg[1:0] cpu_state; reg[1:0] cpu_state_d; reg pl_pcpause_d; reg instr_next; reg instr_next_d; reg pl_branch_excpt; reg pl_branch_excpt_d; reg branch_stall_was; reg branch_stall_was_d; localparam NORMAL= 2'b00, STALL_BRANCH= 2'b01, STALL_MEM= 2'b10, STALL_MULTDIV= 2'b11; assign ifield_fstage_opcode= pl_instr_fstage_d[31:26]; assign ifield_fstage_s= pl_instr_fstage_d[25:21]; assign ifield_fstage_t= pl_instr_fstage_d[20:16]; assign ifield_fstage_d= pl_instr_fstage_d[15:11]; assign ifield_fstage_shift= pl_instr_fstage_d[10:6]; assign ifield_fstage_func= pl_instr_fstage_d[5:0]; always @* begin pl_instr_fstage= pmem_cmd; cpu_state= NORMAL; instr_next= instr_next_d; pl_pcpause= pl_pcpause_d; branch_stall_was= branch_stall_was_d; pl_cause_bd= 1'b0; pl_branch_excpt= pl_branch_excpt_d; case(cpu_state_d) NORMAL: begin pl_pcpause= 1'b0; branch_stall_was= 1'b0; if(exception | ((pl_stall_eret | pl_stall_branch) & !pl_stall_mem)) begin instr_next= !pmem_cmdok & !(pl_stall_eret | exception); //DELAY SLOT HOW NOP pl_instr_fstage= pl_stall_eret | exception | !pmem_cmdok ? 32'd0 : pmem_cmd; cpu_state= STALL_BRANCH; end else if(pl_stall_mem | pl_stall_multdiv) begin pl_pcpause= 1'b1; pl_instr_fstage= pl_instr_fstage_d; cpu_state= pl_stall_mem ? STALL_MEM : STALL_MULTDIV; end else if(!pmem_cmdok) pl_instr_fstage= 32'd0; end STALL_BRANCH: begin branch_stall_was= 1'b1; if(pmem_cmdok) begin instr_next= 1'b0; pl_branch_excpt= 1'b0; end if(exception | ((pl_stall_eret | pl_stall_branch) & !pl_stall_mem)) begin pl_instr_fstage= 32'd0; pl_cause_bd= 1'b1; pl_branch_excpt= 1'b1; cpu_state= STALL_BRANCH; end else if(pl_stall_mem | pl_stall_multdiv) begin pl_pcpause= 1'b1; pl_instr_fstage= pl_instr_fstage_d; cpu_state= pl_stall_mem ? STALL_MEM : STALL_MULTDIV; end else begin pl_instr_fstage= (instr_next_d | pmem_branch_ended) & pmem_cmdok & !pl_branch_excpt_d ? pmem_cmd : 32'd0; cpu_state= pmem_branch_ended & !pl_branch_excpt_d ? NORMAL : STALL_BRANCH; end end STALL_MEM: begin if(exception | ((pl_stall_eret | pl_stall_branch) & !pl_stall_mem)) begin pl_pcpause= 1'b0; if(branch_stall_was_d) pl_cause_bd= 1'b1; instr_next= !pmem_cmdok & !(pl_stall_eret | exception); //DELAY SLOT HOW NOP pl_instr_fstage= pl_stall_eret | exception | !pmem_cmdok ? 32'd0 : pmem_cmd; cpu_state= STALL_BRANCH; end else if(pl_stall_mem | pl_stall_multdiv) begin pl_pcpause= 1'b1; pl_instr_fstage= pl_instr_fstage_d; cpu_state= pl_stall_mem ? STALL_MEM : STALL_MULTDIV; end else begin pl_pcpause= 1'b0; pl_instr_fstage= pmem_cmdok ? pmem_cmd : 32'd0; end end STALL_MULTDIV: begin if(exception) begin if(branch_stall_was_d) pl_cause_bd= 1'b1; instr_next= !pmem_cmdok & !(pl_stall_eret | exception); //DELAY SLOT HOW NOP pl_instr_fstage= pl_stall_eret | exception | !pmem_cmdok ? 32'd0 : pmem_cmd; cpu_state= STALL_BRANCH; end else begin if(!alu_multdiv_ready) begin pl_pcpause= 1'b1; pl_instr_fstage= pl_instr_fstage_d; cpu_state= STALL_MULTDIV; end else begin pl_pcpause= 1'b0; pl_instr_fstage= pmem_cmdok ? pmem_cmd : 32'd0; end end end endcase end always @(posedge clk) begin if(rst) begin instr_next_d<= 1'b0; pl_pcpause_d<= 1'b0; pl_branch_excpt_d<= 1'b0; branch_stall_was_d<= 1'b0; pl_instr_fstage_d<= 32'd0; cpu_state_d<= NORMAL; end else begin instr_next_d<= instr_next; pl_pcpause_d<= pl_pcpause; pl_branch_excpt_d<= pl_branch_excpt; branch_stall_was_d<= branch_stall_was; pl_instr_fstage_d<= pl_instr_fstage; cpu_state_d<= cpu_state; end end endmodule
/* * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ `ifndef SKY130_FD_SC_LP__FAH_BEHAVIORAL_PP_V `define SKY130_FD_SC_LP__FAH_BEHAVIORAL_PP_V /** * fah: Full adder. * * Verilog simulation functional model. */ `timescale 1ns / 1ps `default_nettype none // Import user defined primitives. `include "../../models/udp_pwrgood_pp_pg/sky130_fd_sc_lp__udp_pwrgood_pp_pg.v" `celldefine module sky130_fd_sc_lp__fah ( COUT, SUM , A , B , CI , VPWR, VGND, VPB , VNB ); // Module ports output COUT; output SUM ; input A ; input B ; input CI ; input VPWR; input VGND; input VPB ; input VNB ; // Local signals wire xor0_out_SUM ; wire pwrgood_pp0_out_SUM ; wire a_b ; wire a_ci ; wire b_ci ; wire or0_out_COUT ; wire pwrgood_pp1_out_COUT; // Name Output Other arguments xor xor0 (xor0_out_SUM , A, B, CI ); sky130_fd_sc_lp__udp_pwrgood_pp$PG pwrgood_pp0 (pwrgood_pp0_out_SUM , xor0_out_SUM, VPWR, VGND); buf buf0 (SUM , pwrgood_pp0_out_SUM ); and and0 (a_b , A, B ); and and1 (a_ci , A, CI ); and and2 (b_ci , B, CI ); or or0 (or0_out_COUT , a_b, a_ci, b_ci ); sky130_fd_sc_lp__udp_pwrgood_pp$PG pwrgood_pp1 (pwrgood_pp1_out_COUT, or0_out_COUT, VPWR, VGND); buf buf1 (COUT , pwrgood_pp1_out_COUT ); endmodule `endcelldefine `default_nettype wire `endif // SKY130_FD_SC_LP__FAH_BEHAVIORAL_PP_V
extern "C" int Initialize(int num_of_cu, int iter); extern "C" int getTotalWavefronts(); extern "C" int ScheduleWavefront(); extern "C" void DescheduleWavefront(int cuid, int wfTag); extern "C" int getCuId(); //extern "C" int getWgId(); //extern "C" int getWfId(); extern "C" int getWfTag(); extern "C" int getWfCnt(); extern "C" int getWfNumThrds(); extern "C" int getVregBase(); extern "C" int getVregSize(); extern "C" int getSregBase(); extern "C" int getSregSize(); extern "C" int getLdsBase(); extern "C" int getLdsSize(); extern "C" int getSetVregs(); extern "C" int getVregKey(int index, int thrd); extern "C" int getVregValue(int index, int thrd); extern "C" int getSetSregs(); extern "C" int getSregKey(int index); extern "C" int getSregValue(int index); extern "C" void setVregValue(int cuid, int thrd, int vreg, int bitnum, int value); extern "C" void setSregValue(int cuid, int sreg, int bitnum, int value); extern "C" int getPC(); module gpu_tb(); parameter NUMOFCU = 1; //parameter NUM_OF_ENTRIES_IMEM = 20; // number of entries to print reg clk; reg rst; reg [15:0] ldssize; reg [9:0] vregsize; reg [8:0] sregsize; reg[31:0] sregVal, vregVal; integer cycle_count; integer killtime; integer clockperiod; integer half_clockperiod; integer deassert_reset; integer m, n; integer x, y, z; integer thrds, setVregs, setSregs; integer sregKey, vregKey; integer cuid; integer a; integer wf_rem, iter, kern; reg [(NUMOFCU-1):0] dispatch2cu_wf_dispatch; reg [3:0] dispatch2cu_wg_wf_count; reg [5:0] dispatch2cu_wf_size_dispatch; reg [8:0] dispatch2cu_sgpr_base_dispatch; reg [9:0] dispatch2cu_vgpr_base_dispatch; reg [14:0] dispatch2cu_wf_tag_dispatch; reg [15:0] dispatch2cu_lds_base_dispatch; reg [31:0] dispatch2cu_start_pc_dispatch; wire [(NUMOFCU - 1):0] mem2lsu_ack, buff2fetchwave_ack; wire [(NUMOFCU*7 - 1):0] mem2lsu_tag_resp; wire [(NUMOFCU*32 - 1):0] buff2wave_instr; wire [(NUMOFCU*39 - 1):0] buff2wave_tag; wire [31:0] mem2lsu_rd_data; wire [NUMOFCU-1:0] cu2dispatch_wf_done, lsu2mem_gm_or_lds, fetch2buff_rd_en, issue2tracemon_barrier_retire_en, issue2tracemon_waitcnt_retire_en, wave2decode_instr_valid, salu2sgpr_instr_done, salu2exec_wr_exec_en, salu2exec_wr_vcc_en, salu2exec_wr_scc_en, salu2exec_wr_scc_value, simd0_2vgpr_instr_done, simd1_2vgpr_instr_done, simd2_2vgpr_instr_done, simd3_2vgpr_instr_done, simd0_2exec_wr_vcc_en, simd0_2vgpr_wr_en, simd1_2exec_wr_vcc_en, simd1_2vgpr_wr_en, simd2_2exec_wr_vcc_en, simd2_2vgpr_wr_en, simd3_2exec_wr_vcc_en, simd3_2vgpr_wr_en, simf0_2vgpr_instr_done, simf1_2vgpr_instr_done, simf2_2vgpr_instr_done, simf3_2vgpr_instr_done, simf0_2exec_wr_vcc_en, simf0_2vgpr_wr_en, simf1_2exec_wr_vcc_en, simf1_2vgpr_wr_en, simf2_2exec_wr_vcc_en, simf2_2vgpr_wr_en, simf3_2exec_wr_vcc_en, simf3_2vgpr_wr_en, simd0_2sgpr_wr_en, simd1_2sgpr_wr_en, simd2_2sgpr_wr_en, simd3_2sgpr_wr_en, simf0_2sgpr_wr_en, simf1_2sgpr_wr_en, simf2_2sgpr_wr_en, simf3_2sgpr_wr_en, lsu2sgpr_instr_done, lsu2vgpr_instr_done, issue2fetchwave_wf_done_en, salu2fetchwaveissue_branch_en, salu2fetchwaveissue_branch_taken, decode2tracemon_colldone, decode2issue_valid, lsu2tracemon_gm_or_lds, fetch2tracemon_dispatch, lsu2tracemon_idle, salu2exec_wr_m0_en, decode2issue_barrier; wire [NUMOFCU*2 - 1:0] salu2tracemon_exec_word_sel, salu2tracemon_vcc_word_sel, salu2sgpr_dest_wr_en; wire [NUMOFCU*4 - 1:0] lsu2sgpr_dest_wr_en; wire lsu2mem_rd_en, lsu2mem_wr_en, lsu2vgpr_dest_wr_en; wire [NUMOFCU*6 - 1:0] issue2tracemon_waitcnt_retire_wfid, wave2decode_wfid, salu2sgpr_instr_done_wfid, simd0_2vgpr_instr_done_wfid, simd1_2vgpr_instr_done_wfid, simd2_2vgpr_instr_done_wfid, simd3_2vgpr_instr_done_wfid, simf0_2vgpr_instr_done_wfid, simf1_2vgpr_instr_done_wfid, simf2_2vgpr_instr_done_wfid, simf3_2vgpr_instr_done_wfid, lsu2sgpr_instr_done_wfid, lsu2vgpr_instr_done_wfid, issue2fetchwave_wf_done_wf_id, salu2fetchwaveissue_branch_wfid, decode2issue_wfid, fetch2tracemon_new_wfid; wire [NUMOFCU*7 - 1:0] lsu2mem_tag_req; wire [NUMOFCU*9 - 1:0] wave2decode_sgpr_base, salu2sgpr_dest_addr, simd0_2sgpr_wr_addr, simd1_2sgpr_wr_addr, simd2_2sgpr_wr_addr, simd3_2sgpr_wr_addr, simf0_2sgpr_wr_addr, simf1_2sgpr_wr_addr, simf2_2sgpr_wr_addr, simf3_2sgpr_wr_addr, lsu2sgpr_dest_addr; wire [NUMOFCU*10 - 1:0] wave2decode_vgpr_base, simd0_2vgpr_dest_addr, simd1_2vgpr_dest_addr, simd2_2vgpr_dest_addr, simd3_2vgpr_dest_addr, simf0_2vgpr_dest_addr, simf1_2vgpr_dest_addr, simf2_2vgpr_dest_addr, simf3_2vgpr_dest_addr, lsu2vgpr_dest_addr; wire [NUMOFCU*15 - 1:0] cu2dispatch_wf_tag_done, fetch2tracemon_wf_tag; wire [NUMOFCU*16 - 1:0] wave2decode_lds_base, rfa2execvgprsgpr_select_fu; wire [NUMOFCU*32 - 1:0] fetch2buff_addr, simd0_2tracemon_retire_pc, simd1_2tracemon_retire_pc, simd2_2tracemon_retire_pc, simd3_2tracemon_retire_pc, simf0_2tracemon_retire_pc, simf1_2tracemon_retire_pc, simf2_2tracemon_retire_pc, simf3_2tracemon_retire_pc, salu2tracemon_retire_pc, lsu2tracemon_retire_pc, issue2tracemon_barrier_retire_pc, issue2tracemon_waitcnt_retire_pc, salu2fetch_branch_pc_value, decode2issue_instr_pc, salu2exec_wr_m0_value; wire [NUMOFCU*39 - 1:0] fetch2buff_tag; wire [NUMOFCU*40 - 1:0] issue2tracemon_barrier_retire_wf_bitmap; wire [NUMOFCU*64 - 1:0] lsu2mem_wr_mask, salu2exec_wr_exec_value, salu2exec_wr_vcc_value, salu2sgpr_dest_data, simd0_2exec_wr_vcc_value, simd0_2vgpr_wr_mask, simd1_2exec_wr_vcc_value, simd1_2vgpr_wr_mask, simd2_2exec_wr_vcc_value, simd2_2vgpr_wr_mask, simd3_2exec_wr_vcc_value, simd3_2vgpr_wr_mask, simf0_2exec_wr_vcc_value, simf0_2vgpr_wr_mask, simf1_2exec_wr_vcc_value, simf1_2vgpr_wr_mask, simf2_2exec_wr_vcc_value, simf2_2vgpr_wr_mask, simf3_2exec_wr_vcc_value, simf3_2vgpr_wr_mask, simd0_2sgpr_wr_data, simd1_2sgpr_wr_data, simd2_2sgpr_wr_data, simd3_2sgpr_wr_data, simf0_2sgpr_wr_data, simf1_2sgpr_wr_data, simf2_2sgpr_wr_data, simf3_2sgpr_wr_data, lsu2vgpr_dest_wr_mask, decode2tracemon_collinstr; wire [NUMOFCU*128 - 1:0] lsu2sgpr_dest_data; wire [NUMOFCU*2048 - 1:0] simd0_2vgpr_dest_data, simd1_2vgpr_dest_data, simd2_2vgpr_dest_data, simd3_2vgpr_dest_data, simf0_2vgpr_dest_data, simf1_2vgpr_dest_data, simf2_2vgpr_dest_data, simf3_2vgpr_dest_data; wire [31:0] lsu2mem_wr_data,lsu2mem_addr; wire [2047:0] lsu2vgpr_dest_data; // signals not a part of compute unit // from memory to tracemon wire [NUMOFCU*4 - 1:0] mem2tracemon_store_en; wire [NUMOFCU*2048 - 1:0] mem2tracemon_addr; wire [NUMOFCU*2048 - 1:0] mem2tracemon_store_data; compute_unit DUT[(NUMOFCU-1):0] ( .dispatch2cu_wf_dispatch(dispatch2cu_wf_dispatch), .dispatch2cu_wf_tag_dispatch(dispatch2cu_wf_tag_dispatch), .dispatch2cu_start_pc_dispatch(dispatch2cu_start_pc_dispatch), .dispatch2cu_vgpr_base_dispatch(dispatch2cu_vgpr_base_dispatch), .dispatch2cu_sgpr_base_dispatch(dispatch2cu_sgpr_base_dispatch), .dispatch2cu_lds_base_dispatch(dispatch2cu_lds_base_dispatch), .dispatch2cu_wf_size_dispatch(dispatch2cu_wf_size_dispatch), .dispatch2cu_wg_wf_count(dispatch2cu_wg_wf_count), .mem2lsu_rd_data(mem2lsu_rd_data), .mem2lsu_tag_resp(mem2lsu_tag_resp), .mem2lsu_ack(mem2lsu_ack), .buff2fetchwave_ack(buff2fetchwave_ack), .buff2wave_instr(buff2wave_instr), .buff2wave_tag(buff2wave_tag), .cu2dispatch_wf_tag_done(cu2dispatch_wf_tag_done), .cu2dispatch_wf_done(cu2dispatch_wf_done), .lsu2mem_rd_en(lsu2mem_rd_en), .lsu2mem_wr_en(lsu2mem_wr_en), .lsu2mem_addr(lsu2mem_addr), .lsu2mem_wr_data(lsu2mem_wr_data), .lsu2mem_tag_req(lsu2mem_tag_req), .lsu2mem_wr_mask(lsu2mem_wr_mask), .lsu2mem_gm_or_lds(lsu2mem_gm_or_lds), .fetch2buff_rd_en(fetch2buff_rd_en), .fetch2buff_addr(fetch2buff_addr), .fetch2buff_tag(fetch2buff_tag), .simd0_2tracemon_retire_pc(simd0_2tracemon_retire_pc), .simd1_2tracemon_retire_pc(simd1_2tracemon_retire_pc), .simd2_2tracemon_retire_pc(simd2_2tracemon_retire_pc), .simd3_2tracemon_retire_pc(simd3_2tracemon_retire_pc), .simf0_2tracemon_retire_pc(simf0_2tracemon_retire_pc), .simf1_2tracemon_retire_pc(simf1_2tracemon_retire_pc), .simf2_2tracemon_retire_pc(simf2_2tracemon_retire_pc), .simf3_2tracemon_retire_pc(simf3_2tracemon_retire_pc), .salu2tracemon_retire_pc(salu2tracemon_retire_pc), .salu2tracemon_exec_word_sel(salu2tracemon_exec_word_sel), .salu2tracemon_vcc_word_sel(salu2tracemon_vcc_word_sel), .lsu2tracemon_retire_pc(lsu2tracemon_retire_pc), //.lsu2tracemon_addr(mem2tracemon_addr), .lsu2tracemon_store_data(mem2tracemon_store_data), .lsu2tracemon_idle(lsu2tracemon_idle), .issue2tracemon_barrier_retire_en(issue2tracemon_barrier_retire_en), .issue2tracemon_barrier_retire_wf_bitmap(issue2tracemon_barrier_retire_wf_bitmap), .issue2tracemon_barrier_retire_pc(issue2tracemon_barrier_retire_pc), .issue2tracemon_waitcnt_retire_en(issue2tracemon_waitcnt_retire_en), .issue2tracemon_waitcnt_retire_wfid(issue2tracemon_waitcnt_retire_wfid), .issue2tracemon_waitcnt_retire_pc(issue2tracemon_waitcnt_retire_pc), .wave2decode_instr_valid(wave2decode_instr_valid), .wave2decode_sgpr_base(wave2decode_sgpr_base), .wave2decode_vgpr_base(wave2decode_vgpr_base), .wave2decode_lds_base(wave2decode_lds_base), .wave2decode_wfid(wave2decode_wfid), .salu2sgpr_instr_done(salu2sgpr_instr_done), .salu2sgpr_instr_done_wfid(salu2sgpr_instr_done_wfid), .salu2exec_wr_exec_en(salu2exec_wr_exec_en), .salu2exec_wr_exec_value(salu2exec_wr_exec_value), .salu2exec_wr_vcc_en(salu2exec_wr_vcc_en), .salu2exec_wr_vcc_value(salu2exec_wr_vcc_value), .salu2exec_wr_scc_en(salu2exec_wr_scc_en), .salu2exec_wr_scc_value(salu2exec_wr_scc_value), .salu2sgpr_dest_wr_en(salu2sgpr_dest_wr_en), .salu2sgpr_dest_addr(salu2sgpr_dest_addr), .salu2sgpr_dest_data(salu2sgpr_dest_data), .simd0_2vgpr_instr_done(simd0_2vgpr_instr_done), .simd0_2vgpr_instr_done_wfid(simd0_2vgpr_instr_done_wfid), .simd1_2vgpr_instr_done(simd1_2vgpr_instr_done), .simd1_2vgpr_instr_done_wfid(simd1_2vgpr_instr_done_wfid), .simd2_2vgpr_instr_done(simd2_2vgpr_instr_done), .simd2_2vgpr_instr_done_wfid(simd2_2vgpr_instr_done_wfid), .simd3_2vgpr_instr_done(simd3_2vgpr_instr_done), .simd3_2vgpr_instr_done_wfid(simd3_2vgpr_instr_done_wfid), .simd0_2exec_wr_vcc_en(simd0_2exec_wr_vcc_en), .simd0_2exec_wr_vcc_value(simd0_2exec_wr_vcc_value), .simd0_2vgpr_wr_en(simd0_2vgpr_wr_en), .simd0_2vgpr_dest_addr(simd0_2vgpr_dest_addr), .simd0_2vgpr_dest_data(simd0_2vgpr_dest_data), .simd0_2vgpr_wr_mask(simd0_2vgpr_wr_mask), .simd1_2exec_wr_vcc_en(simd1_2exec_wr_vcc_en), .simd1_2exec_wr_vcc_value(simd1_2exec_wr_vcc_value), .simd1_2vgpr_wr_en(simd1_2vgpr_wr_en), .simd1_2vgpr_dest_addr(simd1_2vgpr_dest_addr), .simd1_2vgpr_dest_data(simd1_2vgpr_dest_data), .simd1_2vgpr_wr_mask(simd1_2vgpr_wr_mask), .simd2_2exec_wr_vcc_en(simd2_2exec_wr_vcc_en), .simd2_2exec_wr_vcc_value(simd2_2exec_wr_vcc_value), .simd2_2vgpr_wr_en(simd2_2vgpr_wr_en), .simd2_2vgpr_dest_addr(simd2_2vgpr_dest_addr), .simd2_2vgpr_dest_data(simd2_2vgpr_dest_data), .simd2_2vgpr_wr_mask(simd2_2vgpr_wr_mask), .simd3_2exec_wr_vcc_en(simd3_2exec_wr_vcc_en), .simd3_2exec_wr_vcc_value(simd3_2exec_wr_vcc_value), .simd3_2vgpr_wr_en(simd3_2vgpr_wr_en), .simd3_2vgpr_dest_addr(simd3_2vgpr_dest_addr), .simd3_2vgpr_dest_data(simd3_2vgpr_dest_data), .simd3_2vgpr_wr_mask(simd3_2vgpr_wr_mask), .simf0_2vgpr_instr_done(simf0_2vgpr_instr_done), .simf0_2vgpr_instr_done_wfid(simf0_2vgpr_instr_done_wfid), .simf1_2vgpr_instr_done(simf1_2vgpr_instr_done), .simf1_2vgpr_instr_done_wfid(simf1_2vgpr_instr_done_wfid), .simf2_2vgpr_instr_done(simf2_2vgpr_instr_done), .simf2_2vgpr_instr_done_wfid(simf2_2vgpr_instr_done_wfid), .simf3_2vgpr_instr_done(simf3_2vgpr_instr_done), .simf3_2vgpr_instr_done_wfid(simf3_2vgpr_instr_done_wfid), .simf0_2exec_wr_vcc_en(simf0_2exec_wr_vcc_en), .simf0_2exec_wr_vcc_value(simf0_2exec_wr_vcc_value), .simf0_2vgpr_wr_en(simf0_2vgpr_wr_en), .simf0_2vgpr_dest_addr(simf0_2vgpr_dest_addr), .simf0_2vgpr_dest_data(simf0_2vgpr_dest_data), .simf0_2vgpr_wr_mask(simf0_2vgpr_wr_mask), .simf1_2exec_wr_vcc_en(simf1_2exec_wr_vcc_en), .simf1_2exec_wr_vcc_value(simf1_2exec_wr_vcc_value), .simf1_2vgpr_wr_en(simf1_2vgpr_wr_en), .simf1_2vgpr_dest_addr(simf1_2vgpr_dest_addr), .simf1_2vgpr_dest_data(simf1_2vgpr_dest_data), .simf1_2vgpr_wr_mask(simf1_2vgpr_wr_mask), .simf2_2exec_wr_vcc_en(simf2_2exec_wr_vcc_en), .simf2_2exec_wr_vcc_value(simf2_2exec_wr_vcc_value), .simf2_2vgpr_wr_en(simf2_2vgpr_wr_en), .simf2_2vgpr_dest_addr(simf2_2vgpr_dest_addr), .simf2_2vgpr_dest_data(simf2_2vgpr_dest_data), .simf2_2vgpr_wr_mask(simf2_2vgpr_wr_mask), .simf3_2exec_wr_vcc_en(simf3_2exec_wr_vcc_en), .simf3_2exec_wr_vcc_value(simf3_2exec_wr_vcc_value), .simf3_2vgpr_wr_en(simf3_2vgpr_wr_en), .simf3_2vgpr_dest_addr(simf3_2vgpr_dest_addr), .simf3_2vgpr_dest_data(simf3_2vgpr_dest_data), .simf3_2vgpr_wr_mask(simf3_2vgpr_wr_mask), .simd0_2sgpr_wr_addr(simd0_2sgpr_wr_addr), .simd0_2sgpr_wr_en(simd0_2sgpr_wr_en), .simd0_2sgpr_wr_data(simd0_2sgpr_wr_data), .simd1_2sgpr_wr_addr(simd1_2sgpr_wr_addr), .simd1_2sgpr_wr_en(simd1_2sgpr_wr_en), .simd1_2sgpr_wr_data(simd1_2sgpr_wr_data), .simd2_2sgpr_wr_addr(simd2_2sgpr_wr_addr), .simd2_2sgpr_wr_en(simd2_2sgpr_wr_en), .simd2_2sgpr_wr_data(simd2_2sgpr_wr_data), .simd3_2sgpr_wr_addr(simd3_2sgpr_wr_addr), .simd3_2sgpr_wr_en(simd3_2sgpr_wr_en), .simd3_2sgpr_wr_data(simd3_2sgpr_wr_data), .simf0_2sgpr_wr_addr(simf0_2sgpr_wr_addr), .simf0_2sgpr_wr_en(simf0_2sgpr_wr_en), .simf0_2sgpr_wr_data(simf0_2sgpr_wr_data), .simf1_2sgpr_wr_addr(simf1_2sgpr_wr_addr), .simf1_2sgpr_wr_en(simf1_2sgpr_wr_en), .simf1_2sgpr_wr_data(simf1_2sgpr_wr_data), .simf2_2sgpr_wr_addr(simf2_2sgpr_wr_addr), .simf2_2sgpr_wr_en(simf2_2sgpr_wr_en), .simf2_2sgpr_wr_data(simf2_2sgpr_wr_data), .simf3_2sgpr_wr_addr(simf3_2sgpr_wr_addr), .simf3_2sgpr_wr_en(simf3_2sgpr_wr_en), .simf3_2sgpr_wr_data(simf3_2sgpr_wr_data), .lsu2sgpr_instr_done(lsu2sgpr_instr_done), .lsu2sgpr_instr_done_wfid(lsu2sgpr_instr_done_wfid), .lsu2sgpr_dest_wr_en(lsu2sgpr_dest_wr_en), .lsu2sgpr_dest_addr(lsu2sgpr_dest_addr), .lsu2sgpr_dest_data(lsu2sgpr_dest_data), .lsu2vgpr_instr_done(lsu2vgpr_instr_done), .lsu2vgpr_dest_data(lsu2vgpr_dest_data), .lsu2vgpr_dest_addr(lsu2vgpr_dest_addr), .lsu2vgpr_dest_wr_mask(lsu2vgpr_dest_wr_mask), .lsu2vgpr_instr_done_wfid(lsu2vgpr_instr_done_wfid), .lsu2vgpr_dest_wr_en(lsu2vgpr_dest_wr_en), .issue2fetchwave_wf_done_en(issue2fetchwave_wf_done_en), .issue2fetchwave_wf_done_wf_id(issue2fetchwave_wf_done_wf_id), .salu2fetchwaveissue_branch_wfid(salu2fetchwaveissue_branch_wfid), .salu2fetchwaveissue_branch_en(salu2fetchwaveissue_branch_en), .salu2fetchwaveissue_branch_taken(salu2fetchwaveissue_branch_taken), .salu2fetch_branch_pc_value(salu2fetch_branch_pc_value), .rfa2execvgprsgpr_select_fu(rfa2execvgprsgpr_select_fu), .decode2tracemon_collinstr(decode2tracemon_collinstr), .decode2tracemon_colldone(decode2tracemon_colldone), .decode2issue_valid(decode2issue_valid), .decode2issue_instr_pc(decode2issue_instr_pc), .decode2issue_wfid(decode2issue_wfid), .lsu2tracemon_gm_or_lds(lsu2tracemon_gm_or_lds), .fetch2tracemon_dispatch(fetch2tracemon_dispatch), .fetch2tracemon_wf_tag(fetch2tracemon_wf_tag), .fetch2tracemon_new_wfid(fetch2tracemon_new_wfid), .salu2exec_wr_m0_en(salu2exec_wr_m0_en), .salu2exec_wr_m0_value(salu2exec_wr_m0_value), .decode2issue_barrier(decode2issue_barrier), .clk(clk), .rst(rst) ); instr_buffer #(.NUMOFCU(NUMOFCU)) instr_buffer0 ( // Instruction buffer - modeled by the testbench. .clk(clk), .rst(rst), // Inputs .fetch_rd_en(fetch2buff_rd_en), .fetch_addr(fetch2buff_addr), .fetch_tag(fetch2buff_tag), // Outputs .fetchwave_ack(buff2fetchwave_ack), .wave_instr(buff2wave_instr), .wave_tag(buff2wave_tag) ); memory #(.NUMOFCU(NUMOFCU)) memory0 ( // Memory module - will be implemented by the testbench .clk(clk), .rst(rst), // Inputs .gm_or_lds(lsu2mem_gm_or_lds), .rd_en(lsu2mem_rd_en), .wr_en(lsu2mem_wr_en), .addresses(lsu2mem_addr), .wr_data(lsu2mem_wr_data), .input_tag(lsu2mem_tag_req), //.wr_mask(lsu2mem_wr_mask), // Outputs .rd_data(mem2lsu_rd_data), .output_tag(mem2lsu_tag_resp), .ack(mem2lsu_ack) //.tracemon_addr(mem2tracemon_addr), //.tracemon_store_data(mem2tracemon_store_data), //.tracemon_store_en(mem2tracemon_store_en) ); // initial begin // //$monitor("read happened %b", lsu2mem_rd_en); // //$monitor("write happened %b", lsu2mem_wr_en); // //$monitor("retire happened %b", DUT[0].lsu0.mem_ctrl.retire); // //$monitor("sgpr happened %b", DUT[0].lsu0.sgpr_dest_wr_en); // $monitor("sgpr addr %b", DUT[0].lsu0.sgpr_dest_addr); // end initial begin //$monitor("read happened %b", lsu2mem_rd_en); //$monitor("write happened %b", lsu2mem_wr_en); //$monitor("retire happened %b", DUT[0].lsu0.mem_ctrl.retire); //$monitor("sgpr happened %b", DUT[0].lsu0.sgpr_dest_wr_en); //$monitor("sgpr data %h", DUT[0].lsu0.flops_mem_wb.flop_rd_data); //$monitor("sgpr addr %h", DUT[0].lsu2mem_addr); //$monitor("exec addr %h", DUT[0].lsu0.exec_exec_value); //$monitor("sgpr addr %h", DUT[0].lsu0.addr_calc.out_ld_st_addr); //$monitor("sgpr data %h", DUT[0].lsu0.flops_mem_wb.flop_rd_data); end //SAIF flow `ifdef SAIF initial begin $set_gate_level_monitoring("rtl_on", "mda"); $set_toggle_region(gpu_tb.DUT[0]); #0; $toggle_start; end `endif //waveforms initial begin if ($test$plusargs("dump_waveforms")) begin $vcdpluson(0,gpu_tb); if ($test$plusargs("dump_glitches")) begin $vcdplusdeltacycleon; $vcdplusglitchon; end end end genvar tg; generate for (tg=0; tg < NUMOFCU; tg=tg+1) begin : TT tracemon #(.CUID(tg)) tracemon0 ( // Dummy unit to aid testbench .issue2tracemon_barrier_retire_en(issue2tracemon_barrier_retire_en), .issue2tracemon_barrier_retire_wf_bitmap(issue2tracemon_barrier_retire_wf_bitmap), .issue2tracemon_barrier_retire_pc(issue2tracemon_barrier_retire_pc), .issue2tracemon_waitcnt_retire_en(issue2tracemon_waitcnt_retire_en), .issue2tracemon_waitcnt_retire_wfid(issue2tracemon_waitcnt_retire_wfid), .issue2tracemon_waitcnt_retire_pc(issue2tracemon_waitcnt_retire_pc), .simd0_2tracemon_retire_pc(simd0_2tracemon_retire_pc), .simd1_2tracemon_retire_pc(simd1_2tracemon_retire_pc), .simd2_2tracemon_retire_pc(simd2_2tracemon_retire_pc), .simd3_2tracemon_retire_pc(simd3_2tracemon_retire_pc), .simf0_2tracemon_retire_pc(simf0_2tracemon_retire_pc), .simf1_2tracemon_retire_pc(simf1_2tracemon_retire_pc), .simf2_2tracemon_retire_pc(simf2_2tracemon_retire_pc), .simf3_2tracemon_retire_pc(simf3_2tracemon_retire_pc), .lsu2mem_rd_en(lsu2mem_rd_en), .lsu2mem_wr_en(lsu2mem_wr_en), .lsu2tracemon_retire_pc(lsu2tracemon_retire_pc), .salu2tracemon_retire_pc(salu2tracemon_retire_pc), .salu2tracemon_exec_word_sel(salu2tracemon_exec_word_sel), .salu2tracemon_vcc_word_sel(salu2tracemon_vcc_word_sel), .wave2decode_instr_valid(wave2decode_instr_valid), .wave2decode_sgpr_base(wave2decode_sgpr_base), .wave2decode_vgpr_base(wave2decode_vgpr_base), .wave2decode_lds_base(wave2decode_lds_base), .wave2decode_wfid(wave2decode_wfid), .salu2sgpr_instr_done(salu2sgpr_instr_done), .salu2sgpr_instr_done_wfid(salu2sgpr_instr_done_wfid), .salu2exec_wr_exec_en(salu2exec_wr_exec_en), .salu2exec_wr_exec_value(salu2exec_wr_exec_value), .salu2exec_wr_vcc_en(salu2exec_wr_vcc_en), .salu2exec_wr_vcc_value(salu2exec_wr_vcc_value), .salu2exec_wr_scc_en(salu2exec_wr_scc_en), .salu2exec_wr_scc_value(salu2exec_wr_scc_value), .salu2sgpr_dest_wr_en(salu2sgpr_dest_wr_en), .salu2sgpr_dest_addr(salu2sgpr_dest_addr), .salu2sgpr_dest_data(salu2sgpr_dest_data), .salu2fetchwaveissue_branch_wfid(salu2fetchwaveissue_branch_wfid), .salu2fetchwaveissue_branch_en(salu2fetchwaveissue_branch_en), .salu2fetchwaveissue_branch_taken(salu2fetchwaveissue_branch_taken), .salu2fetch_branch_pc_value(salu2fetch_branch_pc_value), .simd0_2vgpr_instr_done(simd0_2vgpr_instr_done), .simd0_2vgpr_instr_done_wfid(simd0_2vgpr_instr_done_wfid), .simd1_2vgpr_instr_done(simd1_2vgpr_instr_done), .simd1_2vgpr_instr_done_wfid(simd1_2vgpr_instr_done_wfid), .simd2_2vgpr_instr_done(simd2_2vgpr_instr_done), .simd2_2vgpr_instr_done_wfid(simd2_2vgpr_instr_done_wfid), .simd3_2vgpr_instr_done(simd3_2vgpr_instr_done), .simd3_2vgpr_instr_done_wfid(simd3_2vgpr_instr_done_wfid), .simd0_2exec_wr_vcc_en(simd0_2exec_wr_vcc_en), .simd0_2exec_wr_vcc_value(simd0_2exec_wr_vcc_value), .simd0_2vgpr_wr_en(simd0_2vgpr_wr_en), .simd0_2vgpr_dest_addr(simd0_2vgpr_dest_addr), .simd0_2vgpr_dest_data(simd0_2vgpr_dest_data), .simd0_2vgpr_wr_mask(simd0_2vgpr_wr_mask), .simd1_2exec_wr_vcc_en(simd1_2exec_wr_vcc_en), .simd1_2exec_wr_vcc_value(simd1_2exec_wr_vcc_value), .simd1_2vgpr_wr_en(simd1_2vgpr_wr_en), .simd1_2vgpr_dest_addr(simd1_2vgpr_dest_addr), .simd1_2vgpr_dest_data(simd1_2vgpr_dest_data), .simd1_2vgpr_wr_mask(simd1_2vgpr_wr_mask), .simd2_2exec_wr_vcc_en(simd2_2exec_wr_vcc_en), .simd2_2exec_wr_vcc_value(simd2_2exec_wr_vcc_value), .simd2_2vgpr_wr_en(simd2_2vgpr_wr_en), .simd2_2vgpr_dest_addr(simd2_2vgpr_dest_addr), .simd2_2vgpr_dest_data(simd2_2vgpr_dest_data), .simd2_2vgpr_wr_mask(simd2_2vgpr_wr_mask), .simd3_2exec_wr_vcc_en(simd3_2exec_wr_vcc_en), .simd3_2exec_wr_vcc_value(simd3_2exec_wr_vcc_value), .simd3_2vgpr_wr_en(simd3_2vgpr_wr_en), .simd3_2vgpr_dest_addr(simd3_2vgpr_dest_addr), .simd3_2vgpr_dest_data(simd3_2vgpr_dest_data), .simd3_2vgpr_wr_mask(simd3_2vgpr_wr_mask), .simf0_2vgpr_instr_done(simf0_2vgpr_instr_done), .simf0_2vgpr_instr_done_wfid(simf0_2vgpr_instr_done_wfid), .simf1_2vgpr_instr_done(simf1_2vgpr_instr_done), .simf1_2vgpr_instr_done_wfid(simf1_2vgpr_instr_done_wfid), .simf2_2vgpr_instr_done(simf2_2vgpr_instr_done), .simf2_2vgpr_instr_done_wfid(simf2_2vgpr_instr_done_wfid), .simf3_2vgpr_instr_done(simf3_2vgpr_instr_done), .simf3_2vgpr_instr_done_wfid(simf3_2vgpr_instr_done_wfid), .simf0_2exec_wr_vcc_en(simf0_2exec_wr_vcc_en), .simf0_2exec_wr_vcc_value(simf0_2exec_wr_vcc_value), .simf0_2vgpr_wr_en(simf0_2vgpr_wr_en), .simf0_2vgpr_dest_addr(simf0_2vgpr_dest_addr), .simf0_2vgpr_dest_data(simf0_2vgpr_dest_data), .simf0_2vgpr_wr_mask(simf0_2vgpr_wr_mask), .simf1_2exec_wr_vcc_en(simf1_2exec_wr_vcc_en), .simf1_2exec_wr_vcc_value(simf1_2exec_wr_vcc_value), .simf1_2vgpr_wr_en(simf1_2vgpr_wr_en), .simf1_2vgpr_dest_addr(simf1_2vgpr_dest_addr), .simf1_2vgpr_dest_data(simf1_2vgpr_dest_data), .simf1_2vgpr_wr_mask(simf1_2vgpr_wr_mask), .simf2_2exec_wr_vcc_en(simf2_2exec_wr_vcc_en), .simf2_2exec_wr_vcc_value(simf2_2exec_wr_vcc_value), .simf2_2vgpr_wr_en(simf2_2vgpr_wr_en), .simf2_2vgpr_dest_addr(simf2_2vgpr_dest_addr), .simf2_2vgpr_dest_data(simf2_2vgpr_dest_data), .simf2_2vgpr_wr_mask(simf2_2vgpr_wr_mask), .simf3_2exec_wr_vcc_en(simf3_2exec_wr_vcc_en), .simf3_2exec_wr_vcc_value(simf3_2exec_wr_vcc_value), .simf3_2vgpr_wr_en(simf3_2vgpr_wr_en), .simf3_2vgpr_dest_addr(simf3_2vgpr_dest_addr), .simf3_2vgpr_dest_data(simf3_2vgpr_dest_data), .simf3_2vgpr_wr_mask(simf3_2vgpr_wr_mask), .simd0_2sgpr_wr_addr(simd0_2sgpr_wr_addr), .simd0_2sgpr_wr_en(simd0_2sgpr_wr_en), .simd0_2sgpr_wr_data(simd0_2sgpr_wr_data), .simd1_2sgpr_wr_addr(simd1_2sgpr_wr_addr), .simd1_2sgpr_wr_en(simd1_2sgpr_wr_en), .simd1_2sgpr_wr_data(simd1_2sgpr_wr_data), .simd2_2sgpr_wr_addr(simd2_2sgpr_wr_addr), .simd2_2sgpr_wr_en(simd2_2sgpr_wr_en), .simd2_2sgpr_wr_data(simd2_2sgpr_wr_data), .simd3_2sgpr_wr_addr(simd3_2sgpr_wr_addr), .simd3_2sgpr_wr_en(simd3_2sgpr_wr_en), .simd3_2sgpr_wr_data(simd3_2sgpr_wr_data), .simf0_2sgpr_wr_addr(simf0_2sgpr_wr_addr), .simf0_2sgpr_wr_en(simf0_2sgpr_wr_en), .simf0_2sgpr_wr_data(simf0_2sgpr_wr_data), .simf1_2sgpr_wr_addr(simf1_2sgpr_wr_addr), .simf1_2sgpr_wr_en(simf1_2sgpr_wr_en), .simf1_2sgpr_wr_data(simf1_2sgpr_wr_data), .simf2_2sgpr_wr_addr(simf2_2sgpr_wr_addr), .simf2_2sgpr_wr_en(simf2_2sgpr_wr_en), .simf2_2sgpr_wr_data(simf2_2sgpr_wr_data), .simf3_2sgpr_wr_addr(simf3_2sgpr_wr_addr), .simf3_2sgpr_wr_en(simf3_2sgpr_wr_en), .simf3_2sgpr_wr_data(simf3_2sgpr_wr_data), .lsu2sgpr_instr_done(lsu2sgpr_instr_done), .lsu2sgpr_instr_done_wfid(lsu2sgpr_instr_done_wfid), .lsu2sgpr_dest_wr_en(lsu2sgpr_dest_wr_en), .lsu2sgpr_dest_addr(lsu2sgpr_dest_addr), .lsu2sgpr_dest_data(lsu2sgpr_dest_data), .lsu2vgpr_instr_done(lsu2vgpr_instr_done), .lsu2vgpr_dest_data(lsu2vgpr_dest_data), .lsu2vgpr_dest_addr(lsu2vgpr_dest_addr), .lsu2vgpr_dest_wr_mask(lsu2vgpr_dest_wr_mask), .lsu2vgpr_instr_done_wfid(lsu2vgpr_instr_done_wfid), .lsu2vgpr_dest_wr_en(lsu2vgpr_dest_wr_en), .issue2fetchwave_wf_done_en(issue2fetchwave_wf_done_en), .issue2fetchwave_wf_done_wf_id(issue2fetchwave_wf_done_wf_id), //.mem2tracemon_addr(mem2tracemon_addr),lsu2mem_addr .mem2tracemon_addr(lsu2mem_addr), .mem2tracemon_store_data(mem2tracemon_store_data), .mem2tracemon_store_en(mem2tracemon_store_en), .decode2tracemon_collinstr(decode2tracemon_collinstr), .decode2tracemon_colldone(decode2tracemon_colldone), .decode2issue_instr_pc(decode2issue_instr_pc), .decode2issue_valid(decode2issue_valid), .decode2issue_wfid(decode2issue_wfid), .rfa2execvgprsgpr_select_fu(rfa2execvgprsgpr_select_fu), .lsu2tracemon_gm_or_lds(lsu2tracemon_gm_or_lds), .lsu2tracemon_idle(lsu2tracemon_idle), .fetch2tracemon_dispatch(fetch2tracemon_dispatch), .fetch2tracemon_wf_tag(fetch2tracemon_wf_tag), .fetch2tracemon_new_wfid(fetch2tracemon_new_wfid), .salu2exec_wr_m0_en(salu2exec_wr_m0_en), .salu2exec_wr_m0_value(salu2exec_wr_m0_value), .decode2issue_barrier(decode2issue_barrier), .clk(clk), .rst(rst), .kernel_id(iter-1) ); end endgenerate //genvar pg; //generate // for (pg=0; pg < NUMOFCU; pg=pg+1) begin : PT // profiler #(.CUID(pg)) profiler0 ( // // unit to aid in profiling // .salu2sgpr_instr_done(salu2sgpr_instr_done), // .salu2fetchwaveissue_branch_en(salu2fetchwaveissue_branch_en), // .simd0_2vgpr_instr_done(DUT[pg].simd0_2rfa_queue_entry_valid), // .simd1_2vgpr_instr_done(DUT[pg].simd1_2rfa_queue_entry_valid), // .simd2_2vgpr_instr_done(DUT[pg].simd2_2rfa_queue_entry_valid), // .simd3_2vgpr_instr_done(DUT[pg].simd3_2rfa_queue_entry_valid), // .simf0_2vgpr_instr_done(DUT[pg].simf0_2rfa_queue_entry_valid), // .simf1_2vgpr_instr_done(DUT[pg].simf1_2rfa_queue_entry_valid), // .simf2_2vgpr_instr_done(DUT[pg].simf2_2rfa_queue_entry_valid), // .simf3_2vgpr_instr_done(DUT[pg].simf3_2rfa_queue_entry_valid), // .rfa2execvgprsgpr_select_fu(rfa2execvgprsgpr_select_fu), // .lsu2vgpr_instr_done(lsu2vgpr_instr_done), // .lsu2sgpr_instr_done(lsu2sgpr_instr_done), // .salu_alu_select(DUT[pg].issue2salu_alu_select), // .simd0_alu_select(DUT[pg].issue2simd0_alu_select), // .simd1_alu_select(DUT[pg].issue2simd1_alu_select), // .simd2_alu_select(DUT[pg].issue2simd2_alu_select), // .simd3_alu_select(DUT[pg].issue2simd3_alu_select), // .simf0_alu_select(DUT[pg].issue2simf0_alu_select), // .simf1_alu_select(DUT[pg].issue2simf1_alu_select), // .simf2_alu_select(DUT[pg].issue2simf2_alu_select), // .simf3_alu_select(DUT[pg].issue2simf3_alu_select), // .lsu_select(DUT[pg].issue2lsu_lsu_select), // .clk(clk) // ); // end //endgenerate initial begin $display("Starting"); cycle_count = 0; //instr_count = 0; end initial begin clk = 0; while (1) begin `ifdef GATES $value$plusargs("CLOCKPERIOD=%d",clockperiod); half_clockperiod = clockperiod / 2; deassert_reset = (clockperiod * 12) + half_clockperiod + (half_clockperiod / 2); #half_clockperiod; if(clk == 1'b0) begin $display("GATES MONITOR %m : Posedge of CLK at time %t", $time); end `else #2; //Period is 4 clock ticks or 4ns for rtl `endif clk = ~clk; end end initial begin rst = 1; `ifdef GATES #1; #(deassert_reset-1); `else #51; //Period is 4 clock ticks; So reset is deasserted after 12.75 clock periods `endif rst = 0; end initial begin iter = 0; wf_rem = 0; // maximum simulation time $value$plusargs("KILLTIME=%d",killtime); $display("gpu_tb.v: Setting simulation time limit of #%d", killtime); #killtime; $display("gpu_tb.v: Simulation terminated. Maximum simulation time of #%d reached!", killtime); terminate(); end always @(posedge clk) begin if (wf_rem <= 0) begin $display ("--------------------------------------"); $display("Initializing kernel: %d", iter); $display ("--------------------------------------"); kern = Initialize(NUMOFCU, iter); if (kern <= 0) terminate(); #0; wf_rem = getTotalWavefronts(); $display ("--------------------------------------"); $display("Number of wavefronts: %d", wf_rem); $display ("--------------------------------------"); $readmemh("instr.mem", instr_buffer0.instr_memory); $readmemh("data.mem", memory0.data_memory); iter = iter + 1; end end always @ (posedge clk) begin if (rst) begin // check <= 1'b0; dispatch2cu_wf_dispatch <= 'b0; end end always @ (posedge clk) begin cycle_count = cycle_count + 1; if (!rst) begin if (ScheduleWavefront()==1'b1) begin #1 thrds = getWfNumThrds(); setVregs = getSetVregs(); setSregs = getSetSregs(); cuid = getCuId(); // set vregs for (x = 0; x < setVregs; x++) begin vregKey = getVregKey(x, 0); for (y = 0; y < thrds; y++) begin vregVal = getVregValue(x, y); // set the vregister for(a = 0; a < 32; a++) begin setVregValue(cuid, y, vregKey, a, vregVal[a]); //DUT[cuid].vgpr0.reg_file.bank[y].word[vregKey].bits[a].dff_0.state = vregVal[a]; end end end // set sregs for (z = 0; z < setSregs; z++) begin sregKey = getSregKey(z); sregVal = getSregValue(z); // set the sregister for(a = 0; a < 32; a++) begin setSregValue(cuid, sregKey, a, sregVal[a]); //DUT[cuid].sgpr0.sgpr_reg_file.word[sregKey].bits[a].dff_0.state = sregVal[a]; end end dispatch2cu_vgpr_base_dispatch <= getVregBase(); dispatch2cu_sgpr_base_dispatch <= getSregBase(); dispatch2cu_lds_base_dispatch <= getLdsBase(); vregsize <= getVregSize(); sregsize <= getSregSize(); ldssize <= getLdsSize(); dispatch2cu_start_pc_dispatch <= getPC(); dispatch2cu_wf_size_dispatch <= getWfNumThrds() - 1; dispatch2cu_wf_tag_dispatch <= getWfTag(); dispatch2cu_wg_wf_count <= getWfCnt(); for (m = 0; m < NUMOFCU; m++) begin // $display("CUID: %d",getCuId()); if(m==getCuId()) dispatch2cu_wf_dispatch[m] <= 1'b1; else dispatch2cu_wf_dispatch[m] <= 1'b0; // $display("m: %d dispatch2cu_wf_dispatch: %d",m,dispatch2cu_wf_dispatch[m]); end end else begin for ( m = 0; m < NUMOFCU; m++) begin dispatch2cu_vgpr_base_dispatch <= 10'bx; dispatch2cu_sgpr_base_dispatch <= 9'bx; dispatch2cu_lds_base_dispatch <= 16'bx; vregsize <= 10'bx; sregsize <= 9'bx; ldssize <= 16'bx; dispatch2cu_start_pc_dispatch <= 32'bx; dispatch2cu_wf_size_dispatch <= 6'bx; dispatch2cu_wf_tag_dispatch <= 11'bx; dispatch2cu_wf_dispatch[m] <= 1'b0; end end if(|{dispatch2cu_wf_dispatch, cu2dispatch_wf_done}) $display ("--------------------------------------"); for(n=0; n<NUMOFCU; n++) begin if(|{dispatch2cu_wf_dispatch[n], cu2dispatch_wf_done[n]}) $display ("Time: %g CU: %d Dispatch: %b cu2dispatch_wf_done: %b", $time, n, dispatch2cu_wf_dispatch[n], cu2dispatch_wf_done[n]); end if(|dispatch2cu_wf_dispatch) begin $display ("VGPR_Size value: %d", vregsize); $display ("SREG_Size value: %d", sregsize); $display ("LDS_Size value: %d", ldssize); $display ("PC value: %d", dispatch2cu_start_pc_dispatch); $display ("WFID: %d", dispatch2cu_wf_tag_dispatch); end end end always @ (posedge clk) begin for(n=0; n<NUMOFCU; n++) begin if (cu2dispatch_wf_done[n]) begin DescheduleWavefront(n, cu2dispatch_wf_tag_done[((n * 15) + 14)-:15]); // cuid $display("Descheduled WFID: %d from CU: %d", cu2dispatch_wf_tag_done[((n * 15) + 14)-:15], n); $display ("--------------------------------------"); wf_rem = wf_rem - 1; $display("Wavefronts remaining : %d", wf_rem); end end end //fault_injection fault_injector(.clk(clk)); integer loop; task terminate; begin `ifdef SAIF $toggle_stop; $toggle_report("backward.saif",1.0e-9,"gpu_tb.DUT[0]"); `endif // for(loop = 0; loop<1000; loop=loop+1) begin // $display("tracemon my %d: %h",loop, memory0.data_memory[loop]); // end $finish; end endtask endmodule
/* Copyright (c) 2017 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 1ns / 1ps /* * Wishbone DRP shim */ module wb_drp # ( parameter ADDR_WIDTH = 16 ) ( input wire clk, input wire rst, /* * Wishbone interface */ input wire [ADDR_WIDTH-1:0] wb_adr_i, // ADR_I() address input wire [15:0] wb_dat_i, // DAT_I() data in output wire [15:0] wb_dat_o, // DAT_O() data out input wire wb_we_i, // WE_I write enable input input wire wb_stb_i, // STB_I strobe input output wire wb_ack_o, // ACK_O acknowledge output input wire wb_cyc_i, // CYC_I cycle input /* * DRP interface */ output wire [ADDR_WIDTH-1:0] drp_addr, output wire [15:0] drp_do, input wire [15:0] drp_di, output wire drp_en, output wire drp_we, input wire drp_rdy ); reg cycle = 1'b0; assign drp_addr = wb_adr_i; assign drp_do = wb_dat_i; assign wb_dat_o = drp_di; assign drp_en = wb_cyc_i & wb_stb_i & ~cycle; assign drp_we = wb_cyc_i & wb_stb_i & wb_we_i & ~cycle; assign wb_ack_o = drp_rdy; always @(posedge clk) begin cycle <= wb_cyc_i & wb_stb_i & ~drp_rdy; if (rst) begin cycle <= 1'b0; end end endmodule
/* * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ `ifndef SKY130_FD_SC_LP__BUSDRIVERNOVLP2_BEHAVIORAL_PP_V `define SKY130_FD_SC_LP__BUSDRIVERNOVLP2_BEHAVIORAL_PP_V /** * busdrivernovlp2: Bus driver, enable gates pulldown only (pmos * devices). * * Verilog simulation functional model. */ `timescale 1ns / 1ps `default_nettype none // Import user defined primitives. `include "../../models/udp_pwrgood_pp_pg/sky130_fd_sc_lp__udp_pwrgood_pp_pg.v" `celldefine module sky130_fd_sc_lp__busdrivernovlp2 ( Z , A , TE_B, VPWR, VGND, VPB , VNB ); // Module ports output Z ; input A ; input TE_B; input VPWR; input VGND; input VPB ; input VNB ; // Local signals wire pwrgood_pp0_out_A ; wire pwrgood_pp1_out_teb; // Name Output Other arguments sky130_fd_sc_lp__udp_pwrgood_pp$PG pwrgood_pp0 (pwrgood_pp0_out_A , A, VPWR, VGND ); sky130_fd_sc_lp__udp_pwrgood_pp$PG pwrgood_pp1 (pwrgood_pp1_out_teb, TE_B, VPWR, VGND ); bufif0 bufif00 (Z , pwrgood_pp0_out_A, pwrgood_pp1_out_teb); endmodule `endcelldefine `default_nettype wire `endif // SKY130_FD_SC_LP__BUSDRIVERNOVLP2_BEHAVIORAL_PP_V
/* * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ `ifndef SKY130_FD_SC_LP__TAPVGND_FUNCTIONAL_PP_V `define SKY130_FD_SC_LP__TAPVGND_FUNCTIONAL_PP_V /** * tapvgnd: Tap cell with tap to ground, isolated power connection 1 * row down. * * Verilog simulation functional model. */ `timescale 1ns / 1ps `default_nettype none `celldefine module sky130_fd_sc_lp__tapvgnd ( VPWR, VGND, VPB , VNB ); // Module ports input VPWR; input VGND; input VPB ; input VNB ; // No contents. endmodule `endcelldefine `default_nettype wire `endif // SKY130_FD_SC_LP__TAPVGND_FUNCTIONAL_PP_V
/* * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ `ifndef SKY130_FD_SC_HVL__NOR2_BEHAVIORAL_V `define SKY130_FD_SC_HVL__NOR2_BEHAVIORAL_V /** * nor2: 2-input NOR. * * Verilog simulation functional model. */ `timescale 1ns / 1ps `default_nettype none `celldefine module sky130_fd_sc_hvl__nor2 ( Y, A, B ); // Module ports output Y; input A; input B; // Module supplies supply1 VPWR; supply0 VGND; supply1 VPB ; supply0 VNB ; // Local signals wire nor0_out_Y; // Name Output Other arguments nor nor0 (nor0_out_Y, A, B ); buf buf0 (Y , nor0_out_Y ); endmodule `endcelldefine `default_nettype wire `endif // SKY130_FD_SC_HVL__NOR2_BEHAVIORAL_V
/* * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ `ifndef SKY130_FD_SC_HVL__NAND2_BEHAVIORAL_PP_V `define SKY130_FD_SC_HVL__NAND2_BEHAVIORAL_PP_V /** * nand2: 2-input NAND. * * Verilog simulation functional model. */ `timescale 1ns / 1ps `default_nettype none // Import user defined primitives. `include "../../models/udp_pwrgood_pp_pg/sky130_fd_sc_hvl__udp_pwrgood_pp_pg.v" `celldefine module sky130_fd_sc_hvl__nand2 ( Y , A , B , VPWR, VGND, VPB , VNB ); // Module ports output Y ; input A ; input B ; input VPWR; input VGND; input VPB ; input VNB ; // Local signals wire nand0_out_Y ; wire pwrgood_pp0_out_Y; // Name Output Other arguments nand nand0 (nand0_out_Y , B, A ); sky130_fd_sc_hvl__udp_pwrgood_pp$PG pwrgood_pp0 (pwrgood_pp0_out_Y, nand0_out_Y, VPWR, VGND); buf buf0 (Y , pwrgood_pp0_out_Y ); endmodule `endcelldefine `default_nettype wire `endif // SKY130_FD_SC_HVL__NAND2_BEHAVIORAL_PP_V
// Copyright 1986-2016 Xilinx, Inc. All Rights Reserved. // -------------------------------------------------------------------------------- // Tool Version: Vivado v.2016.3 (win64) Build 1682563 Mon Oct 10 19:07:27 MDT 2016 // Date : Wed Nov 01 12:03:22 2017 // Host : vldmr-PC running 64-bit Service Pack 1 (build 7601) // Command : write_verilog -force -mode synth_stub -rename_top decalper_eb_ot_sdeen_pot_pi_dehcac_xnilix -prefix // decalper_eb_ot_sdeen_pot_pi_dehcac_xnilix_ dbg_ila_stub.v // Design : dbg_ila // Purpose : Stub declaration of top-level module interface // Device : xc7k325tffg676-1 // -------------------------------------------------------------------------------- // This empty module with port declaration file causes synthesis tools to infer a black box for IP. // The synthesis directives are for Synopsys Synplify support to prevent IO buffer insertion. // Please paste the declaration into a Verilog source file or add the file as an additional source. (* X_CORE_INFO = "ila,Vivado 2016.3" *) module decalper_eb_ot_sdeen_pot_pi_dehcac_xnilix(clk, probe0, probe1, probe2, probe3, probe4, probe5, probe6, probe7, probe8, probe9, probe10, probe11, probe12, probe13, probe14, probe15, probe16, probe17, probe18, probe19, probe20, probe21, probe22, probe23, probe24, probe25, probe26, probe27, probe28, probe29, probe30) /* synthesis syn_black_box black_box_pad_pin="clk,probe0[63:0],probe1[63:0],probe2[0:0],probe3[0:0],probe4[0:0],probe5[0:0],probe6[0:0],probe7[63:0],probe8[0:0],probe9[0:0],probe10[0:0],probe11[0:0],probe12[63:0],probe13[0:0],probe14[0:0],probe15[0:0],probe16[0:0],probe17[0:0],probe18[0:0],probe19[8:0],probe20[7:0],probe21[2:0],probe22[2:0],probe23[0:0],probe24[0:0],probe25[7:0],probe26[3:0],probe27[0:0],probe28[0:0],probe29[0:0],probe30[7:0]" */; input clk; input [63:0]probe0; input [63:0]probe1; input [0:0]probe2; input [0:0]probe3; input [0:0]probe4; input [0:0]probe5; input [0:0]probe6; input [63:0]probe7; input [0:0]probe8; input [0:0]probe9; input [0:0]probe10; input [0:0]probe11; input [63:0]probe12; input [0:0]probe13; input [0:0]probe14; input [0:0]probe15; input [0:0]probe16; input [0:0]probe17; input [0:0]probe18; input [8:0]probe19; input [7:0]probe20; input [2:0]probe21; input [2:0]probe22; input [0:0]probe23; input [0:0]probe24; input [7:0]probe25; input [3:0]probe26; input [0:0]probe27; input [0:0]probe28; input [0:0]probe29; input [7:0]probe30; endmodule
// megafunction wizard: %ROM: 1-PORT% // GENERATION: STANDARD // VERSION: WM1.0 // MODULE: altsyncram // ============================================================ // File Name: biossd.v // Megafunction Name(s): // altsyncram // // Simulation Library Files(s): // altera_mf // ============================================================ // ************************************************************ // THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE! // // 9.1 Build 350 03/24/2010 SP 2 SJ Web Edition // ************************************************************ //Copyright (C) 1991-2010 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 from 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 biossd ( address, clock, q); input [11:0] address; input clock; output [7:0] q; `ifndef ALTERA_RESERVED_QIS // synopsys translate_off `endif tri1 clock; `ifndef ALTERA_RESERVED_QIS // synopsys translate_on `endif wire [7:0] sub_wire0; wire [7:0] q = sub_wire0[7:0]; altsyncram altsyncram_component ( .clock0 (clock), .address_a (address), .q_a (sub_wire0), .aclr0 (1'b0), .aclr1 (1'b0), .address_b (1'b1), .addressstall_a (1'b0), .addressstall_b (1'b0), .byteena_a (1'b1), .byteena_b (1'b1), .clock1 (1'b1), .clocken0 (1'b1), .clocken1 (1'b1), .clocken2 (1'b1), .clocken3 (1'b1), .data_a ({8{1'b1}}), .data_b (1'b1), .eccstatus (), .q_b (), .rden_a (1'b1), .rden_b (1'b1), .wren_a (1'b0), .wren_b (1'b0)); defparam altsyncram_component.clock_enable_input_a = "BYPASS", altsyncram_component.clock_enable_output_a = "BYPASS", `ifdef NO_PLI altsyncram_component.init_file = "./src/rom/biossd.rif" `else altsyncram_component.init_file = "./src/rom/biossd.hex" `endif , altsyncram_component.intended_device_family = "Cyclone II", altsyncram_component.lpm_hint = "ENABLE_RUNTIME_MOD=NO", altsyncram_component.lpm_type = "altsyncram", altsyncram_component.numwords_a = 4096, altsyncram_component.operation_mode = "ROM", altsyncram_component.outdata_aclr_a = "NONE", altsyncram_component.outdata_reg_a = "UNREGISTERED", altsyncram_component.widthad_a = 12, altsyncram_component.width_a = 8, altsyncram_component.width_byteena_a = 1; endmodule // ============================================================ // CNX file retrieval info // ============================================================ // Retrieval info: PRIVATE: ADDRESSSTALL_A NUMERIC "0" // Retrieval info: PRIVATE: AclrAddr NUMERIC "0" // Retrieval info: PRIVATE: AclrByte NUMERIC "0" // Retrieval info: PRIVATE: AclrOutput NUMERIC "0" // Retrieval info: PRIVATE: BYTE_ENABLE NUMERIC "0" // Retrieval info: PRIVATE: BYTE_SIZE NUMERIC "8" // Retrieval info: PRIVATE: BlankMemory NUMERIC "0" // Retrieval info: PRIVATE: CLOCK_ENABLE_INPUT_A NUMERIC "0" // Retrieval info: PRIVATE: CLOCK_ENABLE_OUTPUT_A NUMERIC "0" // Retrieval info: PRIVATE: Clken NUMERIC "0" // Retrieval info: PRIVATE: IMPLEMENT_IN_LES NUMERIC "0" // Retrieval info: PRIVATE: INIT_FILE_LAYOUT STRING "PORT_A" // Retrieval info: PRIVATE: INIT_TO_SIM_X NUMERIC "0" // Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone II" // Retrieval info: PRIVATE: JTAG_ENABLED NUMERIC "0" // Retrieval info: PRIVATE: JTAG_ID STRING "NONE" // Retrieval info: PRIVATE: MAXIMUM_DEPTH NUMERIC "0" // Retrieval info: PRIVATE: MIFfilename STRING "./src/rom/biossd.hex" // Retrieval info: PRIVATE: NUMWORDS_A NUMERIC "4096" // Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0" // Retrieval info: PRIVATE: RegAddr NUMERIC "1" // Retrieval info: PRIVATE: RegOutput NUMERIC "0" // Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0" // Retrieval info: PRIVATE: SingleClock NUMERIC "1" // Retrieval info: PRIVATE: UseDQRAM NUMERIC "0" // Retrieval info: PRIVATE: WidthAddr NUMERIC "12" // Retrieval info: PRIVATE: WidthData NUMERIC "8" // Retrieval info: PRIVATE: rden NUMERIC "0" // Retrieval info: CONSTANT: CLOCK_ENABLE_INPUT_A STRING "BYPASS" // Retrieval info: CONSTANT: CLOCK_ENABLE_OUTPUT_A STRING "BYPASS" // Retrieval info: CONSTANT: INIT_FILE STRING "./src/rom/biossd.hex" // Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone II" // Retrieval info: CONSTANT: LPM_HINT STRING "ENABLE_RUNTIME_MOD=NO" // Retrieval info: CONSTANT: LPM_TYPE STRING "altsyncram" // Retrieval info: CONSTANT: NUMWORDS_A NUMERIC "4096" // Retrieval info: CONSTANT: OPERATION_MODE STRING "ROM" // Retrieval info: CONSTANT: OUTDATA_ACLR_A STRING "NONE" // Retrieval info: CONSTANT: OUTDATA_REG_A STRING "UNREGISTERED" // Retrieval info: CONSTANT: WIDTHAD_A NUMERIC "12" // Retrieval info: CONSTANT: WIDTH_A NUMERIC "8" // Retrieval info: CONSTANT: WIDTH_BYTEENA_A NUMERIC "1" // Retrieval info: USED_PORT: address 0 0 12 0 INPUT NODEFVAL address[11..0] // Retrieval info: USED_PORT: clock 0 0 0 0 INPUT VCC clock // Retrieval info: USED_PORT: q 0 0 8 0 OUTPUT NODEFVAL q[7..0] // Retrieval info: CONNECT: @address_a 0 0 12 0 address 0 0 12 0 // Retrieval info: CONNECT: q 0 0 8 0 @q_a 0 0 8 0 // Retrieval info: CONNECT: @clock0 0 0 0 0 clock 0 0 0 0 // Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all // Retrieval info: GEN_FILE: TYPE_NORMAL biossd.v TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL biossd.inc FALSE // Retrieval info: GEN_FILE: TYPE_NORMAL biossd.cmp FALSE // Retrieval info: GEN_FILE: TYPE_NORMAL biossd.bsf TRUE FALSE // Retrieval info: GEN_FILE: TYPE_NORMAL biossd_inst.v FALSE // Retrieval info: GEN_FILE: TYPE_NORMAL biossd_bb.v FALSE // Retrieval info: GEN_FILE: TYPE_NORMAL biossd_waveforms.html FALSE // Retrieval info: GEN_FILE: TYPE_NORMAL biossd_wave*.jpg FALSE // Retrieval info: LIB_FILE: altera_mf
/* * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ `ifndef SKY130_FD_SC_HS__CLKDLYINV3SD3_FUNCTIONAL_V `define SKY130_FD_SC_HS__CLKDLYINV3SD3_FUNCTIONAL_V /** * clkdlyinv3sd3: Clock Delay Inverter 3-stage 0.50um length inner * stage gate. * * Verilog simulation functional model. */ `timescale 1ns / 1ps `default_nettype none // Import sub cells. `include "../u_vpwr_vgnd/sky130_fd_sc_hs__u_vpwr_vgnd.v" `celldefine module sky130_fd_sc_hs__clkdlyinv3sd3 ( Y , A , VPWR, VGND ); // Module ports output Y ; input A ; input VPWR; input VGND; // Local signals wire not0_out_Y ; wire u_vpwr_vgnd0_out_Y; // Name Output Other arguments not not0 (not0_out_Y , A ); sky130_fd_sc_hs__u_vpwr_vgnd u_vpwr_vgnd0 (u_vpwr_vgnd0_out_Y, not0_out_Y, VPWR, VGND); buf buf0 (Y , u_vpwr_vgnd0_out_Y ); endmodule `endcelldefine `default_nettype wire `endif // SKY130_FD_SC_HS__CLKDLYINV3SD3_FUNCTIONAL_V
/* * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ `ifndef SKY130_FD_SC_HD__LPFLOW_INPUTISOLATCH_FUNCTIONAL_V `define SKY130_FD_SC_HD__LPFLOW_INPUTISOLATCH_FUNCTIONAL_V /** * lpflow_inputisolatch: Latching input isolator with inverted enable. * * Verilog simulation functional model. */ `timescale 1ns / 1ps `default_nettype none // Import user defined primitives. `include "../../models/udp_dlatch_lp/sky130_fd_sc_hd__udp_dlatch_lp.v" `celldefine module sky130_fd_sc_hd__lpflow_inputisolatch ( Q , D , SLEEP_B ); // Module ports output Q ; input D ; input SLEEP_B; // Local signals wire buf_Q; // Name Output Other arguments sky130_fd_sc_hd__udp_dlatch$lP dlatch0 (buf_Q , D, SLEEP_B ); buf buf0 (Q , buf_Q ); endmodule `endcelldefine `default_nettype wire `endif // SKY130_FD_SC_HD__LPFLOW_INPUTISOLATCH_FUNCTIONAL_V
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ `ifndef SKY130_FD_SC_MS__SDLCLKP_SYMBOL_V `define SKY130_FD_SC_MS__SDLCLKP_SYMBOL_V /** * sdlclkp: Scan gated clock. * * Verilog stub (without power pins) for graphical symbol definition * generation. * * WARNING: This file is autogenerated, do not modify directly! */ `timescale 1ns / 1ps `default_nettype none (* blackbox *) module sky130_fd_sc_ms__sdlclkp ( //# {{scanchain|Scan Chain}} input SCE , //# {{clocks|Clocking}} input CLK , input GATE, output GCLK ); // Voltage supply signals supply1 VPWR; supply0 VGND; supply1 VPB ; supply0 VNB ; endmodule `default_nettype wire `endif // SKY130_FD_SC_MS__SDLCLKP_SYMBOL_V
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ `ifndef SKY130_FD_SC_LP__DFRTP_SYMBOL_V `define SKY130_FD_SC_LP__DFRTP_SYMBOL_V /** * dfrtp: Delay flop, inverted reset, single output. * * Verilog stub (without power pins) for graphical symbol definition * generation. * * WARNING: This file is autogenerated, do not modify directly! */ `timescale 1ns / 1ps `default_nettype none (* blackbox *) module sky130_fd_sc_lp__dfrtp ( //# {{data|Data Signals}} input D , output Q , //# {{control|Control Signals}} input RESET_B, //# {{clocks|Clocking}} input CLK ); // Voltage supply signals supply1 VPWR; supply0 VGND; supply1 VPB ; supply0 VNB ; endmodule `default_nettype wire `endif // SKY130_FD_SC_LP__DFRTP_SYMBOL_V
/*********************************************************************** AVR ATtX5 CPU for Lattuino This file is part FPGA Libre project http://fpgalibre.sf.net/ Description: This module implements the CPU for Lattuino (iCE40HX4K Lattice FPGA available in the Kéfir I board). To Do: - Author: - Salvador E. Tropea, salvador inti.gob.ar ------------------------------------------------------------------------------ Copyright (c) 2008-2017 Salvador E. Tropea <salvador inti.gob.ar> Copyright (c) 2008-2017 Instituto Nacional de Tecnología Industrial Distributed under the GPL v2 or newer license ------------------------------------------------------------------------------ Design unit: Lattuino_1 File name: lattuino_1.v Note: None Limitations: None known Errors: None known Library: work Dependencies: IEEE.std_logic_1164 avr.Micros miniuart.UART CapSense.Devices work.WBDevInterconPkg work.CPUConfig lattice.components Target FPGA: iCE40HX4K-TQ144 Language: Verilog Wishbone: None Synthesis tools: Lattice iCECube2 2016.02.27810 Simulation tools: GHDL [Sokcho edition] (0.2x) Text editor: SETEdit 0.5.x ***********************************************************************/ module Lattuino_1 ( input CLK, // CPU clock input RESET_P2, // Reset // Buil-in LEDs output LED1, output LED2, output LED3, output LED4, // CapSense buttons inout BTN1, inout BTN2, inout BTN3, inout BTN4, // Arduino UNO I/O inout ARDU00, inout ARDU01, inout ARDU02, inout ARDU03, inout ARDU04, inout ARDU05, inout ARDU06, inout ARDU07, inout ARDU08, inout ARDU09, inout ARDU10, // SS inout ARDU11, // MOSI inout ARDU12, // MISO inout ARDU13, // SCK // A/D Interface output AD_CS, output AD_Din, input AD_Dout, output AD_Clk, // SPI memory output SS_B, output SDO, input SDI, output SCK, // ISP SPI //input ISP_RESET; output ISP_SCK, output ISP_MOSI, input ISP_MISO, // UART output Milk_RXD, // to UART Tx input Milk_TXD, // to UART Rx input Milk_DTR); // UART DTR `include "cpuconfig.v" localparam integer BRDIVISOR=F_CLK/BAUD_RATE/4.0+0.5; localparam integer CNT_PRESC=F_CLK/1e6; // Counter prescaler (1 µs) localparam EXPLICIT_TBUF=0; // Manually instantiate tri-state buffers (old yosys+arachne) localparam DEBUG_SPI=0; localparam DEBUG_INT=0; wire [15:0] pc; // PROM address wire [ROM_ADDR_W-1:0] pcsv; // PROM address wire [15:0] inst; // PROM data wire [15:0] inst_w; // PROM data wire we; wire rst; wire rst1; reg rst2=0; wire [6:0] portb_in; wire [6:0] portb_out; wire [6:0] portb_oe; wire [7:0] portd_in; wire [7:0] portd_out; wire [7:0] portd_oe; wire [3:0] btns; // Capsense buttons wire discharge; wire rst_btn; wire [1:0] pin_irq; // Pin interrupts INT0/1 wire [2:0] dev_irq; // Device interrupts wire [2:0] dev_ack; // Device ACK // WISHBONE signals: // cpu wire [7:0] cpu_dati; wire cpu_acki; wire [7:0] cpu_dato; wire cpu_weo; wire [7:0] cpu_adro; wire cpu_cyco; wire cpu_stbo; // rs2 wire [7:0] rs2_dato; wire rs2_acko; wire [7:0] rs2_dati; wire rs2_wei; wire [0:0] rs2_adri; wire rs2_stbi; // ad wire [7:0] ad_dato; wire ad_acko; wire [7:0] ad_dati; wire ad_wei; wire [0:0] ad_adri; wire ad_stbi; // tmr wire [7:0] tmr_dato; wire tmr_acko; wire [7:0] tmr_dati; wire tmr_wei; wire [2:0] tmr_adri; wire tmr_stbi; // t16 wire [7:0] t16_dato; wire t16_acko; wire [7:0] t16_dati; wire t16_wei; wire [0:0] t16_adri; wire t16_stbi; wire [5:0] pwm; wire [5:0] pwm_ena; wire t16_irq; wire t16_ack; wire inttx; wire intrx; reg dtr_r; wire dtr_reset; // SPI wire spi_sck; wire mosi; wire miso; wire spi_ena; // The CPU enabled the SPI pins // PLL wire clk_spi; // SPI core clock wire clk_sys; // CPU clock wire pll_lock; /////////////////////////////////////////////////////////// // RESET logic -- // Power-On Reset + External pin + CapSense 4 + UART DTR -- /////////////////////////////////////////////////////////// assign rst1=!RESET_P2; assign rst=rst1 | ~rst2 | rst_btn | dtr_reset; always @(posedge clk_sys) begin : do_reset if (!rst2 && pll_lock) rst2 <= 1; end // do_reset // The DTR reset is triggered by a falling edge at DTR always @(posedge clk_sys) begin : do_sample_dtr dtr_r <= Milk_DTR; end // do_sample_dtr assign dtr_reset=dtr_r && !Milk_DTR; assign rst_btn=ENABLE_B1_RESET ? btns[0] : 0; // Built-in LEDs assign LED1=portb_out[6]; // pin IO14 assign LED2=pwm[0]; assign LED3=0; // btns[2]; assign LED4=rst_btn; // Arduino IOx pins: wire [13:0] ardu; assign ardu[ 0]=portd_out[0]; assign ardu[ 1]=portd_out[1]; assign ardu[ 2]=portd_out[2]; assign ardu[ 3]=pwm_ena[0] && ENA_PWM0 ? pwm[0] : portd_out[3]; assign ardu[ 4]=portd_out[4]; assign ardu[ 5]=pwm_ena[1] && ENA_PWM1 ? pwm[1] : portd_out[5]; assign ardu[ 6]=pwm_ena[2] && ENA_PWM2 ? pwm[2] : portd_out[6]; assign ardu[ 7]=portd_out[7]; assign ardu[ 8]=portb_out[0]; assign ardu[ 9]=pwm_ena[3] && ENA_PWM3 ? pwm[3] : portb_out[1]; assign ardu[10]=pwm_ena[4] && ENA_PWM4 ? pwm[4] : portb_out[2]; assign ardu[11]=pwm_ena[5] && ENA_PWM5 && !spi_ena ? pwm[5] : (spi_ena ? mosi : portb_out[3]); assign ardu[12]=portb_out[4]; assign ardu[13]=spi_ena ? spi_sck : portb_out[5]; wire [13:0] ardu_oe; // PB4 reverts to input when SPI is enabled wire miso_oe; assign miso_oe=portb_oe[4] & ~spi_ena; assign ardu_oe={portb_oe[5],miso_oe,portb_oe[3:0],portd_oe}; wire [13:0] ardu_in; generate if (EXPLICIT_TBUF) begin SB_IO #(.PIN_TYPE(6'b1010_01), .PULLUP(1'b0)) io_pins [13:0] (.PACKAGE_PIN({ARDU13,ARDU12,ARDU11,ARDU10,ARDU09,ARDU08,ARDU07,ARDU06,ARDU05,ARDU04,ARDU03,ARDU02,ARDU01,ARDU00}), .OUTPUT_ENABLE(ardu_oe), .D_OUT_0(ardu), .D_IN_0(ardu_in)); assign {portb_in[5:0],portd_in}=ardu_in; assign miso=ardu_in[12]; end else begin assign ARDU00=ardu_oe[ 0] ? ardu[ 0] : 1'bZ; assign ARDU01=ardu_oe[ 1] ? ardu[ 1] : 1'bZ; assign ARDU02=ardu_oe[ 2] ? ardu[ 2] : 1'bZ; assign ARDU03=ardu_oe[ 3] ? ardu[ 3] : 1'bZ; assign ARDU04=ardu_oe[ 4] ? ardu[ 4] : 1'bZ; assign ARDU05=ardu_oe[ 5] ? ardu[ 5] : 1'bZ; assign ARDU06=ardu_oe[ 6] ? ardu[ 6] : 1'bZ; assign ARDU07=ardu_oe[ 7] ? ardu[ 7] : 1'bZ; assign ARDU08=ardu_oe[ 8] ? ardu[ 8] : 1'bZ; assign ARDU09=ardu_oe[ 9] ? ardu[ 9] : 1'bZ; assign ARDU10=ardu_oe[10] ? ardu[10] : 1'bZ; assign ARDU11=ardu_oe[11] ? ardu[11] : 1'bZ; assign ARDU12=ardu_oe[12] ? ardu[12] : 1'bZ; assign ARDU13=ardu_oe[13] ? ardu[13] : 1'bZ; assign portd_in[0]=ARDU00; assign portd_in[1]=ARDU01; assign portd_in[2]=ARDU02; assign portd_in[3]=ARDU03; assign portd_in[4]=ARDU04; assign portd_in[5]=ARDU05; assign portd_in[6]=ARDU06; assign portd_in[7]=ARDU07; assign portb_in[0]=ARDU08; assign portb_in[1]=ARDU09; assign portb_in[2]=ARDU10; assign portb_in[3]=ARDU11; assign portb_in[4]=ARDU12; assign portb_in[5]=ARDU13; assign miso =ARDU12; assign ardu_in={ARDU13,ARDU12,ARDU11,ARDU10,ARDU09,ARDU08,ARDU07,ARDU06,ARDU05,ARDU04,ARDU03,ARDU02,ARDU01,ARDU00}; end endgenerate // This is not 100% Arduino, here we fix SPI regardless spi_ena //ISP_SCK =spi_sck; //ARDU12 =ISP_MISO; //ISP_MOSI=mosi; generate if (DEBUG_INT) begin : do_int_btns // Debug connection to CapSense assign pin_irq[0]=btns[1]; assign pin_irq[1]=btns[2]; end else begin : do_int_pins // INT0/1 pins (PD2 and PD3) assign pin_irq[0]=ENA_INT0 ? ardu_in[2] : 0; assign pin_irq[1]=ENA_INT1 ? ardu_in[3] : 0; end endgenerate // Device interrupts assign dev_irq[0]=intrx; // UART Rx assign dev_irq[1]=inttx; // UART Tx assign dev_irq[2]=t16_irq; // 16 bits Timer assign t16_ack=dev_ack[2]; generate if (DEBUG_SPI) begin : do_debug_spi assign SS_B=portb_out[2]; assign SCK =spi_sck; assign miso=SDI; assign SDO =mosi; end else begin : do_arduino_spi assign SS_B=1; // Disable the SPI memory assign SCK =0; assign SDO =0; end endgenerate ATtX5 #( .ENA_WB(1), .ENA_SPM(1), .ENA_PORTB(1), .ENA_PORTC(0), .ENA_PORTD(1), .PORTB_SIZE(7), .PORTC_SIZE(6), .PORTD_SIZE(8),.RESET_JUMP(RESET_JUMP), .ENA_IRQ_CTRL(1), .RAM_ADDR_W(RAM_ADDR_W), .ENA_SPI(ENABLE_SPI)) micro ( .rst_i(rst), .clk_i(clk_sys), .clk2x_i(clk_spi), .pc_o(pc), .inst_i(inst), .ena_i(1), .portc_i(), .portb_i(portb_in), .pgm_we_o(we), .inst_o(inst_w), .portd_i(portd_in), .pin_irq_i(pin_irq), .dev_irq_i(dev_irq), .dev_ack_o(dev_ack), .portb_o(portb_out), .portd_o(portd_out), .portb_oe_o(portb_oe), .portd_oe_o(portd_oe), // SPI .spi_ena_o(spi_ena), .sclk_o(spi_sck), .miso_i(miso), .mosi_o(mosi), // WISHBONE .wb_adr_o(cpu_adro), .wb_dat_o(cpu_dato), .wb_dat_i(cpu_dati), .wb_stb_o(cpu_stbo), .wb_we_o(cpu_weo), .wb_ack_i(cpu_acki), // Debug .dbg_stop_i(0), .dbg_rf_fake_i(0), .dbg_rr_data_i(0), .dbg_rd_data_i(0)); assign cpu_cyco=0; assign pcsv=pc[ROM_ADDR_W-1:0]; // Program memory (1/2/4Kx16) (2/4/8 kiB) generate if (ROM_ADDR_W==10) begin : pm_2k lattuino_1_blPM_2 #(.WORD_SIZE(16), .ADDR_W(ROM_ADDR_W)) PM_Inst2 (.clk_i(clk_sys), .addr_i(pcsv), .data_o(inst), .data_i(inst_w), .we_i(we)); end else if (ROM_ADDR_W==11) begin : pm_4k lattuino_1_blPM_4 #(.WORD_SIZE(16), .ADDR_W(ROM_ADDR_W)) PM_Inst4 (.clk_i(clk_sys), .addr_i(pcsv), .data_o(inst), .data_i(inst_w), .we_i(we)); end else if (ROM_ADDR_W==12) begin : pm_8k lattuino_1_blPM_8 #(.WORD_SIZE(16), .ADDR_W(ROM_ADDR_W)) PM_Inst8 (.clk_i(clk_sys), .addr_i(pcsv), .data_o(inst), .data_i(inst_w), .we_i(we)); end endgenerate /////////////////////// // WISHBONE Intercon // /////////////////////// WBDevIntercon intercon (// WISHBONE master port(s) // cpu .cpu_dat_o(cpu_dati), .cpu_ack_o(cpu_acki), .cpu_dat_i(cpu_dato), .cpu_we_i(cpu_weo), .cpu_adr_i(cpu_adro), .cpu_cyc_i(cpu_cyco), .cpu_stb_i(cpu_stbo), // WISHBONE slave port(s) // rs2 .rs2_dat_i(rs2_dato), .rs2_ack_i(rs2_acko), .rs2_dat_o(rs2_dati), .rs2_we_o(rs2_wei), .rs2_adr_o(rs2_adri), .rs2_stb_o(rs2_stbi), // ad .ad_dat_i(ad_dato), .ad_ack_i(ad_acko), .ad_dat_o(ad_dati), .ad_we_o(ad_wei), .ad_adr_o(ad_adri), .ad_stb_o(ad_stbi), // tmr .tmr_dat_i(tmr_dato), .tmr_ack_i(tmr_acko), .tmr_dat_o(tmr_dati), .tmr_we_o(tmr_wei), .tmr_adr_o(tmr_adri), .tmr_stb_o(tmr_stbi), // t16 .t16_dat_i(t16_dato), .t16_ack_i(t16_acko), .t16_dat_o(t16_dati), .t16_we_o(t16_wei), .t16_adr_o(t16_adri), .t16_stb_o(t16_stbi), // clock and reset .wb_clk_i(clk_sys), .wb_rst_i(rst)); /////////////////// // WISHBONE UART // /////////////////// UART_C #(.BRDIVISOR(BRDIVISOR), .WIP_ENABLE(1), .AUX_ENABLE(0)) the_uart (// WISHBONE signals .wb_clk_i(clk_sys), .wb_rst_i(rst), .wb_adr_i(rs2_adri), .wb_dat_i(rs2_dati), .wb_dat_o(rs2_dato), .wb_we_i(rs2_wei), .wb_stb_i(rs2_stbi), .wb_ack_o(rs2_acko), // Process signals .inttx_o(inttx), .intrx_o(intrx), .br_clk_i(1), .txd_pad_o(Milk_RXD), .rxd_pad_i(Milk_TXD)); //////////////////////////// // WISHBONE time counters // //////////////////////////// TMCounter #(.CNT_PRESC(CNT_PRESC), .ENA_TMR(ENA_TIME_CNT)) the_counter (// WISHBONE signals .wb_clk_i(clk_sys), .wb_rst_i(rst), .wb_adr_i(tmr_adri), .wb_dat_o(tmr_dato), .wb_stb_i(tmr_stbi), .wb_ack_o(tmr_acko), .wb_dat_i(tmr_dati), .wb_we_i(tmr_wei), // PWMs .pwm_o(pwm), .pwm_e_o(pwm_ena)); ////////////////////////////// // WISHBONE 16 bits counter // ////////////////////////////// TM16bits #(.CNT_PRESC(CNT_PRESC), .ENA_TMR(ENA_TMR16)) the_tm16bits (// Wishbone signals .wb_clk_i(clk_sys), .wb_rst_i(rst), .wb_adr_i(t16_adri), .wb_dat_o(t16_dato), .wb_stb_i(t16_stbi), .wb_ack_o(t16_acko), .wb_dat_i(t16_dati), .wb_we_i(t16_wei), // IRQ .irq_req_o(t16_irq), .irq_ack_i(t16_ack)); ////////////////// // WISHBONE A/D // ////////////////// AD_Conv #(.ENABLE(ENABLE_AD)) the_ad (// WISHBONE signals .wb_clk_i(clk_sys), .wb_rst_i(rst), .wb_adr_i(ad_adri), .wb_dat_o(ad_dato), .wb_stb_i(ad_stbi), .wb_ack_o(ad_acko), .wb_dat_i(ad_dati), .wb_we_i(ad_wei), // A/D .ad_ncs_o(AD_CS), .ad_clk_o(AD_Clk), .ad_din_o(AD_Din), .ad_dout_i(AD_Dout),.spi_ena_i(0)); ////////////////////// // Botones CapSense // ////////////////////// wire [3:0] capsense_in; CapSense_Sys #(.N(4), .FREQUENCY(CNT_PRESC), .DIRECT(0)) CS (.clk_i(clk_sys), .rst_i(0), .capsense_i(capsense_in), .capsense_o(discharge), .buttons_o(btns), .debug_o()); generate if (EXPLICIT_TBUF) begin SB_IO #(.PIN_TYPE(6'b1010_01), .PULLUP(1'b0)) buts [3:0] (.PACKAGE_PIN({BTN4,BTN3,BTN2,BTN1}), .OUTPUT_ENABLE(discharge), .D_OUT_0(4'b0), .D_IN_0(capsense_in)); end else begin assign BTN1=discharge ? 1'b0 : 1'bZ; assign BTN2=discharge ? 1'b0 : 1'bZ; assign BTN3=discharge ? 1'b0 : 1'bZ; assign BTN4=discharge ? 1'b0 : 1'bZ; assign capsense_in={BTN4,BTN3,BTN2,BTN1}; end endgenerate generate if (ENA_2xSCK) begin : do_2xSPI // ************************************************************************* // PLL: 48 MHz clock from 24 MHz clock // ************************************************************************* SB_PLL40_2F_PAD #(// Feedback (all defaults) .FEEDBACK_PATH("SIMPLE"), .DELAY_ADJUSTMENT_MODE_FEEDBACK("FIXED"), // .DELAY_ADJUSTMENT_MODE_RELATIVE("FIXED"), .SHIFTREG_DIV_MODE(2'b0), // 0 --> Divide by 4, 1 --> Divide by 7), 3 --> Divide by 5 .FDA_FEEDBACK(4'b0), // .FDA_RELATIVE(0), .PLLOUT_SELECT_PORTA("GENCLK"), .PLLOUT_SELECT_PORTB("GENCLK_HALF"), // Freq. Multiplier (DIVF+1)/((2**DIVQ)*(DIVR+1))=32/16=2 .DIVF(7'b0011111), // 31 .DIVR(4'b0), .DIVQ(3'b100), // 4 .FILTER_RANGE(3'b010), // Not documented! // Output clock gates (for low power modes) .ENABLE_ICEGATE_PORTA(1'b0), .ENABLE_ICEGATE_PORTB(1'b0) // Test Mode Parameter // .TEST_MODE(0), // EXTERNAL_DIVIDE_FACTOR(1) -- Not Used by model, Added for PLL config GUI ) PLL1 (.PACKAGEPIN(CLK), // Clock pin from GBx .PLLOUTCOREA(), // Clock A (to logic) .PLLOUTGLOBALA(clk_spi), // Clock A (to global lines) .PLLOUTCOREB(), // Clock B (to logic) .PLLOUTGLOBALB(clk_sys), // Clock B (to global lines) .EXTFEEDBACK(), // External feedback (not used here) .DYNAMICDELAY(), // Dynamic delay (not used here) .LOCK(pll_lock), // PLL is locked .BYPASS(1'b0), // Bypass enable .RESETB(1'b1), // /Reset .LATCHINPUTVALUE(), // Clock gate enable // Test Pins (not documented) .SDO(), .SDI(), .SCLK()); end else begin : do_1xSPI assign clk_spi =CLK; assign clk_sys =CLK; assign pll_lock=1; end endgenerate endmodule // Lattuino_1
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ `ifndef SKY130_FD_SC_HDLL__EINVN_8_V `define SKY130_FD_SC_HDLL__EINVN_8_V /** * einvn: Tri-state inverter, negative enable. * * Verilog wrapper for einvn with size of 8 units. * * WARNING: This file is autogenerated, do not modify directly! */ `timescale 1ns / 1ps `default_nettype none `include "sky130_fd_sc_hdll__einvn.v" `ifdef USE_POWER_PINS /*********************************************************/ `celldefine module sky130_fd_sc_hdll__einvn_8 ( Z , A , TE_B, VPWR, VGND, VPB , VNB ); output Z ; input A ; input TE_B; input VPWR; input VGND; input VPB ; input VNB ; sky130_fd_sc_hdll__einvn base ( .Z(Z), .A(A), .TE_B(TE_B), .VPWR(VPWR), .VGND(VGND), .VPB(VPB), .VNB(VNB) ); endmodule `endcelldefine /*********************************************************/ `else // If not USE_POWER_PINS /*********************************************************/ `celldefine module sky130_fd_sc_hdll__einvn_8 ( Z , A , TE_B ); output Z ; input A ; input TE_B; // Voltage supply signals supply1 VPWR; supply0 VGND; supply1 VPB ; supply0 VNB ; sky130_fd_sc_hdll__einvn base ( .Z(Z), .A(A), .TE_B(TE_B) ); endmodule `endcelldefine /*********************************************************/ `endif // USE_POWER_PINS `default_nettype wire `endif // SKY130_FD_SC_HDLL__EINVN_8_V
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ `ifndef SKY130_FD_SC_LP__O32A_LP_V `define SKY130_FD_SC_LP__O32A_LP_V /** * o32a: 3-input OR and 2-input OR into 2-input AND. * * X = ((A1 | A2 | A3) & (B1 | B2)) * * Verilog wrapper for o32a with size for low power. * * WARNING: This file is autogenerated, do not modify directly! */ `timescale 1ns / 1ps `default_nettype none `include "sky130_fd_sc_lp__o32a.v" `ifdef USE_POWER_PINS /*********************************************************/ `celldefine module sky130_fd_sc_lp__o32a_lp ( X , A1 , A2 , A3 , B1 , B2 , VPWR, VGND, VPB , VNB ); output X ; input A1 ; input A2 ; input A3 ; input B1 ; input B2 ; input VPWR; input VGND; input VPB ; input VNB ; sky130_fd_sc_lp__o32a base ( .X(X), .A1(A1), .A2(A2), .A3(A3), .B1(B1), .B2(B2), .VPWR(VPWR), .VGND(VGND), .VPB(VPB), .VNB(VNB) ); endmodule `endcelldefine /*********************************************************/ `else // If not USE_POWER_PINS /*********************************************************/ `celldefine module sky130_fd_sc_lp__o32a_lp ( X , A1, A2, A3, B1, B2 ); output X ; input A1; input A2; input A3; input B1; input B2; // Voltage supply signals supply1 VPWR; supply0 VGND; supply1 VPB ; supply0 VNB ; sky130_fd_sc_lp__o32a base ( .X(X), .A1(A1), .A2(A2), .A3(A3), .B1(B1), .B2(B2) ); endmodule `endcelldefine /*********************************************************/ `endif // USE_POWER_PINS `default_nettype wire `endif // SKY130_FD_SC_LP__O32A_LP_V
/* * Milkymist VJ SoC * Copyright (C) 2007, 2008, 2009 Sebastien Bourdeauducq * * 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, 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 pfpu_f2i( input sys_clk, input alu_rst, input [31:0] a, input valid_i, output reg [31:0] r, output reg valid_o ); wire a_sign = a[31]; wire [7:0] a_expn = a[30:23]; wire [23:0] a_mant = {1'b1, a[22:0]}; reg [30:0] shifted; always @(*) begin if(a_expn >= 8'd150) shifted = a_mant << (a_expn - 8'd150); else shifted = a_mant >> (8'd150 - a_expn); end always @(posedge sys_clk) begin if(alu_rst) valid_o <= 1'b0; else valid_o <= valid_i; if(a_sign) r <= 32'd0 - {1'b0, shifted}; else r <= {1'b0, shifted}; end endmodule
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ `ifndef SKY130_FD_SC_MS__O21BAI_BLACKBOX_V `define SKY130_FD_SC_MS__O21BAI_BLACKBOX_V /** * o21bai: 2-input OR into first input of 2-input NAND, 2nd iput * inverted. * * Y = !((A1 | A2) & !B1_N) * * Verilog stub definition (black box without power pins). * * WARNING: This file is autogenerated, do not modify directly! */ `timescale 1ns / 1ps `default_nettype none (* blackbox *) module sky130_fd_sc_ms__o21bai ( Y , A1 , A2 , B1_N ); output Y ; input A1 ; input A2 ; input B1_N; // Voltage supply signals supply1 VPWR; supply0 VGND; supply1 VPB ; supply0 VNB ; endmodule `default_nettype wire `endif // SKY130_FD_SC_MS__O21BAI_BLACKBOX_V
//======================================================= // This code is generated by Terasic System Builder //======================================================= module DE0_NANO( //////////// CLOCK ////////// CLOCK_50, //////////// LED ////////// LED, //////////// KEY ////////// KEY, //////////// SDRAM ////////// DRAM_ADDR, DRAM_BA, DRAM_CAS_N, DRAM_CKE, DRAM_CLK, DRAM_CS_N, DRAM_DQ, DRAM_DQM, DRAM_RAS_N, DRAM_WE_N, //////////// GPIO_1, GPIO_1 connect to GPIO Default ////////// GPIO, GPIO_IN ); //======================================================= // PARAMETER declarations //======================================================= //======================================================= // PORT declarations //======================================================= //////////// CLOCK ////////// input CLOCK_50; //////////// LED ////////// output [7:0] LED; //////////// KEY ////////// input [1:0] KEY; //////////// SDRAM ////////// output [12:0] DRAM_ADDR; output [1:0] DRAM_BA; output DRAM_CAS_N; output DRAM_CKE; output DRAM_CLK; output DRAM_CS_N; inout [15:0] DRAM_DQ; output [1:0] DRAM_DQM; output DRAM_RAS_N; output DRAM_WE_N; //////////// GPIO_1, GPIO_1 connect to GPIO Default ////////// inout [33:0] GPIO; input [1:0] GPIO_IN; //======================================================= // REG/WIRE declarations //======================================================= //======================================================= // Structural coding //======================================================= endmodule
module auto_module ( input my_clk, input my_rst_n, output manually_listed, /*AUTOINOUTMODPORT("automodport_if" "pure_mp")*/ // Beginning of automatic in/out/inouts (from modport) output out_pure, input in_pure, // End of automatics //ex: input in_pure; //ex: output out_pure; /*AUTOINOUTMODPORT("automodport_if" "req_mon_mp")*/ // Beginning of automatic in/out/inouts (from modport) input req_val, input [63:0] req_dat, input req_credit, // End of automatics //ex: input req_credit, // To auto_i of auto_intf.sv //ex: input [63:0] req_data, // To auto_i of auto_intf.sv //ex: input req_val, // To auto_i of auto_intf.sv /*AUTOINOUTMODPORT("automodport_if" "rsp_drv_mp")*/ // Beginning of automatic in/out/inouts (from modport) output [1:0] rsp_cmd, output [63:0] rsp_data, input rsp_credit // End of automatics //ex: output [1:0] rsp_cmd, // From auto_i of auto_intf.sv //ex: input rsp_credit, // To auto_i of auto_intf.sv //ex: output [63:0] rsp_data // From auto_i of auto_intf.sv ); auto_intf auto_i (// Inputs .clk (my_clk), .rst_n (my_rst_n)); /*AUTOASSIGNMODPORT("automodport_if" "req_mon_mp" "auto_i" )*/ // Beginning of automatic assignments from modport assign auto_i.manually_listed = manually_listed; assign auto_i.req_credit = req_credit; assign auto_i.req_dat = req_dat; assign auto_i.req_val = req_val; // End of automatics //ex: assign auto_i.req_credit = req_credit; //ex: assign auto_i.req_data = req_data; //ex: assign auto_i.req_val = req_val; /*AUTOASSIGNMODPORT("automodport_if" "rsp_drv_mp" "auto_i" )*/ // Beginning of automatic assignments from modport assign rsp_cmd = auto_i.rsp_cmd; assign rsp_data = auto_i.rsp_data; assign auto_i.rsp_credit = rsp_credit; // End of automatics //ex: assign rsp_cmd = auto_i.rsp_cmd; //ex: assign rsp_data = auto_i.rsp_data; //ex: assign auto_i.rsp_credit = rsp_credit; /*AUTOASSIGNMODPORT("automodport_if" "r.*" "auto_i" )*/ // Beginning of automatic assignments from modport assign rsp_cmd = auto_i.rsp_cmd; assign rsp_data = auto_i.rsp_data; assign auto_i.manually_listed = manually_listed; assign auto_i.req_credit = req_credit; assign auto_i.req_dat = req_dat; assign auto_i.req_val = req_val; assign auto_i.rsp_credit = rsp_credit; // End of automatics initial begin `cn_set_intf(virtual auto_intf.req_mon_mp, "auto_pkg::auto_intf", "req_mon_vi", auto_i.req_mon_mp ); `cn_set_intf(virtual auto_intf.rsp_drv_mp, "auto_pkg::auto_intf", "rsp_drv_vi", auto_i.rsp_drv_mp ); end endmodule
`timescale 1ns/10ps module PressCountSim; reg clock0; reg clock180; reg reset; reg countu; reg countd; wire [7:0] nr_presses; initial begin #0 $dumpfile(`VCDFILE); #0 $dumpvars; #5000 $finish; end initial begin #0 clock0 = 1; forever #2 clock0 = ~clock0; end initial begin #0 clock180 = 0; forever #2 clock180 = ~clock180; end initial begin #0 reset = 0; #1 reset = 1; #4 reset = 0; end initial begin #0 countu = 0; countd = 0; #12 countu = 1; #5 countu = 0; #43 countu = 1; #5 countu = 0; #124 countd = 1; #233 countd = 0; #4 countu = 1; #100 countu = 0; #4 countu = 1; #100 countu = 0; end PressCount presscount (.clock0(clock0), .clock180(clock180), .reset(reset), .countu(countu), .countd(countd), .nr_presses(nr_presses)); endmodule // PressCountSim
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ `ifndef SKY130_FD_SC_MS__UDP_MUX_2TO1_SYMBOL_V `define SKY130_FD_SC_MS__UDP_MUX_2TO1_SYMBOL_V /** * udp_mux_2to1: Two to one multiplexer * * Verilog stub (with power pins) for graphical symbol definition * generation. * * WARNING: This file is autogenerated, do not modify directly! */ `timescale 1ns / 1ps `default_nettype none (* blackbox *) module sky130_fd_sc_ms__udp_mux_2to1 ( //# {{data|Data Signals}} input A0, input A1, output X , //# {{control|Control Signals}} input S ); endmodule `default_nettype wire `endif // SKY130_FD_SC_MS__UDP_MUX_2TO1_SYMBOL_V
/* * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ `ifndef SKY130_FD_SC_HDLL__PROBEC_P_BEHAVIORAL_PP_V `define SKY130_FD_SC_HDLL__PROBEC_P_BEHAVIORAL_PP_V /** * probec_p: Virtual current probe point. * * Verilog simulation functional model. */ `timescale 1ns / 1ps `default_nettype none // Import user defined primitives. `include "../../models/udp_pwrgood_pp_pg/sky130_fd_sc_hdll__udp_pwrgood_pp_pg.v" `celldefine module sky130_fd_sc_hdll__probec_p ( X , A , VPWR, VGND, VPB , VNB ); // Module ports output X ; input A ; input VPWR; input VGND; input VPB ; input VNB ; // Local signals wire buf0_out_X ; wire pwrgood_pp0_out_X; // Name Output Other arguments buf buf0 (buf0_out_X , A ); sky130_fd_sc_hdll__udp_pwrgood_pp$PG pwrgood_pp0 (pwrgood_pp0_out_X, buf0_out_X, VPWR, VGND); buf buf1 (X , pwrgood_pp0_out_X ); endmodule `endcelldefine `default_nettype wire `endif // SKY130_FD_SC_HDLL__PROBEC_P_BEHAVIORAL_PP_V
// *************************************************************************** // *************************************************************************** // Copyright 2011(c) Analog Devices, Inc. // // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // - Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in // the documentation and/or other materials provided with the // distribution. // - Neither the name of Analog Devices, Inc. nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // - The use of this software may or may not infringe the patent rights // of one or more patent holders. This license does not release you // from the requirement that you obtain separate licenses from these // patent holders to use this software. // - Use of the software either in source or binary form, must be run // on or directly connected to an Analog Devices Inc. component. // // THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, // INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A // PARTICULAR PURPOSE ARE DISCLAIMED. // // IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY // RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR // BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // *************************************************************************** // *************************************************************************** `timescale 1ns/100ps module usdrx1_spi ( spi_afe_csn, spi_clk_csn, spi_clk, spi_mosi, spi_miso, spi_afe_sdio, spi_clk_sdio); // 4 wire input [ 3:0] spi_afe_csn; input spi_clk_csn; input spi_clk; input spi_mosi; output spi_miso; // 3 wire inout spi_afe_sdio; inout spi_clk_sdio; // internal registers reg [ 5:0] spi_count = 'd0; reg spi_rd_wr_n = 'd0; reg spi_enable = 'd0; // internal signals wire [ 1:0] spi_csn_3_s; wire spi_csn_s; wire spi_enable_s; wire spi_afe_miso_s; wire spi_clk_miso_s; // check on rising edge and change on falling edge assign spi_csn_3_s[1] = & spi_afe_csn; assign spi_csn_3_s[0] = spi_clk_csn; assign spi_csn_s = & spi_csn_3_s; assign spi_enable_s = spi_enable & ~spi_csn_s; always @(posedge spi_clk or posedge spi_csn_s) begin if (spi_csn_s == 1'b1) begin spi_count <= 6'd0; spi_rd_wr_n <= 1'd0; end else begin spi_count <= spi_count + 1'b1; if (spi_count == 6'd0) begin spi_rd_wr_n <= spi_mosi; end end end always @(negedge spi_clk or posedge spi_csn_s) begin if (spi_csn_s == 1'b1) begin spi_enable <= 1'b0; end else begin if (((spi_count == 6'd16) && (spi_csn_3_s[1] == 1'b0)) || ((spi_count == 6'd16) && (spi_csn_3_s[0] == 1'b0))) begin spi_enable <= spi_rd_wr_n; end end end assign spi_miso = ((spi_afe_miso_s & ~spi_csn_3_s[1]) | (spi_clk_miso_s & ~spi_csn_3_s[0])); // io buffers assign spi_afe_miso_s = spi_afe_sdio; assign spi_afe_sdio = (spi_enable_s == 1'b1) ? 1'bz : spi_mosi; assign spi_clk_miso_s = spi_clk_sdio; assign spi_clk_sdio = (spi_enable_s == 1'b1) ? 1'bz : spi_mosi; endmodule // *************************************************************************** // ***************************************************************************
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ `ifndef SKY130_FD_SC_HDLL__OR4_TB_V `define SKY130_FD_SC_HDLL__OR4_TB_V /** * or4: 4-input OR. * * Autogenerated test bench. * * WARNING: This file is autogenerated, do not modify directly! */ `timescale 1ns / 1ps `default_nettype none `include "sky130_fd_sc_hdll__or4.v" module top(); // Inputs are registered reg A; reg B; reg C; reg D; reg VPWR; reg VGND; reg VPB; reg VNB; // Outputs are wires wire X; initial begin // Initial state is x for all inputs. A = 1'bX; B = 1'bX; C = 1'bX; D = 1'bX; VGND = 1'bX; VNB = 1'bX; VPB = 1'bX; VPWR = 1'bX; #20 A = 1'b0; #40 B = 1'b0; #60 C = 1'b0; #80 D = 1'b0; #100 VGND = 1'b0; #120 VNB = 1'b0; #140 VPB = 1'b0; #160 VPWR = 1'b0; #180 A = 1'b1; #200 B = 1'b1; #220 C = 1'b1; #240 D = 1'b1; #260 VGND = 1'b1; #280 VNB = 1'b1; #300 VPB = 1'b1; #320 VPWR = 1'b1; #340 A = 1'b0; #360 B = 1'b0; #380 C = 1'b0; #400 D = 1'b0; #420 VGND = 1'b0; #440 VNB = 1'b0; #460 VPB = 1'b0; #480 VPWR = 1'b0; #500 VPWR = 1'b1; #520 VPB = 1'b1; #540 VNB = 1'b1; #560 VGND = 1'b1; #580 D = 1'b1; #600 C = 1'b1; #620 B = 1'b1; #640 A = 1'b1; #660 VPWR = 1'bx; #680 VPB = 1'bx; #700 VNB = 1'bx; #720 VGND = 1'bx; #740 D = 1'bx; #760 C = 1'bx; #780 B = 1'bx; #800 A = 1'bx; end sky130_fd_sc_hdll__or4 dut (.A(A), .B(B), .C(C), .D(D), .VPWR(VPWR), .VGND(VGND), .VPB(VPB), .VNB(VNB), .X(X)); endmodule `default_nettype wire `endif // SKY130_FD_SC_HDLL__OR4_TB_V
module SysPLL( // interface 'refclk' input wire refclk, // interface 'reset' input wire rst, // interface 'outclk0' output wire sdr_clk, // interface 'outclk1' output wire sys_clk, // interface 'outclk2' output wire vga_clk, output wire pit_clk, // interface 'locked' output wire locked ); wire [4:0] sub_wire0; wire [0:0] sub_wire7 = 1'h0; wire [0:0] sub_wire5; wire [3:3] sub_wire4 = sub_wire0[3:3]; wire [2:2] sub_wire3 = sub_wire0[2:2]; wire [1:1] sub_wire2 = sub_wire0[1:1]; wire [0:0] sub_wire1 = sub_wire0[0:0]; assign sdr_clk = sub_wire1; assign sys_clk = sub_wire2; assign vga_clk = sub_wire3; assign pit_clk = sub_wire4; assign sub_wire5 = refclk; wire [1:0] sub_wire6 = {sub_wire7, sub_wire5}; altpll altpll_component ( .inclk (sub_wire6), .clk (sub_wire0), .activeclock (), .areset (1'b0), .clkbad (), .clkena ({6{1'b1}}), .clkloss (), .clkswitch (1'b0), .configupdate (1'b0), .enable0 (), .enable1 (), .extclk (), .extclkena ({4{1'b1}}), .fbin (1'b1), .fbmimicbidir (), .fbout (), .fref (), .icdrclk (), .locked (locked), .pfdena (1'b1), .phasecounterselect ({4{1'b1}}), .phasedone (), .phasestep (1'b1), .phaseupdown (1'b1), .pllena (1'b1), .scanaclr (1'b0), .scanclk (1'b0), .scanclkena (1'b1), .scandata (1'b0), .scandataout (), .scandone (), .scanread (1'b0), .scanwrite (1'b0), .sclkout0 (), .sclkout1 (), .vcooverrange (), .vcounderrange ()); defparam altpll_component.bandwidth_type = "AUTO", altpll_component.clk0_divide_by = 1, altpll_component.clk0_duty_cycle = 50, altpll_component.clk0_multiply_by = 1, altpll_component.clk0_phase_shift = "-2727", altpll_component.clk1_divide_by = 1, altpll_component.clk1_duty_cycle = 50, altpll_component.clk1_multiply_by = 1, altpll_component.clk1_phase_shift = "0", altpll_component.clk2_divide_by = 2, altpll_component.clk2_duty_cycle = 50, altpll_component.clk2_multiply_by = 1, altpll_component.clk2_phase_shift = "0", altpll_component.clk3_divide_by = 25000000, altpll_component.clk3_duty_cycle = 50, altpll_component.clk3_multiply_by = 596529, altpll_component.clk3_phase_shift = "0", altpll_component.compensate_clock = "CLK1", altpll_component.inclk0_input_frequency = 20000, altpll_component.intended_device_family = "MAX 10", altpll_component.lpm_hint = "CBX_MODULE_PREFIX=pll1", altpll_component.lpm_type = "altpll", altpll_component.operation_mode = "NORMAL", altpll_component.pll_type = "AUTO", altpll_component.port_activeclock = "PORT_UNUSED", altpll_component.port_areset = "PORT_UNUSED", altpll_component.port_clkbad0 = "PORT_UNUSED", altpll_component.port_clkbad1 = "PORT_UNUSED", altpll_component.port_clkloss = "PORT_UNUSED", altpll_component.port_clkswitch = "PORT_UNUSED", altpll_component.port_configupdate = "PORT_UNUSED", altpll_component.port_fbin = "PORT_UNUSED", altpll_component.port_inclk0 = "PORT_USED", altpll_component.port_inclk1 = "PORT_UNUSED", altpll_component.port_locked = "PORT_UNUSED", altpll_component.port_pfdena = "PORT_UNUSED", altpll_component.port_phasecounterselect = "PORT_UNUSED", altpll_component.port_phasedone = "PORT_UNUSED", altpll_component.port_phasestep = "PORT_UNUSED", altpll_component.port_phaseupdown = "PORT_UNUSED", altpll_component.port_pllena = "PORT_UNUSED", altpll_component.port_scanaclr = "PORT_UNUSED", altpll_component.port_scanclk = "PORT_UNUSED", altpll_component.port_scanclkena = "PORT_UNUSED", altpll_component.port_scandata = "PORT_UNUSED", altpll_component.port_scandataout = "PORT_UNUSED", altpll_component.port_scandone = "PORT_UNUSED", altpll_component.port_scanread = "PORT_UNUSED", altpll_component.port_scanwrite = "PORT_UNUSED", altpll_component.port_clk0 = "PORT_USED", altpll_component.port_clk1 = "PORT_USED", altpll_component.port_clk2 = "PORT_USED", altpll_component.port_clk3 = "PORT_USED", altpll_component.port_clk4 = "PORT_UNUSED", altpll_component.port_clk5 = "PORT_UNUSED", altpll_component.port_clkena0 = "PORT_UNUSED", altpll_component.port_clkena1 = "PORT_UNUSED", altpll_component.port_clkena2 = "PORT_UNUSED", altpll_component.port_clkena3 = "PORT_UNUSED", altpll_component.port_clkena4 = "PORT_UNUSED", altpll_component.port_clkena5 = "PORT_UNUSED", altpll_component.port_extclk0 = "PORT_UNUSED", altpll_component.port_extclk1 = "PORT_UNUSED", altpll_component.port_extclk2 = "PORT_UNUSED", altpll_component.port_extclk3 = "PORT_UNUSED", altpll_component.width_clock = 5; endmodule
module spi_slave( input clk, input rst, input ss, input mosi, output miso, input sck, output done, input [7:0] din, input din_update, output [7:0] dout ); reg mosi_d, mosi_q; reg ss_d, ss_q; reg sck_d, sck_q; reg sck_old_d, sck_old_q; reg [7:0] data_d, data_q; reg done_d, done_q; reg [2:0] bit_ct_d, bit_ct_q; reg [7:0] dout_d, dout_q; reg miso_d, miso_q; assign miso = miso_q; assign done = done_q; assign dout = dout_q; always @(*) begin ss_d = ss; mosi_d = mosi; miso_d = miso_q; sck_d = sck; sck_old_d = sck_q; data_d = data_q; done_d = 1'b0; bit_ct_d = bit_ct_q; dout_d = dout_q; if (ss_q) begin bit_ct_d = 3'b0; data_d = din; miso_d = data_q[7]; end else begin if (!sck_old_q && sck_q) begin // rising edge miso_d = data_q[7]; data_d = {data_q[6:0], mosi_q}; bit_ct_d = bit_ct_q + 1'b1; if (bit_ct_q == 3'b111) begin dout_d = {data_q[6:0], mosi_q}; done_d = 1'b1; data_d = din; end end else if (din_update) begin data_d = din; end end end always @(posedge clk) begin if (rst) begin done_q <= 1'b0; bit_ct_q <= 3'b0; dout_q <= 8'b0; miso_q <= 1'b1; end else begin done_q <= done_d; bit_ct_q <= bit_ct_d; dout_q <= dout_d; miso_q <= miso_d; end sck_q <= sck_d; mosi_q <= mosi_d; ss_q <= ss_d; data_q <= data_d; sck_old_q <= sck_old_d; end endmodule
//----------------------------------------------------- // Design Name : hw1_A // File Name : hw1_A.v // Function : This program designs a single mux-based bus. // Coder : hydai //----------------------------------------------------- module hw1_A ( input [15:0] data, input [6:0] control, input clk, input rst_n, output reg [15:0] R0, output reg [15:0] R1, output reg [15:0] R2, output reg [15:0] R3 ); reg [15:0] tmpData; reg [15:0] T0, T1, T2, T3; always @(posedge clk or negedge rst_n) begin if (!rst_n) begin R0 <= 0; R1 <= 0; R2 <= 0; R3 <= 0; end else begin R0 <= (control[0])?(tmpData):R0; R1 <= (control[1])?(tmpData):R1; R2 <= (control[2])?(tmpData):R2; R3 <= (control[3])?(tmpData):R3; end // end of if-else block end // end of always always @(posedge clk or negedge rst_n) begin if (!rst_n) begin tmpData <= 0; end // end of if (!rst_n) case (control[6:4]) 3'b000: tmpData <= R0; 3'b001: tmpData <= R1; 3'b010: tmpData <= R2; 3'b011: tmpData <= R3; 3'b111: tmpData <= data; default: tmpData <= 0; endcase // end of case (control) end // end of always endmodule // endmodule of hw1_A
/******************************************************************************* * Module: dly_16 * Date:2014-05-30 * Author: Andrey Filippov * Description: Synchronous delay by 1-16 clock cycles with reset (will map to primitives) * * Copyright (c) 2014 Elphel, Inc. * dly_16.v 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. * * dly_16.v 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/> . * * Additional permission under GNU GPL version 3 section 7: * If you modify this Program, or any covered work, by linking or combining it * with independent modules provided by the FPGA vendor only (this permission * does not extend to any 3-rd party modules, "soft cores" or macros) under * different license terms solely for the purpose of generating binary "bitstream" * files and/or simulating the code, the copyright holders of this Program give * you the right to distribute the covered work without those independent modules * as long as the source code for them is available from the FPGA vendor free of * charge, and there is no dependence on any encrypted modules for simulating of * the combined code. This permission applies to you if the distributed code * contains all the components and scripts required to completely simulate it * with at least one of the Free Software programs. *******************************************************************************/ `timescale 1ns/1ps module dly_16 #( parameter WIDTH=1 )( input clk, input rst, input [3:0] dly, input [WIDTH-1:0] din, output [WIDTH-1:0] dout ); generate genvar i; for (i=0; i < WIDTH; i=i+1) begin: bit_block dly01_16 dly01_16_i ( .clk(clk), // input .rst(rst), // input .dly(dly), // input[3:0] .din(din[i]), // input .dout(dout[i]) // output reg ); end endgenerate endmodule
// system_acl_iface_acl_kernel_interface_mm_interconnect_0.v // This file was auto-generated from altera_mm_interconnect_hw.tcl. If you edit it your changes // will probably be lost. // // Generated using ACDS version 15.1 185 `timescale 1 ps / 1 ps module system_acl_iface_acl_kernel_interface_mm_interconnect_0 ( input wire kernel_clk_out_clk_clk, // kernel_clk_out_clk.clk input wire address_span_extender_0_reset_reset_bridge_in_reset_reset, // address_span_extender_0_reset_reset_bridge_in_reset.reset input wire kernel_cra_reset_reset_bridge_in_reset_reset, // kernel_cra_reset_reset_bridge_in_reset.reset input wire [29:0] address_span_extender_0_expanded_master_address, // address_span_extender_0_expanded_master.address output wire address_span_extender_0_expanded_master_waitrequest, // .waitrequest input wire [0:0] address_span_extender_0_expanded_master_burstcount, // .burstcount input wire [3:0] address_span_extender_0_expanded_master_byteenable, // .byteenable input wire address_span_extender_0_expanded_master_read, // .read output wire [31:0] address_span_extender_0_expanded_master_readdata, // .readdata output wire address_span_extender_0_expanded_master_readdatavalid, // .readdatavalid input wire address_span_extender_0_expanded_master_write, // .write input wire [31:0] address_span_extender_0_expanded_master_writedata, // .writedata output wire [29:0] kernel_cra_s0_address, // kernel_cra_s0.address output wire kernel_cra_s0_write, // .write output wire kernel_cra_s0_read, // .read input wire [63:0] kernel_cra_s0_readdata, // .readdata output wire [63:0] kernel_cra_s0_writedata, // .writedata output wire [0:0] kernel_cra_s0_burstcount, // .burstcount output wire [7:0] kernel_cra_s0_byteenable, // .byteenable input wire kernel_cra_s0_readdatavalid, // .readdatavalid input wire kernel_cra_s0_waitrequest, // .waitrequest output wire kernel_cra_s0_debugaccess // .debugaccess ); wire address_span_extender_0_expanded_master_translator_avalon_universal_master_0_waitrequest; // address_span_extender_0_expanded_master_agent:av_waitrequest -> address_span_extender_0_expanded_master_translator:uav_waitrequest wire [31:0] address_span_extender_0_expanded_master_translator_avalon_universal_master_0_readdata; // address_span_extender_0_expanded_master_agent:av_readdata -> address_span_extender_0_expanded_master_translator:uav_readdata wire address_span_extender_0_expanded_master_translator_avalon_universal_master_0_debugaccess; // address_span_extender_0_expanded_master_translator:uav_debugaccess -> address_span_extender_0_expanded_master_agent:av_debugaccess wire [29:0] address_span_extender_0_expanded_master_translator_avalon_universal_master_0_address; // address_span_extender_0_expanded_master_translator:uav_address -> address_span_extender_0_expanded_master_agent:av_address wire address_span_extender_0_expanded_master_translator_avalon_universal_master_0_read; // address_span_extender_0_expanded_master_translator:uav_read -> address_span_extender_0_expanded_master_agent:av_read wire [3:0] address_span_extender_0_expanded_master_translator_avalon_universal_master_0_byteenable; // address_span_extender_0_expanded_master_translator:uav_byteenable -> address_span_extender_0_expanded_master_agent:av_byteenable wire address_span_extender_0_expanded_master_translator_avalon_universal_master_0_readdatavalid; // address_span_extender_0_expanded_master_agent:av_readdatavalid -> address_span_extender_0_expanded_master_translator:uav_readdatavalid wire address_span_extender_0_expanded_master_translator_avalon_universal_master_0_lock; // address_span_extender_0_expanded_master_translator:uav_lock -> address_span_extender_0_expanded_master_agent:av_lock wire address_span_extender_0_expanded_master_translator_avalon_universal_master_0_write; // address_span_extender_0_expanded_master_translator:uav_write -> address_span_extender_0_expanded_master_agent:av_write wire [31:0] address_span_extender_0_expanded_master_translator_avalon_universal_master_0_writedata; // address_span_extender_0_expanded_master_translator:uav_writedata -> address_span_extender_0_expanded_master_agent:av_writedata wire [2:0] address_span_extender_0_expanded_master_translator_avalon_universal_master_0_burstcount; // address_span_extender_0_expanded_master_translator:uav_burstcount -> address_span_extender_0_expanded_master_agent:av_burstcount wire rsp_mux_src_valid; // rsp_mux:src_valid -> address_span_extender_0_expanded_master_agent:rp_valid wire [100:0] rsp_mux_src_data; // rsp_mux:src_data -> address_span_extender_0_expanded_master_agent:rp_data wire rsp_mux_src_ready; // address_span_extender_0_expanded_master_agent:rp_ready -> rsp_mux:src_ready wire [0:0] rsp_mux_src_channel; // rsp_mux:src_channel -> address_span_extender_0_expanded_master_agent:rp_channel wire rsp_mux_src_startofpacket; // rsp_mux:src_startofpacket -> address_span_extender_0_expanded_master_agent:rp_startofpacket wire rsp_mux_src_endofpacket; // rsp_mux:src_endofpacket -> address_span_extender_0_expanded_master_agent:rp_endofpacket wire [63:0] kernel_cra_s0_agent_m0_readdata; // kernel_cra_s0_translator:uav_readdata -> kernel_cra_s0_agent:m0_readdata wire kernel_cra_s0_agent_m0_waitrequest; // kernel_cra_s0_translator:uav_waitrequest -> kernel_cra_s0_agent:m0_waitrequest wire kernel_cra_s0_agent_m0_debugaccess; // kernel_cra_s0_agent:m0_debugaccess -> kernel_cra_s0_translator:uav_debugaccess wire [29:0] kernel_cra_s0_agent_m0_address; // kernel_cra_s0_agent:m0_address -> kernel_cra_s0_translator:uav_address wire [7:0] kernel_cra_s0_agent_m0_byteenable; // kernel_cra_s0_agent:m0_byteenable -> kernel_cra_s0_translator:uav_byteenable wire kernel_cra_s0_agent_m0_read; // kernel_cra_s0_agent:m0_read -> kernel_cra_s0_translator:uav_read wire kernel_cra_s0_agent_m0_readdatavalid; // kernel_cra_s0_translator:uav_readdatavalid -> kernel_cra_s0_agent:m0_readdatavalid wire kernel_cra_s0_agent_m0_lock; // kernel_cra_s0_agent:m0_lock -> kernel_cra_s0_translator:uav_lock wire [63:0] kernel_cra_s0_agent_m0_writedata; // kernel_cra_s0_agent:m0_writedata -> kernel_cra_s0_translator:uav_writedata wire kernel_cra_s0_agent_m0_write; // kernel_cra_s0_agent:m0_write -> kernel_cra_s0_translator:uav_write wire [3:0] kernel_cra_s0_agent_m0_burstcount; // kernel_cra_s0_agent:m0_burstcount -> kernel_cra_s0_translator:uav_burstcount wire kernel_cra_s0_agent_rf_source_valid; // kernel_cra_s0_agent:rf_source_valid -> kernel_cra_s0_agent_rsp_fifo:in_valid wire [137:0] kernel_cra_s0_agent_rf_source_data; // kernel_cra_s0_agent:rf_source_data -> kernel_cra_s0_agent_rsp_fifo:in_data wire kernel_cra_s0_agent_rf_source_ready; // kernel_cra_s0_agent_rsp_fifo:in_ready -> kernel_cra_s0_agent:rf_source_ready wire kernel_cra_s0_agent_rf_source_startofpacket; // kernel_cra_s0_agent:rf_source_startofpacket -> kernel_cra_s0_agent_rsp_fifo:in_startofpacket wire kernel_cra_s0_agent_rf_source_endofpacket; // kernel_cra_s0_agent:rf_source_endofpacket -> kernel_cra_s0_agent_rsp_fifo:in_endofpacket wire kernel_cra_s0_agent_rsp_fifo_out_valid; // kernel_cra_s0_agent_rsp_fifo:out_valid -> kernel_cra_s0_agent:rf_sink_valid wire [137:0] kernel_cra_s0_agent_rsp_fifo_out_data; // kernel_cra_s0_agent_rsp_fifo:out_data -> kernel_cra_s0_agent:rf_sink_data wire kernel_cra_s0_agent_rsp_fifo_out_ready; // kernel_cra_s0_agent:rf_sink_ready -> kernel_cra_s0_agent_rsp_fifo:out_ready wire kernel_cra_s0_agent_rsp_fifo_out_startofpacket; // kernel_cra_s0_agent_rsp_fifo:out_startofpacket -> kernel_cra_s0_agent:rf_sink_startofpacket wire kernel_cra_s0_agent_rsp_fifo_out_endofpacket; // kernel_cra_s0_agent_rsp_fifo:out_endofpacket -> kernel_cra_s0_agent:rf_sink_endofpacket wire address_span_extender_0_expanded_master_agent_cp_valid; // address_span_extender_0_expanded_master_agent:cp_valid -> router:sink_valid wire [100:0] address_span_extender_0_expanded_master_agent_cp_data; // address_span_extender_0_expanded_master_agent:cp_data -> router:sink_data wire address_span_extender_0_expanded_master_agent_cp_ready; // router:sink_ready -> address_span_extender_0_expanded_master_agent:cp_ready wire address_span_extender_0_expanded_master_agent_cp_startofpacket; // address_span_extender_0_expanded_master_agent:cp_startofpacket -> router:sink_startofpacket wire address_span_extender_0_expanded_master_agent_cp_endofpacket; // address_span_extender_0_expanded_master_agent:cp_endofpacket -> router:sink_endofpacket wire router_src_valid; // router:src_valid -> cmd_demux:sink_valid wire [100:0] router_src_data; // router:src_data -> cmd_demux:sink_data wire router_src_ready; // cmd_demux:sink_ready -> router:src_ready wire [0:0] router_src_channel; // router:src_channel -> cmd_demux:sink_channel wire router_src_startofpacket; // router:src_startofpacket -> cmd_demux:sink_startofpacket wire router_src_endofpacket; // router:src_endofpacket -> cmd_demux:sink_endofpacket wire kernel_cra_s0_agent_rp_valid; // kernel_cra_s0_agent:rp_valid -> router_001:sink_valid wire [136:0] kernel_cra_s0_agent_rp_data; // kernel_cra_s0_agent:rp_data -> router_001:sink_data wire kernel_cra_s0_agent_rp_ready; // router_001:sink_ready -> kernel_cra_s0_agent:rp_ready wire kernel_cra_s0_agent_rp_startofpacket; // kernel_cra_s0_agent:rp_startofpacket -> router_001:sink_startofpacket wire kernel_cra_s0_agent_rp_endofpacket; // kernel_cra_s0_agent:rp_endofpacket -> router_001:sink_endofpacket wire cmd_demux_src0_valid; // cmd_demux:src0_valid -> cmd_mux:sink0_valid wire [100:0] cmd_demux_src0_data; // cmd_demux:src0_data -> cmd_mux:sink0_data wire cmd_demux_src0_ready; // cmd_mux:sink0_ready -> cmd_demux:src0_ready wire [0:0] cmd_demux_src0_channel; // cmd_demux:src0_channel -> cmd_mux:sink0_channel wire cmd_demux_src0_startofpacket; // cmd_demux:src0_startofpacket -> cmd_mux:sink0_startofpacket wire cmd_demux_src0_endofpacket; // cmd_demux:src0_endofpacket -> cmd_mux:sink0_endofpacket wire rsp_demux_src0_valid; // rsp_demux:src0_valid -> rsp_mux:sink0_valid wire [100:0] rsp_demux_src0_data; // rsp_demux:src0_data -> rsp_mux:sink0_data wire rsp_demux_src0_ready; // rsp_mux:sink0_ready -> rsp_demux:src0_ready wire [0:0] rsp_demux_src0_channel; // rsp_demux:src0_channel -> rsp_mux:sink0_channel wire rsp_demux_src0_startofpacket; // rsp_demux:src0_startofpacket -> rsp_mux:sink0_startofpacket wire rsp_demux_src0_endofpacket; // rsp_demux:src0_endofpacket -> rsp_mux:sink0_endofpacket wire cmd_mux_src_valid; // cmd_mux:src_valid -> kernel_cra_s0_cmd_width_adapter:in_valid wire [100:0] cmd_mux_src_data; // cmd_mux:src_data -> kernel_cra_s0_cmd_width_adapter:in_data wire cmd_mux_src_ready; // kernel_cra_s0_cmd_width_adapter:in_ready -> cmd_mux:src_ready wire [0:0] cmd_mux_src_channel; // cmd_mux:src_channel -> kernel_cra_s0_cmd_width_adapter:in_channel wire cmd_mux_src_startofpacket; // cmd_mux:src_startofpacket -> kernel_cra_s0_cmd_width_adapter:in_startofpacket wire cmd_mux_src_endofpacket; // cmd_mux:src_endofpacket -> kernel_cra_s0_cmd_width_adapter:in_endofpacket wire kernel_cra_s0_cmd_width_adapter_src_valid; // kernel_cra_s0_cmd_width_adapter:out_valid -> kernel_cra_s0_agent:cp_valid wire [136:0] kernel_cra_s0_cmd_width_adapter_src_data; // kernel_cra_s0_cmd_width_adapter:out_data -> kernel_cra_s0_agent:cp_data wire kernel_cra_s0_cmd_width_adapter_src_ready; // kernel_cra_s0_agent:cp_ready -> kernel_cra_s0_cmd_width_adapter:out_ready wire [0:0] kernel_cra_s0_cmd_width_adapter_src_channel; // kernel_cra_s0_cmd_width_adapter:out_channel -> kernel_cra_s0_agent:cp_channel wire kernel_cra_s0_cmd_width_adapter_src_startofpacket; // kernel_cra_s0_cmd_width_adapter:out_startofpacket -> kernel_cra_s0_agent:cp_startofpacket wire kernel_cra_s0_cmd_width_adapter_src_endofpacket; // kernel_cra_s0_cmd_width_adapter:out_endofpacket -> kernel_cra_s0_agent:cp_endofpacket wire router_001_src_valid; // router_001:src_valid -> kernel_cra_s0_rsp_width_adapter:in_valid wire [136:0] router_001_src_data; // router_001:src_data -> kernel_cra_s0_rsp_width_adapter:in_data wire router_001_src_ready; // kernel_cra_s0_rsp_width_adapter:in_ready -> router_001:src_ready wire [0:0] router_001_src_channel; // router_001:src_channel -> kernel_cra_s0_rsp_width_adapter:in_channel wire router_001_src_startofpacket; // router_001:src_startofpacket -> kernel_cra_s0_rsp_width_adapter:in_startofpacket wire router_001_src_endofpacket; // router_001:src_endofpacket -> kernel_cra_s0_rsp_width_adapter:in_endofpacket wire kernel_cra_s0_rsp_width_adapter_src_valid; // kernel_cra_s0_rsp_width_adapter:out_valid -> rsp_demux:sink_valid wire [100:0] kernel_cra_s0_rsp_width_adapter_src_data; // kernel_cra_s0_rsp_width_adapter:out_data -> rsp_demux:sink_data wire kernel_cra_s0_rsp_width_adapter_src_ready; // rsp_demux:sink_ready -> kernel_cra_s0_rsp_width_adapter:out_ready wire [0:0] kernel_cra_s0_rsp_width_adapter_src_channel; // kernel_cra_s0_rsp_width_adapter:out_channel -> rsp_demux:sink_channel wire kernel_cra_s0_rsp_width_adapter_src_startofpacket; // kernel_cra_s0_rsp_width_adapter:out_startofpacket -> rsp_demux:sink_startofpacket wire kernel_cra_s0_rsp_width_adapter_src_endofpacket; // kernel_cra_s0_rsp_width_adapter:out_endofpacket -> rsp_demux:sink_endofpacket wire kernel_cra_s0_agent_rdata_fifo_src_valid; // kernel_cra_s0_agent:rdata_fifo_src_valid -> avalon_st_adapter:in_0_valid wire [65:0] kernel_cra_s0_agent_rdata_fifo_src_data; // kernel_cra_s0_agent:rdata_fifo_src_data -> avalon_st_adapter:in_0_data wire kernel_cra_s0_agent_rdata_fifo_src_ready; // avalon_st_adapter:in_0_ready -> kernel_cra_s0_agent:rdata_fifo_src_ready wire avalon_st_adapter_out_0_valid; // avalon_st_adapter:out_0_valid -> kernel_cra_s0_agent:rdata_fifo_sink_valid wire [65:0] avalon_st_adapter_out_0_data; // avalon_st_adapter:out_0_data -> kernel_cra_s0_agent:rdata_fifo_sink_data wire avalon_st_adapter_out_0_ready; // kernel_cra_s0_agent:rdata_fifo_sink_ready -> avalon_st_adapter:out_0_ready wire [0:0] avalon_st_adapter_out_0_error; // avalon_st_adapter:out_0_error -> kernel_cra_s0_agent:rdata_fifo_sink_error altera_merlin_master_translator #( .AV_ADDRESS_W (30), .AV_DATA_W (32), .AV_BURSTCOUNT_W (1), .AV_BYTEENABLE_W (4), .UAV_ADDRESS_W (30), .UAV_BURSTCOUNT_W (3), .USE_READ (1), .USE_WRITE (1), .USE_BEGINBURSTTRANSFER (0), .USE_BEGINTRANSFER (0), .USE_CHIPSELECT (0), .USE_BURSTCOUNT (1), .USE_READDATAVALID (1), .USE_WAITREQUEST (1), .USE_READRESPONSE (0), .USE_WRITERESPONSE (0), .AV_SYMBOLS_PER_WORD (4), .AV_ADDRESS_SYMBOLS (1), .AV_BURSTCOUNT_SYMBOLS (0), .AV_CONSTANT_BURST_BEHAVIOR (0), .UAV_CONSTANT_BURST_BEHAVIOR (0), .AV_LINEWRAPBURSTS (0), .AV_REGISTERINCOMINGSIGNALS (0) ) address_span_extender_0_expanded_master_translator ( .clk (kernel_clk_out_clk_clk), // clk.clk .reset (address_span_extender_0_reset_reset_bridge_in_reset_reset), // reset.reset .uav_address (address_span_extender_0_expanded_master_translator_avalon_universal_master_0_address), // avalon_universal_master_0.address .uav_burstcount (address_span_extender_0_expanded_master_translator_avalon_universal_master_0_burstcount), // .burstcount .uav_read (address_span_extender_0_expanded_master_translator_avalon_universal_master_0_read), // .read .uav_write (address_span_extender_0_expanded_master_translator_avalon_universal_master_0_write), // .write .uav_waitrequest (address_span_extender_0_expanded_master_translator_avalon_universal_master_0_waitrequest), // .waitrequest .uav_readdatavalid (address_span_extender_0_expanded_master_translator_avalon_universal_master_0_readdatavalid), // .readdatavalid .uav_byteenable (address_span_extender_0_expanded_master_translator_avalon_universal_master_0_byteenable), // .byteenable .uav_readdata (address_span_extender_0_expanded_master_translator_avalon_universal_master_0_readdata), // .readdata .uav_writedata (address_span_extender_0_expanded_master_translator_avalon_universal_master_0_writedata), // .writedata .uav_lock (address_span_extender_0_expanded_master_translator_avalon_universal_master_0_lock), // .lock .uav_debugaccess (address_span_extender_0_expanded_master_translator_avalon_universal_master_0_debugaccess), // .debugaccess .av_address (address_span_extender_0_expanded_master_address), // avalon_anti_master_0.address .av_waitrequest (address_span_extender_0_expanded_master_waitrequest), // .waitrequest .av_burstcount (address_span_extender_0_expanded_master_burstcount), // .burstcount .av_byteenable (address_span_extender_0_expanded_master_byteenable), // .byteenable .av_read (address_span_extender_0_expanded_master_read), // .read .av_readdata (address_span_extender_0_expanded_master_readdata), // .readdata .av_readdatavalid (address_span_extender_0_expanded_master_readdatavalid), // .readdatavalid .av_write (address_span_extender_0_expanded_master_write), // .write .av_writedata (address_span_extender_0_expanded_master_writedata), // .writedata .av_beginbursttransfer (1'b0), // (terminated) .av_begintransfer (1'b0), // (terminated) .av_chipselect (1'b0), // (terminated) .av_lock (1'b0), // (terminated) .av_debugaccess (1'b0), // (terminated) .uav_clken (), // (terminated) .av_clken (1'b1), // (terminated) .uav_response (2'b00), // (terminated) .av_response (), // (terminated) .uav_writeresponsevalid (1'b0), // (terminated) .av_writeresponsevalid () // (terminated) ); altera_merlin_slave_translator #( .AV_ADDRESS_W (30), .AV_DATA_W (64), .UAV_DATA_W (64), .AV_BURSTCOUNT_W (1), .AV_BYTEENABLE_W (8), .UAV_BYTEENABLE_W (8), .UAV_ADDRESS_W (30), .UAV_BURSTCOUNT_W (4), .AV_READLATENCY (0), .USE_READDATAVALID (1), .USE_WAITREQUEST (1), .USE_UAV_CLKEN (0), .USE_READRESPONSE (0), .USE_WRITERESPONSE (0), .AV_SYMBOLS_PER_WORD (8), .AV_ADDRESS_SYMBOLS (1), .AV_BURSTCOUNT_SYMBOLS (0), .AV_CONSTANT_BURST_BEHAVIOR (0), .UAV_CONSTANT_BURST_BEHAVIOR (0), .AV_REQUIRE_UNALIGNED_ADDRESSES (0), .CHIPSELECT_THROUGH_READLATENCY (0), .AV_READ_WAIT_CYCLES (0), .AV_WRITE_WAIT_CYCLES (0), .AV_SETUP_WAIT_CYCLES (0), .AV_DATA_HOLD_CYCLES (0) ) kernel_cra_s0_translator ( .clk (kernel_clk_out_clk_clk), // clk.clk .reset (kernel_cra_reset_reset_bridge_in_reset_reset), // reset.reset .uav_address (kernel_cra_s0_agent_m0_address), // avalon_universal_slave_0.address .uav_burstcount (kernel_cra_s0_agent_m0_burstcount), // .burstcount .uav_read (kernel_cra_s0_agent_m0_read), // .read .uav_write (kernel_cra_s0_agent_m0_write), // .write .uav_waitrequest (kernel_cra_s0_agent_m0_waitrequest), // .waitrequest .uav_readdatavalid (kernel_cra_s0_agent_m0_readdatavalid), // .readdatavalid .uav_byteenable (kernel_cra_s0_agent_m0_byteenable), // .byteenable .uav_readdata (kernel_cra_s0_agent_m0_readdata), // .readdata .uav_writedata (kernel_cra_s0_agent_m0_writedata), // .writedata .uav_lock (kernel_cra_s0_agent_m0_lock), // .lock .uav_debugaccess (kernel_cra_s0_agent_m0_debugaccess), // .debugaccess .av_address (kernel_cra_s0_address), // avalon_anti_slave_0.address .av_write (kernel_cra_s0_write), // .write .av_read (kernel_cra_s0_read), // .read .av_readdata (kernel_cra_s0_readdata), // .readdata .av_writedata (kernel_cra_s0_writedata), // .writedata .av_burstcount (kernel_cra_s0_burstcount), // .burstcount .av_byteenable (kernel_cra_s0_byteenable), // .byteenable .av_readdatavalid (kernel_cra_s0_readdatavalid), // .readdatavalid .av_waitrequest (kernel_cra_s0_waitrequest), // .waitrequest .av_debugaccess (kernel_cra_s0_debugaccess), // .debugaccess .av_begintransfer (), // (terminated) .av_beginbursttransfer (), // (terminated) .av_writebyteenable (), // (terminated) .av_lock (), // (terminated) .av_chipselect (), // (terminated) .av_clken (), // (terminated) .uav_clken (1'b0), // (terminated) .av_outputenable (), // (terminated) .uav_response (), // (terminated) .av_response (2'b00), // (terminated) .uav_writeresponsevalid (), // (terminated) .av_writeresponsevalid (1'b0) // (terminated) ); altera_merlin_master_agent #( .PKT_ORI_BURST_SIZE_H (100), .PKT_ORI_BURST_SIZE_L (98), .PKT_RESPONSE_STATUS_H (97), .PKT_RESPONSE_STATUS_L (96), .PKT_QOS_H (85), .PKT_QOS_L (85), .PKT_DATA_SIDEBAND_H (83), .PKT_DATA_SIDEBAND_L (83), .PKT_ADDR_SIDEBAND_H (82), .PKT_ADDR_SIDEBAND_L (82), .PKT_BURST_TYPE_H (81), .PKT_BURST_TYPE_L (80), .PKT_CACHE_H (95), .PKT_CACHE_L (92), .PKT_THREAD_ID_H (88), .PKT_THREAD_ID_L (88), .PKT_BURST_SIZE_H (79), .PKT_BURST_SIZE_L (77), .PKT_TRANS_EXCLUSIVE (71), .PKT_TRANS_LOCK (70), .PKT_BEGIN_BURST (84), .PKT_PROTECTION_H (91), .PKT_PROTECTION_L (89), .PKT_BURSTWRAP_H (76), .PKT_BURSTWRAP_L (76), .PKT_BYTE_CNT_H (75), .PKT_BYTE_CNT_L (72), .PKT_ADDR_H (65), .PKT_ADDR_L (36), .PKT_TRANS_COMPRESSED_READ (66), .PKT_TRANS_POSTED (67), .PKT_TRANS_WRITE (68), .PKT_TRANS_READ (69), .PKT_DATA_H (31), .PKT_DATA_L (0), .PKT_BYTEEN_H (35), .PKT_BYTEEN_L (32), .PKT_SRC_ID_H (86), .PKT_SRC_ID_L (86), .PKT_DEST_ID_H (87), .PKT_DEST_ID_L (87), .ST_DATA_W (101), .ST_CHANNEL_W (1), .AV_BURSTCOUNT_W (3), .SUPPRESS_0_BYTEEN_RSP (1), .ID (0), .BURSTWRAP_VALUE (1), .CACHE_VALUE (0), .SECURE_ACCESS_BIT (1), .USE_READRESPONSE (0), .USE_WRITERESPONSE (0) ) address_span_extender_0_expanded_master_agent ( .clk (kernel_clk_out_clk_clk), // clk.clk .reset (address_span_extender_0_reset_reset_bridge_in_reset_reset), // clk_reset.reset .av_address (address_span_extender_0_expanded_master_translator_avalon_universal_master_0_address), // av.address .av_write (address_span_extender_0_expanded_master_translator_avalon_universal_master_0_write), // .write .av_read (address_span_extender_0_expanded_master_translator_avalon_universal_master_0_read), // .read .av_writedata (address_span_extender_0_expanded_master_translator_avalon_universal_master_0_writedata), // .writedata .av_readdata (address_span_extender_0_expanded_master_translator_avalon_universal_master_0_readdata), // .readdata .av_waitrequest (address_span_extender_0_expanded_master_translator_avalon_universal_master_0_waitrequest), // .waitrequest .av_readdatavalid (address_span_extender_0_expanded_master_translator_avalon_universal_master_0_readdatavalid), // .readdatavalid .av_byteenable (address_span_extender_0_expanded_master_translator_avalon_universal_master_0_byteenable), // .byteenable .av_burstcount (address_span_extender_0_expanded_master_translator_avalon_universal_master_0_burstcount), // .burstcount .av_debugaccess (address_span_extender_0_expanded_master_translator_avalon_universal_master_0_debugaccess), // .debugaccess .av_lock (address_span_extender_0_expanded_master_translator_avalon_universal_master_0_lock), // .lock .cp_valid (address_span_extender_0_expanded_master_agent_cp_valid), // cp.valid .cp_data (address_span_extender_0_expanded_master_agent_cp_data), // .data .cp_startofpacket (address_span_extender_0_expanded_master_agent_cp_startofpacket), // .startofpacket .cp_endofpacket (address_span_extender_0_expanded_master_agent_cp_endofpacket), // .endofpacket .cp_ready (address_span_extender_0_expanded_master_agent_cp_ready), // .ready .rp_valid (rsp_mux_src_valid), // rp.valid .rp_data (rsp_mux_src_data), // .data .rp_channel (rsp_mux_src_channel), // .channel .rp_startofpacket (rsp_mux_src_startofpacket), // .startofpacket .rp_endofpacket (rsp_mux_src_endofpacket), // .endofpacket .rp_ready (rsp_mux_src_ready), // .ready .av_response (), // (terminated) .av_writeresponsevalid () // (terminated) ); altera_merlin_slave_agent #( .PKT_ORI_BURST_SIZE_H (136), .PKT_ORI_BURST_SIZE_L (134), .PKT_RESPONSE_STATUS_H (133), .PKT_RESPONSE_STATUS_L (132), .PKT_BURST_SIZE_H (115), .PKT_BURST_SIZE_L (113), .PKT_TRANS_LOCK (106), .PKT_BEGIN_BURST (120), .PKT_PROTECTION_H (127), .PKT_PROTECTION_L (125), .PKT_BURSTWRAP_H (112), .PKT_BURSTWRAP_L (112), .PKT_BYTE_CNT_H (111), .PKT_BYTE_CNT_L (108), .PKT_ADDR_H (101), .PKT_ADDR_L (72), .PKT_TRANS_COMPRESSED_READ (102), .PKT_TRANS_POSTED (103), .PKT_TRANS_WRITE (104), .PKT_TRANS_READ (105), .PKT_DATA_H (63), .PKT_DATA_L (0), .PKT_BYTEEN_H (71), .PKT_BYTEEN_L (64), .PKT_SRC_ID_H (122), .PKT_SRC_ID_L (122), .PKT_DEST_ID_H (123), .PKT_DEST_ID_L (123), .PKT_SYMBOL_W (8), .ST_CHANNEL_W (1), .ST_DATA_W (137), .AVS_BURSTCOUNT_W (4), .SUPPRESS_0_BYTEEN_CMD (0), .PREVENT_FIFO_OVERFLOW (1), .USE_READRESPONSE (0), .USE_WRITERESPONSE (0), .ECC_ENABLE (0) ) kernel_cra_s0_agent ( .clk (kernel_clk_out_clk_clk), // clk.clk .reset (kernel_cra_reset_reset_bridge_in_reset_reset), // clk_reset.reset .m0_address (kernel_cra_s0_agent_m0_address), // m0.address .m0_burstcount (kernel_cra_s0_agent_m0_burstcount), // .burstcount .m0_byteenable (kernel_cra_s0_agent_m0_byteenable), // .byteenable .m0_debugaccess (kernel_cra_s0_agent_m0_debugaccess), // .debugaccess .m0_lock (kernel_cra_s0_agent_m0_lock), // .lock .m0_readdata (kernel_cra_s0_agent_m0_readdata), // .readdata .m0_readdatavalid (kernel_cra_s0_agent_m0_readdatavalid), // .readdatavalid .m0_read (kernel_cra_s0_agent_m0_read), // .read .m0_waitrequest (kernel_cra_s0_agent_m0_waitrequest), // .waitrequest .m0_writedata (kernel_cra_s0_agent_m0_writedata), // .writedata .m0_write (kernel_cra_s0_agent_m0_write), // .write .rp_endofpacket (kernel_cra_s0_agent_rp_endofpacket), // rp.endofpacket .rp_ready (kernel_cra_s0_agent_rp_ready), // .ready .rp_valid (kernel_cra_s0_agent_rp_valid), // .valid .rp_data (kernel_cra_s0_agent_rp_data), // .data .rp_startofpacket (kernel_cra_s0_agent_rp_startofpacket), // .startofpacket .cp_ready (kernel_cra_s0_cmd_width_adapter_src_ready), // cp.ready .cp_valid (kernel_cra_s0_cmd_width_adapter_src_valid), // .valid .cp_data (kernel_cra_s0_cmd_width_adapter_src_data), // .data .cp_startofpacket (kernel_cra_s0_cmd_width_adapter_src_startofpacket), // .startofpacket .cp_endofpacket (kernel_cra_s0_cmd_width_adapter_src_endofpacket), // .endofpacket .cp_channel (kernel_cra_s0_cmd_width_adapter_src_channel), // .channel .rf_sink_ready (kernel_cra_s0_agent_rsp_fifo_out_ready), // rf_sink.ready .rf_sink_valid (kernel_cra_s0_agent_rsp_fifo_out_valid), // .valid .rf_sink_startofpacket (kernel_cra_s0_agent_rsp_fifo_out_startofpacket), // .startofpacket .rf_sink_endofpacket (kernel_cra_s0_agent_rsp_fifo_out_endofpacket), // .endofpacket .rf_sink_data (kernel_cra_s0_agent_rsp_fifo_out_data), // .data .rf_source_ready (kernel_cra_s0_agent_rf_source_ready), // rf_source.ready .rf_source_valid (kernel_cra_s0_agent_rf_source_valid), // .valid .rf_source_startofpacket (kernel_cra_s0_agent_rf_source_startofpacket), // .startofpacket .rf_source_endofpacket (kernel_cra_s0_agent_rf_source_endofpacket), // .endofpacket .rf_source_data (kernel_cra_s0_agent_rf_source_data), // .data .rdata_fifo_sink_ready (avalon_st_adapter_out_0_ready), // rdata_fifo_sink.ready .rdata_fifo_sink_valid (avalon_st_adapter_out_0_valid), // .valid .rdata_fifo_sink_data (avalon_st_adapter_out_0_data), // .data .rdata_fifo_sink_error (avalon_st_adapter_out_0_error), // .error .rdata_fifo_src_ready (kernel_cra_s0_agent_rdata_fifo_src_ready), // rdata_fifo_src.ready .rdata_fifo_src_valid (kernel_cra_s0_agent_rdata_fifo_src_valid), // .valid .rdata_fifo_src_data (kernel_cra_s0_agent_rdata_fifo_src_data), // .data .m0_response (2'b00), // (terminated) .m0_writeresponsevalid (1'b0) // (terminated) ); altera_avalon_sc_fifo #( .SYMBOLS_PER_BEAT (1), .BITS_PER_SYMBOL (138), .FIFO_DEPTH (2), .CHANNEL_WIDTH (0), .ERROR_WIDTH (0), .USE_PACKETS (1), .USE_FILL_LEVEL (0), .EMPTY_LATENCY (1), .USE_MEMORY_BLOCKS (0), .USE_STORE_FORWARD (0), .USE_ALMOST_FULL_IF (0), .USE_ALMOST_EMPTY_IF (0) ) kernel_cra_s0_agent_rsp_fifo ( .clk (kernel_clk_out_clk_clk), // clk.clk .reset (kernel_cra_reset_reset_bridge_in_reset_reset), // clk_reset.reset .in_data (kernel_cra_s0_agent_rf_source_data), // in.data .in_valid (kernel_cra_s0_agent_rf_source_valid), // .valid .in_ready (kernel_cra_s0_agent_rf_source_ready), // .ready .in_startofpacket (kernel_cra_s0_agent_rf_source_startofpacket), // .startofpacket .in_endofpacket (kernel_cra_s0_agent_rf_source_endofpacket), // .endofpacket .out_data (kernel_cra_s0_agent_rsp_fifo_out_data), // out.data .out_valid (kernel_cra_s0_agent_rsp_fifo_out_valid), // .valid .out_ready (kernel_cra_s0_agent_rsp_fifo_out_ready), // .ready .out_startofpacket (kernel_cra_s0_agent_rsp_fifo_out_startofpacket), // .startofpacket .out_endofpacket (kernel_cra_s0_agent_rsp_fifo_out_endofpacket), // .endofpacket .csr_address (2'b00), // (terminated) .csr_read (1'b0), // (terminated) .csr_write (1'b0), // (terminated) .csr_readdata (), // (terminated) .csr_writedata (32'b00000000000000000000000000000000), // (terminated) .almost_full_data (), // (terminated) .almost_empty_data (), // (terminated) .in_empty (1'b0), // (terminated) .out_empty (), // (terminated) .in_error (1'b0), // (terminated) .out_error (), // (terminated) .in_channel (1'b0), // (terminated) .out_channel () // (terminated) ); system_acl_iface_acl_kernel_interface_mm_interconnect_0_router router ( .sink_ready (address_span_extender_0_expanded_master_agent_cp_ready), // sink.ready .sink_valid (address_span_extender_0_expanded_master_agent_cp_valid), // .valid .sink_data (address_span_extender_0_expanded_master_agent_cp_data), // .data .sink_startofpacket (address_span_extender_0_expanded_master_agent_cp_startofpacket), // .startofpacket .sink_endofpacket (address_span_extender_0_expanded_master_agent_cp_endofpacket), // .endofpacket .clk (kernel_clk_out_clk_clk), // clk.clk .reset (address_span_extender_0_reset_reset_bridge_in_reset_reset), // clk_reset.reset .src_ready (router_src_ready), // src.ready .src_valid (router_src_valid), // .valid .src_data (router_src_data), // .data .src_channel (router_src_channel), // .channel .src_startofpacket (router_src_startofpacket), // .startofpacket .src_endofpacket (router_src_endofpacket) // .endofpacket ); system_acl_iface_acl_kernel_interface_mm_interconnect_0_router_001 router_001 ( .sink_ready (kernel_cra_s0_agent_rp_ready), // sink.ready .sink_valid (kernel_cra_s0_agent_rp_valid), // .valid .sink_data (kernel_cra_s0_agent_rp_data), // .data .sink_startofpacket (kernel_cra_s0_agent_rp_startofpacket), // .startofpacket .sink_endofpacket (kernel_cra_s0_agent_rp_endofpacket), // .endofpacket .clk (kernel_clk_out_clk_clk), // clk.clk .reset (kernel_cra_reset_reset_bridge_in_reset_reset), // clk_reset.reset .src_ready (router_001_src_ready), // src.ready .src_valid (router_001_src_valid), // .valid .src_data (router_001_src_data), // .data .src_channel (router_001_src_channel), // .channel .src_startofpacket (router_001_src_startofpacket), // .startofpacket .src_endofpacket (router_001_src_endofpacket) // .endofpacket ); system_acl_iface_acl_kernel_interface_mm_interconnect_0_cmd_demux cmd_demux ( .clk (kernel_clk_out_clk_clk), // clk.clk .reset (address_span_extender_0_reset_reset_bridge_in_reset_reset), // clk_reset.reset .sink_ready (router_src_ready), // sink.ready .sink_channel (router_src_channel), // .channel .sink_data (router_src_data), // .data .sink_startofpacket (router_src_startofpacket), // .startofpacket .sink_endofpacket (router_src_endofpacket), // .endofpacket .sink_valid (router_src_valid), // .valid .src0_ready (cmd_demux_src0_ready), // src0.ready .src0_valid (cmd_demux_src0_valid), // .valid .src0_data (cmd_demux_src0_data), // .data .src0_channel (cmd_demux_src0_channel), // .channel .src0_startofpacket (cmd_demux_src0_startofpacket), // .startofpacket .src0_endofpacket (cmd_demux_src0_endofpacket) // .endofpacket ); system_acl_iface_acl_kernel_interface_mm_interconnect_0_cmd_mux cmd_mux ( .clk (kernel_clk_out_clk_clk), // clk.clk .reset (kernel_cra_reset_reset_bridge_in_reset_reset), // clk_reset.reset .src_ready (cmd_mux_src_ready), // src.ready .src_valid (cmd_mux_src_valid), // .valid .src_data (cmd_mux_src_data), // .data .src_channel (cmd_mux_src_channel), // .channel .src_startofpacket (cmd_mux_src_startofpacket), // .startofpacket .src_endofpacket (cmd_mux_src_endofpacket), // .endofpacket .sink0_ready (cmd_demux_src0_ready), // sink0.ready .sink0_valid (cmd_demux_src0_valid), // .valid .sink0_channel (cmd_demux_src0_channel), // .channel .sink0_data (cmd_demux_src0_data), // .data .sink0_startofpacket (cmd_demux_src0_startofpacket), // .startofpacket .sink0_endofpacket (cmd_demux_src0_endofpacket) // .endofpacket ); system_acl_iface_acl_kernel_interface_mm_interconnect_0_cmd_demux rsp_demux ( .clk (kernel_clk_out_clk_clk), // clk.clk .reset (kernel_cra_reset_reset_bridge_in_reset_reset), // clk_reset.reset .sink_ready (kernel_cra_s0_rsp_width_adapter_src_ready), // sink.ready .sink_channel (kernel_cra_s0_rsp_width_adapter_src_channel), // .channel .sink_data (kernel_cra_s0_rsp_width_adapter_src_data), // .data .sink_startofpacket (kernel_cra_s0_rsp_width_adapter_src_startofpacket), // .startofpacket .sink_endofpacket (kernel_cra_s0_rsp_width_adapter_src_endofpacket), // .endofpacket .sink_valid (kernel_cra_s0_rsp_width_adapter_src_valid), // .valid .src0_ready (rsp_demux_src0_ready), // src0.ready .src0_valid (rsp_demux_src0_valid), // .valid .src0_data (rsp_demux_src0_data), // .data .src0_channel (rsp_demux_src0_channel), // .channel .src0_startofpacket (rsp_demux_src0_startofpacket), // .startofpacket .src0_endofpacket (rsp_demux_src0_endofpacket) // .endofpacket ); system_acl_iface_acl_kernel_interface_mm_interconnect_0_rsp_mux rsp_mux ( .clk (kernel_clk_out_clk_clk), // clk.clk .reset (address_span_extender_0_reset_reset_bridge_in_reset_reset), // clk_reset.reset .src_ready (rsp_mux_src_ready), // src.ready .src_valid (rsp_mux_src_valid), // .valid .src_data (rsp_mux_src_data), // .data .src_channel (rsp_mux_src_channel), // .channel .src_startofpacket (rsp_mux_src_startofpacket), // .startofpacket .src_endofpacket (rsp_mux_src_endofpacket), // .endofpacket .sink0_ready (rsp_demux_src0_ready), // sink0.ready .sink0_valid (rsp_demux_src0_valid), // .valid .sink0_channel (rsp_demux_src0_channel), // .channel .sink0_data (rsp_demux_src0_data), // .data .sink0_startofpacket (rsp_demux_src0_startofpacket), // .startofpacket .sink0_endofpacket (rsp_demux_src0_endofpacket) // .endofpacket ); altera_merlin_width_adapter #( .IN_PKT_ADDR_H (65), .IN_PKT_ADDR_L (36), .IN_PKT_DATA_H (31), .IN_PKT_DATA_L (0), .IN_PKT_BYTEEN_H (35), .IN_PKT_BYTEEN_L (32), .IN_PKT_BYTE_CNT_H (75), .IN_PKT_BYTE_CNT_L (72), .IN_PKT_TRANS_COMPRESSED_READ (66), .IN_PKT_TRANS_WRITE (68), .IN_PKT_BURSTWRAP_H (76), .IN_PKT_BURSTWRAP_L (76), .IN_PKT_BURST_SIZE_H (79), .IN_PKT_BURST_SIZE_L (77), .IN_PKT_RESPONSE_STATUS_H (97), .IN_PKT_RESPONSE_STATUS_L (96), .IN_PKT_TRANS_EXCLUSIVE (71), .IN_PKT_BURST_TYPE_H (81), .IN_PKT_BURST_TYPE_L (80), .IN_PKT_ORI_BURST_SIZE_L (98), .IN_PKT_ORI_BURST_SIZE_H (100), .IN_ST_DATA_W (101), .OUT_PKT_ADDR_H (101), .OUT_PKT_ADDR_L (72), .OUT_PKT_DATA_H (63), .OUT_PKT_DATA_L (0), .OUT_PKT_BYTEEN_H (71), .OUT_PKT_BYTEEN_L (64), .OUT_PKT_BYTE_CNT_H (111), .OUT_PKT_BYTE_CNT_L (108), .OUT_PKT_TRANS_COMPRESSED_READ (102), .OUT_PKT_BURST_SIZE_H (115), .OUT_PKT_BURST_SIZE_L (113), .OUT_PKT_RESPONSE_STATUS_H (133), .OUT_PKT_RESPONSE_STATUS_L (132), .OUT_PKT_TRANS_EXCLUSIVE (107), .OUT_PKT_BURST_TYPE_H (117), .OUT_PKT_BURST_TYPE_L (116), .OUT_PKT_ORI_BURST_SIZE_L (134), .OUT_PKT_ORI_BURST_SIZE_H (136), .OUT_ST_DATA_W (137), .ST_CHANNEL_W (1), .OPTIMIZE_FOR_RSP (0), .RESPONSE_PATH (0), .CONSTANT_BURST_SIZE (1), .PACKING (1), .ENABLE_ADDRESS_ALIGNMENT (0) ) kernel_cra_s0_cmd_width_adapter ( .clk (kernel_clk_out_clk_clk), // clk.clk .reset (kernel_cra_reset_reset_bridge_in_reset_reset), // clk_reset.reset .in_valid (cmd_mux_src_valid), // sink.valid .in_channel (cmd_mux_src_channel), // .channel .in_startofpacket (cmd_mux_src_startofpacket), // .startofpacket .in_endofpacket (cmd_mux_src_endofpacket), // .endofpacket .in_ready (cmd_mux_src_ready), // .ready .in_data (cmd_mux_src_data), // .data .out_endofpacket (kernel_cra_s0_cmd_width_adapter_src_endofpacket), // src.endofpacket .out_data (kernel_cra_s0_cmd_width_adapter_src_data), // .data .out_channel (kernel_cra_s0_cmd_width_adapter_src_channel), // .channel .out_valid (kernel_cra_s0_cmd_width_adapter_src_valid), // .valid .out_ready (kernel_cra_s0_cmd_width_adapter_src_ready), // .ready .out_startofpacket (kernel_cra_s0_cmd_width_adapter_src_startofpacket), // .startofpacket .in_command_size_data (3'b000) // (terminated) ); altera_merlin_width_adapter #( .IN_PKT_ADDR_H (101), .IN_PKT_ADDR_L (72), .IN_PKT_DATA_H (63), .IN_PKT_DATA_L (0), .IN_PKT_BYTEEN_H (71), .IN_PKT_BYTEEN_L (64), .IN_PKT_BYTE_CNT_H (111), .IN_PKT_BYTE_CNT_L (108), .IN_PKT_TRANS_COMPRESSED_READ (102), .IN_PKT_TRANS_WRITE (104), .IN_PKT_BURSTWRAP_H (112), .IN_PKT_BURSTWRAP_L (112), .IN_PKT_BURST_SIZE_H (115), .IN_PKT_BURST_SIZE_L (113), .IN_PKT_RESPONSE_STATUS_H (133), .IN_PKT_RESPONSE_STATUS_L (132), .IN_PKT_TRANS_EXCLUSIVE (107), .IN_PKT_BURST_TYPE_H (117), .IN_PKT_BURST_TYPE_L (116), .IN_PKT_ORI_BURST_SIZE_L (134), .IN_PKT_ORI_BURST_SIZE_H (136), .IN_ST_DATA_W (137), .OUT_PKT_ADDR_H (65), .OUT_PKT_ADDR_L (36), .OUT_PKT_DATA_H (31), .OUT_PKT_DATA_L (0), .OUT_PKT_BYTEEN_H (35), .OUT_PKT_BYTEEN_L (32), .OUT_PKT_BYTE_CNT_H (75), .OUT_PKT_BYTE_CNT_L (72), .OUT_PKT_TRANS_COMPRESSED_READ (66), .OUT_PKT_BURST_SIZE_H (79), .OUT_PKT_BURST_SIZE_L (77), .OUT_PKT_RESPONSE_STATUS_H (97), .OUT_PKT_RESPONSE_STATUS_L (96), .OUT_PKT_TRANS_EXCLUSIVE (71), .OUT_PKT_BURST_TYPE_H (81), .OUT_PKT_BURST_TYPE_L (80), .OUT_PKT_ORI_BURST_SIZE_L (98), .OUT_PKT_ORI_BURST_SIZE_H (100), .OUT_ST_DATA_W (101), .ST_CHANNEL_W (1), .OPTIMIZE_FOR_RSP (1), .RESPONSE_PATH (1), .CONSTANT_BURST_SIZE (1), .PACKING (1), .ENABLE_ADDRESS_ALIGNMENT (0) ) kernel_cra_s0_rsp_width_adapter ( .clk (kernel_clk_out_clk_clk), // clk.clk .reset (kernel_cra_reset_reset_bridge_in_reset_reset), // clk_reset.reset .in_valid (router_001_src_valid), // sink.valid .in_channel (router_001_src_channel), // .channel .in_startofpacket (router_001_src_startofpacket), // .startofpacket .in_endofpacket (router_001_src_endofpacket), // .endofpacket .in_ready (router_001_src_ready), // .ready .in_data (router_001_src_data), // .data .out_endofpacket (kernel_cra_s0_rsp_width_adapter_src_endofpacket), // src.endofpacket .out_data (kernel_cra_s0_rsp_width_adapter_src_data), // .data .out_channel (kernel_cra_s0_rsp_width_adapter_src_channel), // .channel .out_valid (kernel_cra_s0_rsp_width_adapter_src_valid), // .valid .out_ready (kernel_cra_s0_rsp_width_adapter_src_ready), // .ready .out_startofpacket (kernel_cra_s0_rsp_width_adapter_src_startofpacket), // .startofpacket .in_command_size_data (3'b000) // (terminated) ); system_acl_iface_acl_kernel_interface_mm_interconnect_0_avalon_st_adapter #( .inBitsPerSymbol (66), .inUsePackets (0), .inDataWidth (66), .inChannelWidth (0), .inErrorWidth (0), .inUseEmptyPort (0), .inUseValid (1), .inUseReady (1), .inReadyLatency (0), .outDataWidth (66), .outChannelWidth (0), .outErrorWidth (1), .outUseEmptyPort (0), .outUseValid (1), .outUseReady (1), .outReadyLatency (0) ) avalon_st_adapter ( .in_clk_0_clk (kernel_clk_out_clk_clk), // in_clk_0.clk .in_rst_0_reset (kernel_cra_reset_reset_bridge_in_reset_reset), // in_rst_0.reset .in_0_data (kernel_cra_s0_agent_rdata_fifo_src_data), // in_0.data .in_0_valid (kernel_cra_s0_agent_rdata_fifo_src_valid), // .valid .in_0_ready (kernel_cra_s0_agent_rdata_fifo_src_ready), // .ready .out_0_data (avalon_st_adapter_out_0_data), // out_0.data .out_0_valid (avalon_st_adapter_out_0_valid), // .valid .out_0_ready (avalon_st_adapter_out_0_ready), // .ready .out_0_error (avalon_st_adapter_out_0_error) // .error ); endmodule
// megafunction wizard: %ALTPLL%VBB% // GENERATION: STANDARD // VERSION: WM1.0 // MODULE: altpll // ============================================================ // File Name: SDRAM_clock.v // Megafunction Name(s): // altpll // // Simulation Library Files(s): // altera_mf // ============================================================ // ************************************************************ // THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE! // // 13.1.0 Build 162 10/23/2013 SJ Web Edition // ************************************************************ //Copyright (C) 1991-2013 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 from 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 SDRAM_clock ( areset, inclk0, c0, locked); input areset; input inclk0; output c0; output locked; `ifndef ALTERA_RESERVED_QIS // synopsys translate_off `endif tri0 areset; `ifndef ALTERA_RESERVED_QIS // synopsys translate_on `endif endmodule // ============================================================ // CNX file retrieval info // ============================================================ // Retrieval info: PRIVATE: ACTIVECLK_CHECK STRING "0" // Retrieval info: PRIVATE: BANDWIDTH STRING "1.000" // Retrieval info: PRIVATE: BANDWIDTH_FEATURE_ENABLED STRING "1" // Retrieval info: PRIVATE: BANDWIDTH_FREQ_UNIT STRING "MHz" // Retrieval info: PRIVATE: BANDWIDTH_PRESET STRING "Low" // Retrieval info: PRIVATE: BANDWIDTH_USE_AUTO STRING "1" // Retrieval info: PRIVATE: BANDWIDTH_USE_PRESET STRING "0" // Retrieval info: PRIVATE: CLKBAD_SWITCHOVER_CHECK STRING "0" // Retrieval info: PRIVATE: CLKLOSS_CHECK STRING "0" // Retrieval info: PRIVATE: CLKSWITCH_CHECK STRING "0" // Retrieval info: PRIVATE: CNX_NO_COMPENSATE_RADIO STRING "0" // Retrieval info: PRIVATE: CREATE_CLKBAD_CHECK STRING "0" // Retrieval info: PRIVATE: CREATE_INCLK1_CHECK STRING "0" // Retrieval info: PRIVATE: CUR_DEDICATED_CLK STRING "c0" // Retrieval info: PRIVATE: CUR_FBIN_CLK STRING "c0" // Retrieval info: PRIVATE: DEVICE_SPEED_GRADE STRING "6" // Retrieval info: PRIVATE: DIV_FACTOR0 NUMERIC "1" // Retrieval info: PRIVATE: DUTY_CYCLE0 STRING "50.00000000" // Retrieval info: PRIVATE: EFF_OUTPUT_FREQ_VALUE0 STRING "166.000000" // Retrieval info: PRIVATE: EXPLICIT_SWITCHOVER_COUNTER STRING "0" // Retrieval info: PRIVATE: EXT_FEEDBACK_RADIO STRING "0" // Retrieval info: PRIVATE: GLOCKED_COUNTER_EDIT_CHANGED STRING "1" // Retrieval info: PRIVATE: GLOCKED_FEATURE_ENABLED STRING "0" // Retrieval info: PRIVATE: GLOCKED_MODE_CHECK STRING "0" // Retrieval info: PRIVATE: GLOCK_COUNTER_EDIT NUMERIC "1048575" // Retrieval info: PRIVATE: HAS_MANUAL_SWITCHOVER STRING "1" // Retrieval info: PRIVATE: INCLK0_FREQ_EDIT STRING "50.000" // Retrieval info: PRIVATE: INCLK0_FREQ_UNIT_COMBO STRING "MHz" // Retrieval info: PRIVATE: INCLK1_FREQ_EDIT STRING "100.000" // Retrieval info: PRIVATE: INCLK1_FREQ_EDIT_CHANGED STRING "1" // Retrieval info: PRIVATE: INCLK1_FREQ_UNIT_CHANGED STRING "1" // Retrieval info: PRIVATE: INCLK1_FREQ_UNIT_COMBO STRING "MHz" // Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone III" // Retrieval info: PRIVATE: INT_FEEDBACK__MODE_RADIO STRING "1" // Retrieval info: PRIVATE: LOCKED_OUTPUT_CHECK STRING "1" // Retrieval info: PRIVATE: LONG_SCAN_RADIO STRING "1" // Retrieval info: PRIVATE: LVDS_MODE_DATA_RATE STRING "Not Available" // Retrieval info: PRIVATE: LVDS_MODE_DATA_RATE_DIRTY NUMERIC "0" // Retrieval info: PRIVATE: LVDS_PHASE_SHIFT_UNIT0 STRING "deg" // Retrieval info: PRIVATE: MIG_DEVICE_SPEED_GRADE STRING "Any" // Retrieval info: PRIVATE: MIRROR_CLK0 STRING "0" // Retrieval info: PRIVATE: MULT_FACTOR0 NUMERIC "1" // Retrieval info: PRIVATE: NORMAL_MODE_RADIO STRING "1" // Retrieval info: PRIVATE: OUTPUT_FREQ0 STRING "166.00000000" // Retrieval info: PRIVATE: OUTPUT_FREQ_MODE0 STRING "1" // Retrieval info: PRIVATE: OUTPUT_FREQ_UNIT0 STRING "MHz" // Retrieval info: PRIVATE: PHASE_RECONFIG_FEATURE_ENABLED STRING "1" // Retrieval info: PRIVATE: PHASE_RECONFIG_INPUTS_CHECK STRING "0" // Retrieval info: PRIVATE: PHASE_SHIFT0 STRING "0.00000000" // Retrieval info: PRIVATE: PHASE_SHIFT_STEP_ENABLED_CHECK STRING "0" // Retrieval info: PRIVATE: PHASE_SHIFT_UNIT0 STRING "deg" // Retrieval info: PRIVATE: PLL_ADVANCED_PARAM_CHECK STRING "0" // Retrieval info: PRIVATE: PLL_ARESET_CHECK STRING "1" // Retrieval info: PRIVATE: PLL_AUTOPLL_CHECK NUMERIC "1" // Retrieval info: PRIVATE: PLL_ENHPLL_CHECK NUMERIC "0" // Retrieval info: PRIVATE: PLL_FASTPLL_CHECK NUMERIC "0" // Retrieval info: PRIVATE: PLL_FBMIMIC_CHECK STRING "0" // Retrieval info: PRIVATE: PLL_LVDS_PLL_CHECK NUMERIC "0" // Retrieval info: PRIVATE: PLL_PFDENA_CHECK STRING "0" // Retrieval info: PRIVATE: PLL_TARGET_HARCOPY_CHECK NUMERIC "0" // Retrieval info: PRIVATE: PRIMARY_CLK_COMBO STRING "inclk0" // Retrieval info: PRIVATE: RECONFIG_FILE STRING "SDRAM_clock.mif" // Retrieval info: PRIVATE: SACN_INPUTS_CHECK STRING "0" // Retrieval info: PRIVATE: SCAN_FEATURE_ENABLED STRING "1" // Retrieval info: PRIVATE: SELF_RESET_LOCK_LOSS STRING "0" // Retrieval info: PRIVATE: SHORT_SCAN_RADIO STRING "0" // Retrieval info: PRIVATE: SPREAD_FEATURE_ENABLED STRING "0" // Retrieval info: PRIVATE: SPREAD_FREQ STRING "50.000" // Retrieval info: PRIVATE: SPREAD_FREQ_UNIT STRING "KHz" // Retrieval info: PRIVATE: SPREAD_PERCENT STRING "0.500" // Retrieval info: PRIVATE: SPREAD_USE STRING "0" // Retrieval info: PRIVATE: SRC_SYNCH_COMP_RADIO STRING "0" // Retrieval info: PRIVATE: STICKY_CLK0 STRING "1" // Retrieval info: PRIVATE: SWITCHOVER_COUNT_EDIT NUMERIC "1" // Retrieval info: PRIVATE: SWITCHOVER_FEATURE_ENABLED STRING "1" // Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0" // Retrieval info: PRIVATE: USE_CLK0 STRING "1" // Retrieval info: PRIVATE: USE_CLKENA0 STRING "0" // Retrieval info: PRIVATE: USE_MIL_SPEED_GRADE NUMERIC "0" // Retrieval info: PRIVATE: ZERO_DELAY_RADIO STRING "0" // Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all // Retrieval info: CONSTANT: BANDWIDTH_TYPE STRING "AUTO" // Retrieval info: CONSTANT: CLK0_DIVIDE_BY NUMERIC "25" // Retrieval info: CONSTANT: CLK0_DUTY_CYCLE NUMERIC "50" // Retrieval info: CONSTANT: CLK0_MULTIPLY_BY NUMERIC "83" // Retrieval info: CONSTANT: CLK0_PHASE_SHIFT STRING "0" // Retrieval info: CONSTANT: COMPENSATE_CLOCK STRING "CLK0" // Retrieval info: CONSTANT: INCLK0_INPUT_FREQUENCY NUMERIC "20000" // Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone III" // Retrieval info: CONSTANT: LPM_TYPE STRING "altpll" // Retrieval info: CONSTANT: OPERATION_MODE STRING "NORMAL" // Retrieval info: CONSTANT: PLL_TYPE STRING "AUTO" // Retrieval info: CONSTANT: PORT_ACTIVECLOCK STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_ARESET STRING "PORT_USED" // Retrieval info: CONSTANT: PORT_CLKBAD0 STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_CLKBAD1 STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_CLKLOSS STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_CLKSWITCH STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_CONFIGUPDATE STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_FBIN STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_INCLK0 STRING "PORT_USED" // Retrieval info: CONSTANT: PORT_INCLK1 STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_LOCKED STRING "PORT_USED" // Retrieval info: CONSTANT: PORT_PFDENA STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_PHASECOUNTERSELECT STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_PHASEDONE STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_PHASESTEP STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_PHASEUPDOWN STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_PLLENA STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_SCANACLR STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_SCANCLK STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_SCANCLKENA STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_SCANDATA STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_SCANDATAOUT STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_SCANDONE STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_SCANREAD STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_SCANWRITE STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_clk0 STRING "PORT_USED" // Retrieval info: CONSTANT: PORT_clk1 STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_clk2 STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_clk3 STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_clk4 STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_clk5 STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_clkena0 STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_clkena1 STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_clkena2 STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_clkena3 STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_clkena4 STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_clkena5 STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_extclk0 STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_extclk1 STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_extclk2 STRING "PORT_UNUSED" // Retrieval info: CONSTANT: PORT_extclk3 STRING "PORT_UNUSED" // Retrieval info: CONSTANT: SELF_RESET_ON_LOSS_LOCK STRING "OFF" // Retrieval info: CONSTANT: WIDTH_CLOCK NUMERIC "5" // Retrieval info: USED_PORT: @clk 0 0 5 0 OUTPUT_CLK_EXT VCC "@clk[4..0]" // Retrieval info: USED_PORT: areset 0 0 0 0 INPUT GND "areset" // Retrieval info: USED_PORT: c0 0 0 0 0 OUTPUT_CLK_EXT VCC "c0" // Retrieval info: USED_PORT: inclk0 0 0 0 0 INPUT_CLK_EXT GND "inclk0" // Retrieval info: USED_PORT: locked 0 0 0 0 OUTPUT GND "locked" // Retrieval info: CONNECT: @areset 0 0 0 0 areset 0 0 0 0 // Retrieval info: CONNECT: @inclk 0 0 1 1 GND 0 0 0 0 // Retrieval info: CONNECT: @inclk 0 0 1 0 inclk0 0 0 0 0 // Retrieval info: CONNECT: c0 0 0 0 0 @clk 0 0 1 0 // Retrieval info: CONNECT: locked 0 0 0 0 @locked 0 0 0 0 // Retrieval info: GEN_FILE: TYPE_NORMAL SDRAM_clock.v TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL SDRAM_clock.ppf TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL SDRAM_clock.inc FALSE // Retrieval info: GEN_FILE: TYPE_NORMAL SDRAM_clock.cmp FALSE // Retrieval info: GEN_FILE: TYPE_NORMAL SDRAM_clock.bsf FALSE // Retrieval info: GEN_FILE: TYPE_NORMAL SDRAM_clock_inst.v FALSE // Retrieval info: GEN_FILE: TYPE_NORMAL SDRAM_clock_bb.v TRUE // Retrieval info: LIB_FILE: altera_mf // Retrieval info: CBX_MODULE_PREFIX: ON
`timescale 1ns / 1ps `define BCR_ADDR (23'b000_10_00_0_0_011_1_0_0_00_01_0_001) // || | | ||| | | || | ||| // Address BCR -+' | | ||| | | || | ||| // Synchronous -------' | ||| | | || | ||| // Variable latency ---------' ||| | | || | ||| // Latency Counter (4 cycles) -----------''' | | || | ||| // ram_wait_i is active-high ---------------' | || | ||| // ram_wait_i asserted during delay ---------------' || | ||| // Default Drive Strength (1/2) ------------------------'' | ||| // Burst wraps within burst length ------------------------' ||| // Burst length is 4 words -----------------------------''' module ramcon( input reset_i, input clk2x_i, output [22:0] ram_adr_o, inout [15:0] ram_dq_io, output ram_ce_on, output ram_adv_on, output ram_oe_on, output ram_we_on, output ram_ub_on, output ram_lb_on, output ram_cre_o, output ram_clk_o, input ram_wait_i, output wb_ack_o, output [15:0] wb_dat_o, input [15:0] wb_dat_i, input [23:1] wb_adr_i, input [1:0] wb_sel_i, input wb_stb_i, input wb_cyc_i, input wb_we_i, output reset_o ); wire ram_en_q; wire ram_adv_o, ram_ce_o, ram_oe_o, ram_we_o, ram_be_valid; wire dato_dq, dq_dati; wire nt0, nt1, nt2, nt3, nt4, nt5; reg t0, t1, t2, t3, t4, t5; reg cfg; wire cfg_o, adr_bcrcfg, clk_en; // PSRAM power-on timing. Do not let the dogs out until // the PSRAM chip has gone through its boot-up sequence. // Wait 150us minimum, and to be conservative, a little // extra. I've arbitrarily selected 32ms, assuming 50MHz // input on clk2x_i. reg [14:0] resetCounter; always @(posedge clk2x_i) begin if(reset_i) begin resetCounter <= 0; end else begin if(resetCounter[14]) begin resetCounter <= resetCounter; end else begin resetCounter <= resetCounter + 1; end end end wire reset_sans_cfg = ~resetCounter[14]; assign reset_o = reset_sans_cfg | cfg; // Bus bridge random logic. reg [15:0] wb_dat_or; assign ram_adr_o = adr_bcrcfg ? `BCR_ADDR : wb_adr_i; assign wb_dat_o = wb_dat_or; always @(negedge clk2x_i) begin if(dato_dq) wb_dat_or <= ram_dq_io; end assign ram_dq_io = dq_dati ? wb_dat_i : 16'hzzzz; assign ram_clk_o = ~clk2x_i & clk_en; // Bus bridge state Machine. kseq ks( .t5(t5), .t4(t4), .t3(t3), .t2(t2), .t1(t1), .wb_we_i(wb_we_i), .t0(t0), .wb_cyc_i(wb_cyc_i), .wb_stb_i(wb_stb_i), .reset_i(reset_sans_cfg), .wb_ack_o(wb_ack_o), .dato_dq(dato_dq), .dq_dati(dq_dati), .ram_oe_o(ram_oe_o), .ram_we_o(ram_we_o), .ram_ce_o(ram_ce_o), .ram_adv_o(ram_adv_o), .ram_be_valid(ram_be_valid), .nt5(nt5), .nt4(nt4), .nt3(nt3), .nt2(nt2), .nt1(nt1), .nt0(nt0), .adr_bcrcfg(adr_bcrcfg), .ram_cre_o(ram_cre_o), .cfg_o(cfg_o), .cfg(cfg), .clk_en(clk_en), .ram_wait_i(ram_wait_i) ); assign ram_adv_on = reset_sans_cfg | ~ram_adv_o; assign ram_ce_on = reset_sans_cfg | ~ram_ce_o; assign ram_oe_on = reset_sans_cfg | ~ram_oe_o; assign ram_we_on = reset_sans_cfg | ~ram_we_o; assign ram_ub_on = reset_sans_cfg | ~(ram_be_valid & wb_sel_i[1]); assign ram_lb_on = reset_sans_cfg | ~(ram_be_valid & wb_sel_i[0]); always @(posedge clk2x_i) begin t0 <= nt0; t1 <= nt1; t2 <= nt2; t3 <= nt3; t4 <= nt4; t5 <= nt5; cfg <= cfg_o; end endmodule
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ `ifndef SKY130_FD_SC_HD__NAND3_1_V `define SKY130_FD_SC_HD__NAND3_1_V /** * nand3: 3-input NAND. * * Verilog wrapper for nand3 with size of 1 units. * * WARNING: This file is autogenerated, do not modify directly! */ `timescale 1ns / 1ps `default_nettype none `include "sky130_fd_sc_hd__nand3.v" `ifdef USE_POWER_PINS /*********************************************************/ `celldefine module sky130_fd_sc_hd__nand3_1 ( Y , A , B , C , VPWR, VGND, VPB , VNB ); output Y ; input A ; input B ; input C ; input VPWR; input VGND; input VPB ; input VNB ; sky130_fd_sc_hd__nand3 base ( .Y(Y), .A(A), .B(B), .C(C), .VPWR(VPWR), .VGND(VGND), .VPB(VPB), .VNB(VNB) ); endmodule `endcelldefine /*********************************************************/ `else // If not USE_POWER_PINS /*********************************************************/ `celldefine module sky130_fd_sc_hd__nand3_1 ( Y, A, B, C ); output Y; input A; input B; input C; // Voltage supply signals supply1 VPWR; supply0 VGND; supply1 VPB ; supply0 VNB ; sky130_fd_sc_hd__nand3 base ( .Y(Y), .A(A), .B(B), .C(C) ); endmodule `endcelldefine /*********************************************************/ `endif // USE_POWER_PINS `default_nettype wire `endif // SKY130_FD_SC_HD__NAND3_1_V
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ `ifndef SKY130_FD_SC_LS__XNOR2_PP_SYMBOL_V `define SKY130_FD_SC_LS__XNOR2_PP_SYMBOL_V /** * xnor2: 2-input exclusive NOR. * * Y = !(A ^ B) * * Verilog stub (with power pins) for graphical symbol definition * generation. * * WARNING: This file is autogenerated, do not modify directly! */ `timescale 1ns / 1ps `default_nettype none (* blackbox *) module sky130_fd_sc_ls__xnor2 ( //# {{data|Data Signals}} input A , input B , output Y , //# {{power|Power}} input VPB , input VPWR, input VGND, input VNB ); endmodule `default_nettype wire `endif // SKY130_FD_SC_LS__XNOR2_PP_SYMBOL_V
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ `ifndef SKY130_FD_SC_LS__MUX4_TB_V `define SKY130_FD_SC_LS__MUX4_TB_V /** * mux4: 4-input multiplexer. * * Autogenerated test bench. * * WARNING: This file is autogenerated, do not modify directly! */ `timescale 1ns / 1ps `default_nettype none `include "sky130_fd_sc_ls__mux4.v" module top(); // Inputs are registered reg A0; reg A1; reg A2; reg A3; reg S0; reg S1; reg VPWR; reg VGND; reg VPB; reg VNB; // Outputs are wires wire X; initial begin // Initial state is x for all inputs. A0 = 1'bX; A1 = 1'bX; A2 = 1'bX; A3 = 1'bX; S0 = 1'bX; S1 = 1'bX; VGND = 1'bX; VNB = 1'bX; VPB = 1'bX; VPWR = 1'bX; #20 A0 = 1'b0; #40 A1 = 1'b0; #60 A2 = 1'b0; #80 A3 = 1'b0; #100 S0 = 1'b0; #120 S1 = 1'b0; #140 VGND = 1'b0; #160 VNB = 1'b0; #180 VPB = 1'b0; #200 VPWR = 1'b0; #220 A0 = 1'b1; #240 A1 = 1'b1; #260 A2 = 1'b1; #280 A3 = 1'b1; #300 S0 = 1'b1; #320 S1 = 1'b1; #340 VGND = 1'b1; #360 VNB = 1'b1; #380 VPB = 1'b1; #400 VPWR = 1'b1; #420 A0 = 1'b0; #440 A1 = 1'b0; #460 A2 = 1'b0; #480 A3 = 1'b0; #500 S0 = 1'b0; #520 S1 = 1'b0; #540 VGND = 1'b0; #560 VNB = 1'b0; #580 VPB = 1'b0; #600 VPWR = 1'b0; #620 VPWR = 1'b1; #640 VPB = 1'b1; #660 VNB = 1'b1; #680 VGND = 1'b1; #700 S1 = 1'b1; #720 S0 = 1'b1; #740 A3 = 1'b1; #760 A2 = 1'b1; #780 A1 = 1'b1; #800 A0 = 1'b1; #820 VPWR = 1'bx; #840 VPB = 1'bx; #860 VNB = 1'bx; #880 VGND = 1'bx; #900 S1 = 1'bx; #920 S0 = 1'bx; #940 A3 = 1'bx; #960 A2 = 1'bx; #980 A1 = 1'bx; #1000 A0 = 1'bx; end sky130_fd_sc_ls__mux4 dut (.A0(A0), .A1(A1), .A2(A2), .A3(A3), .S0(S0), .S1(S1), .VPWR(VPWR), .VGND(VGND), .VPB(VPB), .VNB(VNB), .X(X)); endmodule `default_nettype wire `endif // SKY130_FD_SC_LS__MUX4_TB_V
`timescale 1ns / 1ps /******************************************************************************* * Engineer: Robin zhang * Create Date: 2016.09.10 * Module Name: spi_slave *******************************************************************************/ module spi_slave( clk,sck,mosi,miso,ssel,rst_n,recived_status ); input clk; input rst_n; input sck,mosi,ssel; output miso; output recived_status; reg recived_status; reg[2:0] sckr; reg[2:0] sselr; reg[1:0] mosir; reg[2:0] bitcnt; reg[7:0] bytecnt; reg byte_received; // high when a byte has been received reg [7:0] byte_data_received; reg[7:0] received_memory; reg [7:0] byte_data_sent; reg [7:0] cnt; wire ssel_active; wire sck_risingedge; wire sck_fallingedge; wire ssel_startmessage; wire ssel_endmessage; wire mosi_data; /******************************************************************************* *detect the rising edge and falling edge of sck *******************************************************************************/ always @(posedge clk or negedge rst_n)begin if(!rst_n) sckr <= 3'h0; else sckr <= {sckr[1:0],sck}; end assign sck_risingedge = (sckr[2:1] == 2'b01) ? 1'b1 : 1'b0; assign sck_fallingedge = (sckr[2:1] == 2'b10) ? 1'b1 : 1'b0; /******************************************************************************* *detect starts at falling edge and stops at rising edge of ssel *******************************************************************************/ always @(posedge clk or negedge rst_n)begin if(!rst_n) sselr <= 3'h0; else sselr <= {sselr[1:0],ssel}; end assign ssel_active = (~sselr[1]) ? 1'b1 : 1'b0; // SSEL is active low assign ssel_startmessage = (sselr[2:1]==2'b10) ? 1'b1 : 1'b0; // message starts at falling edge assign ssel_endmessage = (sselr[2:1]==2'b01) ? 1'b1 : 1'b0; // message stops at rising edge /******************************************************************************* *read from mosi *******************************************************************************/ always @(posedge clk or negedge rst_n)begin if(!rst_n) mosir <= 2'h0; else mosir <={mosir[0],mosi}; end assign mosi_data = mosir[1]; /******************************************************************************* *SPI slave reveive in 8-bits format *******************************************************************************/ always @(posedge clk or negedge rst_n)begin if(!rst_n)begin bitcnt <= 3'b000; byte_data_received <= 8'h0; end else begin if(~ssel_active) bitcnt <= 3'b000; else begin if(sck_risingedge)begin bitcnt <= bitcnt + 3'b001; byte_data_received <= {byte_data_received[6:0], mosi_data}; end else begin bitcnt <= bitcnt; byte_data_received <= byte_data_received; end end end end always @(posedge clk or negedge rst_n) begin if(!rst_n) byte_received <= 1'b0; else byte_received <= ssel_active && sck_risingedge && (bitcnt==3'b111); end always @(posedge clk or negedge rst_n) begin if(!rst_n)begin bytecnt <= 8'h0; received_memory <= 8'h0; end else begin if(byte_received) begin bytecnt <= bytecnt + 1'b1; received_memory <= (byte_data_received == bytecnt) ? (received_memory + 1'b1) : received_memory; end else begin bytecnt <= bytecnt; received_memory <= received_memory; end end end /******************************************************************************* *SPI slave send date *******************************************************************************/ always @(posedge clk or negedge rst_n) begin if(!rst_n) cnt<= 8'h0; else begin if(byte_received) cnt<=cnt+8'h1; // count the messages else cnt<=cnt; end end always @(posedge clk or negedge rst_n) begin if(!rst_n) byte_data_sent <= 8'h0; else begin if(ssel_active && sck_fallingedge) begin if(bitcnt==3'b001) byte_data_sent <= cnt; // after that, we send 0s else byte_data_sent <= {byte_data_sent[6:0], 1'b0}; end else byte_data_sent <= byte_data_sent; end end assign miso = byte_data_sent[7]; // send MSB first always @(posedge clk or negedge rst_n) begin if(!rst_n) recived_status <= 1'b0; else recived_status <= (received_memory == 8'd64) ? 1'b1 : 1'b0; end endmodule
//***************************************************************************** // (c) Copyright 2008 - 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 : %version // \ \ Application : MIG // / / Filename : ecc_merge_enc.v // /___/ /\ Date Last Modified : $date$ // \ \ / \ Date Created : Tue Jun 30 2009 // \___\/\___\ // //Device : 7-Series //Design Name : DDR3 SDRAM //Purpose : //Reference : //Revision History : //***************************************************************************** `timescale 1ps/1ps module ecc_merge_enc #( parameter TCQ = 100, parameter PAYLOAD_WIDTH = 64, parameter CODE_WIDTH = 72, parameter DATA_BUF_ADDR_WIDTH = 4, parameter DATA_BUF_OFFSET_WIDTH = 1, parameter DATA_WIDTH = 64, parameter DQ_WIDTH = 72, parameter ECC_WIDTH = 8, parameter nCK_PER_CLK = 4 ) ( /*AUTOARG*/ // Outputs mc_wrdata, mc_wrdata_mask, // Inputs clk, rst, wr_data, wr_data_mask, rd_merge_data, h_rows, raw_not_ecc ); input clk; input rst; input [2*nCK_PER_CLK*PAYLOAD_WIDTH-1:0] wr_data; input [2*nCK_PER_CLK*DATA_WIDTH/8-1:0] wr_data_mask; input [2*nCK_PER_CLK*DATA_WIDTH-1:0] rd_merge_data; reg [2*nCK_PER_CLK*PAYLOAD_WIDTH-1:0] wr_data_r; reg [2*nCK_PER_CLK*DATA_WIDTH/8-1:0] wr_data_mask_r; reg [2*nCK_PER_CLK*DATA_WIDTH-1:0] rd_merge_data_r; always @(posedge clk) wr_data_r <= #TCQ wr_data; always @(posedge clk) wr_data_mask_r <= #TCQ wr_data_mask; always @(posedge clk) rd_merge_data_r <= #TCQ rd_merge_data; // Merge new data with memory read data. wire [2*nCK_PER_CLK*PAYLOAD_WIDTH-1:0] merged_data; genvar h; genvar i; generate for (h=0; h<2*nCK_PER_CLK; h=h+1) begin : merge_data_outer for (i=0; i<DATA_WIDTH/8; i=i+1) begin : merge_data_inner assign merged_data[h*PAYLOAD_WIDTH+i*8+:8] = wr_data_mask_r[h*DATA_WIDTH/8+i] ? rd_merge_data_r[h*DATA_WIDTH+i*8+:8] : wr_data_r[h*PAYLOAD_WIDTH+i*8+:8]; end if (PAYLOAD_WIDTH > DATA_WIDTH) assign merged_data[(h+1)*PAYLOAD_WIDTH-1-:PAYLOAD_WIDTH-DATA_WIDTH]= wr_data_r[(h+1)*PAYLOAD_WIDTH-1-:PAYLOAD_WIDTH-DATA_WIDTH]; end endgenerate // Generate ECC and overlay onto mc_wrdata. input [CODE_WIDTH*ECC_WIDTH-1:0] h_rows; input [2*nCK_PER_CLK-1:0] raw_not_ecc; reg [2*nCK_PER_CLK-1:0] raw_not_ecc_r; always @(posedge clk) raw_not_ecc_r <= #TCQ raw_not_ecc; output reg [2*nCK_PER_CLK*DQ_WIDTH-1:0] mc_wrdata; genvar j; integer k; generate for (j=0; j<2*nCK_PER_CLK; j=j+1) begin : ecc_word always @(/*AS*/h_rows or merged_data or raw_not_ecc_r) begin mc_wrdata[j*DQ_WIDTH+:DQ_WIDTH] = {{DQ_WIDTH-PAYLOAD_WIDTH{1'b0}}, merged_data[j*PAYLOAD_WIDTH+:PAYLOAD_WIDTH]}; for (k=0; k<ECC_WIDTH; k=k+1) if (~raw_not_ecc_r[j]) mc_wrdata[j*DQ_WIDTH+CODE_WIDTH-k-1] = ^(merged_data[j*PAYLOAD_WIDTH+:DATA_WIDTH] & h_rows[k*CODE_WIDTH+:DATA_WIDTH]); end end endgenerate // Set all DRAM masks to zero. output wire[2*nCK_PER_CLK*DQ_WIDTH/8-1:0] mc_wrdata_mask; assign mc_wrdata_mask = {2*nCK_PER_CLK*DQ_WIDTH/8{1'b0}}; endmodule
/* * Copyright (C) 2011 Kiel Friedt * * 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/>. */ //authors Kiel Friedt, Kevin McIntosh,Cody DeHaan module ALU16(A, B, sel, out); input [15:0] A, B; input [2:0] sel; output [15:0] out; assign less = 1'b0;; //Still need to account for less wire [15:0] c; wire set; alu_slice a1(A[0], B[0], sel[2], set, sel, c[0], out[0]); alu_slice a2(A[1], B[1], c[0], less, sel, c[1], out[1]); alu_slice a3(A[2], B[2], c[1], less, sel, c[2], out[2]); alu_slice a4(A[3], B[3], c[2], less, sel, c[3], out[3]); alu_slice a5(A[4], B[4], c[3], less, sel, c[4], out[4]); alu_slice a6(A[5], B[5], c[4], less, sel, c[5], out[5]); alu_slice a7(A[6], B[6], c[5], less, sel, c[6], out[6]); alu_slice a8(A[7], B[7], c[6], less, sel, c[7], out[7]); alu_slice a9(A[8], B[8], c[7], less, sel, c[8], out[8]); alu_slice a10(A[9], B[9], c[8], less, sel, c[9], out[9]); alu_slice a11(A[10], B[10], c[9], less, sel, c[10], out[10]); alu_slice a12(A[11], B[11], c[10], less, sel, c[11], out[11]); alu_slice a13(A[12], B[12], c[11], less, sel, c[12], out[12]); alu_slice a14(A[13], B[13], c[12], less, sel, c[13], out[13]); alu_slice a15(A[14], B[14], c[13], less, sel, c[14], out[14]); alu_slice_msb a16(A[15], B[15], c[14], less, sel, c[15], out[15],set); endmodule
module image_to_ppfifo #( parameter BUFFER_SIZE = 10 )( input clk, input rst, input i_enable, input i_hsync, // vga hsync signal input i_vsync, // vga vsync signal input [2:0] i_red, // vga red signal input [2:0] i_green, // vga green signal input [1:0] i_blue, // vga blue signal output reg o_frame_finished, //Memory FIFO Interface output o_rfifo_ready, input i_rfifo_activate, input i_rfifo_strobe, output [31:0] o_rfifo_data, output [23:0] o_rfifo_size ); //Local Parameters localparam IDLE = 4'h0; localparam PROCESS_IMAGE = 4'h1; //Registers/Wires reg r_prev_vsync; wire w_neg_edge_vsync; //ppfifo interface wire [1:0] w_write_ready; reg [1:0] r_write_activate; wire [23:0] w_write_fifo_size; reg r_write_strobe; reg [23:0] r_write_count; reg [31:0] r_write_data; //Submodules ppfifo p2m #( .DATA_WIDTH (32 ), .ADDRESS_WIDTH (BUFFER_SIZE ) )fifo ( //universal input .reset (rst ), //write side .write_clock (clk ), .write_ready (w_write_ready ), .write_activate (r_write_activate ), .write_fifo_size (w_write_fifo_size ), .write_strobe (r_write_strobe ), .write_data (r_write_data ), // .inactive (w_inactive ), //read side .read_clock (clk ), .read_strobe (i_rfifo_strobe ), .read_ready (o_rfifo_ready ), .read_activate (i_rfifo_activate ), .read_count (o_rfifo_size ), .read_data (o_rfifo_data ) ); //Asynchronous Logic assign w_neg_edge_vsync = (r_prev_vsync & !i_vsync); //Synchronous Logic always @ (posedge clk) begin if (rst) begin r_write_activate <= 0; r_write_strobe <= 0; r_write_count <= 0; r_write_data <= 0; o_frame_finished <= 0; r_prev_vsync <= 0; end else begin o_frame_finished <= 0; r_write_strobe <= 0; if (i_enable && (r_write_activate == 0) && (w_write_ready > 0)) begin r_write_count <= 0; if (w_write_ready[0]) begin r_write_activate[0] <= 1; end else begin r_write_activate[1] <= 1; end end if (i_enable && (r_write_activate > 0)) begin if (i_hsync) begin r_write_data <= {24'h000000, i_red, i_green, i_blue}; r_write_strobe <= 1; r_write_count <= r_write_count + 1; if (r_write_count >= w_write_fifo_size - 1) begin r_write_activate <= 0; end end else if (!i_hsync) begin r_write_activate <= 0; end if (w_neg_edge_vsync) begin o_frame_finished <= 1; end end r_prev_vsync <= i_vsync; end end endmodule
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ `ifndef SKY130_FD_SC_MS__A221O_1_V `define SKY130_FD_SC_MS__A221O_1_V /** * a221o: 2-input AND into first two inputs of 3-input OR. * * X = ((A1 & A2) | (B1 & B2) | C1) * * Verilog wrapper for a221o with size of 1 units. * * WARNING: This file is autogenerated, do not modify directly! */ `timescale 1ns / 1ps `default_nettype none `include "sky130_fd_sc_ms__a221o.v" `ifdef USE_POWER_PINS /*********************************************************/ `celldefine module sky130_fd_sc_ms__a221o_1 ( X , A1 , A2 , B1 , B2 , C1 , VPWR, VGND, VPB , VNB ); output X ; input A1 ; input A2 ; input B1 ; input B2 ; input C1 ; input VPWR; input VGND; input VPB ; input VNB ; sky130_fd_sc_ms__a221o base ( .X(X), .A1(A1), .A2(A2), .B1(B1), .B2(B2), .C1(C1), .VPWR(VPWR), .VGND(VGND), .VPB(VPB), .VNB(VNB) ); endmodule `endcelldefine /*********************************************************/ `else // If not USE_POWER_PINS /*********************************************************/ `celldefine module sky130_fd_sc_ms__a221o_1 ( X , A1, A2, B1, B2, C1 ); output X ; input A1; input A2; input B1; input B2; input C1; // Voltage supply signals supply1 VPWR; supply0 VGND; supply1 VPB ; supply0 VNB ; sky130_fd_sc_ms__a221o base ( .X(X), .A1(A1), .A2(A2), .B1(B1), .B2(B2), .C1(C1) ); endmodule `endcelldefine /*********************************************************/ `endif // USE_POWER_PINS `default_nettype wire `endif // SKY130_FD_SC_MS__A221O_1_V
// The cordic algorithm // This will be a pipelined design that processes // one angle rotation per clock cycle. There is // one rotation per input bit. // Rotation angle must be between -pi/2 to pi/2 // Angle is stated in I3Q13 as it must accomodate +- 1.57... // Output is approx 1.64 times larger than reality due to // the scale factor, which is sum(1 / sqrt(1 + 2^-i)^2) over // i in 0->Width. It's 1.6467602581210652 to more exact module cordic( clk, xI, // Input X value yI, // Input Y Value angle, // Rotation angle in radians xO, yO ); // Bitness of all relevant buses parameter WIDTH = 16; parameter ANGLE_WIDTH = 32; parameter ATAN_INITIAL_FILE = "../mems/atan16_32.hex"; // Inputs /* verilator lint_off UNUSED */ input clk; input signed[WIDTH-1:0] xI, yI; input signed[ANGLE_WIDTH-1:0] angle; /* verilator lint_on UNUSED */ // Outputs output signed[WIDTH-1:0] xO, yO; // Pipeline reg signed[WIDTH-1:0] x_pl[WIDTH:0]; // X pipeline stages reg signed[WIDTH-1:0] y_pl[WIDTH:0]; // Y pipeline stages reg signed[ANGLE_WIDTH-1:0] a_pl[WIDTH:0]; // Angle pipeline stages // atan_lut[i] is the result of atan(x) w/ x = 2^-i in radians reg[ANGLE_WIDTH-1:0] atan_lut[WIDTH-1:0]; initial begin $readmemh(ATAN_INITIAL_FILE, atan_lut); end // Result depends on angle > 0 for +/- // xO = xI -/+ (yI >> i) // yO = yI +/- (xI >> i) wire[1:0] quadrant; assign quadrant = angle[31:30]; integer i; always @(posedge clk) begin // Preprocess angle before entering pipeline. case (quadrant) 2'b00, // Tangent is fine in this quadrants, no reflection 2'b11: begin x_pl[0] <= xI; y_pl[0] <= yI; a_pl[0] <= angle; end 2'b01: begin x_pl[0] <= -yI; y_pl[0] <= xI; a_pl[0] <= {2'b00, angle[29:0]}; end 2'b10: begin x_pl[0] <= yI; y_pl[0] <= -xI; a_pl[0] <= {2'b11, angle[29:0]}; end endcase // Generate pipeline stages. Might need to break this up if it synths to something awful. // Will probably need an alway @(*) block if so to hold the combinational parts. for(i = 0; i < WIDTH; i = i + 1) begin x_pl[i+1] <= (a_pl[i] > 0) ? x_pl[i] - (y_pl[i] >>> i) : x_pl[i] + (y_pl[i] >>> i); y_pl[i+1] <= (a_pl[i] > 0) ? y_pl[i] + (x_pl[i] >>> i) : y_pl[i] - (x_pl[i] >>> i); a_pl[i+1] <= (a_pl[i] > 0) ? a_pl[i] - atan_lut[i] : a_pl[i] + atan_lut[i]; end end // Set the output. That sure looks like it means x[0] doesn't it? But it's xO...utput. assign xO = x_pl[WIDTH-1]; assign yO = y_pl[WIDTH-1]; endmodule
// Copyright 1986-2018 Xilinx, Inc. All Rights Reserved. // -------------------------------------------------------------------------------- // Tool Version: Vivado v.2018.2 (win64) Build 2258646 Thu Jun 14 20:03:12 MDT 2018 // Date : Tue Sep 17 19:44:40 2019 // Host : varun-laptop running 64-bit Service Pack 1 (build 7601) // Command : write_verilog -force -mode synth_stub // d:/github/Digital-Hardware-Modelling/xilinx-vivado/gcd_snickerdoodle/gcd_snickerdoodle.srcs/sources_1/bd/gcd_zynq_snick/ip/gcd_zynq_snick_gcd_0_0/gcd_zynq_snick_gcd_0_0_stub.v // Design : gcd_zynq_snick_gcd_0_0 // Purpose : Stub declaration of top-level module interface // Device : xc7z020clg400-3 // -------------------------------------------------------------------------------- // This empty module with port declaration file causes synthesis tools to infer a black box for IP. // The synthesis directives are for Synopsys Synplify support to prevent IO buffer insertion. // Please paste the declaration into a Verilog source file or add the file as an additional source. (* X_CORE_INFO = "gcd,Vivado 2018.2" *) module gcd_zynq_snick_gcd_0_0(s_axi_gcd_bus_AWADDR, s_axi_gcd_bus_AWVALID, s_axi_gcd_bus_AWREADY, s_axi_gcd_bus_WDATA, s_axi_gcd_bus_WSTRB, s_axi_gcd_bus_WVALID, s_axi_gcd_bus_WREADY, s_axi_gcd_bus_BRESP, s_axi_gcd_bus_BVALID, s_axi_gcd_bus_BREADY, s_axi_gcd_bus_ARADDR, s_axi_gcd_bus_ARVALID, s_axi_gcd_bus_ARREADY, s_axi_gcd_bus_RDATA, s_axi_gcd_bus_RRESP, s_axi_gcd_bus_RVALID, s_axi_gcd_bus_RREADY, ap_clk, ap_rst_n, interrupt) /* synthesis syn_black_box black_box_pad_pin="s_axi_gcd_bus_AWADDR[5:0],s_axi_gcd_bus_AWVALID,s_axi_gcd_bus_AWREADY,s_axi_gcd_bus_WDATA[31:0],s_axi_gcd_bus_WSTRB[3:0],s_axi_gcd_bus_WVALID,s_axi_gcd_bus_WREADY,s_axi_gcd_bus_BRESP[1:0],s_axi_gcd_bus_BVALID,s_axi_gcd_bus_BREADY,s_axi_gcd_bus_ARADDR[5:0],s_axi_gcd_bus_ARVALID,s_axi_gcd_bus_ARREADY,s_axi_gcd_bus_RDATA[31:0],s_axi_gcd_bus_RRESP[1:0],s_axi_gcd_bus_RVALID,s_axi_gcd_bus_RREADY,ap_clk,ap_rst_n,interrupt" */; input [5:0]s_axi_gcd_bus_AWADDR; input s_axi_gcd_bus_AWVALID; output s_axi_gcd_bus_AWREADY; input [31:0]s_axi_gcd_bus_WDATA; input [3:0]s_axi_gcd_bus_WSTRB; input s_axi_gcd_bus_WVALID; output s_axi_gcd_bus_WREADY; output [1:0]s_axi_gcd_bus_BRESP; output s_axi_gcd_bus_BVALID; input s_axi_gcd_bus_BREADY; input [5:0]s_axi_gcd_bus_ARADDR; input s_axi_gcd_bus_ARVALID; output s_axi_gcd_bus_ARREADY; output [31:0]s_axi_gcd_bus_RDATA; output [1:0]s_axi_gcd_bus_RRESP; output s_axi_gcd_bus_RVALID; input s_axi_gcd_bus_RREADY; input ap_clk; input ap_rst_n; output interrupt; endmodule
`timescale 1ns/10ps module soc_system_pll_pwm( // interface 'refclk' input wire refclk, // interface 'reset' input wire rst, // interface 'outclk0' output wire outclk_0, // interface 'locked' output wire locked ); altera_pll #( .fractional_vco_multiplier("false"), .reference_clock_frequency("25.0 MHz"), .operation_mode("direct"), .number_of_clocks(1), .output_clock_frequency0("125.500000 MHz"), .phase_shift0("0 ps"), .duty_cycle0(50), .output_clock_frequency1("0 MHz"), .phase_shift1("0 ps"), .duty_cycle1(50), .output_clock_frequency2("0 MHz"), .phase_shift2("0 ps"), .duty_cycle2(50), .output_clock_frequency3("0 MHz"), .phase_shift3("0 ps"), .duty_cycle3(50), .output_clock_frequency4("0 MHz"), .phase_shift4("0 ps"), .duty_cycle4(50), .output_clock_frequency5("0 MHz"), .phase_shift5("0 ps"), .duty_cycle5(50), .output_clock_frequency6("0 MHz"), .phase_shift6("0 ps"), .duty_cycle6(50), .output_clock_frequency7("0 MHz"), .phase_shift7("0 ps"), .duty_cycle7(50), .output_clock_frequency8("0 MHz"), .phase_shift8("0 ps"), .duty_cycle8(50), .output_clock_frequency9("0 MHz"), .phase_shift9("0 ps"), .duty_cycle9(50), .output_clock_frequency10("0 MHz"), .phase_shift10("0 ps"), .duty_cycle10(50), .output_clock_frequency11("0 MHz"), .phase_shift11("0 ps"), .duty_cycle11(50), .output_clock_frequency12("0 MHz"), .phase_shift12("0 ps"), .duty_cycle12(50), .output_clock_frequency13("0 MHz"), .phase_shift13("0 ps"), .duty_cycle13(50), .output_clock_frequency14("0 MHz"), .phase_shift14("0 ps"), .duty_cycle14(50), .output_clock_frequency15("0 MHz"), .phase_shift15("0 ps"), .duty_cycle15(50), .output_clock_frequency16("0 MHz"), .phase_shift16("0 ps"), .duty_cycle16(50), .output_clock_frequency17("0 MHz"), .phase_shift17("0 ps"), .duty_cycle17(50), .pll_type("General"), .pll_subtype("General") ) altera_pll_i ( .rst (rst), .outclk ({outclk_0}), .locked (locked), .fboutclk ( ), .fbclk (1'b0), .refclk (refclk) ); endmodule
/* * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ `ifndef SKY130_FD_SC_HD__PROBE_P_BEHAVIORAL_PP_V `define SKY130_FD_SC_HD__PROBE_P_BEHAVIORAL_PP_V /** * probe_p: Virtual voltage probe point. * * Verilog simulation functional model. */ `timescale 1ns / 1ps `default_nettype none // Import user defined primitives. `include "../../models/udp_pwrgood_pp_pg/sky130_fd_sc_hd__udp_pwrgood_pp_pg.v" `celldefine module sky130_fd_sc_hd__probe_p ( X , A , VGND, VNB , VPB , VPWR ); // Module ports output X ; input A ; input VGND; input VNB ; input VPB ; input VPWR; // Local signals wire buf0_out_X ; wire pwrgood_pp0_out_X; // Name Output Other arguments buf buf0 (buf0_out_X , A ); sky130_fd_sc_hd__udp_pwrgood_pp$PG pwrgood_pp0 (pwrgood_pp0_out_X, buf0_out_X, VPWR, VGND); buf buf1 (X , pwrgood_pp0_out_X ); endmodule `endcelldefine `default_nettype wire `endif // SKY130_FD_SC_HD__PROBE_P_BEHAVIORAL_PP_V
Require Import Coq.Lists.List. Require Import Coq.omega.Omega. Require Import Coq.Arith.Peano_dec. Require Import Coq.Classes.Morphisms. Require Import Crypto.Tactics.VerdiTactics. Require Import Coq.Numbers.Natural.Peano.NPeano. Require Import Crypto.Util.NatUtil. Require Export Crypto.Util.FixCoqMistakes. Create HintDb distr_length discriminated. Create HintDb simpl_set_nth discriminated. Create HintDb simpl_update_nth discriminated. Create HintDb simpl_nth_default discriminated. Create HintDb simpl_nth_error discriminated. Create HintDb simpl_firstn discriminated. Create HintDb simpl_skipn discriminated. Create HintDb simpl_fold_right discriminated. Create HintDb simpl_sum_firstn discriminated. Create HintDb pull_nth_error discriminated. Create HintDb push_nth_error discriminated. Create HintDb pull_nth_default discriminated. Create HintDb push_nth_default discriminated. Create HintDb pull_firstn discriminated. Create HintDb push_firstn discriminated. Create HintDb pull_skipn discriminated. Create HintDb push_skipn discriminated. Create HintDb pull_update_nth discriminated. Create HintDb push_update_nth discriminated. Create HintDb znonzero discriminated. Hint Rewrite @app_length @rev_length @map_length @seq_length @fold_left_length @split_length_l @split_length_r @firstn_length @combine_length @prod_length : distr_length. Hint Extern 1 => progress autorewrite with distr_length in * : distr_length. Ltac distr_length := autorewrite with distr_length in *; try solve [simpl in *; omega]. Module Export List. Local Set Implicit Arguments. Import ListNotations. (** From the 8.6 Standard Library *) Section Elts. Variable A : Type. (** Results about [nth_error] *) Lemma nth_error_In l n (x : A) : nth_error l n = Some x -> In x l. Proof. revert n. induction l as [|a l IH]; intros [|n]; simpl; try easy. - injection 1; auto. - eauto. Qed. End Elts. Section Map. Variables (A : Type) (B : Type). Variable f : A -> B. Lemma map_cons (x:A)(l:list A) : map f (x::l) = (f x) :: (map f l). Proof. reflexivity. Qed. End Map. Lemma in_seq len start n : In n (seq start len) <-> start <= n < start+len. Proof. revert start. induction len; simpl; intros. - rewrite <- plus_n_O. split;[easy|]. intros (H,H'). apply (Lt.lt_irrefl _ (Lt.le_lt_trans _ _ _ H H')). - rewrite IHlen, <- plus_n_Sm; simpl; split. * intros [H|H]; subst; intuition auto with arith. * intros (H,H'). destruct (Lt.le_lt_or_eq _ _ H); intuition. Qed. Section Facts. Variable A : Type. Theorem length_zero_iff_nil (l : list A): length l = 0 <-> l=[]. Proof. split; [now destruct l | now intros ->]. Qed. End Facts. Section Repeat. Variable A : Type. Fixpoint repeat (x : A) (n: nat ) := match n with | O => [] | S k => x::(repeat x k) end. Theorem repeat_length x n: length (repeat x n) = n. Proof. induction n as [| k Hrec]; simpl; rewrite ?Hrec; reflexivity. Qed. Theorem repeat_spec n x y: In y (repeat x n) -> y=x. Proof. induction n as [|k Hrec]; simpl; destruct 1; auto. Qed. End Repeat. Section Cutting. Variable A : Type. Local Notation firstn := (@firstn A). Lemma firstn_nil n: firstn n [] = []. Proof. induction n; now simpl. Qed. Lemma firstn_cons n a l: firstn (S n) (a::l) = a :: (firstn n l). Proof. now simpl. Qed. Lemma firstn_all l: firstn (length l) l = l. Proof. induction l as [| ? ? H]; simpl; [reflexivity | now rewrite H]. Qed. Lemma firstn_all2 n: forall (l:list A), (length l) <= n -> firstn n l = l. Proof. induction n as [|k iHk]. - intro. inversion 1 as [H1|?]. rewrite (length_zero_iff_nil l) in H1. subst. now simpl. - destruct l as [|x xs]; simpl. * now reflexivity. * simpl. intro H. apply Peano.le_S_n in H. f_equal. apply iHk, H. Qed. Lemma firstn_O l: firstn 0 l = []. Proof. now simpl. Qed. Lemma firstn_le_length n: forall l:list A, length (firstn n l) <= n. Proof. induction n as [|k iHk]; simpl; [auto | destruct l as [|x xs]; simpl]. - auto with arith. - apply le_n_S, iHk. Qed. Lemma firstn_length_le: forall l:list A, forall n:nat, n <= length l -> length (firstn n l) = n. Proof. induction l as [|x xs Hrec]. - simpl. intros n H. apply le_n_0_eq in H. rewrite <- H. now simpl. - destruct n. * now simpl. * simpl. intro H. apply le_S_n in H. now rewrite (Hrec n H). Qed. Lemma firstn_app n: forall l1 l2, firstn n (l1 ++ l2) = (firstn n l1) ++ (firstn (n - length l1) l2). Proof. induction n as [|k iHk]; intros l1 l2. - now simpl. - destruct l1 as [|x xs]. * unfold List.firstn at 2, length. now rewrite 2!app_nil_l, <- minus_n_O. * rewrite <- app_comm_cons. simpl. f_equal. apply iHk. Qed. Lemma firstn_app_2 n: forall l1 l2, firstn ((length l1) + n) (l1 ++ l2) = l1 ++ firstn n l2. Proof. induction n as [| k iHk];intros l1 l2. - unfold List.firstn at 2. rewrite <- plus_n_O, app_nil_r. rewrite firstn_app. rewrite <- minus_diag_reverse. unfold List.firstn at 2. rewrite app_nil_r. apply firstn_all. - destruct l2 as [|x xs]. * simpl. rewrite app_nil_r. apply firstn_all2. auto with arith. * rewrite firstn_app. assert (H0 : (length l1 + S k - length l1) = S k). auto with arith. rewrite H0, firstn_all2; [reflexivity | auto with arith]. Qed. Lemma firstn_firstn: forall l:list A, forall i j : nat, firstn i (firstn j l) = firstn (min i j) l. Proof. induction l as [|x xs Hl]. - intros. simpl. now rewrite ?firstn_nil. - destruct i. * intro. now simpl. * destruct j. + now simpl. + simpl. f_equal. apply Hl. Qed. End Cutting. End List. Hint Rewrite @firstn_skipn : simpl_firstn. Hint Rewrite @firstn_skipn : simpl_skipn. Hint Rewrite @firstn_nil @firstn_cons @List.firstn_all @firstn_O @firstn_app_2 @List.firstn_firstn : push_firstn. Hint Rewrite @firstn_nil @firstn_cons @List.firstn_all @firstn_O @firstn_app_2 @List.firstn_firstn : simpl_firstn. Hint Rewrite @firstn_app : push_firstn. Hint Rewrite <- @firstn_cons @firstn_app @List.firstn_firstn : pull_firstn. Hint Rewrite @firstn_all2 @removelast_firstn @firstn_removelast using omega : push_firstn. Hint Rewrite @firstn_all2 @removelast_firstn @firstn_removelast using omega : simpl_firstn. Local Arguments value / _ _. Local Arguments error / _. Definition sum_firstn l n := fold_right Z.add 0%Z (firstn n l). Fixpoint map2 {A B C} (f : A -> B -> C) (la : list A) (lb : list B) : list C := match la with | nil => nil | a :: la' => match lb with | nil => nil | b :: lb' => f a b :: map2 f la' lb' end end. (* xs[n] := f xs[n] *) Fixpoint update_nth {T} n f (xs:list T) {struct n} := match n with | O => match xs with | nil => nil | x'::xs' => f x'::xs' end | S n' => match xs with | nil => nil | x'::xs' => x'::update_nth n' f xs' end end. (* xs[n] := x *) Definition set_nth {T} n x (xs:list T) := update_nth n (fun _ => x) xs. Definition splice_nth {T} n (x:T) xs := firstn n xs ++ x :: skipn (S n) xs. Hint Unfold splice_nth. Ltac boring := simpl; intuition auto with zarith datatypes; repeat match goal with | [ H : _ |- _ ] => rewrite H; clear H | [ |- appcontext[match ?pf with end] ] => solve [ case pf ] | _ => progress autounfold in * | _ => progress autorewrite with core | _ => progress simpl in * | _ => progress intuition auto with zarith datatypes end; eauto. Ltac boring_list := repeat match goal with | _ => progress boring | _ => progress autorewrite with distr_length simpl_nth_default simpl_update_nth simpl_set_nth simpl_nth_error in * end. Lemma nth_default_cons : forall {T} (x u0 : T) us, nth_default x (u0 :: us) 0 = u0. Proof. auto. Qed. Hint Rewrite @nth_default_cons : simpl_nth_default. Hint Rewrite @nth_default_cons : push_nth_default. Lemma nth_default_cons_S : forall {A} us (u0 : A) n d, nth_default d (u0 :: us) (S n) = nth_default d us n. Proof. boring. Qed. Hint Rewrite @nth_default_cons_S : simpl_nth_default. Hint Rewrite @nth_default_cons_S : push_nth_default. Lemma nth_default_nil : forall {T} n (d : T), nth_default d nil n = d. Proof. induction n; boring. Qed. Hint Rewrite @nth_default_nil : simpl_nth_default. Hint Rewrite @nth_default_nil : push_nth_default. Lemma nth_error_nil_error : forall {A} n, nth_error (@nil A) n = None. Proof. induction n; boring. Qed. Hint Rewrite @nth_error_nil_error : simpl_nth_error. Ltac nth_tac' := intros; simpl in *; unfold error,value in *; repeat progress (match goal with | [ |- context[nth_error nil ?n] ] => rewrite nth_error_nil_error | [ H: ?x = Some _ |- context[match ?x with Some _ => ?a | None => ?a end ] ] => destruct x | [ H: ?x = None _ |- context[match ?x with Some _ => ?a | None => ?a end ] ] => destruct x | [ |- context[match ?x with Some _ => ?a | None => ?a end ] ] => destruct x | [ |- context[match nth_error ?xs ?i with Some _ => _ | None => _ end ] ] => case_eq (nth_error xs i); intros | [ |- context[(if lt_dec ?a ?b then _ else _) = _] ] => destruct (lt_dec a b) | [ |- context[_ = (if lt_dec ?a ?b then _ else _)] ] => destruct (lt_dec a b) | [ H: context[(if lt_dec ?a ?b then _ else _) = _] |- _ ] => destruct (lt_dec a b) | [ H: context[_ = (if lt_dec ?a ?b then _ else _)] |- _ ] => destruct (lt_dec a b) | [ H: _ /\ _ |- _ ] => destruct H | [ H: Some _ = Some _ |- _ ] => injection H; clear H; intros; subst | [ H: None = Some _ |- _ ] => inversion H | [ H: Some _ = None |- _ ] => inversion H | [ |- Some _ = Some _ ] => apply f_equal end); eauto; try (autorewrite with list in *); try omega; eauto. Lemma nth_error_map : forall A B (f:A->B) i xs y, nth_error (map f xs) i = Some y -> exists x, nth_error xs i = Some x /\ f x = y. Proof. induction i; destruct xs; nth_tac'. Qed. Lemma nth_error_seq : forall i start len, nth_error (seq start len) i = if lt_dec i len then Some (start + i) else None. induction i; destruct len; nth_tac'; erewrite IHi; nth_tac'. Qed. Lemma nth_error_error_length : forall A i (xs:list A), nth_error xs i = None -> i >= length xs. Proof. induction i; destruct xs; nth_tac'; try specialize (IHi _ H); omega. Qed. Lemma nth_error_value_length : forall A i (xs:list A) x, nth_error xs i = Some x -> i < length xs. Proof. induction i; destruct xs; nth_tac'; try specialize (IHi _ _ H); omega. Qed. Lemma nth_error_length_error : forall A i (xs:list A), i >= length xs -> nth_error xs i = None. Proof. induction i; destruct xs; nth_tac'; rewrite IHi by omega; auto. Qed. Hint Resolve nth_error_length_error. Hint Rewrite @nth_error_length_error using omega : simpl_nth_error. Lemma map_nth_default : forall (A B : Type) (f : A -> B) n x y l, (n < length l) -> nth_default y (map f l) n = f (nth_default x l n). Proof. intros. unfold nth_default. erewrite map_nth_error. reflexivity. nth_tac'. pose proof (nth_error_error_length A n l H0). omega. Qed. Lemma map_nil : forall A B (f : A -> B), map f nil = nil. Proof. reflexivity. Qed. (* Note: this is a duplicate of a lemma that exists in 8.5, included for 8.4 support *) Lemma In_nth : forall {A} (x : A) d xs, In x xs -> exists i, i < length xs /\ nth i xs d = x. Proof. induction xs; intros; match goal with H : In _ _ |- _ => simpl in H; destruct H end. + subst. exists 0. simpl; split; auto || omega. + destruct IHxs as [i [ ]]; auto. exists (S i). split; auto; simpl; try omega. Qed. Hint Rewrite @map_nth_default using omega : push_nth_default. Ltac nth_tac := repeat progress (try nth_tac'; try (match goal with | [ H: nth_error (map _ _) _ = Some _ |- _ ] => destruct (nth_error_map _ _ _ _ _ _ H); clear H | [ H: nth_error (seq _ _) _ = Some _ |- _ ] => rewrite nth_error_seq in H | [H: nth_error _ _ = None |- _ ] => specialize (nth_error_error_length _ _ _ H); intro; clear H end)). Lemma app_cons_app_app : forall T xs (y:T) ys, xs ++ y :: ys = (xs ++ (y::nil)) ++ ys. Proof. induction xs; boring. Qed. Lemma unfold_set_nth {T} n x : forall xs, @set_nth T n x xs = match n with | O => match xs with | nil => nil | x'::xs' => x::xs' end | S n' => match xs with | nil => nil | x'::xs' => x'::set_nth n' x xs' end end. Proof. induction n; destruct xs; reflexivity. Qed. Lemma simpl_set_nth_0 {T} x : forall xs, @set_nth T 0 x xs = match xs with | nil => nil | x'::xs' => x::xs' end. Proof. intro; rewrite unfold_set_nth; reflexivity. Qed. Lemma simpl_set_nth_S {T} x n : forall xs, @set_nth T (S n) x xs = match xs with | nil => nil | x'::xs' => x'::set_nth n x xs' end. Proof. intro; rewrite unfold_set_nth; reflexivity. Qed. Hint Rewrite @simpl_set_nth_S @simpl_set_nth_0 : simpl_set_nth. Lemma update_nth_ext {T} f g n : forall xs, (forall x, nth_error xs n = Some x -> f x = g x) -> @update_nth T n f xs = @update_nth T n g xs. Proof. induction n; destruct xs; simpl; intros H; try rewrite IHn; try rewrite H; try congruence; trivial. Qed. Global Instance update_nth_Proper {T} : Proper (eq ==> pointwise_relation _ eq ==> eq ==> eq) (@update_nth T). Proof. repeat intro; subst; apply update_nth_ext; trivial. Qed. Lemma update_nth_id_eq_specific {T} f n : forall (xs : list T) (H : forall x, nth_error xs n = Some x -> f x = x), update_nth n f xs = xs. Proof. induction n; destruct xs; simpl; intros; try rewrite IHn; try rewrite H; unfold value in *; try congruence; assumption. Qed. Hint Rewrite @update_nth_id_eq_specific using congruence : simpl_update_nth. Lemma update_nth_id_eq : forall {T} f (H : forall x, f x = x) n (xs : list T), update_nth n f xs = xs. Proof. intros; apply update_nth_id_eq_specific; trivial. Qed. Hint Rewrite @update_nth_id_eq using congruence : simpl_update_nth. Lemma update_nth_id : forall {T} n (xs : list T), update_nth n (fun x => x) xs = xs. Proof. intros; apply update_nth_id_eq; trivial. Qed. Hint Rewrite @update_nth_id : simpl_update_nth. Lemma nth_update_nth : forall m {T} (xs:list T) (n:nat) (f:T -> T), nth_error (update_nth m f xs) n = if eq_nat_dec n m then option_map f (nth_error xs n) else nth_error xs n. Proof. induction m. { destruct n, xs; auto. } { destruct xs, n; intros; simpl; auto; [ | rewrite IHm ]; clear IHm; edestruct eq_nat_dec; reflexivity. } Qed. Hint Rewrite @nth_update_nth : push_nth_error. Hint Rewrite <- @nth_update_nth : pull_nth_error. Lemma length_update_nth : forall {T} i f (xs:list T), length (update_nth i f xs) = length xs. Proof. induction i, xs; boring. Qed. Hint Rewrite @length_update_nth : distr_length. (** TODO: this is in the stdlib in 8.5; remove this when we move to 8.5-only *) Lemma nth_error_None : forall (A : Type) (l : list A) (n : nat), nth_error l n = None <-> length l <= n. Proof. intros A l n. destruct (le_lt_dec (length l) n) as [H|H]; split; intro H'; try omega; try (apply nth_error_length_error in H; tauto); try (apply nth_error_error_length in H'; omega). Qed. (** TODO: this is in the stdlib in 8.5; remove this when we move to 8.5-only *) Lemma nth_error_Some : forall (A : Type) (l : list A) (n : nat), nth_error l n <> None <-> n < length l. Proof. intros; rewrite nth_error_None; split; omega. Qed. Lemma nth_set_nth : forall m {T} (xs:list T) (n:nat) x, nth_error (set_nth m x xs) n = if eq_nat_dec n m then (if lt_dec n (length xs) then Some x else None) else nth_error xs n. Proof. intros; unfold set_nth; rewrite nth_update_nth. destruct (nth_error xs n) eqn:?, (lt_dec n (length xs)) as [p|p]; rewrite <- nth_error_Some in p; solve [ reflexivity | exfalso; apply p; congruence ]. Qed. Hint Rewrite @nth_set_nth : push_nth_error. Lemma length_set_nth : forall {T} i x (xs:list T), length (set_nth i x xs) = length xs. Proof. intros; apply length_update_nth. Qed. Hint Rewrite @length_set_nth : distr_length. Lemma nth_error_length_exists_value : forall {A} (i : nat) (xs : list A), (i < length xs)%nat -> exists x, nth_error xs i = Some x. Proof. induction i, xs; boring; try omega. Qed. Lemma nth_error_length_not_error : forall {A} (i : nat) (xs : list A), nth_error xs i = None -> (i < length xs)%nat -> False. Proof. intros. destruct (nth_error_length_exists_value i xs); intuition; congruence. Qed. Lemma nth_error_value_eq_nth_default : forall {T} i (x : T) xs, nth_error xs i = Some x -> forall d, nth_default d xs i = x. Proof. unfold nth_default; boring. Qed. Hint Rewrite @nth_error_value_eq_nth_default using eassumption : simpl_nth_default. Lemma skipn0 : forall {T} (xs:list T), skipn 0 xs = xs. Proof. auto. Qed. Lemma destruct_repeat : forall {A} xs y, (forall x : A, In x xs -> x = y) -> xs = nil \/ exists xs', xs = y :: xs' /\ (forall x : A, In x xs' -> x = y). Proof. destruct xs; intros; try tauto. right. exists xs; split. + f_equal; auto using in_eq. + intros; auto using in_cons. Qed. Lemma splice_nth_equiv_update_nth : forall {T} n f d (xs:list T), splice_nth n (f (nth_default d xs n)) xs = if lt_dec n (length xs) then update_nth n f xs else xs ++ (f d)::nil. Proof. induction n, xs; boring_list. do 2 break_if; auto; omega. Qed. Lemma splice_nth_equiv_update_nth_update : forall {T} n f d (xs:list T), n < length xs -> splice_nth n (f (nth_default d xs n)) xs = update_nth n f xs. Proof. intros. rewrite splice_nth_equiv_update_nth. break_if; auto; omega. Qed. Lemma splice_nth_equiv_update_nth_snoc : forall {T} n f d (xs:list T), n >= length xs -> splice_nth n (f (nth_default d xs n)) xs = xs ++ (f d)::nil. Proof. intros. rewrite splice_nth_equiv_update_nth. break_if; auto; omega. Qed. Definition IMPOSSIBLE {T} : list T. exact nil. Qed. Ltac remove_nth_error := repeat match goal with | _ => exfalso; solve [ eauto using @nth_error_length_not_error ] | [ |- context[match nth_error ?ls ?n with _ => _ end] ] => destruct (nth_error ls n) eqn:? end. Lemma update_nth_equiv_splice_nth: forall {T} n f (xs:list T), update_nth n f xs = if lt_dec n (length xs) then match nth_error xs n with | Some v => splice_nth n (f v) xs | None => IMPOSSIBLE end else xs. Proof. induction n; destruct xs; intros; autorewrite with simpl_update_nth simpl_nth_default in *; simpl in *; try (erewrite IHn; clear IHn); auto. repeat break_match; remove_nth_error; try reflexivity; try omega. Qed. Lemma splice_nth_equiv_set_nth : forall {T} n x (xs:list T), splice_nth n x xs = if lt_dec n (length xs) then set_nth n x xs else xs ++ x::nil. Proof. intros; rewrite splice_nth_equiv_update_nth with (f := fun _ => x); auto. Qed. Lemma splice_nth_equiv_set_nth_set : forall {T} n x (xs:list T), n < length xs -> splice_nth n x xs = set_nth n x xs. Proof. intros; rewrite splice_nth_equiv_update_nth_update with (f := fun _ => x); auto. Qed. Lemma splice_nth_equiv_set_nth_snoc : forall {T} n x (xs:list T), n >= length xs -> splice_nth n x xs = xs ++ x::nil. Proof. intros; rewrite splice_nth_equiv_update_nth_snoc with (f := fun _ => x); auto. Qed. Lemma set_nth_equiv_splice_nth: forall {T} n x (xs:list T), set_nth n x xs = if lt_dec n (length xs) then splice_nth n x xs else xs. Proof. intros; unfold set_nth; rewrite update_nth_equiv_splice_nth with (f := fun _ => x); auto. repeat break_match; remove_nth_error; trivial. Qed. Lemma combine_update_nth : forall {A B} n f g (xs:list A) (ys:list B), combine (update_nth n f xs) (update_nth n g ys) = update_nth n (fun xy => (f (fst xy), g (snd xy))) (combine xs ys). Proof. induction n; destruct xs, ys; simpl; try rewrite IHn; reflexivity. Qed. (* grumble, grumble, [rewrite] is bad at inferring the identity function, and constant functions *) Ltac rewrite_rev_combine_update_nth := let lem := match goal with | [ |- appcontext[update_nth ?n (fun xy => (@?f xy, @?g xy)) (combine ?xs ?ys)] ] => let f := match (eval cbv [fst] in (fun y x => f (x, y))) with | fun _ => ?f => f end in let g := match (eval cbv [snd] in (fun x y => g (x, y))) with | fun _ => ?g => g end in constr:(@combine_update_nth _ _ n f g xs ys) end in rewrite <- lem. Lemma combine_update_nth_l : forall {A B} n (f : A -> A) xs (ys:list B), combine (update_nth n f xs) ys = update_nth n (fun xy => (f (fst xy), snd xy)) (combine xs ys). Proof. intros ??? f xs ys. etransitivity; [ | apply combine_update_nth with (g := fun x => x) ]. rewrite update_nth_id; reflexivity. Qed. Lemma combine_update_nth_r : forall {A B} n (g : B -> B) (xs:list A) (ys:list B), combine xs (update_nth n g ys) = update_nth n (fun xy => (fst xy, g (snd xy))) (combine xs ys). Proof. intros ??? g xs ys. etransitivity; [ | apply combine_update_nth with (f := fun x => x) ]. rewrite update_nth_id; reflexivity. Qed. Lemma combine_set_nth : forall {A B} n (x:A) xs (ys:list B), combine (set_nth n x xs) ys = match nth_error ys n with | None => combine xs ys | Some y => set_nth n (x,y) (combine xs ys) end. Proof. intros; unfold set_nth; rewrite combine_update_nth_l. nth_tac; [ repeat rewrite_rev_combine_update_nth; apply f_equal2 | assert (nth_error (combine xs ys) n = None) by (apply nth_error_None; rewrite combine_length; omega * ) ]; autorewrite with simpl_update_nth; reflexivity. Qed. Lemma nth_error_value_In : forall {T} n xs (x:T), nth_error xs n = Some x -> In x xs. Proof. induction n; destruct xs; nth_tac. Qed. Lemma In_nth_error_value : forall {T} xs (x:T), In x xs -> exists n, nth_error xs n = Some x. Proof. induction xs; nth_tac; break_or_hyp. - exists 0; reflexivity. - edestruct IHxs; eauto. exists (S x0). eauto. Qed. Lemma nth_value_index : forall {T} i xs (x:T), nth_error xs i = Some x -> In i (seq 0 (length xs)). Proof. induction i; destruct xs; nth_tac; right. rewrite <- seq_shift; apply in_map; eapply IHi; eauto. Qed. Lemma nth_error_app : forall {T} n (xs ys:list T), nth_error (xs ++ ys) n = if lt_dec n (length xs) then nth_error xs n else nth_error ys (n - length xs). Proof. induction n; destruct xs; nth_tac; rewrite IHn; destruct (lt_dec n (length xs)); trivial; omega. Qed. Lemma nth_default_app : forall {T} n x (xs ys:list T), nth_default x (xs ++ ys) n = if lt_dec n (length xs) then nth_default x xs n else nth_default x ys (n - length xs). Proof. intros. unfold nth_default. rewrite nth_error_app. destruct (lt_dec n (length xs)); auto. Qed. Hint Rewrite @nth_default_app : push_nth_default. Lemma combine_truncate_r : forall {A B} (xs : list A) (ys : list B), combine xs ys = combine xs (firstn (length xs) ys). Proof. induction xs; destruct ys; boring. Qed. Lemma combine_truncate_l : forall {A B} (xs : list A) (ys : list B), combine xs ys = combine (firstn (length ys) xs) ys. Proof. induction xs; destruct ys; boring. Qed. Lemma combine_app_samelength : forall {A B} (xs xs':list A) (ys ys':list B), length xs = length ys -> combine (xs ++ xs') (ys ++ ys') = combine xs ys ++ combine xs' ys'. Proof. induction xs, xs', ys, ys'; boring; omega. Qed. Lemma skipn_nil : forall {A} n, skipn n nil = @nil A. Proof. destruct n; auto. Qed. Hint Rewrite @skipn_nil : simpl_skipn. Hint Rewrite @skipn_nil : push_skipn. Lemma skipn_0 : forall {A} xs, @skipn A 0 xs = xs. Proof. reflexivity. Qed. Hint Rewrite @skipn_0 : simpl_skipn. Hint Rewrite @skipn_0 : push_skipn. Lemma skipn_cons_S : forall {A} n x xs, @skipn A (S n) (x::xs) = @skipn A n xs. Proof. reflexivity. Qed. Hint Rewrite @skipn_cons_S : simpl_skipn. Hint Rewrite @skipn_cons_S : push_skipn. Lemma skipn_app : forall {A} n (xs ys : list A), skipn n (xs ++ ys) = skipn n xs ++ skipn (n - length xs) ys. Proof. induction n, xs, ys; boring. Qed. Hint Rewrite @skipn_app : push_skipn. Lemma firstn_app_inleft : forall {A} n (xs ys : list A), (n <= length xs)%nat -> firstn n (xs ++ ys) = firstn n xs. Proof. induction n, xs, ys; boring; try omega. Qed. Hint Rewrite @firstn_app_inleft using solve [ distr_length ] : simpl_firstn. Hint Rewrite @firstn_app_inleft using solve [ distr_length ] : push_firstn. Lemma skipn_app_inleft : forall {A} n (xs ys : list A), (n <= length xs)%nat -> skipn n (xs ++ ys) = skipn n xs ++ ys. Proof. induction n, xs, ys; boring; try omega. Qed. Hint Rewrite @skipn_app_inleft using solve [ distr_length ] : push_skipn. Lemma firstn_map : forall {A B} (f : A -> B) n (xs : list A), firstn n (map f xs) = map f (firstn n xs). Proof. induction n, xs; boring. Qed. Hint Rewrite @firstn_map : push_firstn. Hint Rewrite <- @firstn_map : pull_firstn. Lemma skipn_map : forall {A B} (f : A -> B) n (xs : list A), skipn n (map f xs) = map f (skipn n xs). Proof. induction n, xs; boring. Qed. Hint Rewrite @skipn_map : push_skipn. Hint Rewrite <- @skipn_map : pull_skipn. Lemma firstn_all : forall {A} n (xs:list A), n = length xs -> firstn n xs = xs. Proof. induction n, xs; boring; omega. Qed. Hint Rewrite @firstn_all using solve [ distr_length ] : simpl_firstn. Hint Rewrite @firstn_all using solve [ distr_length ] : push_firstn. Lemma skipn_all : forall {T} n (xs:list T), (n >= length xs)%nat -> skipn n xs = nil. Proof. induction n, xs; boring; omega. Qed. Hint Rewrite @skipn_all using solve [ distr_length ] : simpl_skipn. Hint Rewrite @skipn_all using solve [ distr_length ] : push_skipn. Lemma firstn_app_sharp : forall {A} n (l l': list A), length l = n -> firstn n (l ++ l') = l. Proof. intros. rewrite firstn_app_inleft; auto using firstn_all; omega. Qed. Hint Rewrite @firstn_app_sharp using solve [ distr_length ] : simpl_firstn. Hint Rewrite @firstn_app_sharp using solve [ distr_length ] : push_firstn. Lemma skipn_app_sharp : forall {A} n (l l': list A), length l = n -> skipn n (l ++ l') = l'. Proof. intros. rewrite skipn_app_inleft; try rewrite skipn_all; auto; omega. Qed. Hint Rewrite @skipn_app_sharp using solve [ distr_length ] : simpl_skipn. Hint Rewrite @skipn_app_sharp using solve [ distr_length ] : push_skipn. Lemma skipn_length : forall {A} n (xs : list A), length (skipn n xs) = (length xs - n)%nat. Proof. induction n, xs; boring. Qed. Hint Rewrite @skipn_length : distr_length. Lemma fold_right_cons : forall {A B} (f:B->A->A) a b bs, fold_right f a (b::bs) = f b (fold_right f a bs). Proof. reflexivity. Qed. Hint Rewrite @fold_right_cons : simpl_fold_right. Lemma length_cons : forall {T} (x:T) xs, length (x::xs) = S (length xs). reflexivity. Qed. Hint Rewrite @length_cons : distr_length. Lemma cons_length : forall A (xs : list A) a, length (a :: xs) = S (length xs). Proof. auto. Qed. Lemma length0_nil : forall {A} (xs : list A), length xs = 0%nat -> xs = nil. Proof. induction xs; boring; discriminate. Qed. Lemma length_snoc : forall {T} xs (x:T), length xs = pred (length (xs++x::nil)). Proof. boring; simpl_list; boring. Qed. Lemma firstn_combine : forall {A B} n (xs:list A) (ys:list B), firstn n (combine xs ys) = combine (firstn n xs) (firstn n ys). Proof. induction n, xs, ys; boring. Qed. Hint Rewrite @firstn_combine : push_firstn. Hint Rewrite <- @firstn_combine : pull_firstn. Lemma combine_nil_r : forall {A B} (xs:list A), combine xs (@nil B) = nil. Proof. induction xs; boring. Qed. Lemma skipn_combine : forall {A B} n (xs:list A) (ys:list B), skipn n (combine xs ys) = combine (skipn n xs) (skipn n ys). Proof. induction n, xs, ys; boring. rewrite combine_nil_r; reflexivity. Qed. Hint Rewrite @skipn_combine : push_skipn. Hint Rewrite <- @skipn_combine : pull_skipn. Lemma break_list_last: forall {T} (xs:list T), xs = nil \/ exists xs' y, xs = xs' ++ y :: nil. Proof. destruct xs using rev_ind; auto. right; do 2 eexists; auto. Qed. Lemma break_list_first: forall {T} (xs:list T), xs = nil \/ exists x xs', xs = x :: xs'. Proof. destruct xs; auto. right; do 2 eexists; auto. Qed. Lemma list012 : forall {T} (xs:list T), xs = nil \/ (exists x, xs = x::nil) \/ (exists x xs' y, xs = x::xs'++y::nil). Proof. destruct xs; auto. right. destruct xs using rev_ind. { left; eexists; auto. } { right; repeat eexists; auto. } Qed. Lemma nil_length0 : forall {T}, length (@nil T) = 0%nat. Proof. auto. Qed. Hint Rewrite @nil_length0 : distr_length. Lemma nth_error_Some_nth_default : forall {T} i x (l : list T), (i < length l)%nat -> nth_error l i = Some (nth_default x l i). Proof. intros ? ? ? ? i_lt_length. destruct (nth_error_length_exists_value _ _ i_lt_length) as [k nth_err_k]. unfold nth_default. rewrite nth_err_k. reflexivity. Qed. Lemma update_nth_cons : forall {T} f (u0 : T) us, update_nth 0 f (u0 :: us) = (f u0) :: us. Proof. reflexivity. Qed. Hint Rewrite @update_nth_cons : simpl_update_nth. Lemma set_nth_cons : forall {T} (x u0 : T) us, set_nth 0 x (u0 :: us) = x :: us. Proof. intros; apply update_nth_cons. Qed. Hint Rewrite @set_nth_cons : simpl_set_nth. Lemma cons_update_nth : forall {T} n f (y : T) us, y :: update_nth n f us = update_nth (S n) f (y :: us). Proof. induction n; boring. Qed. Hint Rewrite <- @cons_update_nth : simpl_update_nth. Lemma update_nth_nil : forall {T} n f, update_nth n f (@nil T) = @nil T. Proof. induction n; boring. Qed. Hint Rewrite @update_nth_nil : simpl_update_nth. Lemma cons_set_nth : forall {T} n (x y : T) us, y :: set_nth n x us = set_nth (S n) x (y :: us). Proof. intros; apply cons_update_nth. Qed. Hint Rewrite <- @cons_set_nth : simpl_set_nth. Lemma set_nth_nil : forall {T} n (x : T), set_nth n x nil = nil. Proof. intros; apply update_nth_nil. Qed. Hint Rewrite @set_nth_nil : simpl_set_nth. Lemma skipn_nth_default : forall {T} n us (d : T), (n < length us)%nat -> skipn n us = nth_default d us n :: skipn (S n) us. Proof. induction n; destruct us; intros; nth_tac. rewrite (IHn us d) at 1 by omega. nth_tac. Qed. Lemma nth_default_out_of_bounds : forall {T} n us (d : T), (n >= length us)%nat -> nth_default d us n = d. Proof. induction n; unfold nth_default; nth_tac; destruct us; nth_tac. assert (n >= length us)%nat by omega. pose proof (nth_error_length_error _ n us H1). rewrite H0 in H2. congruence. Qed. Hint Rewrite @nth_default_out_of_bounds using omega : simpl_nth_default. Ltac nth_error_inbounds := match goal with | [ |- context[match nth_error ?xs ?i with Some _ => _ | None => _ end ] ] => case_eq (nth_error xs i); match goal with | [ |- forall _, nth_error xs i = Some _ -> _ ] => let x := fresh "x" in let H := fresh "H" in intros x H; repeat progress erewrite H; repeat progress erewrite (nth_error_value_eq_nth_default i xs x); auto | [ |- nth_error xs i = None -> _ ] => let H := fresh "H" in intros H; destruct (nth_error_length_not_error _ _ H); try solve [distr_length] end; idtac end. Ltac set_nth_inbounds := match goal with | [ |- context[set_nth ?i ?x ?xs] ] => rewrite (set_nth_equiv_splice_nth i x xs); destruct (lt_dec i (length xs)); match goal with | [ H : ~ (i < (length xs))%nat |- _ ] => destruct H | [ H : (i < (length xs))%nat |- _ ] => try solve [distr_length] end end. Ltac update_nth_inbounds := match goal with | [ |- context[update_nth ?i ?f ?xs] ] => rewrite (update_nth_equiv_splice_nth i f xs); destruct (lt_dec i (length xs)); match goal with | [ H : ~ (i < (length xs))%nat |- _ ] => destruct H | [ H : (i < (length xs))%nat |- _ ] => remove_nth_error; try solve [distr_length] end end. Ltac nth_inbounds := nth_error_inbounds || set_nth_inbounds || update_nth_inbounds. Definition nth_dep {A} (ls : list A) (n : nat) (pf : n < length ls) : A. Proof. refine (match nth_error ls n as v return nth_error ls n = v -> A with | Some v => fun _ => v | None => fun bad => match _ : False with end end eq_refl). apply (proj1 (@nth_error_None _ _ _)) in bad; instantiate; generalize dependent (length ls); clear. abstract (intros; omega). Defined. Lemma nth_error_nth_dep {A} ls n pf : nth_error ls n = Some (@nth_dep A ls n pf). Proof. unfold nth_dep. generalize dependent (@nth_error_None A ls n). edestruct nth_error; boring. Qed. Lemma nth_default_nth_dep {A} d ls n pf : nth_default d ls n = @nth_dep A ls n pf. Proof. unfold nth_dep. generalize dependent (@nth_error_None A ls n). destruct (nth_error ls n) eqn:?; boring. erewrite nth_error_value_eq_nth_default by eassumption; reflexivity. Qed. Lemma nth_default_in_bounds : forall {T} (d' d : T) n us, (n < length us)%nat -> nth_default d us n = nth_default d' us n. Proof. intros; erewrite !nth_default_nth_dep; reflexivity. Grab Existential Variables. assumption. Qed. Hint Resolve @nth_default_in_bounds : simpl_nth_default. Lemma cons_eq_head : forall {T} (x y:T) xs ys, x::xs = y::ys -> x=y. Proof. intros; solve_by_inversion. Qed. Lemma cons_eq_tail : forall {T} (x y:T) xs ys, x::xs = y::ys -> xs=ys. Proof. intros; solve_by_inversion. Qed. Lemma map_nth_default_always {A B} (f : A -> B) (n : nat) (x : A) (l : list A) : nth_default (f x) (map f l) n = f (nth_default x l n). Proof. revert n; induction l; simpl; intro n; destruct n; [ try reflexivity.. ]. nth_tac. Qed. Hint Rewrite @map_nth_default_always : push_nth_default. Lemma fold_right_and_True_forall_In_iff : forall {T} (l : list T) (P : T -> Prop), (forall x, In x l -> P x) <-> fold_right and True (map P l). Proof. induction l; intros; simpl; try tauto. rewrite <- IHl. intuition (subst; auto). Qed. Lemma fold_right_invariant : forall {A} P (f: A -> A -> A) l x, P x -> (forall y, In y l -> forall z, P z -> P (f y z)) -> P (fold_right f x l). Proof. induction l; intros ? ? step; auto. simpl. apply step; try apply in_eq. apply IHl; auto. intros y in_y_l. apply (in_cons a) in in_y_l. auto. Qed. Lemma In_firstn : forall {T} n l (x : T), In x (firstn n l) -> In x l. Proof. induction n; destruct l; boring. Qed. Lemma In_skipn : forall {T} n l (x : T), In x (skipn n l) -> In x l. Proof. induction n; destruct l; boring. Qed. Lemma firstn_firstn : forall {A} m n (l : list A), (n <= m)%nat -> firstn n (firstn m l) = firstn n l. Proof. induction m; destruct n; intros; try omega; auto. destruct l; auto. simpl. f_equal. apply IHm; omega. Qed. Hint Rewrite @firstn_firstn using omega : push_firstn. Lemma firstn_succ : forall {A} (d : A) n l, (n < length l)%nat -> firstn (S n) l = (firstn n l) ++ nth_default d l n :: nil. Proof. induction n; destruct l; rewrite ?(@nil_length0 A); intros; try omega. + rewrite nth_default_cons; auto. + simpl. rewrite nth_default_cons_S. rewrite <-IHn by (rewrite cons_length in *; omega). reflexivity. Qed. Lemma update_nth_out_of_bounds : forall {A} n f xs, n >= length xs -> @update_nth A n f xs = xs. Proof. induction n; destruct xs; simpl; try congruence; try omega; intros. rewrite IHn by omega; reflexivity. Qed. Hint Rewrite @update_nth_out_of_bounds using omega : simpl_update_nth. Lemma update_nth_nth_default_full : forall {A} (d:A) n f l i, nth_default d (update_nth n f l) i = if lt_dec i (length l) then if (eq_nat_dec i n) then f (nth_default d l i) else nth_default d l i else d. Proof. induction n; (destruct l; simpl in *; [ intros; destruct i; simpl; try reflexivity; omega | ]); intros; repeat break_if; subst; try destruct i; repeat first [ progress break_if | progress subst | progress boring | progress autorewrite with simpl_nth_default | omega ]. Qed. Hint Rewrite @update_nth_nth_default_full : push_nth_default. Lemma update_nth_nth_default : forall {A} (d:A) n f l i, (0 <= i < length l)%nat -> nth_default d (update_nth n f l) i = if (eq_nat_dec i n) then f (nth_default d l i) else nth_default d l i. Proof. intros; rewrite update_nth_nth_default_full; repeat break_if; boring. Qed. Hint Rewrite @update_nth_nth_default using (omega || distr_length; omega) : push_nth_default. Lemma set_nth_nth_default_full : forall {A} (d:A) n v l i, nth_default d (set_nth n v l) i = if lt_dec i (length l) then if (eq_nat_dec i n) then v else nth_default d l i else d. Proof. intros; apply update_nth_nth_default_full; assumption. Qed. Hint Rewrite @set_nth_nth_default_full : push_nth_default. Lemma set_nth_nth_default : forall {A} (d:A) n x l i, (0 <= i < length l)%nat -> nth_default d (set_nth n x l) i = if (eq_nat_dec i n) then x else nth_default d l i. Proof. intros; apply update_nth_nth_default; assumption. Qed. Hint Rewrite @set_nth_nth_default using (omega || distr_length; omega) : push_nth_default. Lemma nth_default_preserves_properties : forall {A} (P : A -> Prop) l n d, (forall x, In x l -> P x) -> P d -> P (nth_default d l n). Proof. intros; rewrite nth_default_eq. destruct (nth_in_or_default n l d); auto. congruence. Qed. Lemma nth_default_preserves_properties_length_dep : forall {A} (P : A -> Prop) l n d, (forall x, In x l -> n < (length l) -> P x) -> ((~ n < length l) -> P d) -> P (nth_default d l n). Proof. intros. destruct (lt_dec n (length l)). + rewrite nth_default_eq; auto using nth_In. + rewrite nth_default_out_of_bounds by omega. auto. Qed. Lemma nth_error_first : forall {T} (a b : T) l, nth_error (a :: l) 0 = Some b -> a = b. Proof. intros; simpl in *. unfold value in *. congruence. Qed. Lemma nth_error_exists_first : forall {T} l (x : T) (H : nth_error l 0 = Some x), exists l', l = x :: l'. Proof. induction l; try discriminate; eexists. apply nth_error_first in H. subst; eauto. Qed. Lemma list_elementwise_eq : forall {T} (l1 l2 : list T), (forall i, nth_error l1 i = nth_error l2 i) -> l1 = l2. Proof. induction l1, l2; intros; try reflexivity; pose proof (H 0%nat) as Hfirst; simpl in Hfirst; inversion Hfirst. f_equal. apply IHl1. intros i; specialize (H (S i)). boring. Qed. Lemma sum_firstn_all_succ : forall n l, (length l <= n)%nat -> sum_firstn l (S n) = sum_firstn l n. Proof. unfold sum_firstn; intros. autorewrite with push_firstn; reflexivity. Qed. Hint Rewrite @sum_firstn_all_succ using omega : simpl_sum_firstn. Lemma sum_firstn_all : forall n l, (length l <= n)%nat -> sum_firstn l n = sum_firstn l (length l). Proof. unfold sum_firstn; intros. autorewrite with push_firstn; reflexivity. Qed. Hint Rewrite @sum_firstn_all using omega : simpl_sum_firstn. Lemma sum_firstn_succ_default : forall l i, sum_firstn l (S i) = (nth_default 0 l i + sum_firstn l i)%Z. Proof. unfold sum_firstn; induction l, i; intros; autorewrite with simpl_nth_default simpl_firstn simpl_fold_right in *; try reflexivity. rewrite IHl; omega. Qed. Hint Rewrite @sum_firstn_succ_default : simpl_sum_firstn. Lemma sum_firstn_0 : forall xs, sum_firstn xs 0 = 0%Z. Proof. destruct xs; reflexivity. Qed. Hint Rewrite @sum_firstn_0 : simpl_sum_firstn. Lemma sum_firstn_succ : forall l i x, nth_error l i = Some x -> sum_firstn l (S i) = (x + sum_firstn l i)%Z. Proof. intros; rewrite sum_firstn_succ_default. erewrite nth_error_value_eq_nth_default by eassumption; reflexivity. Qed. Hint Rewrite @sum_firstn_succ using congruence : simpl_sum_firstn. Lemma sum_firstn_succ_cons : forall x xs i, sum_firstn (x :: xs) (S i) = (x + sum_firstn xs i)%Z. Proof. unfold sum_firstn; simpl; reflexivity. Qed. Hint Rewrite @sum_firstn_succ_cons : simpl_sum_firstn. Lemma sum_firstn_nil : forall i, sum_firstn nil i = 0%Z. Proof. destruct i; reflexivity. Qed. Hint Rewrite @sum_firstn_nil : simpl_sum_firstn. Lemma sum_firstn_succ_default_rev : forall l i, sum_firstn l i = (sum_firstn l (S i) - nth_default 0 l i)%Z. Proof. intros; rewrite sum_firstn_succ_default; omega. Qed. Lemma sum_firstn_succ_rev : forall l i x, nth_error l i = Some x -> sum_firstn l i = (sum_firstn l (S i) - x)%Z. Proof. intros; erewrite sum_firstn_succ by eassumption; omega. Qed. Lemma sum_firstn_nonnegative : forall n l, (forall x, In x l -> 0 <= x)%Z -> (0 <= sum_firstn l n)%Z. Proof. induction n as [|n IHn]; destruct l as [|? l]; autorewrite with simpl_sum_firstn; simpl; try omega. { specialize (IHn l). destruct n; simpl; autorewrite with simpl_sum_firstn simpl_nth_default in *; intuition auto with zarith. } Qed. Hint Resolve sum_firstn_nonnegative : znonzero. Lemma sum_firstn_app : forall xs ys n, sum_firstn (xs ++ ys) n = (sum_firstn xs n + sum_firstn ys (n - length xs))%Z. Proof. induction xs; simpl. { intros ys n; autorewrite with simpl_sum_firstn; simpl. f_equal; omega. } { intros ys [|n]; autorewrite with simpl_sum_firstn; simpl; [ reflexivity | ]. rewrite IHxs; omega. } Qed. Lemma sum_firstn_app_sum : forall xs ys n, sum_firstn (xs ++ ys) (length xs + n) = (sum_firstn xs (length xs) + sum_firstn ys n)%Z. Proof. intros; rewrite sum_firstn_app; autorewrite with simpl_sum_firstn. do 2 f_equal; omega. Qed. Hint Rewrite @sum_firstn_app_sum : simpl_sum_firstn. Lemma nth_error_skipn : forall {A} n (l : list A) m, nth_error (skipn n l) m = nth_error l (n + m). Proof. induction n; destruct l; boring. apply nth_error_nil_error. Qed. Hint Rewrite @nth_error_skipn : push_nth_error. Lemma nth_default_skipn : forall {A} (l : list A) d n m, nth_default d (skipn n l) m = nth_default d l (n + m). Proof. cbv [nth_default]; intros. rewrite nth_error_skipn. reflexivity. Qed. Hint Rewrite @nth_default_skipn : push_nth_default. Lemma sum_firstn_skipn : forall l n m, sum_firstn l (n + m) = (sum_firstn l n + sum_firstn (skipn n l) m)%Z. Proof. induction m; intros. + rewrite sum_firstn_0. autorewrite with natsimplify. omega. + rewrite <-plus_n_Sm, !sum_firstn_succ_default. rewrite nth_default_skipn. omega. Qed. Lemma sum_firstn_prefix_le' : forall l n m, (forall x, In x l -> (0 <= x)%Z) -> (sum_firstn l n <= sum_firstn l (n + m))%Z. Proof. intros. rewrite sum_firstn_skipn. pose proof (sum_firstn_nonnegative m (skipn n l)) as Hskipn_nonneg. match type of Hskipn_nonneg with ?P -> _ => assert P as Q; [ | specialize (Hskipn_nonneg Q); omega ] end. intros x HIn_skipn. apply In_skipn in HIn_skipn. auto. Qed. Lemma sum_firstn_prefix_le : forall l n m, (forall x, In x l -> (0 <= x)%Z) -> (n <= m)%nat -> (sum_firstn l n <= sum_firstn l m)%Z. Proof. intros. replace m with (n + (m - n))%nat by omega. auto using sum_firstn_prefix_le'. Qed. Lemma sum_firstn_pos_lt_succ : forall l n m, (forall x, In x l -> (0 <= x)%Z) -> (n < length l)%nat -> (sum_firstn l n < sum_firstn l (S m))%Z -> (n <= m)%nat. Proof. intros. destruct (le_dec n m); auto. replace n with (m + (n - m))%nat in H1 by omega. rewrite sum_firstn_skipn in H1. rewrite sum_firstn_succ_default in *. match goal with H : (?a + ?b < ?c + ?a)%Z |- _ => assert (b < c)%Z by omega end. destruct (lt_dec m (length l)). { rewrite skipn_nth_default with (d := 0%Z) in H2 by assumption. replace (n - m)%nat with (S (n - S m))%nat in H2 by omega. rewrite sum_firstn_succ_cons in H2. pose proof (sum_firstn_nonnegative (n - S m) (skipn (S m) l)). match type of H3 with ?P -> _ => assert P as Q; [ | specialize (H3 Q); omega ] end. intros ? A. apply In_skipn in A. apply H in A. omega. } { rewrite skipn_all, nth_default_out_of_bounds in H2 by omega. rewrite sum_firstn_nil in H2; omega. } Qed. Definition NotSum {T} (xs : list T) (v : nat) := True. Ltac NotSum := lazymatch goal with | [ |- NotSum ?xs (length ?xs + _)%nat ] => fail | [ |- NotSum _ _ ] => exact I end. Lemma sum_firstn_app_hint : forall xs ys n, NotSum xs n -> sum_firstn (xs ++ ys) n = (sum_firstn xs n + sum_firstn ys (n - length xs))%Z. Proof. auto using sum_firstn_app. Qed. Hint Rewrite sum_firstn_app_hint using solve [ NotSum ] : simpl_sum_firstn. Lemma nth_default_map2 : forall {A B C} (f : A -> B -> C) ls1 ls2 i d d1 d2, nth_default d (map2 f ls1 ls2) i = if lt_dec i (min (length ls1) (length ls2)) then f (nth_default d1 ls1 i) (nth_default d2 ls2 i) else d. Proof. induction ls1, ls2. + cbv [map2 length min]. intros. break_if; try omega. apply nth_default_nil. + cbv [map2 length min]. intros. break_if; try omega. apply nth_default_nil. + cbv [map2 length min]. intros. break_if; try omega. apply nth_default_nil. + simpl. destruct i. - intros. rewrite !nth_default_cons. break_if; auto; omega. - intros. rewrite !nth_default_cons_S. rewrite IHls1 with (d1 := d1) (d2 := d2). repeat break_if; auto; omega. Qed. Lemma map2_cons : forall A B C (f : A -> B -> C) ls1 ls2 a b, map2 f (a :: ls1) (b :: ls2) = f a b :: map2 f ls1 ls2. Proof. reflexivity. Qed. Lemma map2_nil_l : forall A B C (f : A -> B -> C) ls2, map2 f nil ls2 = nil. Proof. reflexivity. Qed. Lemma map2_nil_r : forall A B C (f : A -> B -> C) ls1, map2 f ls1 nil = nil. Proof. destruct ls1; reflexivity. Qed. Local Hint Resolve map2_nil_r map2_nil_l. Opaque map2. Lemma map2_length : forall A B C (f : A -> B -> C) ls1 ls2, length (map2 f ls1 ls2) = min (length ls1) (length ls2). Proof. induction ls1, ls2; intros; try solve [cbv; auto]. rewrite map2_cons, !length_cons, IHls1. auto. Qed. Ltac simpl_list_lengths := repeat match goal with | H : appcontext[length (@nil ?A)] |- _ => rewrite (@nil_length0 A) in H | H : appcontext[length (_ :: _)] |- _ => rewrite length_cons in H | |- appcontext[length (@nil ?A)] => rewrite (@nil_length0 A) | |- appcontext[length (_ :: _)] => rewrite length_cons end. Lemma map2_app : forall A B C (f : A -> B -> C) ls1 ls2 ls1' ls2', (length ls1 = length ls2) -> map2 f (ls1 ++ ls1') (ls2 ++ ls2') = map2 f ls1 ls2 ++ map2 f ls1' ls2'. Proof. induction ls1, ls2; intros; rewrite ?map2_nil_r, ?app_nil_l; try congruence; simpl_list_lengths; try omega. rewrite <-!app_comm_cons, !map2_cons. rewrite IHls1; auto. Qed. Lemma firstn_update_nth {A} : forall f m n (xs : list A), firstn m (update_nth n f xs) = update_nth n f (firstn m xs). Proof. induction m; destruct n, xs; autorewrite with simpl_firstn simpl_update_nth; congruence. Qed. Hint Rewrite @firstn_update_nth : push_firstn. Hint Rewrite @firstn_update_nth : pull_update_nth. Hint Rewrite <- @firstn_update_nth : pull_firstn. Hint Rewrite <- @firstn_update_nth : push_update_nth. Require Import Coq.Lists.SetoidList. Global Instance Proper_nth_default : forall A eq, Proper (eq==>eqlistA eq==>Logic.eq==>eq) (nth_default (A:=A)). Proof. do 5 intro; subst; induction 1. + repeat intro; rewrite !nth_default_nil; assumption. + repeat intro; subst; destruct y0; rewrite ?nth_default_cons, ?nth_default_cons_S; auto. Qed. Lemma fold_right_andb_true_map_iff A (ls : list A) f : List.fold_right andb true (List.map f ls) = true <-> forall i, List.In i ls -> f i = true. Proof. induction ls; simpl; [ | rewrite Bool.andb_true_iff, IHls ]; try tauto. intuition (congruence || eauto). Qed. Lemma Forall2_forall_iff : forall {A} R (xs ys : list A) d, length xs = length ys -> (Forall2 R xs ys <-> (forall i, (i < length xs)%nat -> R (nth_default d xs i) (nth_default d ys i))). Proof. split; intros. + revert xs ys H H0 H1. induction i; intros; destruct H0; distr_length; autorewrite with push_nth_default; auto. eapply IHi; auto. omega. + revert xs ys H H0; induction xs; intros; destruct ys; distr_length; econstructor. - specialize (H0 0%nat). autorewrite with push_nth_default in *; auto. apply H0; omega. - apply IHxs; try omega. intros. specialize (H0 (S i)). autorewrite with push_nth_default in *; auto. apply H0; omega. Qed. Lemma nth_default_firstn : forall {A} (d : A) l i n, nth_default d (firstn n l) i = if le_dec n (length l) then if lt_dec i n then nth_default d l i else d else nth_default d l i. Proof. induction n; intros; break_if; autorewrite with push_nth_default; auto; try omega. + rewrite (firstn_succ d) by omega. autorewrite with push_nth_default; repeat (break_if; distr_length); rewrite Min.min_l in * by omega; try omega. - apply IHn; omega. - replace i with n in * by omega. rewrite Nat.sub_diag. autorewrite with push_nth_default; auto. - rewrite nth_default_out_of_bounds; distr_length; auto. + rewrite firstn_all2 by omega. auto. Qed. Hint Rewrite @nth_default_firstn : push_nth_default. Lemma nth_error_repeat {T} x n i v : nth_error (@repeat T x n) i = Some v -> v = x. Proof. revert n x v; induction i as [|i IHi]; destruct n; simpl in *; eauto; congruence. Qed. Hint Rewrite repeat_length : distr_length. Lemma repeat_spec_iff : forall {A} (ls : list A) x n, (length ls = n /\ forall y, In y ls -> y = x) <-> ls = repeat x n. Proof. split; [ revert A ls x n | intro; subst; eauto using repeat_length, repeat_spec ]. induction ls, n; simpl; intros; intuition try congruence. f_equal; auto. Qed. Lemma repeat_spec_eq : forall {A} (ls : list A) x n, length ls = n -> (forall y, In y ls -> y = x) -> ls = repeat x n. Proof. intros; apply repeat_spec_iff; auto. Qed. Lemma tl_repeat {A} x n : tl (@repeat A x n) = repeat x (pred n). Proof. destruct n; reflexivity. Qed. Lemma firstn_repeat : forall {A} x n k, firstn k (@repeat A x n) = repeat x (min k n). Proof. induction n, k; boring. Qed. Hint Rewrite @firstn_repeat : push_firstn. Lemma skipn_repeat : forall {A} x n k, skipn k (@repeat A x n) = repeat x (n - k). Proof. induction n, k; boring. Qed. Hint Rewrite @skipn_repeat : push_skipn.
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ `ifndef SKY130_FD_SC_HDLL__TAPVGND2_PP_BLACKBOX_V `define SKY130_FD_SC_HDLL__TAPVGND2_PP_BLACKBOX_V /** * tapvgnd2: Tap cell with tap to ground, isolated power connection * 2 rows down. * * Verilog stub definition (black box with power pins). * * WARNING: This file is autogenerated, do not modify directly! */ `timescale 1ns / 1ps `default_nettype none (* blackbox *) module sky130_fd_sc_hdll__tapvgnd2 ( VPWR, VGND, VPB , VNB ); input VPWR; input VGND; input VPB ; input VNB ; endmodule `default_nettype wire `endif // SKY130_FD_SC_HDLL__TAPVGND2_PP_BLACKBOX_V
// megafunction wizard: %ALTFP_CONVERT% // GENERATION: STANDARD // VERSION: WM1.0 // MODULE: ALTFP_CONVERT // ============================================================ // File Name: int16_float32.v // Megafunction Name(s): // ALTFP_CONVERT // // Simulation Library Files(s): // lpm // ============================================================ // ************************************************************ // THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE! // // 14.1.0 Build 186 12/03/2014 SJ Web Edition // ************************************************************ //Copyright (C) 1991-2014 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 from 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, the Altera Quartus II License Agreement, //the 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. //altfp_convert CBX_AUTO_BLACKBOX="ALL" DEVICE_FAMILY="Cyclone V" OPERATION="INT2FLOAT" ROUNDING="TO_NEAREST" WIDTH_DATA=16 WIDTH_EXP_INPUT=8 WIDTH_EXP_OUTPUT=8 WIDTH_INT=16 WIDTH_MAN_INPUT=23 WIDTH_MAN_OUTPUT=23 WIDTH_RESULT=32 clock dataa result //VERSION_BEGIN 14.1 cbx_altbarrel_shift 2014:12:03:18:16:05:SJ cbx_altfp_convert 2014:12:03:18:16:05:SJ cbx_altpriority_encoder 2014:12:03:18:16:05:SJ cbx_altsyncram 2014:12:03:18:16:05:SJ cbx_cycloneii 2014:12:03:18:16:05:SJ cbx_lpm_abs 2014:12:03:18:16:05:SJ cbx_lpm_add_sub 2014:12:03:18:16:05:SJ cbx_lpm_compare 2014:12:03:18:16:05:SJ cbx_lpm_decode 2014:12:03:18:16:05:SJ cbx_lpm_divide 2014:12:03:18:16:05:SJ cbx_lpm_mux 2014:12:03:18:16:05:SJ cbx_mgl 2014:12:03:20:51:57:SJ cbx_stratix 2014:12:03:18:16:05:SJ cbx_stratixii 2014:12:03:18:16:05:SJ cbx_stratixiii 2014:12:03:18:16:05:SJ cbx_stratixv 2014:12:03:18:16:05:SJ cbx_util_mgl 2014:12:03:18:16:05:SJ VERSION_END // synthesis VERILOG_INPUT_VERSION VERILOG_2001 // altera message_off 10463 //altbarrel_shift CBX_AUTO_BLACKBOX="ALL" DEVICE_FAMILY="Cyclone V" PIPELINE=2 SHIFTDIR="LEFT" SHIFTTYPE="LOGICAL" WIDTH=16 WIDTHDIST=4 aclr clk_en clock data distance result //VERSION_BEGIN 14.1 cbx_altbarrel_shift 2014:12:03:18:16:05:SJ cbx_mgl 2014:12:03:20:51:57:SJ VERSION_END //synthesis_resources = reg 36 //synopsys translate_off `timescale 1 ps / 1 ps //synopsys translate_on module int16_float32_altbarrel_shift_gof ( aclr, clk_en, clock, data, distance, result) ; input aclr; input clk_en; input clock; input [15:0] data; input [3:0] distance; output [15:0] result; `ifndef ALTERA_RESERVED_QIS // synopsys translate_off `endif tri0 aclr; tri1 clk_en; tri0 clock; `ifndef ALTERA_RESERVED_QIS // synopsys translate_on `endif reg [1:0] dir_pipe; reg [15:0] sbit_piper1d; reg [15:0] sbit_piper2d; reg sel_pipec2r1d; reg sel_pipec3r1d; wire [4:0] dir_w; wire direction_w; wire [7:0] pad_w; wire [79:0] sbit_w; wire [3:0] sel_w; wire [63:0] smux_w; // synopsys translate_off initial dir_pipe = 0; // synopsys translate_on always @ ( posedge clock or posedge aclr) if (aclr == 1'b1) dir_pipe <= 2'b0; else if (clk_en == 1'b1) dir_pipe <= {dir_w[3], dir_w[1]}; // synopsys translate_off initial sbit_piper1d = 0; // synopsys translate_on always @ ( posedge clock or posedge aclr) if (aclr == 1'b1) sbit_piper1d <= 16'b0; else if (clk_en == 1'b1) sbit_piper1d <= smux_w[31:16]; // synopsys translate_off initial sbit_piper2d = 0; // synopsys translate_on always @ ( posedge clock or posedge aclr) if (aclr == 1'b1) sbit_piper2d <= 16'b0; else if (clk_en == 1'b1) sbit_piper2d <= smux_w[63:48]; // synopsys translate_off initial sel_pipec2r1d = 0; // synopsys translate_on always @ ( posedge clock or posedge aclr) if (aclr == 1'b1) sel_pipec2r1d <= 1'b0; else if (clk_en == 1'b1) sel_pipec2r1d <= distance[2]; // synopsys translate_off initial sel_pipec3r1d = 0; // synopsys translate_on always @ ( posedge clock or posedge aclr) if (aclr == 1'b1) sel_pipec3r1d <= 1'b0; else if (clk_en == 1'b1) sel_pipec3r1d <= distance[3]; assign dir_w = {dir_pipe[1], dir_w[2], dir_pipe[0], dir_w[0], direction_w}, direction_w = 1'b0, pad_w = {8{1'b0}}, result = sbit_w[79:64], sbit_w = {sbit_piper2d, smux_w[47:32], sbit_piper1d, smux_w[15:0], data}, sel_w = {sel_pipec3r1d, sel_pipec2r1d, distance[1:0]}, smux_w = {((({16{(sel_w[3] & (~ dir_w[3]))}} & {sbit_w[55:48], pad_w[7:0]}) | ({16{(sel_w[3] & dir_w[3])}} & {pad_w[7:0], sbit_w[63:56]})) | ({16{(~ sel_w[3])}} & sbit_w[63:48])), ((({16{(sel_w[2] & (~ dir_w[2]))}} & {sbit_w[43:32], pad_w[3:0]}) | ({16{(sel_w[2] & dir_w[2])}} & {pad_w[3:0], sbit_w[47:36]})) | ({16{(~ sel_w[2])}} & sbit_w[47:32])), ((({16{(sel_w[1] & (~ dir_w[1]))}} & {sbit_w[29:16], pad_w[1:0]}) | ({16{(sel_w[1] & dir_w[1])}} & {pad_w[1:0], sbit_w[31:18]})) | ({16{(~ sel_w[1])}} & sbit_w[31:16])), ((({16{(sel_w[0] & (~ dir_w[0]))}} & {sbit_w[14:0], pad_w[0]}) | ({16{(sel_w[0] & dir_w[0])}} & {pad_w[0], sbit_w[15:1]})) | ({16{(~ sel_w[0])}} & sbit_w[15:0]))}; endmodule //int16_float32_altbarrel_shift_gof //altpriority_encoder CBX_AUTO_BLACKBOX="ALL" WIDTH=16 WIDTHAD=4 data q //VERSION_BEGIN 14.1 cbx_altpriority_encoder 2014:12:03:18:16:05:SJ cbx_mgl 2014:12:03:20:51:57:SJ VERSION_END //altpriority_encoder CBX_AUTO_BLACKBOX="ALL" LSB_PRIORITY="NO" WIDTH=8 WIDTHAD=3 data q //VERSION_BEGIN 14.1 cbx_altpriority_encoder 2014:12:03:18:16:05:SJ cbx_mgl 2014:12:03:20:51:57:SJ VERSION_END //altpriority_encoder CBX_AUTO_BLACKBOX="ALL" LSB_PRIORITY="NO" WIDTH=4 WIDTHAD=2 data q //VERSION_BEGIN 14.1 cbx_altpriority_encoder 2014:12:03:18:16:05:SJ cbx_mgl 2014:12:03:20:51:57:SJ VERSION_END //altpriority_encoder CBX_AUTO_BLACKBOX="ALL" LSB_PRIORITY="NO" WIDTH=2 WIDTHAD=1 data q //VERSION_BEGIN 14.1 cbx_altpriority_encoder 2014:12:03:18:16:05:SJ cbx_mgl 2014:12:03:20:51:57:SJ VERSION_END //synthesis_resources = //synopsys translate_off `timescale 1 ps / 1 ps //synopsys translate_on module int16_float32_altpriority_encoder_3v7 ( data, q) ; input [1:0] data; output [0:0] q; assign q = {data[1]}; endmodule //int16_float32_altpriority_encoder_3v7 //altpriority_encoder CBX_AUTO_BLACKBOX="ALL" LSB_PRIORITY="NO" WIDTH=2 WIDTHAD=1 data q zero //VERSION_BEGIN 14.1 cbx_altpriority_encoder 2014:12:03:18:16:05:SJ cbx_mgl 2014:12:03:20:51:57:SJ VERSION_END //synthesis_resources = //synopsys translate_off `timescale 1 ps / 1 ps //synopsys translate_on module int16_float32_altpriority_encoder_3e8 ( data, q, zero) ; input [1:0] data; output [0:0] q; output zero; assign q = {data[1]}, zero = (~ (data[0] | data[1])); endmodule //int16_float32_altpriority_encoder_3e8 //synthesis_resources = //synopsys translate_off `timescale 1 ps / 1 ps //synopsys translate_on module int16_float32_altpriority_encoder_6v7 ( data, q) ; input [3:0] data; output [1:0] q; wire [0:0] wire_altpriority_encoder10_q; wire [0:0] wire_altpriority_encoder11_q; wire wire_altpriority_encoder11_zero; int16_float32_altpriority_encoder_3v7 altpriority_encoder10 ( .data(data[1:0]), .q(wire_altpriority_encoder10_q)); int16_float32_altpriority_encoder_3e8 altpriority_encoder11 ( .data(data[3:2]), .q(wire_altpriority_encoder11_q), .zero(wire_altpriority_encoder11_zero)); assign q = {(~ wire_altpriority_encoder11_zero), ((wire_altpriority_encoder11_zero & wire_altpriority_encoder10_q) | ((~ wire_altpriority_encoder11_zero) & wire_altpriority_encoder11_q))}; endmodule //int16_float32_altpriority_encoder_6v7 //altpriority_encoder CBX_AUTO_BLACKBOX="ALL" LSB_PRIORITY="NO" WIDTH=4 WIDTHAD=2 data q zero //VERSION_BEGIN 14.1 cbx_altpriority_encoder 2014:12:03:18:16:05:SJ cbx_mgl 2014:12:03:20:51:57:SJ VERSION_END //synthesis_resources = //synopsys translate_off `timescale 1 ps / 1 ps //synopsys translate_on module int16_float32_altpriority_encoder_6e8 ( data, q, zero) ; input [3:0] data; output [1:0] q; output zero; wire [0:0] wire_altpriority_encoder12_q; wire wire_altpriority_encoder12_zero; wire [0:0] wire_altpriority_encoder13_q; wire wire_altpriority_encoder13_zero; int16_float32_altpriority_encoder_3e8 altpriority_encoder12 ( .data(data[1:0]), .q(wire_altpriority_encoder12_q), .zero(wire_altpriority_encoder12_zero)); int16_float32_altpriority_encoder_3e8 altpriority_encoder13 ( .data(data[3:2]), .q(wire_altpriority_encoder13_q), .zero(wire_altpriority_encoder13_zero)); assign q = {(~ wire_altpriority_encoder13_zero), ((wire_altpriority_encoder13_zero & wire_altpriority_encoder12_q) | ((~ wire_altpriority_encoder13_zero) & wire_altpriority_encoder13_q))}, zero = (wire_altpriority_encoder12_zero & wire_altpriority_encoder13_zero); endmodule //int16_float32_altpriority_encoder_6e8 //synthesis_resources = //synopsys translate_off `timescale 1 ps / 1 ps //synopsys translate_on module int16_float32_altpriority_encoder_bv7 ( data, q) ; input [7:0] data; output [2:0] q; wire [1:0] wire_altpriority_encoder8_q; wire [1:0] wire_altpriority_encoder9_q; wire wire_altpriority_encoder9_zero; int16_float32_altpriority_encoder_6v7 altpriority_encoder8 ( .data(data[3:0]), .q(wire_altpriority_encoder8_q)); int16_float32_altpriority_encoder_6e8 altpriority_encoder9 ( .data(data[7:4]), .q(wire_altpriority_encoder9_q), .zero(wire_altpriority_encoder9_zero)); assign q = {(~ wire_altpriority_encoder9_zero), (({2{wire_altpriority_encoder9_zero}} & wire_altpriority_encoder8_q) | ({2{(~ wire_altpriority_encoder9_zero)}} & wire_altpriority_encoder9_q))}; endmodule //int16_float32_altpriority_encoder_bv7 //altpriority_encoder CBX_AUTO_BLACKBOX="ALL" LSB_PRIORITY="NO" WIDTH=8 WIDTHAD=3 data q zero //VERSION_BEGIN 14.1 cbx_altpriority_encoder 2014:12:03:18:16:05:SJ cbx_mgl 2014:12:03:20:51:57:SJ VERSION_END //synthesis_resources = //synopsys translate_off `timescale 1 ps / 1 ps //synopsys translate_on module int16_float32_altpriority_encoder_be8 ( data, q, zero) ; input [7:0] data; output [2:0] q; output zero; wire [1:0] wire_altpriority_encoder14_q; wire wire_altpriority_encoder14_zero; wire [1:0] wire_altpriority_encoder15_q; wire wire_altpriority_encoder15_zero; int16_float32_altpriority_encoder_6e8 altpriority_encoder14 ( .data(data[3:0]), .q(wire_altpriority_encoder14_q), .zero(wire_altpriority_encoder14_zero)); int16_float32_altpriority_encoder_6e8 altpriority_encoder15 ( .data(data[7:4]), .q(wire_altpriority_encoder15_q), .zero(wire_altpriority_encoder15_zero)); assign q = {(~ wire_altpriority_encoder15_zero), (({2{wire_altpriority_encoder15_zero}} & wire_altpriority_encoder14_q) | ({2{(~ wire_altpriority_encoder15_zero)}} & wire_altpriority_encoder15_q))}, zero = (wire_altpriority_encoder14_zero & wire_altpriority_encoder15_zero); endmodule //int16_float32_altpriority_encoder_be8 //synthesis_resources = //synopsys translate_off `timescale 1 ps / 1 ps //synopsys translate_on module int16_float32_altpriority_encoder_rb6 ( data, q) ; input [15:0] data; output [3:0] q; wire [2:0] wire_altpriority_encoder6_q; wire [2:0] wire_altpriority_encoder7_q; wire wire_altpriority_encoder7_zero; int16_float32_altpriority_encoder_bv7 altpriority_encoder6 ( .data(data[7:0]), .q(wire_altpriority_encoder6_q)); int16_float32_altpriority_encoder_be8 altpriority_encoder7 ( .data(data[15:8]), .q(wire_altpriority_encoder7_q), .zero(wire_altpriority_encoder7_zero)); assign q = {(~ wire_altpriority_encoder7_zero), (({3{wire_altpriority_encoder7_zero}} & wire_altpriority_encoder6_q) | ({3{(~ wire_altpriority_encoder7_zero)}} & wire_altpriority_encoder7_q))}; endmodule //int16_float32_altpriority_encoder_rb6 //synthesis_resources = lpm_add_sub 2 lpm_compare 1 reg 155 //synopsys translate_off `timescale 1 ps / 1 ps //synopsys translate_on module int16_float32_altfp_convert_bqm ( clock, dataa, result) ; input clock; input [15:0] dataa; output [31:0] result; wire [15:0] wire_altbarrel_shift5_result; wire [3:0] wire_altpriority_encoder2_q; reg [7:0] exponent_bus_pre_reg; reg [7:0] exponent_bus_pre_reg2; reg [7:0] exponent_bus_pre_reg3; reg [14:0] mag_int_a_reg; reg [14:0] mag_int_a_reg2; reg [23:0] mantissa_pre_round_reg; reg [3:0] priority_encoder_reg; reg [31:0] result_reg; reg sign_int_a_reg1; reg sign_int_a_reg2; reg sign_int_a_reg3; reg sign_int_a_reg4; reg sign_int_a_reg5; wire [14:0] wire_add_sub1_result; wire [7:0] wire_add_sub3_result; wire wire_cmpr4_alb; wire aclr; wire [7:0] bias_value_w; wire clk_en; wire [7:0] const_bias_value_add_width_int_w; wire [7:0] exceptions_value; wire [7:0] exponent_bus; wire [7:0] exponent_bus_pre; wire [7:0] exponent_output_w; wire [7:0] exponent_rounded; wire [7:0] exponent_zero_w; wire [14:0] int_a; wire [14:0] int_a_2s; wire [14:0] invert_int_a; wire [3:0] leading_zeroes; wire [14:0] mag_int_a; wire [22:0] mantissa_bus; wire [23:0] mantissa_pre_round; wire [23:0] mantissa_rounded; wire max_neg_value_selector; wire [7:0] max_neg_value_w; wire [7:0] minus_leading_zero; wire [15:0] prio_mag_int_a; wire [31:0] result_w; wire [14:0] shifted_mag_int_a; wire sign_bus; wire sign_int_a; wire [3:0] zero_padding_w; int16_float32_altbarrel_shift_gof altbarrel_shift5 ( .aclr(aclr), .clk_en(clk_en), .clock(clock), .data({1'b0, mag_int_a_reg2}), .distance(leading_zeroes), .result(wire_altbarrel_shift5_result)); int16_float32_altpriority_encoder_rb6 altpriority_encoder2 ( .data(prio_mag_int_a), .q(wire_altpriority_encoder2_q)); // synopsys translate_off initial exponent_bus_pre_reg = 0; // synopsys translate_on always @ ( posedge clock or posedge aclr) if (aclr == 1'b1) exponent_bus_pre_reg <= 8'b0; else if (clk_en == 1'b1) exponent_bus_pre_reg <= exponent_bus_pre_reg2; // synopsys translate_off initial exponent_bus_pre_reg2 = 0; // synopsys translate_on always @ ( posedge clock or posedge aclr) if (aclr == 1'b1) exponent_bus_pre_reg2 <= 8'b0; else if (clk_en == 1'b1) exponent_bus_pre_reg2 <= exponent_bus_pre_reg3; // synopsys translate_off initial exponent_bus_pre_reg3 = 0; // synopsys translate_on always @ ( posedge clock or posedge aclr) if (aclr == 1'b1) exponent_bus_pre_reg3 <= 8'b0; else if (clk_en == 1'b1) exponent_bus_pre_reg3 <= exponent_bus_pre; // synopsys translate_off initial mag_int_a_reg = 0; // synopsys translate_on always @ ( posedge clock or posedge aclr) if (aclr == 1'b1) mag_int_a_reg <= 15'b0; else if (clk_en == 1'b1) mag_int_a_reg <= mag_int_a; // synopsys translate_off initial mag_int_a_reg2 = 0; // synopsys translate_on always @ ( posedge clock or posedge aclr) if (aclr == 1'b1) mag_int_a_reg2 <= 15'b0; else if (clk_en == 1'b1) mag_int_a_reg2 <= mag_int_a_reg; // synopsys translate_off initial mantissa_pre_round_reg = 0; // synopsys translate_on always @ ( posedge clock or posedge aclr) if (aclr == 1'b1) mantissa_pre_round_reg <= 24'b0; else if (clk_en == 1'b1) mantissa_pre_round_reg <= mantissa_pre_round; // synopsys translate_off initial priority_encoder_reg = 0; // synopsys translate_on always @ ( posedge clock or posedge aclr) if (aclr == 1'b1) priority_encoder_reg <= 4'b0; else if (clk_en == 1'b1) priority_encoder_reg <= wire_altpriority_encoder2_q; // synopsys translate_off initial result_reg = 0; // synopsys translate_on always @ ( posedge clock or posedge aclr) if (aclr == 1'b1) result_reg <= 32'b0; else if (clk_en == 1'b1) result_reg <= result_w; // synopsys translate_off initial sign_int_a_reg1 = 0; // synopsys translate_on always @ ( posedge clock or posedge aclr) if (aclr == 1'b1) sign_int_a_reg1 <= 1'b0; else if (clk_en == 1'b1) sign_int_a_reg1 <= sign_int_a; // synopsys translate_off initial sign_int_a_reg2 = 0; // synopsys translate_on always @ ( posedge clock or posedge aclr) if (aclr == 1'b1) sign_int_a_reg2 <= 1'b0; else if (clk_en == 1'b1) sign_int_a_reg2 <= sign_int_a_reg1; // synopsys translate_off initial sign_int_a_reg3 = 0; // synopsys translate_on always @ ( posedge clock or posedge aclr) if (aclr == 1'b1) sign_int_a_reg3 <= 1'b0; else if (clk_en == 1'b1) sign_int_a_reg3 <= sign_int_a_reg2; // synopsys translate_off initial sign_int_a_reg4 = 0; // synopsys translate_on always @ ( posedge clock or posedge aclr) if (aclr == 1'b1) sign_int_a_reg4 <= 1'b0; else if (clk_en == 1'b1) sign_int_a_reg4 <= sign_int_a_reg3; // synopsys translate_off initial sign_int_a_reg5 = 0; // synopsys translate_on always @ ( posedge clock or posedge aclr) if (aclr == 1'b1) sign_int_a_reg5 <= 1'b0; else if (clk_en == 1'b1) sign_int_a_reg5 <= sign_int_a_reg4; lpm_add_sub add_sub1 ( .cout(), .dataa(invert_int_a), .datab(15'b000000000000001), .overflow(), .result(wire_add_sub1_result) `ifndef FORMAL_VERIFICATION // synopsys translate_off `endif , .aclr(1'b0), .add_sub(1'b1), .cin(), .clken(1'b1), .clock(1'b0) `ifndef FORMAL_VERIFICATION // synopsys translate_on `endif ); defparam add_sub1.lpm_direction = "ADD", add_sub1.lpm_width = 15, add_sub1.lpm_type = "lpm_add_sub", add_sub1.lpm_hint = "ONE_INPUT_IS_CONSTANT=YES"; lpm_add_sub add_sub3 ( .cout(), .dataa(const_bias_value_add_width_int_w), .datab(minus_leading_zero), .overflow(), .result(wire_add_sub3_result) `ifndef FORMAL_VERIFICATION // synopsys translate_off `endif , .aclr(1'b0), .add_sub(1'b1), .cin(), .clken(1'b1), .clock(1'b0) `ifndef FORMAL_VERIFICATION // synopsys translate_on `endif ); defparam add_sub3.lpm_direction = "SUB", add_sub3.lpm_width = 8, add_sub3.lpm_type = "lpm_add_sub", add_sub3.lpm_hint = "ONE_INPUT_IS_CONSTANT=YES"; lpm_compare cmpr4 ( .aeb(), .agb(), .ageb(), .alb(wire_cmpr4_alb), .aleb(), .aneb(), .dataa(exponent_output_w), .datab(bias_value_w) `ifndef FORMAL_VERIFICATION // synopsys translate_off `endif , .aclr(1'b0), .clken(1'b1), .clock(1'b0) `ifndef FORMAL_VERIFICATION // synopsys translate_on `endif ); defparam cmpr4.lpm_representation = "UNSIGNED", cmpr4.lpm_width = 8, cmpr4.lpm_type = "lpm_compare"; assign aclr = 1'b0, bias_value_w = 8'b01111111, clk_en = 1'b1, const_bias_value_add_width_int_w = 8'b10001101, exceptions_value = (({8{(~ max_neg_value_selector)}} & exponent_zero_w) | ({8{max_neg_value_selector}} & max_neg_value_w)), exponent_bus = exponent_rounded, exponent_bus_pre = (({8{(~ wire_cmpr4_alb)}} & exponent_output_w) | ({8{wire_cmpr4_alb}} & exceptions_value)), exponent_output_w = wire_add_sub3_result, exponent_rounded = exponent_bus_pre_reg, exponent_zero_w = {8{1'b0}}, int_a = dataa[14:0], int_a_2s = wire_add_sub1_result, invert_int_a = (~ int_a), leading_zeroes = (~ priority_encoder_reg), mag_int_a = (({15{(~ sign_int_a)}} & int_a) | ({15{sign_int_a}} & int_a_2s)), mantissa_bus = mantissa_rounded[22:0], mantissa_pre_round = {shifted_mag_int_a[14:0], {9{1'b0}}}, mantissa_rounded = mantissa_pre_round_reg, max_neg_value_selector = (wire_cmpr4_alb & sign_int_a_reg2), max_neg_value_w = 8'b10001110, minus_leading_zero = {zero_padding_w, leading_zeroes}, prio_mag_int_a = {mag_int_a_reg, 1'b1}, result = result_reg, result_w = {sign_bus, exponent_bus, mantissa_bus}, shifted_mag_int_a = wire_altbarrel_shift5_result[14:0], sign_bus = sign_int_a_reg5, sign_int_a = dataa[15], zero_padding_w = {4{1'b0}}; endmodule //int16_float32_altfp_convert_bqm //VALID FILE // synopsys translate_off `timescale 1 ps / 1 ps // synopsys translate_on module int16_float32 ( clock, dataa, result); input clock; input [15:0] dataa; output [31:0] result; wire [31:0] sub_wire0; wire [31:0] result = sub_wire0[31:0]; int16_float32_altfp_convert_bqm int16_float32_altfp_convert_bqm_component ( .clock (clock), .dataa (dataa), .result (sub_wire0)); endmodule // ============================================================ // CNX file retrieval info // ============================================================ // Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all // Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone V" // Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone V" // Retrieval info: CONSTANT: LPM_HINT STRING "UNUSED" // Retrieval info: CONSTANT: LPM_TYPE STRING "altfp_convert" // Retrieval info: CONSTANT: OPERATION STRING "INT2FLOAT" // Retrieval info: CONSTANT: ROUNDING STRING "TO_NEAREST" // Retrieval info: CONSTANT: WIDTH_DATA NUMERIC "16" // Retrieval info: CONSTANT: WIDTH_EXP_INPUT NUMERIC "8" // Retrieval info: CONSTANT: WIDTH_EXP_OUTPUT NUMERIC "8" // Retrieval info: CONSTANT: WIDTH_INT NUMERIC "16" // Retrieval info: CONSTANT: WIDTH_MAN_INPUT NUMERIC "23" // Retrieval info: CONSTANT: WIDTH_MAN_OUTPUT NUMERIC "23" // Retrieval info: CONSTANT: WIDTH_RESULT NUMERIC "32" // Retrieval info: USED_PORT: clock 0 0 0 0 INPUT NODEFVAL "clock" // Retrieval info: CONNECT: @clock 0 0 0 0 clock 0 0 0 0 // Retrieval info: USED_PORT: dataa 0 0 16 0 INPUT NODEFVAL "dataa[15..0]" // Retrieval info: CONNECT: @dataa 0 0 16 0 dataa 0 0 16 0 // Retrieval info: USED_PORT: result 0 0 32 0 OUTPUT NODEFVAL "result[31..0]" // Retrieval info: CONNECT: result 0 0 32 0 @result 0 0 32 0 // Retrieval info: GEN_FILE: TYPE_NORMAL int16_float32.v TRUE FALSE // Retrieval info: GEN_FILE: TYPE_NORMAL int16_float32.qip TRUE FALSE // Retrieval info: GEN_FILE: TYPE_NORMAL int16_float32.bsf TRUE TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL int16_float32_inst.v TRUE TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL int16_float32_bb.v TRUE TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL int16_float32.inc TRUE TRUE // Retrieval info: GEN_FILE: TYPE_NORMAL int16_float32.cmp TRUE TRUE // Retrieval info: LIB_FILE: lpm
// Full Adder rtl module full_adder (a0, b0, c0, a1, b1, c_out, s_out, s2, s3); // Inputs_top input a0; input b0; input c0; input a1; input b1; // End of inputs_top // Outputs_top output c_out; output s_out; output s2; output d1; output s3; // End of outputs_top // Wires wire c1; wire c2; wire s1; wire d1; wire c3; // Some assignments assign carry_out = c1 | c2; assign s_out = s1; //assign d_out = d1; // Instantiating two half-adders to make the circuit. // Module instantiation half_adder u1_half_adder ( // Inputs .in_x(a0), .in_y(b0), // End of inputs // Outputs .out_sum(s0), .out_carry(c1) // End of outputs ); // Module instantiation half_adder u2_half_adder ( // Inputs .in_x(s0), .in_y(c0), // End of inputs // Outputs .out_sum(s1), .out_carry(c2) // End of outputs ); // Module instantiation test1 test1 ( // Inputs .in_1(s1), .in_2(s0), .in_3(a1), .in_4(b1), // End of inputs // Outputs .out_1(s2), .out_2(d1), .out_3(c3) // End of outputs ); // Module instantiation test2 test2 ( // Inputs .in_1(d1), .in_2(c3), .in_3(b1), // End of inputs // Outputs .out_1(s3) // End of outputs ); endmodule
/* * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ `ifndef SKY130_FD_SC_LP__HA_BEHAVIORAL_PP_V `define SKY130_FD_SC_LP__HA_BEHAVIORAL_PP_V /** * ha: Half adder. * * Verilog simulation functional model. */ `timescale 1ns / 1ps `default_nettype none // Import user defined primitives. `include "../../models/udp_pwrgood_pp_pg/sky130_fd_sc_lp__udp_pwrgood_pp_pg.v" `celldefine module sky130_fd_sc_lp__ha ( COUT, SUM , A , B , VPWR, VGND, VPB , VNB ); // Module ports output COUT; output SUM ; input A ; input B ; input VPWR; input VGND; input VPB ; input VNB ; // Local signals wire and0_out_COUT ; wire pwrgood_pp0_out_COUT; wire xor0_out_SUM ; wire pwrgood_pp1_out_SUM ; // Name Output Other arguments and and0 (and0_out_COUT , A, B ); sky130_fd_sc_lp__udp_pwrgood_pp$PG pwrgood_pp0 (pwrgood_pp0_out_COUT, and0_out_COUT, VPWR, VGND); buf buf0 (COUT , pwrgood_pp0_out_COUT ); xor xor0 (xor0_out_SUM , B, A ); sky130_fd_sc_lp__udp_pwrgood_pp$PG pwrgood_pp1 (pwrgood_pp1_out_SUM , xor0_out_SUM, VPWR, VGND ); buf buf1 (SUM , pwrgood_pp1_out_SUM ); endmodule `endcelldefine `default_nettype wire `endif // SKY130_FD_SC_LP__HA_BEHAVIORAL_PP_V
(* src = "../../verilog/adt7310.v:1", top = 1 *) module ADT7310 ( (* intersynth_port = "Reset_n_i", src = "../../verilog/adt7310.v:3" *) input Reset_n_i, (* intersynth_port = "Clk_i", src = "../../verilog/adt7310.v:5" *) input Clk_i, (* intersynth_conntype = "Bit", intersynth_port = "ReconfModuleIn_s", src = "../../verilog/adt7310.v:7" *) input Enable_i, (* intersynth_conntype = "Bit", intersynth_port = "ReconfModuleIRQs_s", src = "../../verilog/adt7310.v:9" *) output CpuIntr_o, (* intersynth_conntype = "Bit", intersynth_port = "Outputs_o", src = "../../verilog/adt7310.v:11" *) output ADT7310CS_n_o, (* intersynth_conntype = "Byte", intersynth_port = "SPI_DataOut", src = "../../verilog/adt7310.v:13" *) input[7:0] SPI_Data_i, (* intersynth_conntype = "Bit", intersynth_port = "SPI_Write", src = "../../verilog/adt7310.v:15" *) output SPI_Write_o, (* intersynth_conntype = "Bit", intersynth_port = "SPI_ReadNext", src = "../../verilog/adt7310.v:17" *) output SPI_ReadNext_o, (* intersynth_conntype = "Byte", intersynth_port = "SPI_DataIn", src = "../../verilog/adt7310.v:19" *) output[7:0] SPI_Data_o, (* intersynth_conntype = "Bit", intersynth_port = "SPI_FIFOFull", src = "../../verilog/adt7310.v:21" *) input SPI_FIFOFull_i, (* intersynth_conntype = "Bit", intersynth_port = "SPI_FIFOEmpty", src = "../../verilog/adt7310.v:23" *) input SPI_FIFOEmpty_i, (* intersynth_conntype = "Bit", intersynth_port = "SPI_Transmission", src = "../../verilog/adt7310.v:25" *) input SPI_Transmission_i, (* intersynth_conntype = "Word", intersynth_param = "SPICounterPresetH_i", src = "../../verilog/adt7310.v:27" *) input[15:0] SPICounterPresetH_i, (* intersynth_conntype = "Word", intersynth_param = "SPICounterPresetL_i", src = "../../verilog/adt7310.v:29" *) input[15:0] SPICounterPresetL_i, (* intersynth_conntype = "Word", intersynth_param = "Threshold_i", src = "../../verilog/adt7310.v:31" *) input[15:0] Threshold_i, (* intersynth_conntype = "Word", intersynth_param = "PeriodCounterPreset_i", src = "../../verilog/adt7310.v:33" *) input[15:0] PeriodCounterPreset_i, (* intersynth_conntype = "Word", intersynth_param = "SensorValue_o", src = "../../verilog/adt7310.v:35" *) output[15:0] SensorValue_o, (* intersynth_conntype = "Bit", intersynth_port = "SPI_CPOL", src = "../../verilog/adt7310.v:37" *) output SPI_CPOL_o, (* intersynth_conntype = "Bit", intersynth_port = "SPI_CPHA", src = "../../verilog/adt7310.v:39" *) output SPI_CPHA_o, (* intersynth_conntype = "Bit", intersynth_port = "SPI_LSBFE", src = "../../verilog/adt7310.v:41" *) output SPI_LSBFE_o ); wire \$techmap\SPIFSM_1.$auto$opt_reduce.cc:126:opt_mux$2459 ; (* src = "../../../../counter32/verilog/counter32_rv1.v:12" *) wire [15:0] \$techmap\SPIFSM_1.$extract$\Counter32_RV1_Timer$2533.DH_s ; (* src = "../../../../counter32/verilog/counter32_rv1.v:13" *) wire [15:0] \$techmap\SPIFSM_1.$extract$\Counter32_RV1_Timer$2533.DL_s ; (* src = "../../../../counter32/verilog/counter32_rv1.v:14" *) wire \$techmap\SPIFSM_1.$extract$\Counter32_RV1_Timer$2533.Overflow_s ; wire \$techmap\SPIFSM_1.$procmux$297_CMP ; wire \$techmap\SPIFSM_1.$procmux$302_CMP ; (* src = "../../../../addsubcmp/verilog/addsubcmp_greater.v:8" *) wire \$techmap\SensorFSM_1.$extract$\AddSubCmp_Greater_Direct$2538.Carry_s ; (* src = "../../../../addsubcmp/verilog/addsubcmp_greater.v:7" *) wire [15:0] \$techmap\SensorFSM_1.$extract$\AddSubCmp_Greater_Direct$2538.D_s ; (* src = "../../../../addsubcmp/verilog/addsubcmp_greater.v:11" *) wire \$techmap\SensorFSM_1.$extract$\AddSubCmp_Greater_Direct$2538.Overflow_s ; (* src = "../../../../addsubcmp/verilog/addsubcmp_greater.v:10" *) wire \$techmap\SensorFSM_1.$extract$\AddSubCmp_Greater_Direct$2538.Sign_s ; (* src = "../../../../addsubcmp/verilog/addsubcmp_greater.v:9" *) wire \$techmap\SensorFSM_1.$extract$\AddSubCmp_Greater_Direct$2538.Zero_s ; (* src = "../../../../counter/verilog/counter_rv1.v:14" *) wire [15:0] \$techmap\SensorFSM_1.$extract$\Counter_RV1_Timer$2532.D_s ; (* src = "../../../../counter/verilog/counter_rv1.v:15" *) wire \$techmap\SensorFSM_1.$extract$\Counter_RV1_Timer$2532.Overflow_s ; (* src = "../../verilog/spifsm.v:45" *) wire \SPIFSM_1.SPI_FSM_TimerEnable ; (* src = "../../verilog/spifsm.v:43" *) wire \SPIFSM_1.SPI_FSM_TimerOvfl ; (* src = "../../verilog/spifsm.v:44" *) wire \SPIFSM_1.SPI_FSM_TimerPreset ; (* src = "../../verilog/spifsm.v:47" *) wire \SPIFSM_1.SPI_FSM_Wr0 ; (* src = "../../verilog/spifsm.v:46" *) wire \SPIFSM_1.SPI_FSM_Wr1 ; (* keep = 1, src = "../../verilog/adt7310.v:56" *) wire [7:0] SPIFSM_Byte0_s; (* keep = 1, src = "../../verilog/adt7310.v:58" *) wire [7:0] SPIFSM_Byte1_s; (* keep = 1, src = "../../verilog/adt7310.v:54" *) wire SPIFSM_Done_s; (* keep = 1, src = "../../verilog/adt7310.v:52" *) wire SPIFSM_Start_s; (* src = "../../verilog/sensorfsm.v:39" *) wire [15:0] \SensorFSM_1.AbsDiffResult ; (* src = "../../verilog/sensorfsm.v:33" *) wire \SensorFSM_1.SensorFSM_StoreNewValue ; (* src = "../../verilog/sensorfsm.v:31" *) wire \SensorFSM_1.SensorFSM_TimerEnable ; (* src = "../../verilog/sensorfsm.v:29" *) wire \SensorFSM_1.SensorFSM_TimerOvfl ; (* src = "../../verilog/sensorfsm.v:30" *) wire \SensorFSM_1.SensorFSM_TimerPreset ; (* src = "../../verilog/sensorfsm.v:37" *) wire [15:0] \SensorFSM_1.SensorValue ; wire SPIFSM_1_Out11_s; wire SPIFSM_1_Out12_s; wire SPIFSM_1_Out13_s; wire SPIFSM_1_Out14_s; wire SPIFSM_1_CfgMode_s; wire SPIFSM_1_CfgClk_s; wire SPIFSM_1_CfgShift_s; wire SPIFSM_1_CfgDataIn_s; wire SPIFSM_1_CfgDataOut_s; wire SensorFSM_1_Out5_s; wire SensorFSM_1_Out6_s; wire SensorFSM_1_Out7_s; wire SensorFSM_1_Out8_s; wire SensorFSM_1_Out9_s; wire SensorFSM_1_CfgMode_s; wire SensorFSM_1_CfgClk_s; wire SensorFSM_1_CfgShift_s; wire SensorFSM_1_CfgDataIn_s; wire SensorFSM_1_CfgDataOut_s; Byte2Word \$extract$\Byte2Word$2543 ( .H_i(SPIFSM_Byte1_s), .L_i(SPIFSM_Byte0_s), .Y_o(\SensorFSM_1.SensorValue ) ); ByteMuxQuad \$techmap\SPIFSM_1.$extract$\ByteMuxQuad$2539 ( .A_i(8'b00001000), .B_i(8'b11111111), .C_i(8'b01010000), .D_i(8'b00100000), .SAB_i(\$techmap\SPIFSM_1.$auto$opt_reduce.cc:126:opt_mux$2459 ), .SC_i(\$techmap\SPIFSM_1.$procmux$297_CMP ), .SD_i(\$techmap\SPIFSM_1.$procmux$302_CMP ), .Y_o(SPI_Data_o) ); ByteRegister \$techmap\SPIFSM_1.$extract$\ByteRegister$2536 ( .Clk_i(Clk_i), .D_i(SPI_Data_i), .Enable_i(\SPIFSM_1.SPI_FSM_Wr0 ), .Q_o(SPIFSM_Byte0_s), .Reset_n_i(Reset_n_i) ); ByteRegister \$techmap\SPIFSM_1.$extract$\ByteRegister$2537 ( .Clk_i(Clk_i), .D_i(SPI_Data_i), .Enable_i(\SPIFSM_1.SPI_FSM_Wr1 ), .Q_o(SPIFSM_Byte1_s), .Reset_n_i(Reset_n_i) ); (* src = "../../../../counter32/verilog/counter32_rv1.v:19" *) Counter32 \$techmap\SPIFSM_1.$extract$\Counter32_RV1_Timer$2533.ThisCounter ( .Clk_i(Clk_i), .DH_o(\$techmap\SPIFSM_1.$extract$\Counter32_RV1_Timer$2533.DH_s ), .DL_o(\$techmap\SPIFSM_1.$extract$\Counter32_RV1_Timer$2533.DL_s ), .Direction_i(1'b1), .Enable_i(\SPIFSM_1.SPI_FSM_TimerEnable ), .Overflow_o(\$techmap\SPIFSM_1.$extract$\Counter32_RV1_Timer$2533.Overflow_s ), .PresetValH_i(SPICounterPresetH_i), .PresetValL_i(SPICounterPresetL_i), .Preset_i(\SPIFSM_1.SPI_FSM_TimerPreset ), .ResetSig_i(1'b0), .Reset_n_i(Reset_n_i), .Zero_o(\SPIFSM_1.SPI_FSM_TimerOvfl ) ); SPIFSM SPIFSM_1 ( .Reset_n_i(Reset_n_i), .Clk_i(Clk_i), .In0_i(\SPIFSM_1.SPI_FSM_TimerOvfl ), .In1_i(SPI_Transmission_i), .In2_i(SPIFSM_Start_s), .In3_i(1'b0), .In4_i(1'b0), .In5_i(1'b0), .In6_i(1'b0), .In7_i(1'b0), .Out0_o(\$techmap\SPIFSM_1.$procmux$297_CMP ), .Out1_o(\$techmap\SPIFSM_1.$procmux$302_CMP ), .Out2_o(\SPIFSM_1.SPI_FSM_Wr0 ), .Out3_o(\SPIFSM_1.SPI_FSM_Wr1 ), .Out4_o(\$techmap\SPIFSM_1.$auto$opt_reduce.cc:126:opt_mux$2459 ), .Out5_o(\SPIFSM_1.SPI_FSM_TimerEnable ), .Out6_o(\SPIFSM_1.SPI_FSM_TimerPreset ), .Out7_o(ADT7310CS_n_o), .Out8_o(SPIFSM_Done_s), .Out9_o(SPI_Write_o), .Out10_o(SPI_ReadNext_o), .Out11_o(SPIFSM_1_Out11_s), .Out12_o(SPIFSM_1_Out12_s), .Out13_o(SPIFSM_1_Out13_s), .Out14_o(SPIFSM_1_Out14_s), .CfgMode_i(SPIFSM_1_CfgMode_s), .CfgClk_i(SPIFSM_1_CfgClk_s), .CfgShift_i(SPIFSM_1_CfgShift_s), .CfgDataIn_i(SPIFSM_1_CfgDataIn_s), .CfgDataOut_o(SPIFSM_1_CfgDataOut_s) ); AbsDiff \$techmap\SensorFSM_1.$extract$\AbsDiff$2534 ( .A_i(\SensorFSM_1.SensorValue ), .B_i(SensorValue_o), .D_o(\SensorFSM_1.AbsDiffResult ) ); (* src = "../../../../addsubcmp/verilog/addsubcmp_greater.v:13" *) AddSubCmp \$techmap\SensorFSM_1.$extract$\AddSubCmp_Greater_Direct$2538.ThisAddSubCmp ( .A_i(\SensorFSM_1.AbsDiffResult ), .AddOrSub_i(1'b1), .B_i(Threshold_i), .Carry_i(1'b0), .Carry_o(\$techmap\SensorFSM_1.$extract$\AddSubCmp_Greater_Direct$2538.Carry_s ), .D_o(\$techmap\SensorFSM_1.$extract$\AddSubCmp_Greater_Direct$2538.D_s ), .Overflow_o(\$techmap\SensorFSM_1.$extract$\AddSubCmp_Greater_Direct$2538.Overflow_s ), .Sign_o(\$techmap\SensorFSM_1.$extract$\AddSubCmp_Greater_Direct$2538.Sign_s ), .Zero_o(\$techmap\SensorFSM_1.$extract$\AddSubCmp_Greater_Direct$2538.Zero_s ) ); (* src = "../../../../counter/verilog/counter_rv1.v:20" *) Counter \$techmap\SensorFSM_1.$extract$\Counter_RV1_Timer$2532.ThisCounter ( .Clk_i(Clk_i), .D_o(\$techmap\SensorFSM_1.$extract$\Counter_RV1_Timer$2532.D_s ), .Direction_i(1'b1), .Enable_i(\SensorFSM_1.SensorFSM_TimerEnable ), .Overflow_o(\$techmap\SensorFSM_1.$extract$\Counter_RV1_Timer$2532.Overflow_s ), .PresetVal_i(PeriodCounterPreset_i), .Preset_i(\SensorFSM_1.SensorFSM_TimerPreset ), .ResetSig_i(1'b0), .Reset_n_i(Reset_n_i), .Zero_o(\SensorFSM_1.SensorFSM_TimerOvfl ) ); WordRegister \$techmap\SensorFSM_1.$extract$\WordRegister$2535 ( .Clk_i(Clk_i), .D_i(\SensorFSM_1.SensorValue ), .Enable_i(\SensorFSM_1.SensorFSM_StoreNewValue ), .Q_o(SensorValue_o), .Reset_n_i(Reset_n_i) ); SensorFSM SensorFSM_1 ( .Reset_n_i(Reset_n_i), .Clk_i(Clk_i), .In0_i(Enable_i), .In1_i(SPIFSM_Done_s), .In2_i(\SensorFSM_1.SensorFSM_TimerOvfl ), .In3_i(\$techmap\SensorFSM_1.$extract$\AddSubCmp_Greater_Direct$2538.Carry_s ), .In4_i(\$techmap\SensorFSM_1.$extract$\AddSubCmp_Greater_Direct$2538.Zero_s ), .In5_i(1'b0), .In6_i(1'b0), .In7_i(1'b0), .In8_i(1'b0), .In9_i(1'b0), .Out0_o(SPIFSM_Start_s), .Out1_o(\SensorFSM_1.SensorFSM_StoreNewValue ), .Out2_o(\SensorFSM_1.SensorFSM_TimerEnable ), .Out3_o(\SensorFSM_1.SensorFSM_TimerPreset ), .Out4_o(CpuIntr_o), .Out5_o(SensorFSM_1_Out5_s), .Out6_o(SensorFSM_1_Out6_s), .Out7_o(SensorFSM_1_Out7_s), .Out8_o(SensorFSM_1_Out8_s), .Out9_o(SensorFSM_1_Out9_s), .CfgMode_i(SensorFSM_1_CfgMode_s), .CfgClk_i(SensorFSM_1_CfgClk_s), .CfgShift_i(SensorFSM_1_CfgShift_s), .CfgDataIn_i(SensorFSM_1_CfgDataIn_s), .CfgDataOut_o(SensorFSM_1_CfgDataOut_s) ); assign SPI_CPHA_o = 1'b1; assign SPI_CPOL_o = 1'b1; assign SPI_LSBFE_o = 1'b0; assign SPIFSM_1_CfgMode_s = 1'b0; assign SPIFSM_1_CfgClk_s = 1'b0; assign SPIFSM_1_CfgShift_s = 1'b0; assign SPIFSM_1_CfgDataIn_s = 1'b0; assign SensorFSM_1_CfgMode_s = 1'b0; assign SensorFSM_1_CfgClk_s = 1'b0; assign SensorFSM_1_CfgShift_s = 1'b0; assign SensorFSM_1_CfgDataIn_s = 1'b0; endmodule
/* * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ `ifndef SKY130_FD_SC_HD__MUX4_FUNCTIONAL_PP_V `define SKY130_FD_SC_HD__MUX4_FUNCTIONAL_PP_V /** * mux4: 4-input multiplexer. * * Verilog simulation functional model. */ `timescale 1ns / 1ps `default_nettype none // Import user defined primitives. `include "../../models/udp_pwrgood_pp_pg/sky130_fd_sc_hd__udp_pwrgood_pp_pg.v" `include "../../models/udp_mux_4to2/sky130_fd_sc_hd__udp_mux_4to2.v" `celldefine module sky130_fd_sc_hd__mux4 ( X , A0 , A1 , A2 , A3 , S0 , S1 , VPWR, VGND, VPB , VNB ); // Module ports output X ; input A0 ; input A1 ; input A2 ; input A3 ; input S0 ; input S1 ; input VPWR; input VGND; input VPB ; input VNB ; // Local signals wire mux_4to20_out_X ; wire pwrgood_pp0_out_X; // Name Output Other arguments sky130_fd_sc_hd__udp_mux_4to2 mux_4to20 (mux_4to20_out_X , A0, A1, A2, A3, S0, S1 ); sky130_fd_sc_hd__udp_pwrgood_pp$PG pwrgood_pp0 (pwrgood_pp0_out_X, mux_4to20_out_X, VPWR, VGND); buf buf0 (X , pwrgood_pp0_out_X ); endmodule `endcelldefine `default_nettype wire `endif // SKY130_FD_SC_HD__MUX4_FUNCTIONAL_PP_V