Files
-
hardware / ButterStick_r0.1 / ButterStick.kicad_pcb
-
hardware / ButterStick_r0.1 / ButterStick.sch
-
hardware / ButterStick_r0.1 / fileEthernet.sch
-
hardware / ButterStick_r0.1 / fileFPGA.sch
-
hardware / ButterStick_r0.1 / fileHyperRAM.sch
-
hardware / ButterStick_r0.1 / fileIO.sch
-
hardware / ButterStick_r0.1 / filePower.sch
-
hardware / ButterStick_r0.1 / fileSDMMC.sch
-
hardware / ButterStick_r0.1 / SmartVIO.sch
-
hardware / ButterStick_r0.1 / SYZYGY_PORT0.sch
-
hardware / ButterStick_r0.1 / SYZYGY_PORT1.sch
-
hardware / ButterStick_r0.1 / SYZYGY_PORT2.sch
-
hardware / ButterStick_r0.1 / SyzygyStandard.sch
-
hardware / ButterStick_r0.2 / ButterStick.kicad_pcb
-
hardware / ButterStick_r0.2 / ButterStick.sch
-
hardware / ButterStick_r0.2 / fileEthernet.sch
-
hardware / ButterStick_r0.2 / fileFPGA.sch
-
hardware / ButterStick_r0.2 / fileHyperRAM.sch
-
hardware / ButterStick_r0.2 / fileIO.sch
-
hardware / ButterStick_r0.2 / filePower.sch
-
hardware / ButterStick_r0.2 / fileSDMMC.sch
-
hardware / ButterStick_r0.2 / PCBSpecs.sch
-
hardware / ButterStick_r0.2 / SmartVIO.sch
-
hardware / ButterStick_r0.2 / SYZYGY_PORT0.sch
-
hardware / ButterStick_r0.2 / SYZYGY_PORT1.sch
-
hardware / ButterStick_r0.2 / SYZYGY_PORT2.sch
-
hardware / ButterStick_r0.2 / SyzygyStandard.sch
-
hardware / ButterStick_r0.2 / TestPonts.sch
Last update 5 years 7 months
by
Greg Davill
FilesgatewareGigEethverilog | |
---|---|
.. | |
iddr_x1.v | |
iddr_x2.v | |
oddr_x1.v | |
oddr_x2.v | |
pll.v |
iddr_x2.v/* Verilog netlist generated by SCUBA Diamond (64-bit) 3.10.0.111.2 */ /* Module Version: 5.8 */ /* /usr/local/diamond/3.10_x64/ispfpga/bin/lin64/scuba -w -n iddr_4_x2 -lang verilog -synth lse -bus_exp 7 -bb -arch sa5p00 -type iol -mode Receive -io_type LVCMOS18 -width 4 -freq_in 125 -gear 4 -del 128 -fdc /home/greg/projects/diamond_test/pll/iddr_4_x2/iddr_4_x2.fdc */ /* Sun Feb 17 15:19:44 2019 */ // ============================================================================ // COPYRIGHT NOTICE // Copyright 2013 Lattice Semiconductor Corporation // ALL RIGHTS RESERVED // This confidential and proprietary software may be used only as authorized by // a licensing agreement from Lattice Semiconductor Corporation. // The entire notice above must be reproduced on all authorized copies and // copies may only be made to the extent permitted by a licensing agreement // from Lattice Semiconductor Corporation. // // Lattice Semiconductor Corporation TEL : 1-800-Lattice (USA and Canada) // 5555 NE Moore Court 408-826-6000 (other locations) // Hillsboro, OR 97124 web : http://www.latticesemi.com/ // U.S.A email: techsupport@latticesemi.com // ============================================================================= // Module : gddr_sync.v // Description: // - Code for bus synchronization // - Needed to tolerate large skew between stop and ddr and clkdiv reset // ============================================================================= `timescale 1ns/1ps module iddr_4_x2gddr_sync ( // inputs rst, // Asynchronous reset sync_clk, // oscillator clk or other constant running low speed clk. // note that this clk should not be coming from clk sources // that this module will stop or reset (e.g. ECLKSYNC, CLKDIV) start, // Initialize the sync process // outputs stop, // ECLKSYNC.stop signal ddr_reset, // DDR and CLKDIV reset signal ready // READY signal; clock sync is done. ); //----------------------------------------------------------------------------- // PORTS DECLARATIONS //----------------------------------------------------------------------------- // input ports input rst; input sync_clk; input start; // output ports output stop; output ddr_reset; output ready; //----------------------------------------------------------------------------- // PARAMETERS //----------------------------------------------------------------------------- // Local parameters: States localparam INIT = 3'b000; localparam STOP = 3'b001; localparam RESET = 3'b011; localparam READY = 3'b100; //----------------------------------------------------------------------------- // SIGNAL DECLARATIONS //----------------------------------------------------------------------------- wire rst; wire sync_clk; wire start; wire ddr_reset; wire stop; wire ready; reg ddr_reset_d; reg [3:0] ctrl_cnt; // control counter reg [2:0] stop_assert; // stop signal counter reg [2:0] cs_gddr_sync /*synthesis syn_preserve=1*/ ; // current state reg [2:0] ns_gddr_sync; // next state reg reset_flag; // flag signal that // indicates that RESET // is already done //----------------------------------------------------------------------------- // WIRE ASSIGNMENTS //----------------------------------------------------------------------------- assign stop = cs_gddr_sync[0]; assign ddr_reset = cs_gddr_sync[1] | ddr_reset_d; assign ready = cs_gddr_sync[2]; //----------------------------------------------------------------------------- // REGISTER ASSIGNMENTS //----------------------------------------------------------------------------- always @(posedge sync_clk or posedge rst) begin if (rst==1'b1) begin cs_gddr_sync <= INIT; ctrl_cnt <= 4'd0; stop_assert <= 3'd0; reset_flag <= 1'b0; ddr_reset_d <= 1'b1; end else begin cs_gddr_sync <= ns_gddr_sync; ddr_reset_d <= 1'b0; // CTRL_CNT for state machines if (((cs_gddr_sync==INIT)&&(reset_flag==1'b0))||((ctrl_cnt == 3) &&(cs_gddr_sync!=INIT))) begin ctrl_cnt <= 'd0; end else if (ctrl_cnt < 8) begin ctrl_cnt <= ctrl_cnt + 1; end // STOP signal will then be asserted 4T after rstn if ((!rst)&&(start)&&(stop_assert<4)&&(reset_flag==1'b0)) begin stop_assert <= stop_assert + 1; end // Asserts the reset_flag after RESET state if ((cs_gddr_sync==RESET)&&(ns_gddr_sync == STOP)) begin reset_flag <= 1'b1; end // Deasserts the reset_flag after READY state if ((cs_gddr_sync==READY)&&(ns_gddr_sync == INIT)) begin reset_flag <= 1'b0; end end end // GDDR_SYNC State machine always @(*) begin case (cs_gddr_sync) /* synthesis full_case parallel_case */ INIT: // INIT state 0 begin if ((start)&&(stop_assert==3)&&(reset_flag==1'b0)) begin ns_gddr_sync = STOP; end else if ((reset_flag==1'b1)&&(ctrl_cnt == 7)&&(start)) begin ns_gddr_sync = READY; end else begin ns_gddr_sync = INIT; end end STOP: //STOP state 1 begin if (ctrl_cnt == 3) begin if (reset_flag ==1'b1) begin ns_gddr_sync = INIT; end else begin ns_gddr_sync = RESET; end end else begin ns_gddr_sync = STOP; end end RESET: // RESET state 2 begin if (ctrl_cnt == 3) begin ns_gddr_sync = STOP; end else begin ns_gddr_sync = RESET; end end READY: // READY state 5 begin if ((!start)) begin ns_gddr_sync = INIT; end else begin ns_gddr_sync = READY; end end default: begin ns_gddr_sync = cs_gddr_sync; end endcase end endmodule // iddr_4_x2gddr_sync `timescale 1 ns / 1 ps module eth_iddr_x2 (alignwd, clkin, ready, sclk, start, sync_clk, sync_reset, datain, data, ctrlin, ctrl)/* synthesis NGD_DRC_MASK=1 */; input wire alignwd; input wire clkin; input wire start; input wire sync_clk; input wire sync_reset; input wire [3:0] datain; output wire ready; output wire sclk; output wire [15:0] data; input wire ctrlin; output wire [3:0] ctrl; wire stop; wire eclki; wire buf_clkin; wire data_a3; wire data_b3; wire data_c3; wire data_d3; wire data_a2; wire data_b2; wire data_c2; wire data_d2; wire data_a1; wire data_b1; wire data_c1; wire data_d1; wire data_a0; wire data_b0; wire data_c0; wire data_d0; wire reset; wire eclko; wire sclk_t; wire dataini_t3; wire dataini_t2; wire dataini_t1; wire dataini_t0; wire buf_dataini3; wire buf_dataini2; wire buf_dataini1; wire buf_dataini0; wire ctrl_a0; wire ctrl_b0; wire ctrl_c0; wire ctrl_d0; wire ctrlini_t0; wire buf_ctrlini0; IDDRX2F Inst2_IDDRX2F4 (.D(ctrlini_t0), .SCLK(sclk_t), .ECLK(eclko), .RST(reset), .ALIGNWD(alignwd), .Q3(ctrl_d0), .Q2(ctrl_c0), .Q1(ctrl_b0), .Q0(ctrl_a0)); defparam udel_ctrlini0.DEL_MODE = "USER_DEFINED" ; defparam udel_ctrlini0.DEL_VALUE = 0 ; DELAYG udel_ctrlini0 (.A(buf_ctrlini0), .Z(ctrlini_t0)); IB Inst1_IB4 (.I(ctrlin[0]), .O(buf_ctrlini0)) /* synthesis IO_TYPE="LVCMOS18" */; assign ctrl[3] = ctrl_d0; assign ctrl[2] = ctrl_c0; assign ctrl[1] = ctrl_b0; assign ctrl[0] = ctrl_a0; IB Inst5_IB (.I(clkin), .O(buf_clkin)) /* synthesis IO_TYPE="LVCMOS18" */; //defparam udel_clkini0.DEL_MODE = "USER_DEFINED" ; //defparam udel_clkini0.DEL_VALUE = 40 ; //DELAYG udel_clkini0 (.A(buf_clkin), .Z(eclki)); defparam Inst4_CLKDIVF.DIV = "2.0" ; CLKDIVF Inst4_CLKDIVF (.CLKI(eclko), .RST(reset), .ALIGNWD(alignwd), .CDIVX(sclk_t)); ECLKSYNCB Inst3_ECLKSYNCB (.ECLKI(eclki), .STOP(stop), .ECLKO(eclko)); iddr_4_x2gddr_sync Inst_gddr_sync (.rst(sync_reset), .sync_clk(sync_clk), .start(start), .stop(stop), .ddr_reset(reset), .ready(ready)); IDDRX2F Inst2_IDDRX2F3 (.D(dataini_t3), .SCLK(sclk_t), .ECLK(eclko), .RST(reset), .ALIGNWD(alignwd), .Q3(data_d3), .Q2(data_c3), .Q1(data_b3), .Q0(data_a3)); IDDRX2F Inst2_IDDRX2F2 (.D(dataini_t2), .SCLK(sclk_t), .ECLK(eclko), .RST(reset), .ALIGNWD(alignwd), .Q3(data_d2), .Q2(data_c2), .Q1(data_b2), .Q0(data_a2)); IDDRX2F Inst2_IDDRX2F1 (.D(dataini_t1), .SCLK(sclk_t), .ECLK(eclko), .RST(reset), .ALIGNWD(alignwd), .Q3(data_d1), .Q2(data_c1), .Q1(data_b1), .Q0(data_a1)); IDDRX2F Inst2_IDDRX2F0 (.D(dataini_t0), .SCLK(sclk_t), .ECLK(eclko), .RST(reset), .ALIGNWD(alignwd), .Q3(data_d0), .Q2(data_c0), .Q1(data_b0), .Q0(data_a0)); defparam udel_dataini3.DEL_MODE = "USER_DEFINED" ; defparam udel_dataini3.DEL_VALUE = 0 ; DELAYG udel_dataini3 (.A(buf_dataini3), .Z(dataini_t3)); defparam udel_dataini2.DEL_MODE = "USER_DEFINED" ; defparam udel_dataini2.DEL_VALUE = 0 ; DELAYG udel_dataini2 (.A(buf_dataini2), .Z(dataini_t2)); defparam udel_dataini1.DEL_MODE = "USER_DEFINED" ; defparam udel_dataini1.DEL_VALUE = 0 ; DELAYG udel_dataini1 (.A(buf_dataini1), .Z(dataini_t1)); defparam udel_dataini0.DEL_MODE = "USER_DEFINED" ; defparam udel_dataini0.DEL_VALUE = 0 ; DELAYG udel_dataini0 (.A(buf_dataini0), .Z(dataini_t0)); IB Inst1_IB3 (.I(datain[3]), .O(buf_dataini3)) /* synthesis IO_TYPE="LVCMOS18" */; IB Inst1_IB2 (.I(datain[2]), .O(buf_dataini2)) /* synthesis IO_TYPE="LVCMOS18" */; IB Inst1_IB1 (.I(datain[1]), .O(buf_dataini1)) /* synthesis IO_TYPE="LVCMOS18" */; IB Inst1_IB0 (.I(datain[0]), .O(buf_dataini0)) /* synthesis IO_TYPE="LVCMOS18" */; assign sclk = sclk_t; assign data[15] = data_d3; assign data[14] = data_d2; assign data[13] = data_d1; assign data[12] = data_d0; assign data[11] = data_c3; assign data[10] = data_c2; assign data[9] = data_c1; assign data[8] = data_c0; assign data[7] = data_b3; assign data[6] = data_b2; assign data[5] = data_b1; assign data[4] = data_b0; assign data[3] = data_a3; assign data[2] = data_a2; assign data[1] = data_a1; assign data[0] = data_a0; assign eclki = buf_clkin; // exemplar begin // exemplar attribute Inst5_IB IO_TYPE LVCMOS18 // exemplar attribute Inst1_IB3 IO_TYPE LVCMOS18 // exemplar attribute Inst1_IB2 IO_TYPE LVCMOS18 // exemplar attribute Inst1_IB1 IO_TYPE LVCMOS18 // exemplar attribute Inst1_IB0 IO_TYPE LVCMOS18 // exemplar end endmodule