⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 spi_bitcounter_rtl.v

📁 verilog语言写的SPI接口,全同步设计,低门数,可以很容易应用到嵌入设计方案中.
💻 V
字号:
// HDLi Version 3.0d IP Bundle 1999.08.25
// Parameters: counter -b6 -t0 -p1 -f0 -L0 -C -c -R -S  -M   -l vsc983 -padlib vst8p31 -Synopsys -rtl -nentity -nadd_p -ntiming -nls -verilog -br 0,4,8,12,32,0  
// spi_bitcounter: 95.33 physical gates (vsc983)
// spi_bitcounter: 2471.99 squm area (vsc983)
// -----------------------------------------------------------------------------
//                            VLSI Technology, Inc.
// -----------------------------------------------------------------------------
// Copyright 1999 by VLSI Technology, Inc. All rights reserved.
// 
// This module is property of VLSI Technology, Inc (VLSI) and its use is
// granted to the customer for the sole purpose of implementing in silicon
// provided by VLSI. This module may only be used in accordance with the
// provisions of the Design Integrator License Agreement.
// 
// -----------------------------------------------------------------------------
//                          Counter Compiler Version 1.1b
// -----------------------------------------------------------------------------
// spi_bitcounter : RTL Verilog
// (RTL is optimized for simulation, not synthesis)
// "spi_bitcounter.v" contains the Structural Verilog
//
// Compiled by coste on Wed Oct 27 15:09:45 1999
// -----------------------------------------------------------------------------
module spi_bitcounter (
                       clk,
                       cdn,
                       csn,
                       cen,
                       maxval,
                       q,
                       tci);

   input        clk;
   input        cdn;
   input        csn;
   input        cen;
   input  [5:0] maxval;
   output [5:0] q;
   output       tci;


   parameter areset_value = 6'b000000;
   parameter sreset_value = 6'b000000;
   parameter minval = 6'b000000;

   reg [5:0] q;
   wire tci;

   always @(posedge clk or negedge cdn)
   begin
      if (~cdn)
         q <= areset_value;
      else if (~csn)
         q <= sreset_value;
      else if (cen)
         q <= ((q <= minval || q >= maxval) && &(q | ~maxval)) ? minval : (q+1);
   end

   assign tci = ((q <= minval || q>= maxval) && &(q | ~maxval));

endmodule // spi_bitcounter

// -----------------------------------------------------------------------------
// Verilog Component Instantiation:
// -----------------------------------------------------------------------------
/*
   spi_bitcounter u1 (.clk(),       // Clock Input
                      .cdn(),       // Clear Direct Not Input
                      .csn(),       // Clear Synchronous Not Input
                      .cen(),       // Count Enable Input
                      .maxval(),    // Programmable Maximum Count Value
                      .q(),         //  6 bit Result
                      .tci());      // Terminal Count Indicator

*/
// -----------------------------------------------------------------------------
// Verilog Synthesis Commands:
// -----------------------------------------------------------------------------
/*
   set_dont_touch find(design, spi_bitcounter, -hierarchy)
   remove_attribute find(design, spi_bitcounter, -hierarchy) dont_touch
   set_ungroup find(design, spi_bitcounter, -hierarchy)
*/
// -----------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -