//***************************************************************************
// 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. 关于springMVC转换json出现的异常

    jackson-core-asl-1.9.0.jar,jackson-mapper-asl-1.9.0.jar两个包 并且在controller中有如下代码 @RequestMapping(value ...

  2. sharding-JDBC 实现读写分离

    需求 一主两从,做读写分离. 多个从库之间实现负载均衡. 可手动强制部分读请求到主库上.(因为主从同步有延迟,对实时性要求高的系统,可以将部分读请求也走主库) 本次不讨论 MySQL如何配置主从同步相 ...

  3. <一>dubbo框架学前原理介绍

    alibaba有好几个分布式框架,主要有:进行远程调用(类似于RMI的这种远程调用)的(dubbo.hsf),jms消息服务(napoli.notify),KV数据库(tair)等.这个框架/工具/产 ...

  4. Mysql 中的Text字段的范围

    mysql中text 最大长度为65,535(2的16次方–1)字符的TEXT列.如果你觉得text长度不够,可以选择 MEDIUMTEXT最大长度为16,777,215. LONGTEXT最大长度为 ...

  5. echarts官网上的动态加载数据bug被我解决。咳咳/。

    又是昨天,为什么昨天发生了这么多事.没办法,谁让我今天没事可做呢. 昨天需求是动态加载数据,画一个实时监控的折线图.大概长这样. 我屁颠屁颠的把代码copy过来,一运行,caocaocao~bug出现 ...

  6. Druid 架构

    本篇译自 Druid 项目白皮书部分内容( https://github.com/apache/incubator-druid/tree/master/publications/whitepaper/ ...

  7. shell脚本学习(六)

    shell函数 注:现在是unix编程 实例: #!/bin/shdemon(){ echo "这是一个shell脚本"}demon 注: 调用是只写函数名没有() 函数的返回值 ...

  8. Linux命令之ftp

    ftp [-pinegvd] [host] pftp [-inegvd] [host] 用户通过ftp这个程序来使用Internet上的标准文件传输协议(FTP).本程序允许用户向远端网站发送文件,或 ...

  9. java 反射 获取Class对象的三种方式

    String str="hello world"; //方式一 :通过对象的getClass()方法 Class<?> clazz1 =str.getClass(); ...

  10. 【BZOJ 2186】 2186: [Sdoi2008]沙拉公主的困惑 (欧拉筛,线性求逆元)

    2186: [Sdoi2008]沙拉公主的困惑 Description 大富翁国因为通货膨胀,以及假钞泛滥,政府决定推出一项新的政策:现有钞票编号范围为1到N的阶乘,但是,政府只发行编号与M!互质的钞 ...