pci_wb_tpram.v
上传用户:quan1896
上传日期:2014-05-14
资源大小:211k
文件大小:33k
源码类别:

并行计算

开发平台:

Others

  1. <!-- pf_header_start -->
  2. <html>
  3.   <head>
  4.     <META NAME="keywords" CONTENT="cores, VHDL, Verilog HDL, ASIC, Synthesizable,
  5.       standard cell, IP, Intellectual Property, 32-bit RISC, UART, PCI, SDRAM,
  6.       full custom, system on a chip, SOC, reusable, design, development, synthesis,
  7.       designs, developers, C, Linux, eCos, open, free, open source cores, RTL code,
  8.       system-on-a-chip, circuits, digital, GNU, GPL, core, controller, processor,
  9.       system design, chip design, EDA, design methodology, design tools, ASICs, programmable logic,
  10.       FPGA's, PLDs, CPLDs, verification, Synthesis, HDL, Simulation, IC design software,
  11.       semiconductor design, integrated circuits, system designs, chip designs, EDAs, 
  12.       design methodologies, design tool, ASIC, programmable logics, FPGA, PLD, CPLD, Synthesis, 
  13.       circuit, Synopsys, system design, chip design, programmable logic, FPGA's, PLDs, 
  14.       CPLDs, verification, Simulation">
  15.     <META NAME="description" CONTENT="OPENCORES.ORG endorses development and hosts
  16.       a repository of free, open-source cores (chip designs) and supplemental
  17.       platforms (boards).">
  18.     <STYLE type=text/css>
  19.       BODY {margin: 0;}
  20.       BODY, P, DIV, TD, TR, TH, FORM, OL, UL, LI, B, I, INPUT, TEXTAREA, SELECT,
  21.       FONT {font-size: 10pt; FONT-FAMILY: Verdana, Tahoma, Arial, Helvetica;}
  22.       P, TD, FORM, TEXTAREA {font-size: 10pt;}
  23.       H1, H2 {FONT-FAMILY: Verdana, Tahoma, Arial, Helvetica; font-size: 13pt; text-decoration: none}
  24.       .noline {text-decoration: none;}
  25.       .menu_top {text-decoration: none; font-weight: bold;
  26.         font-size: 7pt; color: #000000; FONT-FAMILY: Verdana, Tahoma, Arial, Helvetica;} 
  27.       .menu_section {text-decoration: none; font-weight: bold;
  28.         font-size: 10pt; color: #ffffff; FONT-FAMILY: Verdana, Tahoma, Arial, Helvetica;} 
  29.       .menu_item {font-size: 10pt; color: #004488; FONT-FAMILY: Verdana, Tahoma, Arial, Helvetica;}
  30.       .menu_section_admin {text-decoration: none; font-weight: bold;
  31.         font-size: 10pt; color: #ffff44; FONT-FAMILY: Verdana, Tahoma, Arial, Helvetica;} 
  32.       .page_title {text-decoration: none; font-weight: bold; color: #c00000; font-size: 13pt; FONT-FAMILY: Verdana, Tahoma, Arial, Helvetica;}
  33.       .block_title {text-decoration: none; font-weight: bold; font-size: 11pt; color: #000000; FONT-FAMILY: Verdana, Tahoma, Arial, Helvetica;}
  34.       .block_subtitle {text-decoration: none; font-weight: bold; font-size: 10pt; color: #000000; FONT-FAMILY: Verdana, Tahoma, Arial, Helvetica;}
  35.       .title {text-decoration: none; font-weight: bold; font-size: 10pt; color: #000000; FONT-FAMILY: Verdana, Tahoma, Arial, Helvetica;}
  36.       .large {font-size: 13pt; FONT-FAMILY: Verdana, Tahoma, Arial, Helvetica;}
  37.       .medium {font-size: 10pt; FONT-FAMILY: Verdana, Tahoma, Arial, Helvetica;}
  38.       .small {font-size: 7pt; FONT-FAMILY: Verdana, Tahoma, Arial, Helvetica;}
  39.       .ultrasmall {font-size: 3pt; FONT-FAMILY: Verdana, Tahoma, Arial, Helvetica;}
  40.       .button { font-family:Verdana, Tahoma, Arial, Helvetica; }
  41.       .searchfield {font-family: verdana, arial, helvetica; font-size: 10px; color: #333333; width: 80px; height: 17px;}
  42.     </STYLE>
  43.     <title>OPENCORES.ORG</title>
  44.     <script laguage="Javascript">
  45.       function check(msg) {
  46.         if(confirm(msg)) {
  47.           return true
  48.         } else {
  49.           return false
  50.         }
  51.       }
  52.     </script>
  53.   </head>
  54.   
  55.   <body 
  56.     bgcolor="#e0e0e0" 
  57.     topmargin="0" 
  58.     leftmargin="0" 
  59.     marginwidth="0" 
  60.     marginheight="0" 
  61.     link="#004488" 
  62.     alink="#ff3300"
  63.     vlink="#444444"
  64.   >
  65. <a name="top">
  66. <!-- pf_header_end -->
  67. <center>
  68. <table cellpadding=0 cellspacing=0 border=0 width=96%><tr>
  69. <td width=1 bgcolor=#000000><img width=1 src="/images/dotty.gif"></td>
  70. <td>
  71. <table border=0 cellpadding=0 cellspacing=0 width=100%>
  72. <tr><td background="/images/topbg.gif" bgcolor=#aaddff height=70>
  73. <table width=100% border=0 ><tr><td width=180>
  74. <a href="/"><img border=0 src="/images/oc_logo.gif"></a>
  75. </td><td>
  76. <center>
  77. <!--
  78. <a title="" href="/banner.cgi"><img width=468 height=60 border=0 alt="" src=""></a>
  79. //-->
  80. <script type="text/javascript"><!--
  81. google_ad_client = "pub-9285819221080148";
  82. xgoogle_ad_width = 728;
  83. xgoogle_ad_height = 79;
  84. xgoogle_ad_format = "728x90_as";
  85. google_ad_width = 468;
  86. google_ad_height = 47;
  87. google_ad_format = "468x60_as";
  88. google_ad_type = "text_image";
  89. google_ad_channel ="3274390903";
  90. google_color_border = "aaddff";
  91. xgoogle_color_border = "ffee88";
  92. xgoogle_color_bg = "FFEE88";
  93. google_color_bg = "aaddFF";
  94. google_color_link = "004488";
  95. google_color_url = "b00000";
  96. google_color_text = "000000";
  97. //--></script>
  98. <script type="text/javascript"
  99.   src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
  100. </script>
  101. </center>
  102. </td><td align=right>
  103. </td>
  104. </tr></table>
  105. </td></tr>
  106. <tr bgcolor=#000000><td><img height=1 src="/images/dotty.gif"></td></tr>
  107. <tr><td bgcolor=#ffffff>
  108. <table border=0 cellpadding=0 cellspacing=0 width=100%><tr>
  109. <td bgcolor=#ffee88 width=60% background="/images/menu1.gif"></td>
  110. <td bgcolor=#ffee88 width=15 background="/images/menu1.gif" align=right><input type=image border=0 src="/images/exp1pf.gif" onclick="javascript:window.location='/pf.cgi?url=/cvsweb.shtml/pci/rtl/verilog/pci_wb_tpram.v?rev=1.4'"></a></td>
  111. <td bgcolor=#ffffff align=right nowrap>
  112. &nbsp; &nbsp; &nbsp; &nbsp; 
  113. <font class=menu_top size=-1>
  114.         
  115.           <a class=menu_top href="/login.cgi/login">LOGIN</a>
  116.           
  117.             &nbsp; ::: &nbsp;
  118.           
  119.         
  120.           <a class=menu_top href="/recover_pass.cgi/recover_pass">RECOVER PASS</a>
  121.           
  122.             &nbsp; ::: &nbsp;
  123.           
  124.         
  125.           <a class=menu_top href="/get_account.cgi/get_account">GET ACCOUNT</a>
  126.           
  127.         
  128. &nbsp; &nbsp;
  129. </font>
  130. </td></tr>
  131. <tr bgcolor=#ffffff>
  132.   <td></td>
  133.   <td></td>
  134.   <td bgcolor=#000000><img src="/images/dotty.gif"></td>
  135. </tr>
  136. </table>
  137. <table border=0 cellpadding=0 cellspacing=0>
  138. <tr>
  139. <td width=10><img width=10 src="/images/dotty.gif"></td>
  140. <td width=120 valign=top>
  141.         
  142.         <table width=100% border=0 cellpadding=2 cellspacing=0>
  143.           <tr><td><img height=2 src="/images/dotty.gif"></td></tr>
  144.         
  145.          <tr><td bgcolor="#347FB8">
  146.            <img src="/images/bullet.gif">
  147.          
  148.            <font class=menu_section>Browse</font>
  149.          
  150.          </td></tr>
  151.           
  152.            <tr><td>
  153.               
  154.                   
  155.                       <li class=small>
  156.                   
  157.               
  158.             
  159.                 <a class=menu_item href="/browse.cgi/by_category"><font class=menu_item>Projects</font></a></li>
  160.             
  161.            </td></tr>
  162.             
  163.           
  164.            <tr><td>
  165.               
  166.                   
  167.                       <li class=small>
  168.                   
  169.               
  170.             
  171.                 <a class=menu_item href="/cvsweb.shtml/"><font class=menu_item>Code (CVS)</font></a></li>
  172.             
  173.            </td></tr>
  174.             
  175.           
  176.            <tr><td>
  177.               
  178.                   
  179.                       <li class=small>
  180.                   
  181.               
  182.             
  183.                 <a class=menu_item href="/forums.cgi"><font class=menu_item>Forums</font></a></li>
  184.             
  185.            </td></tr>
  186.             
  187.           
  188.            <tr><td>
  189.               
  190.                   
  191.                       <li class=small>
  192.                   
  193.               
  194.             
  195.                 <a class=menu_item href="/news.cgi/list/1"><font class=menu_item>News</font></a></li>
  196.             
  197.            </td></tr>
  198.             
  199.           
  200.            <tr><td>
  201.               
  202.                   
  203.                       <li class=small>
  204.                   
  205.               
  206.             
  207.                 <a class=menu_item href="/articles.cgi/list"><font class=menu_item>Articles</font></a></li>
  208.             
  209.            </td></tr>
  210.             
  211.           
  212.            <tr><td>
  213.               
  214.                   
  215.                       <li class=small>
  216.                   
  217.               
  218.             
  219.                 <a class=menu_item href="/polls.cgi/list"><font class=menu_item>Polls</font></a></li>
  220.             
  221.            </td></tr>
  222.             
  223.           
  224.           <tr><td><font size=-2>&nbsp;</font></td></tr>
  225.         
  226.          <tr><td bgcolor="#347FB8">
  227.            <img src="/images/bullet.gif">
  228.          
  229.            <font class=menu_section>OpenCores</font>
  230.          
  231.          </td></tr>
  232.           
  233.            <tr><td>
  234.               
  235.                   
  236.                       <li class=small>
  237.                   
  238.               
  239.             
  240.                 <a class=menu_item href="/faq.cgi/index"><font class=menu_item>FAQ</font></a></li>
  241.             
  242.            </td></tr>
  243.             
  244.           
  245.            <tr><td>
  246.               
  247.                   
  248.                       <li class=small>
  249.                   
  250.               
  251.             
  252.                 <a class=menu_item href="/projects.cgi/web/opencores/cvs_howto"><font class=menu_item>CVS HowTo</font></a></li>
  253.             
  254.            </td></tr>
  255.             
  256.           
  257.            <tr><td>
  258.               
  259.                   
  260.                       <li class=small>
  261.                   
  262.               
  263.             
  264.                 <a class=menu_item href="/projects.cgi/web/opencores/mission"><font class=menu_item>Mission</font></a></li>
  265.             
  266.            </td></tr>
  267.             
  268.           
  269.            <tr><td>
  270.               
  271.                   
  272.                       <li class=small>
  273.                   
  274.               
  275.             
  276.                 <a class=menu_item href="/projects.cgi/web/opencores/media"><font class=menu_item>Media</font></a></li>
  277.             
  278.            </td></tr>
  279.             
  280.           
  281.            <tr><td>
  282.               
  283.                   
  284.                       <li class=small>
  285.                   
  286.               
  287.             
  288.                 <a class=menu_item href="/projects.cgi/web/opencores/tools"><font class=menu_item>Tools</font></a></li>
  289.             
  290.            </td></tr>
  291.             
  292.           
  293.            <tr><td>
  294.               
  295.                   
  296.                       <li class=small>
  297.                   
  298.               
  299.             
  300.                 <a class=menu_item href="/projects.cgi/web/opencores/sponsors"><font class=menu_item>Sponsors</font></a></li>
  301.             
  302.            </td></tr>
  303.             
  304.           
  305.            <tr><td>
  306.               
  307.                   
  308.                       <li class=small>
  309.                   
  310.               
  311.             
  312.                 <a class=menu_item href="/projects.cgi/web/opencores/mirrors"><font class=menu_item>Mirrors</font></a></li>
  313.             
  314.            </td></tr>
  315.             
  316.           
  317.            <tr><td>
  318.               
  319.                   
  320.                       <li class=small>
  321.                   
  322.               
  323.             
  324.                 <a class=menu_item href="/projects.cgi/web/opencores/logos"><font class=menu_item>Logos</font></a></li>
  325.             
  326.            </td></tr>
  327.             
  328.           
  329.            <tr><td>
  330.               
  331.                   
  332.                       <li class=small>
  333.                   
  334.               
  335.             
  336.                 <a class=menu_item href="/projects.cgi/web/opencores/contacts"><font class=menu_item>Contact us</font></a></li>
  337.             
  338.            </td></tr>
  339.             
  340.           
  341.           <tr><td><font size=-2>&nbsp;</font></td></tr>
  342.         
  343.          <tr><td bgcolor="#347FB8">
  344.            <img src="/images/bullet.gif">
  345.          
  346.            <font class=menu_section>Tools</font>
  347.          
  348.          </td></tr>
  349.           
  350.            <tr><td>
  351.               
  352.                   
  353.                       <li class=small>
  354.                   
  355.               
  356.             
  357.                 <font class=menu_item><a href="/search.cgi">Search</a><br><table><tr><form action=/search.cgi/do_search><td><font class=small>&nbsp;&nbsp;</font></td><td><input class=searchfield type=text name=query></td></form></tr></table></font></li>
  358.             
  359.            </td></tr>
  360.             
  361.           
  362.            <tr><td>
  363.               
  364.                   
  365.                       <li class=small>
  366.                   
  367.               
  368.             
  369.                 <a class=menu_item href="/cvsget.shtml"><font class=menu_item>Download Cores (CVSGet)</font></a></li>
  370.             
  371.            </td></tr>
  372.             
  373.           
  374.           <tr><td><font size=-2>&nbsp;</font></td></tr>
  375.         
  376.          <tr><td bgcolor="#347FB8">
  377.            <img src="/images/bullet.gif">
  378.          
  379.            <font class=menu_section>More</font>
  380.          
  381.          </td></tr>
  382.           
  383.            <tr><td>
  384.               
  385.                   
  386.                       <li class=small>
  387.                   
  388.               
  389.             
  390.                 <a class=menu_item href="/projects.cgi/web/wishbone/"><font class=menu_item>Wishbone</font></a></li>
  391.             
  392.            </td></tr>
  393.             
  394.           
  395.            <tr><td>
  396.               
  397.                   
  398.                       <li class=small>
  399.                   
  400.               
  401.             
  402.                 <a class=menu_item href="/projects.cgi/web/perlilog/"><font class=menu_item>Perlilog</font></a></li>
  403.             
  404.            </td></tr>
  405.             
  406.           
  407.            <tr><td>
  408.               
  409.                   
  410.                       <li class=small>
  411.                   
  412.               
  413.             
  414.                 <a class=menu_item href="/projects.cgi/web/edatools/"><font class=menu_item>EDA tools</font></a></li>
  415.             
  416.            </td></tr>
  417.             
  418.           
  419.            <tr><td>
  420.               
  421.                   
  422.                       <li class=small>
  423.                   
  424.               
  425.             
  426.                 <a class=menu_item href="/projects.cgi/web/opentech/"><font class=menu_item>OpenTech CD</font></a></li>
  427.             
  428.            </td></tr>
  429.             
  430.           
  431.           <tr><td><font size=-2>&nbsp;</font></td></tr>
  432.         
  433.         </table>
  434. </td>
  435. <td width=10><img width=10 src="/images/dotty.gif"></td>
  436. <td background="/images/vpd.gif"><img width=1 src="/images/dotty.gif"></td>
  437. <td width=10><img width=10 src="/images/dotty.gif"></td>
  438. <td valign=top>
  439.         
  440.         <table width=100% cellpadding=2 cellspacing=0 border=0>
  441.           <tr><td><img height=2 src="/images/dotty.gif"></td></tr>
  442.         </table>
  443.         
  444. <table width=100% cellspacing=0 cellpadding=0 border=0><tr><td>
  445. <!-- pf_body_start -->
  446.  
  447. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  448. <html>
  449. <head>
  450. <title>pci/rtl/verilog/pci_wb_tpram.v - view - 1.4</title>
  451. <meta name="robots" content="nofollow" />
  452. <meta name="generator" content="FreeBSD-CVSweb 3.0.5" />
  453. <meta http-equiv="Content-Script-Type" content="text/javascript" />
  454. <meta http-equiv="Content-Style-Type" content="text/css" />
  455. <link rel="stylesheet" type="text/css" href="/css/cvsweb.css" />
  456. </head>
  457. <body class="src">
  458. <table class="navigate-header" width="100%" summary="Navigation">
  459.  <tr>
  460.   <td>
  461. <a href="./pci_wb_tpram.v#rev1.4"><img src="/icons/back.gif" alt="[BACK]" border="0" width="20" height="22" /></a><b>Return to <a href="./pci_wb_tpram.v#rev1.4">pci_wb_tpram.v</a> CVS log</b> <img src="/icons/text.gif" alt="[TXT]" border="0" width="20" height="22" /></td>  <td style="text-align: right"><img src="/icons/dir.gif" alt="[DIR]" border="0" width="20" height="22" /> <b>Up to  <a href="/cvsweb.shtml/#dirlist">[Official OpenCores CVS Repository]</a> / <a href="/cvsweb.shtml/pci/#dirlist">pci</a> / <a href="/cvsweb.shtml/pci/rtl/#dirlist">rtl</a> / <a href="/cvsweb.shtml/pci/rtl/verilog/#dirlist">verilog</a></b></td>
  462.  </tr>
  463. </table>
  464. <hr />
  465. <div class="log-markup">
  466. File:&nbsp;
  467.  <a href="/cvsweb.shtml/#dirlist">[Official OpenCores CVS Repository]</a> / <a href="/cvsweb.shtml/pci/#dirlist">pci</a> / <a href="/cvsweb.shtml/pci/rtl/#dirlist">rtl</a> / <a href="/cvsweb.shtml/pci/rtl/verilog/#dirlist">verilog</a> / <a href="/cvsweb.shtml/pci/rtl/verilog/pci_wb_tpram.v">pci_wb_tpram.v</a><br />
  468. <a name="rev1.4"></a><a name="HEAD"></a>
  469.  Revision <b>1.4</b>: <a href="/cvsweb.cgi/~checkout~/pci/rtl/verilog/pci_wb_tpram.v?rev=1.4;content-type=text%2Fplain" class="download-link">download</a> - view: <a href="pci_wb_tpram.v?rev=1.4;content-type=text%2Fplain" class="display-link">text</a>, <a href="pci_wb_tpram.v?annotate=1.4">annotated</a> - <a href="pci_wb_tpram.v?r1=1.4#rev1.4">select&nbsp;for&nbsp;diffs</a><br />
  470. <i>Thu Aug 19 15:27:34 2004 UTC</i> (2 years, 8 months ago) by <i>mihad</i><br />
  471. Branches: <a href="./pci_wb_tpram.v?only_with_tag=MAIN">MAIN</a><br />
  472. CVS tags: <a href="./pci_wb_tpram.v?only_with_tag=HEAD">HEAD</a><br />
  473. <pre class="log">
  474. Changed minimum pci image size to 256 bytes because
  475. of some PC system problems with size of IO images.
  476. </pre>
  477. </div>
  478. <hr /><pre>
  479. //////////////////////////////////////////////////////////////////////
  480. ////                                                              ////
  481. ////  Generic Two-Port Synchronous RAM                            ////
  482. ////                                                              ////
  483. ////  This file is part of pci bridge project                     ////
  484. ////  http://www.opencores.org/cvsweb.shtml/pci/                  ////
  485. ////                                                              ////
  486. ////  Description                                                 ////
  487. ////  This block is a wrapper with common two-port                ////
  488. ////  synchronous memory interface for different                  ////
  489. ////  types of ASIC and FPGA RAMs. Beside universal memory        ////
  490. ////  interface it also provides behavioral model of generic      ////
  491. ////  two-port synchronous RAM.                                   ////
  492. ////  It should be used in all OPENCORES designs that want to be  ////
  493. ////  portable accross different target technologies and          ////
  494. ////  independent of target memory.                               ////
  495. ////                                                              ////
  496. ////  Supported ASIC RAMs are:                                    ////
  497. ////  - Artisan Double-Port Sync RAM                              ////
  498. ////  - Avant! Two-Port Sync RAM (*)                              ////
  499. ////  - Virage 2-port Sync RAM                                    ////
  500. ////                                                              ////
  501. ////  Supported FPGA RAMs are:                                    ////
  502. ////  - Xilinx Virtex RAMB4_S16_S16                               ////
  503. ////                                                              ////
  504. ////  To Do:                                                      ////
  505. ////   - fix Avant!                                               ////
  506. ////   - xilinx rams need external tri-state logic                ////
  507. ////   - add additional RAMs (Altera, VS etc)                     ////
  508. ////                                                              ////
  509. ////  Author(s):                                                  ////
  510. ////      - Damjan Lampret, lampret@opencores.org                 ////
  511. ////      - Miha Dolenc, mihad@opencores.org                      ////
  512. ////                                                              ////
  513. //////////////////////////////////////////////////////////////////////
  514. ////                                                              ////
  515. //// Copyright (C) 2000 Authors and OPENCORES.ORG                 ////
  516. ////                                                              ////
  517. //// This source file may be used and distributed without         ////
  518. //// restriction provided that this copyright statement is not    ////
  519. //// removed from the file and that any derivative work contains  ////
  520. //// the original copyright notice and the associated disclaimer. ////
  521. ////                                                              ////
  522. //// This source file is free software; you can redistribute it   ////
  523. //// and/or modify it under the terms of the GNU Lesser General   ////
  524. //// Public License as published by the Free Software Foundation; ////
  525. //// either version 2.1 of the License, or (at your option) any   ////
  526. //// later version.                                               ////
  527. ////                                                              ////
  528. //// This source is distributed in the hope that it will be       ////
  529. //// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
  530. //// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
  531. //// PURPOSE.  See the GNU Lesser General Public License for more ////
  532. //// details.                                                     ////
  533. ////                                                              ////
  534. //// You should have received a copy of the GNU Lesser General    ////
  535. //// Public License along with this source; if not, download it   ////
  536. //// from http://www.opencores.org/lgpl.shtml                     ////
  537. ////                                                              ////
  538. //////////////////////////////////////////////////////////////////////
  539. //
  540. // CVS Revision History
  541. //
  542. // $Log: pci_wb_tpram.v,v $
  543. // Revision 1.4  2004/08/19 15:27:34  mihad
  544. // Changed minimum pci image size to 256 bytes because
  545. // of some PC system problems with size of IO images.
  546. //
  547. // Revision 1.3  2003/10/17 09:11:52  markom
  548. // mbist signals updated according to newest convention
  549. //
  550. // Revision 1.2  2003/08/14 13:06:03  simons
  551. // synchronizer_flop replaced with pci_synchronizer_flop, artisan ram instance updated.
  552. //
  553. // Revision 1.1  2003/01/27 16:49:31  mihad
  554. // Changed module and file names. Updated scripts accordingly. FIFO synchronizations changed.
  555. //
  556. // Revision 1.7  2002/10/18 03:36:37  tadejm
  557. // Changed wrong signal name mbist_sen into mbist_ctrl_i.
  558. //
  559. // Revision 1.6  2002/10/17 22:49:22  tadejm
  560. // Changed BIST signals for RAMs.
  561. //
  562. // Revision 1.5  2002/10/11 10:09:01  mihad
  563. // Added additional testcase and changed rst name in BIST to trst
  564. //
  565. // Revision 1.4  2002/10/08 17:17:06  mihad
  566. // Added BIST signals for RAMs.
  567. //
  568. // Revision 1.3  2002/09/30 17:22:27  mihad
  569. // Added support for Virtual Silicon two port RAM. Didn't run regression on it yet!
  570. //
  571. // Revision 1.2  2002/08/19 16:51:36  mihad
  572. // Extracted distributed RAM module from wb/pci_tpram.v to its own file, got rid of undef directives
  573. //
  574. // Revision 1.1  2002/02/01 14:43:31  mihad
  575. // *** empty log message ***
  576. //
  577. //
  578. // synopsys translate_off
  579. `include &quot;timescale.v&quot;
  580. // synopsys translate_on
  581. `include &quot;pci_constants.v&quot;
  582. module pci_wb_tpram
  583. (
  584. // Generic synchronous two-port RAM interface
  585. clk_a,
  586.     rst_a,
  587.     ce_a,
  588.     we_a,
  589.     oe_a,
  590.     addr_a,
  591.     di_a,
  592.     do_a,
  593. clk_b,
  594.     rst_b,
  595.     ce_b,
  596.     we_b,
  597.     oe_b,
  598.     addr_b,
  599.     di_b,
  600.     do_b
  601. `ifdef PCI_BIST
  602.     ,
  603.     // debug chain signals
  604.     mbist_si_i,       // bist scan serial in
  605.     mbist_so_o,       // bist scan serial out
  606.     mbist_ctrl_i        // bist chain shift control
  607. `endif
  608. );
  609. //
  610. // Default address and data buses width
  611. //
  612. parameter aw = 8;
  613. parameter dw = 40;
  614. //
  615. // Generic synchronous two-port RAM interface
  616. //
  617. input clk_a; // Clock
  618. input rst_a; // Reset
  619. input ce_a; // Chip enable input
  620. input we_a; // Write enable input
  621. input oe_a; // Output enable input
  622. input  [aw-1:0] addr_a; // address bus inputs
  623. input [dw-1:0] di_a; // input data bus
  624. output [dw-1:0] do_a; // output data bus
  625. input clk_b; // Clock
  626. input rst_b; // Reset
  627. input ce_b; // Chip enable input
  628. input we_b; // Write enable input
  629. input oe_b; // Output enable input
  630. input  [aw-1:0] addr_b; // address bus inputs
  631. input [dw-1:0] di_b; // input data bus
  632. output [dw-1:0] do_b; // output data bus
  633. `ifdef PCI_BIST
  634. // debug chain signals
  635. input   mbist_si_i;       // bist scan serial in
  636. output  mbist_so_o;       // bist scan serial out
  637. input [`PCI_MBIST_CTRL_WIDTH - 1:0] mbist_ctrl_i;       // bist chain shift control
  638. `endif
  639. //
  640. // Internal wires and registers
  641. //
  642. `ifdef WB_VS_STP
  643.     `define PCI_WB_RAM_SELECTED
  644.     `ifdef PCI_BIST
  645.         vs_hdtp_64x40_bist i_vs_hdtp_64x40_bist
  646.     `else
  647.         vs_hdtp_64x40 i_vs_hdtp_64x40
  648.     `endif
  649.         (
  650.             .RCK        (clk_b),
  651.             .WCK        (clk_a),
  652.             .RADR       (addr_b),
  653.             .WADR       (addr_a),
  654.             .DI         (di_a),
  655.             .DOUT       (do_b),
  656.             .REN        (1'b0),
  657.             .WEN        (!we_a)
  658.         `ifdef PCI_BIST
  659.             ,
  660.             // debug chain signals
  661.             .mbist_si_i   (mbist_si_i),
  662.             .mbist_so_o   (mbist_so_o),
  663.             .mbist_ctrl_i   (mbist_ctrl_i)
  664.         `endif
  665.         );
  666.     
  667.     assign do_a = 0 ;
  668. `endif
  669. `ifdef WB_ARTISAN_SDP
  670.     `define PCI_WB_RAM_SELECTED
  671.     //
  672.     // Instantiation of ASIC memory:
  673.     //
  674.     // Artisan Synchronous Double-Port RAM (ra2sh)
  675.     //
  676.     `ifdef PCI_BIST
  677.         art_hsdp_64x40_bist /*#(dw, 1&lt;&lt;aw, aw) */ artisan_sdp
  678.         (
  679.          .QA(do_a),
  680.          .CLKA(clk_a),
  681.          .CENA(~ce_a),
  682.          .WENA(~we_a),
  683.          .AA(addr_a),
  684.          .DA(di_a),
  685.          .OENA(~oe_a),
  686.          .QB(do_b),
  687.          .CLKB(clk_b),
  688.          .CENB(~ce_b),
  689.          .WENB(~we_b),
  690.          .AB(addr_b),
  691.          .DB(di_b),
  692.          .OENB(~oe_b),
  693.           .mbist_si_i   (mbist_si_i),
  694.           .mbist_so_o   (mbist_so_o),
  695.           .mbist_ctrl_i   (mbist_ctrl_i)
  696.         );
  697.     `else
  698.         art_hsdp_64x40 /*#(dw, 1&lt;&lt;aw, aw) */ artisan_sdp
  699.         (
  700.          .QA(do_a),
  701.          .CLKA(clk_a),
  702.          .CENA(~ce_a),
  703.          .WENA(~we_a),
  704.          .AA(addr_a),
  705.          .DA(di_a),
  706.          .OENA(~oe_a),
  707.          .QB(do_b),
  708.          .CLKB(clk_b),
  709.          .CENB(~ce_b),
  710.          .WENB(~we_b),
  711.          .AB(addr_b),
  712.          .DB(di_b),
  713.          .OENB(~oe_b)
  714.         );
  715.     `endif
  716. `endif
  717. `ifdef AVANT_ATP
  718.     `define PCI_WB_RAM_SELECTED
  719.     //
  720.     // Instantiation of ASIC memory:
  721.     //
  722.     // Avant! Asynchronous Two-Port RAM
  723.     //
  724.     avant_atp avant_atp(
  725.      .web(~we),
  726.      .reb(),
  727.      .oeb(~oe),
  728.      .rcsb(),
  729.      .wcsb(),
  730.      .ra(addr),
  731.      .wa(addr),
  732.      .di(di),
  733.      .do(do)
  734.     );
  735. `endif
  736. `ifdef VIRAGE_STP
  737.     `define PCI_WB_RAM_SELECTED
  738.     //
  739.     // Instantiation of ASIC memory:
  740.     //
  741.     // Virage Synchronous 2-port R/W RAM
  742.     //
  743.     virage_stp virage_stp(
  744.      .QA(do_a),
  745.      .QB(do_b),
  746.      .ADRA(addr_a),
  747.      .DA(di_a),
  748.      .WEA(we_a),
  749.      .OEA(oe_a),
  750.      .MEA(ce_a),
  751.      .CLKA(clk_a),
  752.      .ADRB(adr_b),
  753.      .DB(di_b),
  754.      .WEB(we_b),
  755.      .OEB(oe_b),
  756.      .MEB(ce_b),
  757.      .CLKB(clk_b)
  758.     );
  759. `endif
  760. `ifdef WB_XILINX_DIST_RAM
  761.     `define PCI_WB_RAM_SELECTED
  762.     reg [(aw-1):0] out_address ;
  763.     always@(posedge clk_b or posedge rst_b)
  764.     begin
  765.         if ( rst_b )
  766.             out_address &lt;= #1 0 ;
  767.         else if (ce_b)
  768.             out_address &lt;= #1 addr_b ;
  769.     end
  770.     pci_ram_16x40d #(aw) wb_distributed_ram
  771.     (
  772.         .data_out       (do_b),
  773.         .we             (we_a),
  774.         .data_in        (di_a),
  775.         .read_address   (out_address),
  776.         .write_address  (addr_a),
  777.         .wclk           (clk_a)
  778.     );
  779.     assign do_a = 0 ;
  780. `endif
  781. `ifdef WB_XILINX_RAMB4
  782.     `define PCI_WB_RAM_SELECTED
  783.     //
  784.     // Instantiation of FPGA memory:
  785.     //
  786.     // Virtex/Spartan2
  787.     //
  788.     //
  789.     // Block 0
  790.     //
  791.     RAMB4_S16_S16 ramb4_s16_s16_0(
  792.      .CLKA(clk_a),
  793.      .RSTA(rst_a),
  794.      .ADDRA(addr_a),
  795.      .DIA(di_a[15:0]),
  796.      .ENA(ce_a),
  797.      .WEA(we_a),
  798.      .DOA(do_a[15:0]),
  799.      .CLKB(clk_b),
  800.      .RSTB(rst_b),
  801.      .ADDRB(addr_b),
  802.      .DIB(di_b[15:0]),
  803.      .ENB(ce_b),
  804.      .WEB(we_b),
  805.      .DOB(do_b[15:0])
  806.     );
  807.     //
  808.     // Block 1
  809.     //
  810.     RAMB4_S16_S16 ramb4_s16_s16_1(
  811.      .CLKA(clk_a),
  812.      .RSTA(rst_a),
  813.      .ADDRA(addr_a),
  814.      .DIA(di_a[31:16]),
  815.      .ENA(ce_a),
  816.      .WEA(we_a),
  817.      .DOA(do_a[31:16]),
  818.      .CLKB(clk_b),
  819.      .RSTB(rst_b),
  820.      .ADDRB(addr_b),
  821.      .DIB(di_b[31:16]),
  822.      .ENB(ce_b),
  823.      .WEB(we_b),
  824.      .DOB(do_b[31:16])
  825.     );
  826.     //
  827.     // Block 2
  828.     //
  829.     // block ram2 wires - non generic width of block rams
  830.     wire [15:0] blk2_di_a = {8'h00, di_a[39:32]} ;
  831.     wire [15:0] blk2_di_b = {8'h00, di_b[39:32]} ;
  832.     wire [15:0] blk2_do_a ;
  833.     wire [15:0] blk2_do_b ;
  834.     assign do_a[39:32] = blk2_do_a[7:0] ;
  835.     assign do_b[39:32] = blk2_do_b[7:0] ;
  836.     RAMB4_S16_S16 ramb4_s16_s16_2(
  837.             .CLKA(clk_a),
  838.             .RSTA(rst_a),
  839.             .ADDRA(addr_a),
  840.             .DIA(blk2_di_a),
  841.             .ENA(ce_a),
  842.             .WEA(we_a),
  843.             .DOA(blk2_do_a),
  844.             .CLKB(clk_b),
  845.             .RSTB(rst_b),
  846.             .ADDRB(addr_b),
  847.             .DIB(blk2_di_b),
  848.             .ENB(ce_b),
  849.             .WEB(we_b),
  850.             .DOB(blk2_do_b)
  851.     );
  852. `endif
  853. `ifdef PCI_WB_RAM_SELECTED
  854. `else
  855.     //
  856.     // Generic two-port synchronous RAM model
  857.     //
  858.     //
  859.     // Generic RAM's registers and wires
  860.     //
  861.     reg [dw-1:0] mem [(1&lt;&lt;aw)-1:0]; // RAM content
  862.     reg [dw-1:0] do_reg_b; // RAM data output register
  863.     //
  864.     // Data output drivers
  865.     //
  866.     assign do_a = {dw{1'b0}}    ;
  867.     assign do_b = do_reg_b      ;
  868.     //
  869.     // RAM read and write
  870.     //
  871.     always @(posedge clk_a)
  872.      if (ce_a &amp;&amp; we_a)
  873.      mem[addr_a] &lt;= #1 di_a;
  874.     //
  875.     // RAM read and write
  876.     //
  877.     always @(posedge clk_b)
  878.      if (ce_b)
  879.      do_reg_b &lt;= #1 mem[addr_b];
  880. `endif
  881. // synopsys translate_off
  882. initial
  883. begin
  884.     if (dw !== 40)
  885.     begin
  886.         $display(&quot;RAM instantiation error! Expected RAM width %d, actual %h!&quot;, 40, dw) ;
  887.         $finish ;
  888.     end
  889.     `ifdef XILINX_RAMB4
  890.         if (aw !== 8)
  891.         begin
  892.             $display(&quot;RAM instantiation error! Expected RAM address width %d, actual %h!&quot;, 40, aw) ;
  893.             $finish ;
  894.         end
  895.     `endif
  896.     // currenlty only artisan ram of depth 256 is supported - they don't provide generic ram models
  897.     `ifdef ARTISAN_SDP
  898.         if (aw !== 8)
  899.         begin
  900.             $display(&quot;RAM instantiation error! Expected RAM address width %d, actual %h!&quot;, 40, aw) ;
  901.             $finish ;
  902.         end
  903.     `endif
  904. end
  905. // synopsys translate_on
  906. endmodule
  907. </pre>
  908. <hr />
  909. <address><span style="font-size: smaller">FreeBSD-CVSweb &lt;<a href="mailto:freebsd-cvsweb@FreeBSD.org">freebsd-cvsweb@FreeBSD.org</a>&gt;</span></address>
  910. </body>
  911. </html>
  912. <!-- pf_body_end -->
  913. </td>
  914. <td><img width=15 src="/images/dotty.gif"></td>
  915. </tr></table>
  916. <xcenter>
  917. <p>
  918. <table width=100% cellpadding=0 cellspacing=0 border=0>
  919.       <tr><td align=right valign=bottom><a title='Top' href='#top'><img border=0 alt='Top' src='/images/hr_up.gif'></a></td></tr>
  920.       <tr><td background='/images/hpd.gif'><img height=1 border=0 src='/images/dotty.gif'></td></tr><tr><td height=4><img height=4 src='/images/dotty.gif'></td></tr></table>
  921. &nbsp;
  922. <br>
  923. <!--
  924. <table border=0 cellpadding=0 cellspacing=1 bgcolor=#ffffff><tr><td>
  925. <table cellpadding=0 cellspacing=0 border=0 bgcolor=#ffffff><tr><td>
  926. //-->
  927. <script type="text/javascript"><!--
  928. google_ad_client = "pub-9285819221080148";
  929. google_alternate_color = "FFFFFF";
  930. google_ad_width = 728;
  931. google_ad_height = 90;
  932. google_ad_format = "728x90_as";
  933. google_ad_type = "text_image";
  934. google_ad_channel ="3034172958";
  935. google_color_border = "ffffff";
  936. google_color_bg = "ffffff";
  937. google_color_link = "444488";
  938. google_color_url = "b00000";
  939. google_color_text = "666666";
  940. //--></script>
  941. <script type="text/javascript"
  942.   src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
  943. </script>
  944. <!--
  945. </td></tr></table>
  946. </td></tr></table>
  947. //-->
  948. </center>
  949. <img border=0 src="/images/dotty.gif" height=1 width=400>
  950. <img border=0 src="/images/dotty.gif" height=1 width=30>
  951. <img border=0 src="/images/dotty.gif" height=1 width=30>
  952. <img border=0 src="/images/dotty.gif" height=1 width=30>
  953. <img border=0 src="/images/dotty.gif" height=1 width=30>
  954. <img border=0 src="/images/dotty.gif" height=1 width=30>
  955. <img border=0 src="/images/dotty.gif" height=1 width=30>
  956. <img border=0 src="/images/dotty.gif" height=1 width=30>
  957. <img border=0 src="/images/dotty.gif" height=1 width=30>
  958. <img border=0 src="/images/dotty.gif" height=1 width=30>
  959. <img border=0 src="/images/dotty.gif" height=1 width=30>
  960. <img border=0 src="/images/dotty.gif" height=1 width=30>
  961. <img border=0 src="/images/dotty.gif" height=1 width=30>
  962. <img border=0 src="/images/dotty.gif" height=1 width=30>
  963. <img border=0 src="/images/dotty.gif" height=1 width=30>
  964. <img border=0 src="/images/dotty.gif" height=1 width=30>
  965. <img border=0 src="/images/dotty.gif" height=1 width=30>
  966. <img border=0 src="/images/dotty.gif" height=1 width=30>
  967. <img border=0 src="/images/dotty.gif" height=1 width=30>
  968. <img border=0 src="/images/dotty.gif" height=1 width=30>
  969. <img border=0 src="/images/dotty.gif" height=1 width=30>
  970. <img border=0 src="/images/dotty.gif" height=1 width=30>
  971. <img border=0 src="/images/dotty.gif" height=1 width=30>
  972. <img border=0 src="/images/dotty.gif" height=1 width=30>
  973. <img border=0 src="/images/dotty.gif" height=1 width=30>
  974. </td></tr>
  975. </table>
  976. &nbsp;
  977. </td></tr>
  978. <tr bgcolor=#000000><td><img height=1 src="/images/dotty.gif"></td></tr>
  979. </table>
  980. <table background="/images/topbg.gif" width=100% cellpadding=0 cellspacing=0 border=0 bgcolor=#aaddff>
  981. <tr><td align=right>
  982. Copyright (c) 1999-2007 OPENCORES.ORG. All rights reserved. &nbsp;
  983. </td></tr>
  984. <tr><td>
  985. &nbsp;
  986. </td></tr>
  987. </table>
  988. </td>
  989. <td width=1 bgcolor=#000000><img width=1 src="/images/dotty.gif"></td>
  990. <td width=1 bgcolor=#f0f0c8><img width=1 src="/images/dotty.gif"></td>
  991. </tr></table>
  992. </center>
  993. <!-- pf_footer_start -->
  994.   </body>
  995. </html>
  996. <!-- pf_footer_end -->