这个verilog程序请懂的高手给我讲下原理吗?
这个程序请懂的高手给我讲下原理好吗?library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity sram is
generic(width:integer:=8;
depth:integer:=8;
adder:integer:=3);
port(datain:in std_logic_vector(width-1 downto 0);
dataout
ut std_logic_vector(width-1 downto 0);
clock:in std_logic;
we,re:in std_logic;
wadd:in std_logic_vector(adder-1 downto 0);
radd:in std_logic_vector(adder-1 downto 0));
end sram;
architecture art of sram is
type men is array(0 to depth-1)of
std_logic_vector(width-1 downto 0);
signal ramtmp:men;
begin
process(clock)
begin
if(clock'event and clock='1')then
if(we='1')then
ramtmp(conv_integer(wadd))<=datain;
end if;
end if;
end process;
process(clock)
begin
if(clock'event and clock='1')then
if(re='1')then
dataout<=ramtmp(conv_integer(radd));
end if;
end if;
end process;
end art; 谢谢<br>
这句<br>
ramtmp(conv_integer(wadd))<=datain<br>
书上没看到过类似的,是什么意思呢? 我波形图怎么弄不出来呢,设置了参数以后,运行打开输出信号波形是不会变的 mirson 真是高手,佩服,向你学习!
我波形图怎么弄不出来呢,设置了参数以后,运行打开输出信号波形是不会变的
页:
[1]