5525 发表于 2016-6-30 22:36
换了下降沿的,这么一来 传数据给core,core在传数据给你,这里可就都是非同期了。
方便的话,能发sim的 ...
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY mult2_vhd_tst IS
END mult2_vhd_tst;
ARCHITECTURE mult2_arch OF mult2_vhd_tst IS
-- constants
constant ClockPeriod : TIME := 20 ns;
-- signals
SIGNAL aclr : STD_LOGIC;
SIGNAL clk_en : STD_LOGIC;
SIGNAL clock : STD_LOGIC;
SIGNAL dataa : STD_LOGIC_VECTOR(31 DOWNTO 0);
SIGNAL datab : STD_LOGIC_VECTOR(31 DOWNTO 0);
SIGNAL result : STD_LOGIC_VECTOR(31 DOWNTO 0);
COMPONENT mult2
PORT (
aclr : IN STD_LOGIC;
clk_en : IN STD_LOGIC;
clock : IN STD_LOGIC;
dataa : IN STD_LOGIC_VECTOR(31 DOWNTO 0);
datab : IN STD_LOGIC_VECTOR(31 DOWNTO 0);
result : OUT STD_LOGIC_VECTOR(31 DOWNTO 0)
);
END COMPONENT;
BEGIN
i1 : mult2
PORT MAP (
-- list connections between master ports and signals
aclr => aclr,
clk_en => clk_en,
clock => clock,
dataa => dataa,
datab => datab,
result => result
);
init : PROCESS
-- variable declarations
BEGIN
-- code that executes only once
aclr