-
Notifications
You must be signed in to change notification settings - Fork 2
/
AllCPUs.vhd
92 lines (77 loc) · 2.69 KB
/
AllCPUs.vhd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
-- Peter-Bernd Otte
-- 2.4.2012
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity AllCPUs is
generic (
NVMEbusChs : integer
);
Port ( ExpTriggerIn : in STD_LOGIC;
Interrupt_Delayed : out std_logic_vector(NVMEbusChs-1 downto 0);
SingleVMECPUsReadoutComplete : in STD_LOGIC_VECTOR(NVMEbusChs-1 downto 0);
ReadoutCompleteReset : out STD_LOGIC;
Reset : in std_logic;
SingleVMECPUsBusy : out STD_LOGIC_VECTOR(NVMEbusChs-1 downto 0);
SelectIncludeCPU : in STD_LOGIC_VECTOR(NVMEbusChs-1 downto 0);
SelectInterruptDelayTimes : in std_logic_vector(NVMEbusChs*16-1 downto 0);
VMECPUsBusy : out STD_LOGIC;
clock100 : in std_logic;
Debug_Out : out std_logic_vector(NVMEbusChs-1 downto 0));
end AllCPUs;
architecture Behavioral of AllCPUs is
COMPONENT VMEbusCh
PORT(
Interrupt : IN std_logic;
Interrupt_Delayed : out std_logic;
SingleCPUReadoutComplete : in STD_LOGIC;
Reset : in STD_LOGIC;
clock : in std_logic;
SelectIncludeCPU : IN std_logic;
SelectInterruptDelayTime : in std_logic_vector(15 downto 0);
CPUbusyOut : OUT std_logic;
Debug_Out : out STD_LOGIC
);
END COMPONENT;
component GateShortener
generic (
NCh : integer
);
Port ( sig_in : in STD_LOGIC;
sig_out : out STD_LOGIC;
clock : in STD_LOGIC);
end component;
signal Inter_ReadoutCompleteReset : std_logic;
attribute keep : string;
attribute keep of Inter_ReadoutCompleteReset: signal is "TRUE";
signal Inter_VMECPUsBusy : std_logic_vector(NVMEbusChs-1 downto 0);
signal Pre_VMECPUsBusy, Inter_Pre_VMECPUsBusy, Pre_VMECPUsBusy_Inv : std_logic;
begin
AllVMEbusChs: for i in 0 to NVMEbusChs-1 generate
begin
Inst_VMEbusCh: VMEbusCh PORT MAP(
Interrupt => ExpTriggerIn,
Interrupt_Delayed => Interrupt_Delayed(i),
SingleCPUReadoutComplete => SingleVMECPUsReadoutComplete(i),
Reset => Reset,
clock => clock100,
SelectIncludeCPU => SelectIncludeCPU(i),
SelectInterruptDelayTime => SelectInterruptDelayTimes(16*i+15 downto 16*i),
CPUbusyOut => Inter_VMECPUsBusy(i),
Debug_Out => Debug_Out(i)
);
end generate;
SingleVMECPUsBusy <= Inter_VMECPUsBusy;
Inter_Pre_VMECPUsBusy <= '1' when Inter_VMECPUsBusy /= "0" else '0';
process(clock100)
begin
if rising_edge(clock100) then
Pre_VMECPUsBusy <= Inter_Pre_VMECPUsBusy;
end if;
end process;
Pre_VMECPUsBusy_Inv <= not Pre_VMECPUsBusy;
GateShortener_1 : GateShortener GENERIC MAP (NCh => 4) PORT MAP (sig_in => Pre_VMECPUsBusy_Inv, sig_out => Inter_ReadoutCompleteReset, clock => clock100);
ReadoutCompleteReset <= Inter_ReadoutCompleteReset;
VMECPUsBusy <= Pre_VMECPUsBusy;
end Behavioral;