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. JavaScript单元测试工具-Jest

    标注: 首先这并不是一篇完整的关于Jest的教程,只是个人在接触jest学习的一点随手笔记,大部分内容都是对官方文档的一些翻译. ----------------------------------- ...

  2. hadoop datanode usages方差算法

    stdDev 标准差(方差) 阐述及应用 简单来说,标准差是一组数值自平均值分散开来的程度的一种测量观念.一个较大的标准差,代表大部分的数值和其平均值之间差异较大:一个较小的标准差,代表这些数值较接近 ...

  3. Python之路【第一篇】:Python基础1

    本节内容 Python介绍 发展史 Python 2 or 3? 安装 Hello World程序 变量 用户输入 模块初识 .pyc是个什么鬼? 数据类型初识 数据运算 表达式if ...else语 ...

  4. 暑假集训D21总结

    考试 今天考了一大圈 不可做 题 本来是爆零的,后来把数据改了一下,成功暴力骗了5分= = 刷题 无限水题$ing$,然后就$GG$了 生活 不开心$ing$,没有啥好写的 今天就是莫名的不开心 歌 ...

  5. noip模拟赛 浮游大陆的68号岛

    题目描述 妖精仓库里生活着黄金妖精们,她们过着快乐,却随时准备着迎接死亡的生活. 换用更高尚的说法,是随时准备着为这个无药可救的世界献身. 然而孩子们的生活却总是无忧无虑的,幼体的黄金妖精们过着天真烂 ...

  6. 虚拟机+centOS挂载ISO步骤

    https://blog.csdn.net/u010612373/article/details/52240447

  7. [poj2417]Discrete Logging_BSGS

    Discrete Logging poj-2417 题目大意:求$a^x\equiv b(mod\qquad c)$ 注释:O(分块可过) 想法:介绍一种算法BSGS(Baby-Step Giant- ...

  8. SQLServer到底支持多少连接数的并发?

    1)不启用连接池 当创建到101个连接的时候,就无法再创建新连接了.也就是说,如果连接字符串不做任何处理,我们的程序只能够跟SQLServer建立101个连接. 2)启用连接池 在连接字符串中加入代码 ...

  9. php 数组 array()

    定义和用法 array() 创建数组,带有键和值.如果在创建数组时省略了键,则生成一个整数键,默认从 0 开始,然后以 1 进行递增. 用 array() 创建一个数组,可使用 => 来分隔键和 ...

  10. Java学习笔记之 IO包 字节流

    IO包最重要的五个类和一个接口 File/OutputStream/InputStream(字节流)/Writer/Reader(字符流) 一个接口:Serializable   File类: 字节流 ...