我应该如何在测试平台中创建时钟?我已经找到了一个答案,但是有关堆栈溢出的其他人已经建议有其他或更好的方法来实现这一点:
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY test_tb IS
END test_tb;
ARCHITECTURE behavior OF test_tb IS
COMPONENT test
PORT(clk : IN std_logic;)
END COMPONENT;
signal clk : std_logic := '0';
constant clk_period : time := 1 ns;
BEGIN
uut: test PORT MAP (clk => clk);
-- Clock process definitions( clock with 50% duty cycle is generated here.
clk_process :process
begin
clk <= '0';
wait for clk_period/2; --for 0.5 ns signal is '0'.
clk <= '1';
wait for clk_period/2; --for next 0.5 …Run Code Online (Sandbox Code Playgroud) 在一个过程中,我有这样的事情:
CASE res IS
WHEN "00" => Y <= A;
WHEN "01" => Y <= A;
WHEN "10" => Y <= B;
WHEN "11" => Y <= C;
WHEN OTHERS => Y <= 'X';
END CASE;
Run Code Online (Sandbox Code Playgroud)
注意这种情况"00"并"01"获得相同的值.是否有类似的正确语法
WHEN "00", "01" => ?
额外注意:除了改变Y之外,还有更多内容,我只是为了简单起见而使用它.所以案例/何时是必要的.
LLVM非常模块化,允许您相当容易地定义新的后端.但是,有关创建LLVM后端的大多数文档/教程都侧重于添加新的处理器指令集和寄存器.我想知道为LLVM创建VHDL后端需要什么?是否有使用LLVM从一种更高级语言转到另一种语言的示例?
只是为了澄清:有没有将LLVM IR翻译成更高级语言而不是汇编语言的例子?例如:您可以使用Clang在C中读取,使用LLVM进行一些优化,然后使用其他语言(如Java或Fortran)编写代码.
我有一个矢量 signal tmp : std_logic_vector(15 downto 0)
我必须把它移到n位的左边或右边.我怎么才能实现这个操作.我想连接操作,但我不知道如何使用它.
我在做类似的事情时遇到了麻烦
b(0 to 7) <= a(7 downto 0)
Run Code Online (Sandbox Code Playgroud)
当我用ghdl编译它时,我有一个订单错误.我发现使电路工作的唯一方法如下:
library ieee;
use ieee.std_logic_1164.all;
entity reverser is
port(
a: in std_logic_vector(7 downto 0);
y: out std_logic_vector(7 downto 0);
rev: in std_logic
);
end reverser;
architecture rtl of reverser is
signal b: std_logic_vector (7 downto 0);
begin
b(7) <= a(0);
b(6) <= a(1);
b(5) <= a(2);
b(4) <= a(3);
b(3) <= a(4);
b(2) <= a(5);
b(1) <= a(6);
b(0) <= a(7);
y <= b when rev = '1' else a;
end rtl; …Run Code Online (Sandbox Code Playgroud) 我想要一个简单的模块,添加两个std_logic_vectors.但是,当使用下面的代码和+运算符时,它不会合成.
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
entity add_module is
port(
pr_in1 : in std_logic_vector(31 downto 0);
pr_in2 : in std_logic_vector(31 downto 0);
pr_out : out std_logic_vector(31 downto 0)
);
end add_module;
architecture Behavior of add_module is
begin
pr_out <= pr_in1 + pr_in2;
end architecture Behavior;
Run Code Online (Sandbox Code Playgroud)
我从XST得到的错误消息
第17行.+在这种情况下不能有这样的操作数.
我想念图书馆吗?如果可能,我不想将输入转换为自然数.
非常感谢
我不确定我是否理解vhdl中'downto'与'to'之间的区别.
我已经看过一些在线解释,但我仍然认为我不理解.任何人都可以为我安排好吗?
任何人都知道编程VHDL的良好环境并使用Linux模拟它(无论是Xilinx还是Altera)?
多年来,我参与了许多基于微控制器的项目; 主要使用Microchip的PIC.我已经使用过各种微控制器模拟器,虽然它们有时会非常有用,但我常常感到很沮丧.在现实生活中,微控制器从不存在,固件的行为取决于环境.但是,我使用过的sims都没有为微控制器以外的任何东西提供良好的支持.
我的第一个想法是在Verilog中对整个电路板进行建模.但是,我宁愿不创建一个完整的CPU模型,而且我没有太多运气找到我使用的芯片的现有模型.无论如何,我真的不需要或者想要在这个细节级别模拟proc,我想保留常规处理器sim提供的调试工具.
在我看来,理想的解决方案是混合模拟器,它将传统的处理器模拟器与Verilog模型连接起来.
这样的事情存在吗?
我正在尝试根据此链接实现3阶段MD5管道.特别是第31页的算法.还有另一个描述数据转发的文档.MD5算法在RFC1321中描述.这是在FPGA中完成的(Terasic DE2-115).这个项目中没有原理图,只有VHDL代码
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity md5core is
port (
CLOCK_50 : in std_logic;
SW : in std_logic_vector(17 downto 17)
);
end entity md5core;
architecture md5core_rtl of md5core is
type r_array is array(0 to 64) of std_logic_vector(7 downto 0);
constant R : r_array := ( x"07", x"0c", x"11", x"16", x"07", x"0c", x"11", x"16", x"07", x"0c", x"11", x"16", x"07", x"0c", x"11",
x"16", x"05", x"09", x"0e", x"14", x"05", x"09", x"0e", x"14", x"05", x"09", …Run Code Online (Sandbox Code Playgroud) vhdl ×10
fpga ×2
case ×1
clock ×1
intel-fpga ×1
linux ×1
llvm ×1
md5 ×1
pipelining ×1
simulation ×1
simulator ×1
verilog ×1
xilinx ×1