-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbs_cell.vhd
107 lines (67 loc) · 1.71 KB
/
bs_cell.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
----------------------------------------------------------------------------------
-- Company:
-- Engineer:
--
-- Create Date: 02/02/2021 10:57:13 AM
-- Design Name:
-- Module Name: BS_Cell - Behavioral
-- Project Name:
-- Target Devices:
-- Tool Versions:
-- Description:
--
-- Dependencies:
--
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;
-- Uncomment the following library declaration if instantiating
-- any Xilinx leaf cells in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity BS_Cell is
Port ( rst : in STD_LOGIC;
clk : in STD_LOGIC;
mic : in STD_LOGIC;
mlc : in STD_LOGIC;
pin : in STD_LOGIC;
sin : in STD_LOGIC;
moc : in STD_LOGIC;
mcsc : in STD_LOGIC;
pout : out STD_LOGIC;
sout : out STD_LOGIC);
end BS_Cell;
architecture Behavioral of BS_Cell is
signal cs_reg, l_reg, cs_next, l_next, mio : std_logic;
begin
---state register
process(clk, rst, cs_reg, l_reg)
begin
if rst = '1' then
cs_reg <= '0';
l_reg <= '0';
else
if (rising_edge(clk)) then
cs_reg <= cs_next;
l_reg <= l_next;
end if;
end if;
end process;
-----combinational block
mio <= sin when mic = '1' else
pin;
cs_next <= mio when mcsc = '1' else
cs_reg;
l_next <= cs_reg when mlc = '1' else
l_reg;
pout <= l_reg when moc = '1' else
pin;
sout <= cs_reg;
end Behavioral;