【VHDL】

1.component(元件):元件可放在library内,供所有使用者多次调用。

元件声明:

component label is

port( port_name: signal_mode signal_type;...);

end component;

元件实例化:

label:component_name port map(port_list);

2.几种常见库:

use ieee.std_logic_unsigned.all 使得std_logic_vector类型的数据像unsigned类型一样操作。

use ieee.std_logic_arith.all 包括有符号数和无符号数的算术运算和比较运算。

3.信号与变量:

常量(默认值):constant const_name: type := value;

可在包、实体或结构体中声明。

信号(实际连线):signal name:type [range] [:= initial_value];

表示端口或内部连接。不能简单理解为某端口的电压,0、1、Z,一个信号对应一部分的触发和相应的动作。比如temp<=temp+1对应某个寄存器中数值加一。

变量(局部):variable name:type [range] [:= initial_value];

特点:立即赋值。综合时会生成额外的寄存器。

4. others => '0' 用于对数组中的各个元素赋值‘0’;others => NULL 用于某些语句(例如case语句)中的子句(例如when子句)不做任何赋值。

5.Example: Legal and illegal operations with std_logic_vector.

LIBRARY ieee;

USE ieee.std_logic_1164.all;    -- no extra package required

...

SIGNAL a: IN STD_LOGIC_VECTOR (7 DOWNTO 0);

SIGNAL b: IN STD_LOGIC_VECTOR (7 DOWNTO 0);

SIGNAL x: OUT STD_LOGIC_VECTOR (7 DOWNTO 0);

...

v <= a + b;      -- illegal (arithmetic operation not OK)

w <= a AND b;    -- legal (logical operation OK)

Despite the constraint mentioned above, there is a simple way of allowing data of

type STD_LOGIC_VECTOR to participate directly in arithmetic operations. For

that, theieeelibrary provides two packages,std_logic_signedandstd_logic_unsigned,

which allow operations with STD_LOGIC_VECTOR data to be performed as if the

data were of type SIGNED or UNSIGNED, respectively.

6.Description

The following error occurs in NGDBuild:

"Error: 432 - Logical block 'xxxx' with type 'xxx' is unexpanded."

Solution

NGDBuild issues this error when it cannot resolve all of the components/modules for the entire design.

For example, suppose you have an HDL design that instantiates black-box modules, and the module description for these black-boxes is contained in an EDIF file. If the EDIF file is not in the macro search path or the project directory, NGDBuild issues this error.

To avoid this problem, verify that the module description file has the correct name and is located in the macro search path or project directory.

你可能感兴趣的:(【VHDL】)