?? 86_stack.vhd
字號:
--------------------------------------------------------------------------------
--
-- AMD 2910 Benchmark (Functional blocks) (Algorithmic Behaviour of Funct blocks)
--
-- Source: AMD data book
--
--------------------------------------------------------------------------------
library l2901_lib;
use l2901_lib.types.all;
use l2901_lib.MVL7_functions.all;
use l2901_lib.synthesis_types.all;
entity stack is
port (
clk : in clock;
pop : in MVL7;
push : in MVL7;
clear : in MVL7;
uPC : in MVL7_VECTOR(11 downto 0);
sp : inout INTEGER range 0 to 5;
reg_file : inout MEMORY_12_BIT(5 downto 0);
FULL_BAR : out MVL7
);
end stack;
architecture stack of stack is
begin
------------------------------------------------------------------------------
stack_and_sp : block ( (clk = '1') and (not clk'stable) )
signal write_address : INTEGER range 0 to 5;
begin
sp <= guarded (sp - 1) WHEN (pop = '1') and (sp /= 0) ELSE
(sp + 1) WHEN (push = '1') and (sp /= 5) ELSE
0 when clear = '1'ELSE
sp;
write_address <= sp + 1 WHEN (sp /= 5) ELSE --
sp;
reg_file(write_address) <= guarded uPC WHEN (push = '1') ELSE
reg_file(write_address);
FULL_BAR <= '0' WHEN sp = 5 ELSE
'1';
end block stack_and_sp;
------------------------------------------------------------------------------
end stack;
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -