我是VHDL/FPGA编程的初学者.我想比较两个32位std_logic_vector的.我目前正在使用:
if ( RX_FRAME(to_integer(s_data_counter)).Data /= REF_FRAME(to_integer(s_data_counter)).Data ) then
s_bad_frame <= '1';
state <= DONE;
end if;
Run Code Online (Sandbox Code Playgroud)
这里RX_FRAME和REF_FRAME是2个的阵列std_logic_vector(31 downto 0)
我想知道综合工具如何转化/=为硬件.是否可以使用它?或者我应该做一个XOR有关的向量并检查结果向量对零?如果我执行XOR并检查零,是否会增加所需的硬件数量?我使用的是Vivado Design Suite 2015.3.
综合完成后,我会收到许多文件,如 .fw、.mcs、.prm 和 .bit 文件,我们可以将 .bit 文件以外的其他文件转储到 FPGA 中吗?项目模式和非项目模式哪个更有优势?编码是在 verilog 中完成的。
我正在使用Xilinx Vivado在VHDL上开发类似MIPS的CPU.我的BranchControl模块有一个组件,如下所示:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity BranchControl is
Port ( PL : in STD_LOGIC;
BC : in STD_LOGIC_VECTOR(3 downto 0);
PC : in STD_LOGIC_VECTOR (31 downto 0);
AD : in STD_LOGIC_VECTOR (31 downto 0);
Flags : in STD_LOGIC_VECTOR(3 downto 0);
PCLoad : out STD_LOGIC;
PCValue : out STD_LOGIC_VECTOR (31 downto 0));
end BranchControl;
architecture Behavioral of branchcontrol is
signal Z,N,P,C,V, T: std_logic;
begin
Z <= Flags(3); -- zero flag
N <= Flags(2); -- negative flag
P <= …Run Code Online (Sandbox Code Playgroud) 当我在 Xilinx Vivado 2016.4 中模拟我的顶级模块时,我收到了奇怪的错误:
ERROR: [VRFC 10-1342] root scope declaration is not allowed in verilog 95/2K mode [<...>/header.vh]
Run Code Online (Sandbox Code Playgroud)
我正在使用指定了 Verilog 2001 的内置Vivado 模拟器。我的header.vh如下所示:
`ifndef _header_vh_
`define _header_vh_
function integer clog2;
input integer value;
begin
value = value - 1;
for (clog2 = 0; value > 0; clog2 = clog2 + 1)
value = value >> 1;
end
endfunction
`endif
Run Code Online (Sandbox Code Playgroud) 我写了一些 vivado RTL,然后在实体的端口中添加了一些 vhdl 属性来定义 Xilinx Vivado 工具的接口,如下所示:
library ieee;
use ieee.std_logic_1164.all;
entity vivado_rtl_island is
port(
-- Clocks
i_m50_clk :in std_logic;
i_m50_rst :in std_logic;
-- APB Command Inteface
s_paddr :in std_logic_vector(31 downto 0);
s_psel :in std_logic;
s_penable :in std_logic;
s_pwrite :in std_logic;
s_pwdata :in std_logic_vector(31 downto 0);
s_pready :out std_logic;
s_prdata :out std_logic_vector(31 downto 0);
s_pread :out std_logic;
s_pslverr :out std_logic
);
end entity;
architecture rtl of vivado_rtl_island is
-- Define APB Interface for "Vivado IP Integrator"
ATTRIBUTE X_INTERFACE_INFO: STRING; …Run Code Online (Sandbox Code Playgroud) 使用 Verilog 几个月后,我很好奇以下内容之间有什么区别:
reg [31:0] sum;
integer sum;
Run Code Online (Sandbox Code Playgroud)
既然整数只是一个32位值,为什么不能直接用reg来表示呢?为什么一个在内存使用或访问时间方面可能比另一个更有效?请告诉我您的想法,或者您是否需要我进一步阐述我的问题。
使用整数的示例:
integer t = 0;
always @(posedge clk) begin
if (t < 9999) t = t + 1;
else t = 0;
end
Run Code Online (Sandbox Code Playgroud)
使用 Reg 的示例:
reg[13:0] t = 14'b0; //Represent up to 16383
always @(posedge clk) begin
if (t < 9999) t = t + 14'b00000000000001;
else t = 14'b0;
end
Run Code Online (Sandbox Code Playgroud) 我使用basys3板创建了这个简单的mod16计数器,而且我的时钟不对.代码本身确实有效,但是一个计数(从"1"变为"2"等)持续40秒,而不是1秒!如果条件为1,我试图降低"clk_vector",但它也没有帮助.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
entity mod_16_k is
Port ( switch : in STD_LOGIC_VECTOR (3 downto 0);
CLK1 : in STD_LOGIC;
reset : in STD_LOGIC;
led : out STD_LOGIC_VECTOR (15 downto 0));
end mod_16_k;
architecture Behavioral of mod_16_k is
signal clk_vector :integer;
signal clk_vec2 :std_logic_vector(15 downto 0);
begin
zegar_wew : process(CLK1)
begin
if(CLK1'event and CLK1 = '1') then
clk_vector <= clk_vector + 1;
if(clk_vector = 100000000) then
clk_vec2 <= std_logic_vector(unsigned(clk_vec2) + 1);
end if;
end if;
end process; …Run Code Online (Sandbox Code Playgroud) 我想使用TCL删除目录中的所有文件.(我在Win 10下使用Xilinx Vivado的TCL控制台.)我在TCL文档中发现了这一点
file delete ?-force? ?- -? pathname ?pathname ... ?
Run Code Online (Sandbox Code Playgroud)
应该管用.但
file delete -force -- [glob *]
Run Code Online (Sandbox Code Playgroud)
什么也没做.这有什么不对?
我尝试开发备用内存代码,但仿真在 Vivado 中卡住了。我不能确切地说它是否被卡住,但模拟没有运行。我已附上我无法清楚表达的问题的图片。代码的测试平台位于此处。在尝试获取仿真波形时,Vivado并没有给出仿真,而在Icarus Verilog中完全可以工作,并且在GTK Wave中仿真波形清晰。
module trial_tb;
reg clk;
reg rst_n;
reg bist_enable;
reg we;
reg [5:0] wraddr;
reg data_in;
reg re;
reg [5:0] rdaddr;
wire data_out;
wire repair_fail;
wire repair_finish;
integer m;
integer idx;
SRAM_repair uut (clk, rst_n, bist_enable, we, wraddr, data_in, re, rdaddr, data_out, repair_fail, repair_finish);
initial
begin
clk = 0;
rst_n <= 0;
bist_enable <= 0;
rdaddr <= 'b0;
wraddr <= 'b0;
we <= 1'b0;
re <= 1'b0;
data_in <= 1'b0;
#5.0 rst_n <= 1;
#5.0 bist_enable …Run Code Online (Sandbox Code Playgroud) 我是 VHDL 新手,正在使用 VIvado 2017.1。
我正在尝试使用包来定义常量和其他此类枚举类型以包含在多个模型中。但是现在,我无法在我的模型中使用该包。我不断得到
Error: Cannot find <PACKAGE NAME> in library <xil_defaultlib>. Please ensure that the library was compiled, and that a library and a use clause are present in the VHDL file
然而,有问题的包位于 xil_defaultlib 文件夹中,我很确定它已编译,因为我没有看到错误[如此处所示][1]。
我的每个代码是
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.std_logic_unsigned.all;
use work.Specs_Package.all;
entity Freq_Divider is
Port ( En,clk, reset : in std_logic; clock_out: out std_logic);
end Freq_Divider;
architecture bhv of Freq_Divider is
signal count: std_logic_vector(7 downto 0);
signal tmp : std_logic := '0';
begin
if …Run Code Online (Sandbox Code Playgroud)vivado ×10
vhdl ×5
verilog ×4
xilinx ×4
fpga ×2
synthesis ×2
comparison ×1
delete-file ×1
ghdl ×1
hdl ×1
mips ×1
package ×1
processor ×1
tcl ×1
test-bench ×1