下面是一个计数器,旨在表示一个8位二进制数与8发光二极管,它正在模拟使用一个测试平台,但当运行模拟时,输出只是显示UU为led。
以下是我要测试的主要实体:
use IEEE.STD_LOGIC_1164.all;
use IEEE.STD_LOGIC_unsigned.all;
entity Lab_3_Source_File is
generic(N_BITS : integer := 8);
port(
btnd : in STD_LOGIC ;
clk : in STD_LOGIC;
led : out STD_LOGIC_VECTOR(7 downto 0)
);
en
我很难理解这段代码的效果:我的组件:
library IEEE;
use IEEE.std_logic_1164.all;
entity problem is
port(
clk : in std_logic;
a : in std_logic);
end problem;
architecture impl of problem is
signal a_sig : std_logic;
begin
clk_proc : process(clk)
begin
if rising_edge(clk) then
a_sig <=
让我们举个例子
如果我的数据集是这样的。LOG 1 (x.log)包含
INFO @1102266 PHResourceLayer_Z4: mti_clk_chk:################ start of test ################ ; T=1102266
INFO @1102334 PHResourceLayer_Z4: mti_clk_chk:Checking the period of MTI, MTI10 clk from SV; T=1102334
LOG 2 (y.log)包含
UVM_INFO @1092507 reporter Z4_COREA: mt
我预计信号‘延迟’是一个时钟周期晚wrt到实体‘端口’的‘输入’,但ISIM显示没有相移。我认为信号分配和实际值之间总是存在延迟(当进程暂停时),但我在这里没有看到它。
为什么会这样呢?
代码:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity test is
Port ( clk: in std_logic;
input: in std_logic
);
end test;
architecture Behavioral of test is
signal delay: std
因此,我们在Verilog中提供了一个顺序模块,并负责创建一个测试平台,以显示非阻塞和阻塞分配之间的区别。
提供的代码:
module sequential_module (A, B, C, D, clk);
input clk;
output A, B, C, D;
reg A, B, C, D;
always @(posedge clk)
begin
A = B;
B = A;
end
always @(posedge clk)
begin
C <= D;
D <= C;
end
endmodule
我似乎无法将任何值插入到testbench中的
我们有一个大学项目,我们必须模拟一个用于DSP的MAC单元。对于模拟,我使用Aldec Riviera Pro 2014.06通过EDA操场。问题是,即使我初始化了一个名为add_res的32位签名信号,但在模拟时,它的值将始终显示为XXXX_XXXX。
这是design.vhd的代码
LIBRARY IEEE;
USE IEEE.std_logic_1164.all;
USE IEEE.numeric_std.all;
-----------------------------
ENTITY mac IS
PORT (B, C : IN SIGNED (15 DOWNTO 0)
我正在尝试从testbench文件调用接口文件中定义的任务。该任务定义为 task master_monitor(
output bit [ADDR_WIDTH-1:0] addr,
output bit [DATA_WIDTH-1:0] data,
output bit we
);
while (!cyc_o) @(posedge clk_i);
完整的错误消息是:
ERROR:HDLCompiler:377 - "C:/Users/einar/Documents/Xilinx/ISE/Projects/EDA385/scale_clock_tb.vhd" Line 17: Entity port d does not match with type unsigned of component port
我正在使用ISE,我已经实现了顶层模块,顶层模块是scale_clock。
而且,当我做行为模拟时,它也能很好地模拟。但对于地图后或后路线,我得到了上面的错误信息。
这是组件的代码:
library IEEE;
use
我为什么要:
# ** Error (suppressible): testbench.sv(27): (vopt-12003) Variable 'ar[0].subar[0]' written by continuous and procedural assignments. See testbench.sv(19).
# ** Error (suppressible): testbench.sv(27): (vopt-12003) Variable 'ar[0].subar[1]' written by continuous and procedural
我想为一个模块编写一个测试平台,该模块实例化几个组件,但没有重要的输出。为了测试正确性,我必须访问uut组件的变量。至少能够访问uut的变量是有帮助的。
我可以想象像这样工作的人:
uut: top_module port map(
i_clk => clk,
i_reset => reset
);
testbench: process
begin
wait for CLK_PERIOD;
report STD_LOGIC'image(top_module.flag) severity n
我在测试台代码中有一个问题,并且我没有得到正确的波形。即使是时钟也不会触发。 D触发器的代码: module D_FF(o,D,clk);
output reg o;
input D,clk;
always @ (posedge clk)
begin
if(D==1'b1)begin
o=1'b1;
end
else begin
o=1'b0;
end
end
endmodule
我试图运行一个测试平台,当我试图运行模拟时,我得到了以下错误:
./rc_符号_testbench:错误:不按升序排列的事务
./rc_符号_testbench:错误:模拟失败的msf_symbols.vhd rc_symbols_testbench.vhd
仍然产生错误的testbench的简化版本:
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
use STD.textio.all;
use IEEE.std_logic_textio.all;
entity rc_symbols_test
我编写了这个VHDL-程序vor,一个ALU和它的测试平台正在工作:
ALU-代码:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
entity ALU_CLK is
port( Clk : in std_logic; --clock signal
InRegA,InRegB : in signed(31 downto 0); --input operands
InOp : in unsigned(2 downto 0); --Operation to be per
如何实现溢出代码?
我不知道出了什么问题。结果是middle.Below中的负数是代码片段
module fibonacci(input clk, input rst, output [7:0]out, output reg overflow);
reg [7:0]a,b;
always@(posedge rst)
begin
a =8'b0;
b =8'b1;
end
always@(posedge clk)
begin
if ( a < 8'b11111111 ) begin
b = a + b ;
我有一个永远不会返回值的过程。
procedure gen_start_impulse (
signal rising_signal : out std_logic;
signal carier_clk : in std_logic;
constant duration : in integer) is
variable clk_counter : integer := 0;
begin
这是我的dff和多路复用器和移位寄存器的代码,它应该在4个时钟中丰富输出,但它只在一个时钟中完成,而且我无法自己修复它。这是我的dff代码:
use IEEE.STD_LOGIC_1164.ALL;
entity DFLipFlop is
Port ( d : in STD_LOGIC;
clock : in STD_LOGIC;
reset : in STD_LOGIC;
q : out STD_LOGIC);
end DFLipFlop;
architecture Behavioral of DFL