//***************************************************************************
// Copyright(c)2016, Lyu Yang
// All rights reserved
//
// File name : wb_xmigddr.v
// Module name :
// Author : Lyu Yang
// Email :
// Date : 2016-12-00
// Version : v1.0
//
// Abstract : DDR Chip Clock Source is 50MHz.
//
// Modification history
// ------------------------------------------------------------------------
// Version Date(yyyy/mm/dd) name
// Description
//
// $Log$
//***************************************************************************
`timescale 1ns / 100ps
module wb_xmigddr (
input wb_clk_i,
input wb_rst_i, // Wishbone Interface
input wb_cyc_i,
input wb_stb_i,
input wb_we_i,
input [:] wb_sel_i,
input [:] wb_adr_i,
input [:] wb_dat_i,
output [:] wb_dat_o,
output wb_ack_o, // DDR Chip Signals
output mcb3_dram_ck,
output mcb3_dram_ck_n,
inout [:] mcb3_dram_dq,
output [:] mcb3_dram_a,
output [:] mcb3_dram_ba,
output mcb3_dram_ras_n,
output mcb3_dram_cas_n,
output mcb3_dram_we_n,
output mcb3_dram_odt,
output mcb3_dram_cke,
output mcb3_dram_dm,
inout mcb3_dram_udqs,
inout mcb3_dram_udqs_n,
output mcb3_dram_udm,
inout mcb3_dram_dqs,
inout mcb3_dram_dqs_n,
inout mcb3_rzq,
inout mcb3_zio
); // DDR DRAM Calib Done
wire c3_calib_done;
// BIU Signals
wire c3_px_cmd_en;
wire [:] c3_px_cmd_instr;
wire [:] c3_px_cmd_byte_addr;
wire c3_px_cmd_full;
wire c3_px_wr_en;
wire c3_px_wr_empty;
wire c3_px_rd_en;
wire c3_px_rd_empty; // Read, Write and Ack Signals
wire wb_req;
reg wb_req_r, wb_ack_write, wb_ack_read; assign wb_req = wb_stb_i & wb_cyc_i & c3_calib_done; always @(posedge wb_clk_i)
wb_req_r <= wb_req & !wb_ack_o; assign wb_req_new = wb_req & !wb_req_r; // Write and Read Ack Signal
always @(posedge wb_clk_i)
wb_ack_write <= wb_req & wb_we_i & !wb_ack_write & !c3_px_cmd_full; always @(posedge wb_clk_i)
wb_ack_read <= wb_req & !wb_we_i & !wb_ack_read & !c3_px_rd_empty; assign wb_ack_o = (wb_we_i ? wb_ack_write : wb_ack_read) & wb_stb_i;
assign c3_px_cmd_instr = {'b00, ~wb_we_i};
assign c3_px_cmd_byte_addr = {wb_adr_i[:], 'b00};
assign c3_px_wr_en = (wb_stb_i & wb_cyc_i & wb_we_i) ? wb_req_new : 'b0;
assign c3_px_rd_en = (wb_stb_i & wb_cyc_i & !wb_we_i) ? wb_ack_read : 'b0;
assign c3_px_cmd_en = (wb_stb_i & wb_cyc_i & wb_we_i) ? wb_ack_write : wb_req_new & !wb_we_i; // Xilinx Spartan6 MIG
mig_spartan6 memc_ddr
(
// controller clock and reset
.c3_sys_clk (wb_clk_i),
.c3_sys_rst_i (wb_rst_i), // user insterface signals
.c3_p0_cmd_clk (wb_clk_i),
.c3_p0_cmd_en (c3_px_cmd_en),
.c3_p0_cmd_instr (c3_px_cmd_instr),
.c3_p0_cmd_bl ('d0),
.c3_p0_cmd_byte_addr (c3_px_cmd_byte_addr),
.c3_p0_cmd_empty (),
.c3_p0_cmd_full (c3_px_cmd_full),
.c3_p0_wr_clk (wb_clk_i),
.c3_p0_wr_en (c3_px_wr_en),
.c3_p0_wr_mask (~wb_sel_i),
.c3_p0_wr_data (wb_dat_i),
.c3_p0_wr_full (),
.c3_p0_wr_empty (c3_px_wr_empty),
.c3_p0_wr_count (),
.c3_p0_wr_underrun (),
.c3_p0_wr_error (),
.c3_p0_rd_clk (wb_clk_i),
.c3_p0_rd_en (c3_px_rd_en),
.c3_p0_rd_data (wb_dat_o),
.c3_p0_rd_full (),
.c3_p0_rd_empty (c3_px_rd_empty),
.c3_p0_rd_count (),
.c3_p0_rd_overflow (),
.c3_p0_rd_error (),
// port1
.c3_p1_cmd_clk (),
.c3_p1_cmd_en ('b0),
.c3_p1_cmd_instr (),
.c3_p1_cmd_bl (),
.c3_p1_cmd_byte_addr (),
.c3_p1_cmd_empty (),
.c3_p1_cmd_full (),
.c3_p1_wr_clk (),
.c3_p1_wr_en ('b0),
.c3_p1_wr_mask (),
.c3_p1_wr_data (),
.c3_p1_wr_full (),
.c3_p1_wr_empty (),
.c3_p1_wr_count (),
.c3_p1_wr_underrun (),
.c3_p1_wr_error (),
.c3_p1_rd_clk (),
.c3_p1_rd_en ('b0),
.c3_p1_rd_data (),
.c3_p1_rd_full (),
.c3_p1_rd_empty (),
.c3_p1_rd_count (),
.c3_p1_rd_overflow (),
.c3_p1_rd_error (),
// port2
.c3_p2_cmd_clk (),
.c3_p2_cmd_en ('b0),
.c3_p2_cmd_instr (),
.c3_p2_cmd_bl (),
.c3_p2_cmd_byte_addr (),
.c3_p2_cmd_empty (),
.c3_p2_cmd_full (),
.c3_p2_wr_clk (),
.c3_p2_wr_en ('b0),
.c3_p2_wr_mask (),
.c3_p2_wr_data (),
.c3_p2_wr_full (),
.c3_p2_wr_empty (),
.c3_p2_wr_count (),
.c3_p2_wr_underrun (),
.c3_p2_wr_error (),
.c3_p2_rd_clk (),
.c3_p2_rd_en ('b0),
.c3_p2_rd_data (),
.c3_p2_rd_full (),
.c3_p2_rd_empty (),
.c3_p2_rd_count (),
.c3_p2_rd_overflow (),
.c3_p2_rd_error (),
// port3
.c3_p3_cmd_clk (),
.c3_p3_cmd_en ('b0),
.c3_p3_cmd_instr (),
.c3_p3_cmd_bl (),
.c3_p3_cmd_byte_addr (),
.c3_p3_cmd_empty (),
.c3_p3_cmd_full (),
.c3_p3_wr_clk (),
.c3_p3_wr_en ('b0),
.c3_p3_wr_mask (),
.c3_p3_wr_data (),
.c3_p3_wr_full (),
.c3_p3_wr_empty (),
.c3_p3_wr_count (),
.c3_p3_wr_underrun (),
.c3_p3_wr_error (),
.c3_p3_rd_clk (),
.c3_p3_rd_en ('b0),
.c3_p3_rd_data (),
.c3_p3_rd_full (),
.c3_p3_rd_empty (),
.c3_p3_rd_count (),
.c3_p3_rd_overflow (),
.c3_p3_rd_error (), // ddr2 chip signals
.mcb3_dram_dq (mcb3_dram_dq),
.mcb3_dram_a (mcb3_dram_a),
.mcb3_dram_ba (mcb3_dram_ba),
.mcb3_dram_ras_n (mcb3_dram_ras_n),
.mcb3_dram_cas_n (mcb3_dram_cas_n),
.mcb3_dram_we_n (mcb3_dram_we_n),
.mcb3_dram_odt (mcb3_dram_odt),
.mcb3_dram_cke (mcb3_dram_cke),
.mcb3_dram_dm (mcb3_dram_dm),
.mcb3_dram_udqs (mcb3_dram_udqs),
.mcb3_dram_udqs_n (mcb3_dram_udqs_n),
.mcb3_dram_udm (mcb3_dram_udm),
.mcb3_dram_dqs (mcb3_dram_dqs),
.mcb3_dram_dqs_n (mcb3_dram_dqs_n),
.mcb3_dram_ck (mcb3_dram_ck),
.mcb3_dram_ck_n (mcb3_dram_ck_n),
.mcb3_rzq (mcb3_rzq),
.mcb3_zio (mcb3_zio),
.c3_clk0 (),
.c3_rst0 (),
.c3_calib_done (c3_calib_done)
); endmodule

Wishbone总线从接口转Xilinx MIG (Spartan 6)的更多相关文章

  1. openrisc 之 Wishbone总线学习笔记——接口信号定义

    这部分内容就是copy下来的,网上到处都有.先看看接口啥样子,在详细说明 接口定义copy http://blog.csdn.net/ce123/article/details/6929897.百度文 ...

  2. openrisc 之 Wishbone总线学习笔记——总线互联

    一,总线命名规范 1,wishbone总线接口信号都是高电平有限 2,wishbone接口信号都是以 _i ,或者是 _o 结束.i表示输入, o表示输出. ()表示该信号为总线信号,总线位宽可以大于 ...

  3. OR1200处理器中Wishbone总线接口模块WB_BIU介绍

    下面内容摘自<步步惊芯--软核处理器内部设计分析>一书 WB_BIU模块是OR1200处理器与外部Wishbone总线连接的接口模块.15.1节给出了WB_BIU模块的对外连接关系,并指出 ...

  4. KC705E 增强版 基于FMC接口的Xilinx Kintex-7 FPGA K7 XC7K325T PCIeX8 接口卡

    KC705E 增强版 基于FMC接口的Xilinx Kintex-7 FPGA K7 XC7K325T PCIeX8 接口卡 一.板卡概述 本板卡基于Xilinx公司的FPGAXC7K325T-2FF ...

  5. 330-支持PXIE带FMC接口的Xilinx FPGA XC7K325T PCIeX8 接口卡平台

    支持PXIE带FMC接口的Xilinx FPGA XC7K325T PCIeX8 接口卡平台 一.板卡概述     本板卡基于Xilinx公司的FPGAXC7K325T-2FFG900 芯片,pin_ ...

  6. 270-VC709E 增强版 基于FMC接口的Xilinx Vertex-7 FPGA V7 XC7VX690T PCIeX8 接口卡

    VC709E 增强版 基于FMC接口的Xilinx Vertex-7 FPGA V7 XC7VX690T PCIeX8 接口卡 一.板卡概述       本板卡基于Xilinx公司的FPGA XC7V ...

  7. openrisc 之 Wishbone总线学习笔记——总线特性

    特性: 一,互联方式: 支持点到点.共享总线.十字交叉(Crossbar)和基于交换结构(Switch fabric)的互联. 二,数据操作方式:单次读/写操作.块读/写操作,读改写(RMW,Read ...

  8. modelsim仿真xilinx mig ip core相关问题

    1.运用自动化脚本文件 do sim.do  其中不支持 .f文件 , 需要直接vlog 2.对于mig模型采用下面句型(根据example中do sim.do文件) vlog -sv +define ...

  9. PCI总线目标接口状态机设计

    module state_machine (devsel_l, trdy_l, stop_l, pci_ad_oe,      dts_oe, par_oe, bk_oe, pci_ad_en, hi ...

随机推荐

  1. windows系统安装mysql压缩zip版

    1.下载 打开官网:https://www.mysql.com 进入DOWNLOADS--->Community--->MySQL Community Server,选择系统对应的版本点击 ...

  2. C++编译常见错误

    error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To di ...

  3. TCP Socket Port Check

    写了两个小程序,主要是用于linux和windows下TCP端口的检测,自带的telnet无法满足我批量检测的需要,在我眼里这类端口检测程序最为关键的是超时的限制,若端口不能却要老久才返回结果,有点不 ...

  4. AC日记——「SCOI2015」国旗计划 LiBreOJ 2007

    #2007. 「SCOI2015」国旗计划 思路: 跪烂Claris 代码: #include <cstdio> #include <algorithm> #define ma ...

  5. 前端读者 | 百度前端编码规范(JS)

    本文来自:百度FEX 1 前言 JavaScript在百度一直有着广泛的应用,特别是在浏览器端的行为管理.本文档的目标是使JavaScript代码风格保持一致,容易被理解和被维护. 虽然本文档是针对J ...

  6. 在centos 6.9安装wordpress,浏览器不能访问问题

    在centos 6.9安装wordpress浏览器访问先出现403错误,然后提示access denied nginx错误打印FastCGI sent in stderr: "Unable ...

  7. 在SpringMVC中 /* 和 / 的区别

    <url-pattern> / </url-pattern>:会匹配到 /springmvc 这样的路径型url,而不会匹配到像 .jsp 这样的后缀型的url. <ur ...

  8. ThoughtWorks测试

    Fizz-Buzz-Whizz 问题描述: 1. 你首先说出三个不同的特殊数,要求必须是个位数,比如3.5.7. 2. 让所有学生拍成一队,然后按顺序报数. 3. 学生报数时,如果所报数字是第一个特殊 ...

  9. 215. Kth Largest Element in an Array【Medium】【找到第 k 大的元素】

    Find the kth largest element in an unsorted array. Note that it is the kth largest element in the so ...

  10. 洛谷P1007 独木桥 [数论]

    题目传送门 独木桥 题目背景 战争已经进入到紧要时间.你是运输小队长,正在率领运输部队向前线运送物资.运输任务像做题一样的无聊.你希望找些刺激,于是命令你的士兵们到前方的一座独木桥上欣赏风景,而你留在 ...