Jan 17

Tip - 同时更改所有IO管脚的电平标准 不指定

RickySu , 10:54 , 技术经验 , 评论(1) , 引用(0) , 阅读(1977) , Via 本站原创 | |
要更改所有IO Pin的IO Standard,可以打开PACE,选择所有管脚(通过shift或ctrl键多选),按右键,Create Constraints,然后自己选需要的吧:)
Tags: ,
nc
2007/03/28 22:52
今天看ac97控制器的hdl,发现用natural类型的subtype在一个逻辑相量中寻3bit出来作地址译码,语法诡异,编了一个简单程序,验证果然如此,每见那本书上是这么用的。

--------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;


entity endian_2 is

end endian_2;

architecture Behavioral of endian_2 is

constant C_OPB_AWIDTH : integer := 32;
signal temp1 : std_logic_vector(31 downto 0) := x"9999_9999"; --1001,1001,...
signal temp2  : std_logic_vector(0 to 31) := x"5555_5555";  --...,0101,0101
signal result1 : std_logic_vector(2 downto 0);
signal result2 : std_logic_vector(2 downto 0);

subtype  ADDR_CHK1 is natural range C_OPB_AWIDTH-3 downto C_OPB_AWIDTH-5;  --29,28,27 bit
subtype  ADDR_CHK2 is natural range C_OPB_AWIDTH-5 to C_OPB_AWIDTH-3;  --27,28,29
bit

begin

  result1 <= temp1(ADDR_CHK1);--should be 01,1
  result2 <= temp2(ADDR_CHK2);--should be 1,01

end Behavioral;
RickySu 回复于 2007/04/06 10:15
natural是integer的一个子集

subtype natural is integer range 0 to integer'high; --(2^31 - 1)
subtype positive is integer range 1 to integer'high; --(2^31 - 1)
分页: 1/1 第一页 1 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]