标签: vhdl

VHDL:意外IF的问题

您好我正在尝试在xilinx ISE环境中学习VHDL,我无法使用此代码,我不知道为什么.我尝试使用/不使用ands的单引号,但没有任何作用.有人可以帮帮我吗?

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

---- Uncomment the following library declaration if instantiating
---- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;

entity teh_3 is
    Port ( thermo_input : in  STD_LOGIC_VECTOR(3 DOWNTO 0);
           too_hot : out  STD_LOGIC;
           too_cold : out  STD_LOGIC;
           just_right : out  STD_LOGIC);
end teh_3;

architecture Behavioral of teh_3 is

begin

IF thermo_input < "1000" THEN
  too_cold <='1' and
  too_hot <='0' and
  just_right <='0';
ELSIF thermo_input > "1011" THEN 
    too_hot <='1' …
Run Code Online (Sandbox Code Playgroud)

vhdl

0
推荐指数
1
解决办法
8590
查看次数

如何使用fpga取样?

我想把数字数据的样本外部提交给FPGA spartan 3.我想最初采用1000个样本/秒.如何在vhdl编码中选择时钟频率?

谢谢.

spartan fpga vhdl

0
推荐指数
1
解决办法
3091
查看次数

rising_edge 函数避免“锁存警告”?

有时我在 Xilinx ISE 中收到警告:

锁存器可能是由不完整的 case 或 if 语句生成的。我们不建议在 FPGA/CPLD 设计中使用锁存器,因为它们可能会导致时序问题。

但是如果我使用rising_edge()函数,那么即使我有不完整的情况,也不会发出警告,例如:

process (clk, rst)
begin   
    if (rst = '1') then
        test <= '0';
    elsif (rising_edge(clk)) then
        test <= '1';
    end if;
end process;
Run Code Online (Sandbox Code Playgroud)

那么为什么 FPGA 中的锁存器被认为是一种丑陋的设计呢?为什么使用rising_edge()函数可以避免这些警告?(事实上​​,我认为使用rising_edge()函数也会引入锁存器)

fpga vhdl

0
推荐指数
1
解决办法
586
查看次数

vhdl中的流程声明

我正在努力学习VHDL并努力学习它的一些基础知识.问题如下:

Process语句被描述为包含顺序运行的代码(一行接一行).我想问为什么不能在进程语句中运行并发代码(意味着所有行并行执行).其次,如果流程语句包含顺序代码,那么它如何建模,例如,三个触发器同时进行,例​​如,

- 内部流程声明

Q1 <= D1;
Q2 <= Q1;
Q3 <= Q2;
Run Code Online (Sandbox Code Playgroud)

vhdl hardware-programming

0
推荐指数
1
解决办法
808
查看次数

在端口映射中使用when...else语句

我在端口映射中找不到有关使用when...else 语句的任何内容。这似乎是正确的形式,但当我编译时,我看到这样的错误:

错误 (10500):Device.vhd(68) 文本“when”附近的 VHDL 语法错误;期待“)”或“,”

这可能是一个愚蠢的错误,因为我对 vhdl 还很陌生。你能给我一个提示吗?我将非常感谢任何帮助。这是代码,SDA端口是inout类型:

com : I2C_com port map (

             reset_en => reset_en,
             I2C_clock_port => SCL,
             clk => clk,
             sda_read_data <= SDA when RD ='1' else 'Z',
             sda_write_data => SDA 
        );
Run Code Online (Sandbox Code Playgroud)

fpga vhdl

0
推荐指数
1
解决办法
1719
查看次数

读取FPGA中的文件

在开始之前,请注意我对 FPGA 完全陌生。我想知道是否可以在FPGA中存储文件(*.txt或*.csv)并逐行读取它(即文件I/O操作)。请告诉我。任何帮助,将不胜感激。

我将使用 VHDL 进行编码,并可能使用 Xilinx XUPV5 LX110T 板。

fpga vhdl xilinx

0
推荐指数
1
解决办法
3708
查看次数

std_logic 到整数的转换

我想将我的 sys-clock (std_logic) 转换为整数值 (sys_clk)。因此我使用以下库:

library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;

-- code example 
sys_clk         : INTEGER;
clk_clk         : in  std_logic;
Run Code Online (Sandbox Code Playgroud)

如何将 clk_clk 转换为我的 sys_clk?

谢谢

integer type-conversion vhdl

0
推荐指数
1
解决办法
1万
查看次数

无法将字符串[]转换为vhdl中的字符串

我正在vhdl中编写代码并遇到此错误

 Assignment target incompatible with right side. Cannot convert 'dataArray' to 'STRING'
Run Code Online (Sandbox Code Playgroud)

这是我的代码

 entity instructionTranslator is
    port(clk :in std_logic;
    instructionCode :in std_logic_vector(4 downto 0);
    instructionType:out std_logic_vector(1 downto 0) ;
    data :out string (1 to 1)--here is data
    );  
end instructionTranslator;
               .
               .
               .
architecture  Translator of instructionTranslator is    
    type dataArray is array (0 to 13)of string(1 to 1);

    process(clk) begin
      data<=dataArray(1);
Run Code Online (Sandbox Code Playgroud)

应该如何在vhdl中选择数组的特殊索引.

arrays string vhdl

0
推荐指数
1
解决办法
100
查看次数

在VHDL中注册地图实现

在我的设计中,我试图创建一个寄存器映射,可以由单独的组件灵活地使用它。例如,假设我创建了以下寄存器映射类型:

package regmap_package is

    type regmap_t is array(natural range <>) of std_logic_vector(7 downto 0);

end package regmap_package;
Run Code Online (Sandbox Code Playgroud)

因此,这将是我的寄存器映射,其中包含x个8位寄存器。然后在我的顶级实体中声明寄存器映射的总大小:

signal regs : regmap_t(0 to 15);
Run Code Online (Sandbox Code Playgroud)

因此,在此示例中,我将具有16 x 8位寄存器映射。我的问题来了:假设我要创建一些子组件。每个组件仅需要这些寄存器的一部分即可进行操作。

例如,component1需要从地址0到地址7的寄存器,而component 2则需要从地址8到地址15的寄存器。该组件的实体声明如何,以及如何将整个寄存器数组的一部分传递给它?这些组件是否将根据自己的本地寻址方案(每个从0到7)运行?

arrays vhdl

0
推荐指数
1
解决办法
479
查看次数

VHDL _ TO_INTEGER

我对 VHDL 中的一个问题感到困惑。

我做了一个VGA_display_ characters,所以我想std_logic_vectors通过to_integer无符号将一些转换为整数,然后我想恢复,这样我就不能同时使用这些库了。

ieee.std_logic_arith.allieee.numeric_std.all quartus 给出的错误:

(错误(10621):interface.vhd(34)处的VHDL使用条款错误:不止一个使用条款导入了一个简单名称“无符号”的声明——没有一个声明是直接可见的错误(10784):syn_arit处的HDL错误.vhd(26):请参阅我的代码下方的对象“无符号”声明:

to_整数

conv_std_logic_vector

vhdl vga quartus

0
推荐指数
1
解决办法
4363
查看次数