1
1
-- This VHDL was converted from Verilog using the
2
- -- Icarus Verilog VHDL Code Generator 11 .0 (stable ) ()
2
+ -- Icarus Verilog VHDL Code Generator 13 .0 (devel ) (s20221226-518-g94d9d1951 )
3
3
4
4
library ieee;
5
5
use ieee.std_logic_1164.all ;
6
6
use ieee.numeric_std.all ;
7
7
8
- -- Generated from Verilog module ConfigFSM (ConfigFSM_template .v:1)
8
+ -- Generated from Verilog module ConfigFSM (ConfigFSM .v:1)
9
9
-- FrameBitsPerRow = 32
10
10
-- NumberOfRows = 16
11
11
-- RowSelectWidth = 5
@@ -19,29 +19,30 @@ entity ConfigFSM is
19
19
);
20
20
port (
21
21
CLK : in std_logic ;
22
+ FSM_Reset : in std_logic ;
22
23
FrameAddressRegister : out std_logic_vector (31 downto 0 );
23
24
LongFrameStrobe : out std_logic ;
24
- Reset : in std_logic ;
25
25
RowSelect : out std_logic_vector (4 downto 0 );
26
26
WriteData : in std_logic_vector (31 downto 0 );
27
- WriteStrobe : in std_logic
27
+ WriteStrobe : in std_logic ;
28
+ resetn : in std_logic
28
29
);
29
30
end entity ;
30
31
31
- -- Generated from Verilog module ConfigFSM (ConfigFSM_template .v:1)
32
+ -- Generated from Verilog module ConfigFSM (ConfigFSM .v:1)
32
33
-- FrameBitsPerRow = 32
33
34
-- NumberOfRows = 16
34
35
-- RowSelectWidth = 5
35
36
-- desync_flag = 20
36
37
architecture from_verilog of ConfigFSM is
37
38
signal FrameAddressRegister_Reg : std_logic_vector (31 downto 0 );
38
- signal LongFrameStrobe_Reg : std_logic := '0' ;
39
+ signal LongFrameStrobe_Reg : std_logic ;
39
40
signal RowSelect_Reg : std_logic_vector (4 downto 0 );
40
- signal FrameShiftState : unsigned (4 downto 0 ) := "00000" ; -- Declared at ConfigFSM_template .v:19
41
- signal FrameStrobe : std_logic := '0' ; -- Declared at ConfigFSM_template .v:17
42
- signal oldFrameStrobe : std_logic := '0' ; -- Declared at ConfigFSM_template .v:74
43
- signal old_reset : std_logic := '0' ; -- Declared at ConfigFSM_template .v:23
44
- signal state : std_logic_vector (1 downto 0 ) := "00" ; -- Declared at ConfigFSM_template .v:22
41
+ signal FrameShiftState : unsigned (4 downto 0 ); -- Declared at ConfigFSM .v:20
42
+ signal FrameStrobe : std_logic ; -- Declared at ConfigFSM .v:18
43
+ signal oldFrameStrobe : std_logic ; -- Declared at ConfigFSM .v:83
44
+ signal old_reset : std_logic ; -- Declared at ConfigFSM .v:24
45
+ signal state : std_logic_vector (1 downto 0 ); -- Declared at ConfigFSM .v:23
45
46
46
47
function Boolean_To_Logic (B : Boolean ) return std_logic is
47
48
begin
@@ -56,49 +57,57 @@ begin
56
57
LongFrameStrobe <= LongFrameStrobe_Reg;
57
58
RowSelect <= RowSelect_Reg;
58
59
59
- -- Generated from always process in ConfigFSM (ConfigFSM_template .v:24 )
60
- process (CLK) is
60
+ -- Generated from always process in ConfigFSM (ConfigFSM .v:25 )
61
+ P_FSM : process (resetn, CLK) is
61
62
begin
62
- if rising_edge (CLK) then
63
- old_reset <= Reset;
64
- FrameStrobe <= '0' ;
65
- if (old_reset = '0' ) and (Reset = '1' ) then
63
+ if falling_edge (resetn) or rising_edge (CLK) then
64
+ if (not resetn) = '1' then
65
+ old_reset <= '0' ;
66
66
state <= "00" ;
67
67
FrameShiftState <= "00000" ;
68
+ FrameAddressRegister_Reg <= X"00000000" ;
69
+ FrameStrobe <= '0' ;
68
70
else
69
- case state is
70
- when "00" =>
71
- if WriteStrobe = '1' then
72
- if WriteData = X"fab0fab1" then
73
- state <= "01" ;
71
+ old_reset <= FSM_Reset;
72
+ FrameStrobe <= '0' ;
73
+ if (old_reset = '0' ) and (FSM_Reset = '1' ) then
74
+ state <= "00" ;
75
+ FrameShiftState <= "00000" ;
76
+ else
77
+ case state is
78
+ when "00" =>
79
+ if WriteStrobe = '1' then
80
+ if WriteData = X"FAB0FAB1" then
81
+ state <= "01" ;
82
+ end if ;
74
83
end if ;
75
- end if ;
76
- when "01" =>
77
- if WriteStrobe = '1' then
78
- if WriteData( 20 ) = '1' then
79
- state <= "00" ;
80
- else
81
- FrameAddressRegister_Reg <= WriteData ;
82
- FrameShiftState <= to_unsigned (NumberOfRows, FrameShiftState 'length ) ;
83
- state <= "10" ;
84
+ when "01" =>
85
+ if WriteStrobe = '1' then
86
+ if WriteData(desync_flag) = '1' then
87
+ state <= "00" ;
88
+ else
89
+ FrameAddressRegister_Reg <= WriteData;
90
+ FrameShiftState <= to_unsigned (NumberOfRows,FrameShiftState 'length ) ;
91
+ state <= "10" ;
92
+ end if ;
84
93
end if ;
85
- end if ;
86
- when "10" =>
87
- if WriteStrobe = '1' then
88
- FrameShiftState <= FrameShiftState - "00001" ;
89
- if FrameShiftState = X"00000001" then
90
- FrameStrobe <= '1' ;
91
- state <= "01" ;
94
+ when "10" =>
95
+ if WriteStrobe = '1' then
96
+ FrameShiftState <= FrameShiftState - "00001" ;
97
+ if Resize ( FrameShiftState, 32 ) = X"00000001" then
98
+ FrameStrobe <= '1' ;
99
+ state <= "01" ;
100
+ end if ;
92
101
end if ;
93
- end if ;
94
- when others =>
95
- null ;
96
- end case ;
102
+ when others =>
103
+ null ;
104
+ end case ;
105
+ end if ;
97
106
end if ;
98
107
end if ;
99
108
end process ;
100
109
101
- -- Generated from always process in ConfigFSM (ConfigFSM_template .v:66 )
110
+ -- Generated from always process in ConfigFSM (ConfigFSM .v:75 )
102
111
process (WriteStrobe, FrameShiftState) is
103
112
begin
104
113
if WriteStrobe = '1' then
@@ -108,12 +117,17 @@ begin
108
117
end if ;
109
118
end process ;
110
119
111
- -- Generated from always process in ConfigFSM (ConfigFSM_template .v:75 )
112
- process (CLK) is
120
+ -- Generated from always process in ConfigFSM (ConfigFSM .v:84 )
121
+ P_StrobeREG : process (resetn, CLK) is
113
122
begin
114
- if rising_edge (CLK) then
115
- oldFrameStrobe <= FrameStrobe;
116
- LongFrameStrobe_Reg <= Boolean_To_Logic((FrameStrobe = '1' ) or (oldFrameStrobe = '1' ));
123
+ if falling_edge (resetn) or rising_edge (CLK) then
124
+ if (not resetn) = '1' then
125
+ oldFrameStrobe <= '0' ;
126
+ LongFrameStrobe_Reg <= '0' ;
127
+ else
128
+ oldFrameStrobe <= FrameStrobe;
129
+ LongFrameStrobe_Reg <= Boolean_To_Logic((FrameStrobe = '1' ) or (oldFrameStrobe = '1' ));
130
+ end if ;
117
131
end if ;
118
132
end process ;
119
133
end architecture ;
0 commit comments