GENERATE

  It is another concurrent statement (along with operators and WHEN). It is equivalent to the sequential statement LOOP in the sense that it

allows a section of code to be repeated a number of times, thus creating several instances of the same assignments.

  1)  FOR / GENERATE: notice that GENERATE must be labeled.

label: FOR identifier IN range GENERATE
  (concurrent assignments)
END GENERATE;

  2)  IF/GENERATE

  An irregular form is also available, which uses IF/GENERATE (with an IF equivalent; recall that originally IF is a sequential statement). Here ELSE is not allowed.  

label1: FOR identifier IN range GENERATE
  ...
label2: IF condition GENERATE
  (concurrent assignments)
END GENERATE;
...
END GENERATE;

Example 1

SIGNAL x: BIT_VECTOR ( DOWNTO );
SIGNAL y: BIT_VECTOR ( DOWNTO );
SIGNAL z: BIT_VECTOR ( DOWNTO );
...
G1: FOR i IN x'RANGE GENERATE
  z(i) <= x(i) AND y(i+);
END GENERATE;

Example 2  Vector Shifter

  The output vector must be a shifted version of the input vector, with twice its width and an amount of shift specified by another input.

For example, if the input bus has width 4, and the present value is ‘‘1111’’, then the output should be one of the lines of the following

matrix (the original vector is underscored):

  row(0): 0 0 0 0 1 1 1 1

  row(1): 0 0 0 1 1 1 1 0

  row(2): 0 0 1 1 1 1 0 0

  row(3): 0 1 1 1 1 0 0 0

  row(4): 1 1 1 1 0 0 0 0

 ------------------------------------------------
LIBRARY ieee;
USE ieee.std_logic_1164.all;
------------------------------------------------
ENTITY shifter IS
PORT ( inp: IN STD_LOGIC_VECTOR ( DOWNTO );
    sel: IN INTEGER RANGE TO ;
    outp: OUT STD_LOGIC_VECTOR ( DOWNTO ));
END shifter;
------------------------------------------------
ARCHITECTURE shifter OF shifter IS
  SUBTYPE vector IS STD_LOGIC_VECTOR ( DOWNTO );
  TYPE matrix IS ARRAY ( DOWNTO ) OF vector;
  SIGNAL row: matrix;
BEGIN
  row() <= "" & inp;
  G1: FOR i IN TO GENERATE
    row(i) <= row(i-)( DOWNTO ) & '';
  END GENERATE;
  outp <= row(sel);
END shifter;
------------------------------------------------

VHDL之concurrent之generate的更多相关文章

  1. VHDL之concurrent之when

    WHEN (simple and selected) It is one of the fundamental concurrent statements (along with operators ...

  2. VHDL之concurrent之block

    1 Simple BLOCK The simple block represents only a way of partitioning the code. It allows concurrent ...

  3. VHDL之concurrent之operators

    Using operators Operators can be used to implement any combinational circuit. However, as will becom ...

  4. Concurrent.Thread.js

    (function(){ if ( !this.Data || (typeof this.Data != 'object' && typeof this.Data != 'functi ...

  5. how to forget about delta cycles for RTL design

    A delta cycle is a VHDL construct used to makeVHDL, a concurrent language, executable on asequential ...

  6. Oracle E-Business Suite Maintenance Guide Release 12.2(Patching Procedures)

    更多内容参考: http://docs.oracle.com/cd/E51111_01/current/acrobat/122ebsmt.zip Preparing for Patching For ...

  7. How to measure IOPS for VMware

    http://blog.synology.com/blog/?p=2225 Executive SummaryThis article, intended towards IT Professiona ...

  8. Generate PDF in Sourcing through concurrent request,在EBS java并发中调用指定am的方法

    package oracle.apps.pon.printing.cp; import java.io.InputStream; import java.io.FileOutputStream; im ...

  9. VHDL基础1

    Description Structure 一个可综合的VHDL描述中一般由3部分组成:LIBRARY declarations.ENTITY.ARCHITECTURE Library(库)用来设计重 ...

随机推荐

  1. 第七节:numpy之矩阵及特殊矩阵的创建

  2. C#反射获取数据库字段

    static string sqlselect = "insert into {0}({1}) values ({2})"; (这个方法可以适用于任何数据库的插入语句) publi ...

  3. static 语句块

    static{}(即static块),会在类被加载的时候执行且仅会被执行一次,一般用来初始化静态变量和调用静态方法,下面我们详细的讨论一下该语句块的特性及应用. 一.在程序的一次执行过程中,stati ...

  4. P1331 海战 洛谷

    题目描述 在峰会期间,武装部队得处于高度戒备.警察将监视每一条大街,军队将保卫建筑物,领空将布满了F-2003飞机.此外,巡洋船只和舰队将被派去保护海岸线.不幸的是因为种种原因,国防海军部仅有很少的几 ...

  5. PHP中echo和print的区别

    这篇文章主要介绍了PHP中echo和print的区别,针对二者使用中常见的用法区别进行了较为深入的总结与分析,需要的朋友可以参考下 一般来说,PHP中动态输出HTML内容,是通过print 和 ech ...

  6. N天学习一个linux命令之du

    用途 统计文件或者目录占用硬盘空间大小 用法 du [OPTION] [FILE]du [OPTION] --files0-from=F 常用参数 -a, --all统计所有文件,不仅仅是目录 -b, ...

  7. 使用Keras编写GAN的入门

    使用Keras编写GAN的入门 GAN Time: 2017-5-31 前言 代码 reference 前言 主要参考了网页[1]的教程,同时主要算法来自Ian J. Goodfellow 的论文,算 ...

  8. android.os.TransactionTooLargeException

    android.os.TransactionTooLargeException 今天开发过程共遇到问题,后台要反回一些表格,不是单纯的数据.就是有一些html标签的东西.错误的思路: 我得到数据后通过 ...

  9. Win8.1下COCOS2D-X 3.4环境搭建

     Cocos2dx_3.4开发环境搭建,并编译成APK 第一步:须要下载的:(windows64位系统下环境搭建) Ant   apache-ant-1.9.4-bin.zip NDK   and ...

  10. 技术总结--android篇(四)--工具类总结

    StringUtil(视个人须要进行加入) public class StringUtil { public static boolean isMail(String string) { if (nu ...