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. c# SQL事务

    SQL事务执行 SqlTransaction   sqlTransaction   =   sqlConnection.BeginTransaction();    SqlCommand   sqlC ...

  2. Java基础学习总结(71)——深入理解Java虚拟机内存

    Java虚拟机中的内存分配图 : 各个区域的特性总结如下表: 补充说明: 当多线程情形下,可能多个线程要在堆上分配内存,那么可能出现内存分配的同步问题,解决方案有两个,一个就是同步内存分配动作:另一个 ...

  3. [bzoj4530][Bjoi2014]大融合_LCT

    大融合 bzoj-4530 Bjoi-2014 题目大意:n个点,m个操作,支持:两点连边:查询两点负载:负载.边(x,y)的负载就是将(x,y)这条边断掉后能和x联通的点的数量乘以能和y联通的点的数 ...

  4. Spring MVC-表单(Form)标签-隐藏字段(Hidden Field)示例(转载实践)

    以下内容翻译自:https://www.tutorialspoint.com/springmvc/springmvc_hidden.htm 说明:示例基于Spring MVC 4.1.6. 以下示例显 ...

  5. firdac支持的序列和还原格式

    TFDStorageFormat = (sfAuto, sfXML, sfBinary, sfJSON); FIREDAC支持3种序列格式:XML,JSON和BIN.

  6. PHP array_chunk()

    定义和用法 array_chunk() 函数把一个数组分割为新的数组块. 其中每个数组的长度由参数 size 决定. 可选参数 preserve_key 是一个布尔值,它指定新数组是否使用原数组相同的 ...

  7. HDU 4524

    简单题,先从右边消起,注意结束时a[1]==0才能是yes #include <iostream> #include <cstdio> #include <cstring ...

  8. POJ 2947-Widget Factory(高斯消元解同余方程式)

    题目地址:id=2947">POJ 2947 题意:N种物品.M条记录,接写来M行,每行有K.Start,End,表述从星期Start到星期End,做了K件物品.接下来的K个数为物品的 ...

  9. 迭代器和iter()函数

    1.先来个样例,有个初步的印象: myTuple=(123,'xyz',45.67) i=iter(myTuple) i.next() 123 i.next() 'xyz' i.next() 45.6 ...

  10. iOS 推送证书的制作

    关于iOS推送证书的P12文件,并非直接从KeyChain导出来的证书文件.而是须要经过openSSL工具制作的.(好在Mac OS 默认就有openSSL命令) 针对不同的Server平台,须要的证 ...