mirror of
git://projects.qi-hardware.com/nn-usb-fpga.git
synced 2025-04-21 12:27:27 +03:00
Fixing some examples, adding scripts for compiling xilinx libs with ghdl
This commit is contained in:
1379
Examples/sram_gpio/logic/sim/ddr/ddr.v
Normal file
1379
Examples/sram_gpio/logic/sim/ddr/ddr.v
Normal file
File diff suppressed because it is too large
Load Diff
63
Examples/sram_gpio/logic/sim/ddr/ddr_parameters.vh
Normal file
63
Examples/sram_gpio/logic/sim/ddr/ddr_parameters.vh
Normal file
@@ -0,0 +1,63 @@
|
||||
/****************************************************************************************
|
||||
*
|
||||
* Disclaimer This software code and all associated documentation, comments or other
|
||||
* of Warranty: information (collectively "Software") is provided "AS IS" without
|
||||
* warranty of any kind. MICRON TECHNOLOGY, INC. ("MTI") EXPRESSLY
|
||||
* DISCLAIMS ALL WARRANTIES EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
||||
* TO, NONINFRINGEMENT OF THIRD PARTY RIGHTS, AND ANY IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE. MTI DOES NOT
|
||||
* WARRANT THAT THE SOFTWARE WILL MEET YOUR REQUIREMENTS, OR THAT THE
|
||||
* OPERATION OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE.
|
||||
* FURTHERMORE, MTI DOES NOT MAKE ANY REPRESENTATIONS REGARDING THE USE OR
|
||||
* THE RESULTS OF THE USE OF THE SOFTWARE IN TERMS OF ITS CORRECTNESS,
|
||||
* ACCURACY, RELIABILITY, OR OTHERWISE. THE ENTIRE RISK ARISING OUT OF USE
|
||||
* OR PERFORMANCE OF THE SOFTWARE REMAINS WITH YOU. IN NO EVENT SHALL MTI,
|
||||
* ITS AFFILIATED COMPANIES OR THEIR SUPPLIERS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, CONSEQUENTIAL, INCIDENTAL, OR SPECIAL DAMAGES (INCLUDING,
|
||||
* WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, BUSINESS INTERRUPTION,
|
||||
* OR LOSS OF INFORMATION) ARISING OUT OF YOUR USE OF OR INABILITY TO USE
|
||||
* THE SOFTWARE, EVEN IF MTI HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGES. Because some jurisdictions prohibit the exclusion or
|
||||
* limitation of liability for consequential or incidental damages, the
|
||||
* above limitation may not apply to you.
|
||||
*
|
||||
* Copyright 2003 Micron Technology, Inc. All rights reserved.
|
||||
*
|
||||
****************************************************************************************/
|
||||
|
||||
// Timing parameters based on Speed Grade
|
||||
|
||||
// SYMBOL UNITS DESCRIPTION
|
||||
// ------ ----- -----------
|
||||
|
||||
// `ifdef sg6T // Timing Parameters for -6T (CL = 2.5)
|
||||
parameter tCK = 6.0; // tCK ns Nominal Clock Cycle Time
|
||||
parameter tDQSQ = 0.45; // tDQSS ns DQS-DQ skew, DQS to last DQ valid, per group, per access
|
||||
parameter tMRD = 12.0; // tMRD ns Load Mode Register command cycle time
|
||||
parameter tRAP = 15.0; // tRAP ns ACTIVE to READ with Auto precharge command
|
||||
parameter tRAS = 42.0; // tRAS ns Active to Precharge command time
|
||||
parameter tRC = 60.0; // tRC ns Active to Active/Auto Refresh command time
|
||||
parameter tRFC = 120.0; // tRFC ns Refresh to Refresh Command interval time
|
||||
parameter tRCD = 15.0; // tRCD ns Active to Read/Write command time
|
||||
parameter tRP = 15.0; // tRP ns Precharge command period
|
||||
parameter tRRD = 12.0; // tRRD ns Active bank a to Active bank b command time
|
||||
parameter tWR = 15.0; // tWR ns Write recovery time
|
||||
|
||||
|
||||
|
||||
// Size Parameters based on Part Width
|
||||
|
||||
|
||||
//`else `define x16
|
||||
parameter ADDR_BITS = 13; // Set this parameter to control how many Address bits are used
|
||||
parameter DQ_BITS = 16; // Set this parameter to control how many Data bits are used
|
||||
parameter DQS_BITS = 2; // Set this parameter to control how many DQS bits are used
|
||||
parameter DM_BITS = 2; // Set this parameter to control how many DM bits are used
|
||||
parameter COL_BITS = 10; // Set this parameter to control how many Column bits are used
|
||||
|
||||
parameter full_mem_bits = 2+ADDR_BITS+COL_BITS; // Set this parameter to control how many unique addresses are used
|
||||
parameter part_mem_bits = 14; // Set this parameter to control how many unique addresses are used
|
||||
|
||||
parameter no_halt = 0; // If set to 1, the model won't halt on command sequence/major errors
|
||||
parameter Debug = 1; // Turn on debug message
|
||||
|
||||
64
Examples/sram_gpio/logic/sim/ddr/parameters.v
Normal file
64
Examples/sram_gpio/logic/sim/ddr/parameters.v
Normal file
@@ -0,0 +1,64 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (c) 2005 Xilinx, Inc.
|
||||
// This design is confidential and proprietary of Xilinx, All Rights Reserved.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// ____ ____
|
||||
// / /\/ /
|
||||
// /___/ \ / Vendor : Xilinx
|
||||
// \ \ \/ Version : $Name: mig_v1_73_b0 $
|
||||
// \ \ Application : MIG
|
||||
// / / Filename : mem_interface_top_parameters_0.v
|
||||
// /___/ /\ Date Last Modified : $Date: 2007/06/06 05:44:42 $
|
||||
// \ \ / \ Date Created : Mon May 2 2005
|
||||
// \___\/\___\
|
||||
// Device : Spartan-3/3E/3A
|
||||
// Design Name : DDR1 SDRAM
|
||||
// Purpose : This module has the parameters used in the design.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
`define data_width 16
|
||||
`define data_strobe_width 2
|
||||
`define data_mask_width 2
|
||||
`define clk_width 1
|
||||
`define fifo_16 1
|
||||
`define ReadEnable 1
|
||||
`define memory_width 8
|
||||
`define DatabitsPerReadClock 8
|
||||
`define DatabitsPerMask 8
|
||||
`define no_of_cs 1
|
||||
`define data_mask 1
|
||||
`define mask_disable 0
|
||||
`define RESET 0
|
||||
`define cke_width 1
|
||||
`define registered 0
|
||||
`define col_ap_width 11
|
||||
`define write_pipe_itr 1
|
||||
`define write_pipeline 4
|
||||
`define top_bottom 0
|
||||
`define left_right 1
|
||||
`define row_address 13
|
||||
`define column_address 10
|
||||
`define bank_address 2
|
||||
`define spartan3e 1
|
||||
`define burst_length 3'b001
|
||||
`define burst_type 1'b0
|
||||
`define cas_latency_value 3'b110
|
||||
`define Operating_mode 5'b00000
|
||||
`define load_mode_register 13'b0000001100001
|
||||
`define drive_strengh 1'b0
|
||||
`define dll_enable 1'b0
|
||||
`define ext_load_mode_register 13'b0000000000000
|
||||
`define chip_address 1
|
||||
`define reset_active_low 1'b1
|
||||
`define rcd_count_value 3'b001
|
||||
`define ras_count_value 4'b0101
|
||||
`define mrd_count_value 1'b0
|
||||
`define rp_count_value 3'b001
|
||||
`define rfc_count_value 6'b001001
|
||||
`define twr_count_value 3'b110
|
||||
`define twtr_count_value 3'b100
|
||||
`define max_ref_width 11
|
||||
`define max_ref_cnt 11'b10000000001
|
||||
|
||||
`timescale 1ns/100ps
|
||||
|
||||
44
Examples/sram_gpio/logic/sim/ddr/readme.txt
Normal file
44
Examples/sram_gpio/logic/sim/ddr/readme.txt
Normal file
@@ -0,0 +1,44 @@
|
||||
********************************************************************************************
|
||||
The sim folder has sample test_bench files to simulate the designs in Modelsim environment.
|
||||
This folder has the memory model, test bench, glbl file and required parameter files.
|
||||
Read the steps in this file before simulations are done.
|
||||
|
||||
To run simulations for this sample configuration, user has to generate the RTL from the tool for the following GUI
|
||||
options.
|
||||
|
||||
Data_width : 64
|
||||
HDL : Verilog or VHDL
|
||||
Memory configuration : x16
|
||||
DIMM/Component : Component
|
||||
Memory Part No : MT46V16M16XX-5
|
||||
Add test bench : Yes
|
||||
Use DCM : Yes
|
||||
Number of controllers : 1
|
||||
Number of Write pipelines : 4
|
||||
|
||||
-----------------------------------------------For Verilog or VHDL----------------------------------------------------------
|
||||
|
||||
1. After the rtl is generated, create the Model sim project file. Add all the rtl files from the rtl folder
|
||||
to the project Also add the memory model, test bench and glbl files from the sim folder.
|
||||
|
||||
2. Compile the design.
|
||||
|
||||
3. After successful compilation of design load the design using the following comamnd.
|
||||
|
||||
vsim -t ps +notimingchecks -L ../Modeltech_6.1a/unisims_ver work.ddr1_test_tb glbl
|
||||
Note : User should set proper path for unisim verilog libraries
|
||||
|
||||
4. After the design is successfully loaded, run the simulations and view the waveforms.
|
||||
|
||||
|
||||
Notes :
|
||||
|
||||
1. To run simulations for different data widths and configurations, users should modify the test bench files
|
||||
with right memory models and design files.
|
||||
|
||||
2. User must manually change the frequency of the test bench for proper simulations.
|
||||
|
||||
3. Users should modify the test bench files for without test bench case.
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user