// Actel Corporation Proprietary and Confidential
// Copyright 2013 Actel Corporation.  All rights reserved.
// ANY USE OR REDISTRIBUTION IN PART OR IN WHOLE MUST BE HANDLED IN
// ACCORDANCE WITH THE ACTEL LICENSE AGREEMENT AND MUST BE APPROVED
// IN ADVANCE IN WRITING.
// Revision Information:
// SVN Revision Information:
// SVN $Revision: 21302 $
// SVN $Date: 2013-10-17 11:52:38 -0700 (Thu, 17 Oct 2013) $
`timescale 1ns/1ps
module
CAHBLTOO0
(
input
HCLK,
input
HRESETN,
input
[
3
:
0
]
CAHBLTIO0,
input
CAHBLTlO0,
input
CAHBLTOI0,
input
CAHBLTII0,
input
CAHBLTlI0,
input
CAHBLTOl0,
output
reg
[
3
:
0
]
CAHBLTIl0
)
;
localparam
CAHBLTll0
=
4
'b
0000
;
localparam
CAHBLTO00
=
4
'b
0001
;
localparam
CAHBLTI00
=
4
'b
0010
;
localparam
CAHBLTl00
=
4
'b
0011
;
localparam
CAHBLTO10
=
4
'b
0100
;
localparam
CAHBLTI10
=
4
'b
0101
;
localparam
CAHBLTl10
=
4
'b
0110
;
localparam
CAHBLTOO1
=
4
'b
0111
;
localparam
CAHBLTIO1
=
4
'b
1000
;
localparam
CAHBLTlO1
=
4
'b
1001
;
localparam
CAHBLTOI1
=
4
'b
1010
;
localparam
CAHBLTII1
=
4
'b
1011
;
localparam
CAHBLTlI1
=
4
'b
1100
;
localparam
CAHBLTOl1
=
4
'b
1101
;
localparam
CAHBLTIl1
=
4
'b
1110
;
localparam
CAHBLTll1
=
4
'b
1111
;
localparam
CAHBLTO01
=
4
'b
0001
;
localparam
CAHBLTI01
=
4
'b
0010
;
localparam
CAHBLTl01
=
4
'b
0100
;
localparam
CAHBLTO11
=
4
'b
1000
;
localparam
CAHBLTI11
=
4
'b
0000
;
reg
[
127
:
0
]
CAHBLTl11
;
reg
[
3
:
0
]
CAHBLTOOOI
;
reg
[
3
:
0
]
CAHBLTIOOI
;
always
@(*)
begin
CAHBLTIl0
=
CAHBLTI11
;
case
(
CAHBLTIOOI
)
CAHBLTOl1
:
begin
CAHBLTl11
=
"M3DONE"
;
if
(
CAHBLTIO0
[
0
]
)
begin
if
(
CAHBLTOI0
)
CAHBLTOOOI
=
CAHBLTI00
;
else
begin
CAHBLTIl0
=
CAHBLTO01
;
if
(
CAHBLTlO0
)
CAHBLTOOOI
=
CAHBLTO00
;
else
CAHBLTOOOI
=
CAHBLTll0
;
end
end
else
if
(
CAHBLTIO0
[
1
]
)
begin
if
(
CAHBLTII0
)
CAHBLTOOOI
=
CAHBLTl10
;
else
begin
CAHBLTIl0
=
CAHBLTI01
;
if
(
CAHBLTlO0
)
CAHBLTOOOI
=
CAHBLTI10
;
else
CAHBLTOOOI
=
CAHBLTO10
;
end
end
else
if
(
CAHBLTIO0
[
2
]
)
begin
if
(
CAHBLTlI0
)
CAHBLTOOOI
=
CAHBLTOI1
;
else
begin
CAHBLTIl0
=
CAHBLTl01
;
if
(
CAHBLTlO0
)
CAHBLTOOOI
=
CAHBLTlO1
;
else
CAHBLTOOOI
=
CAHBLTIO1
;
end
end
else
if
(
CAHBLTIO0
[
3
]
)
begin
if
(
CAHBLTOl0
)
CAHBLTOOOI
=
CAHBLTIl1
;
else
begin
CAHBLTIl0
=
CAHBLTO11
;
if
(
CAHBLTlO0
)
CAHBLTOOOI
=
CAHBLTOl1
;
else
CAHBLTOOOI
=
CAHBLTlI1
;
end
end
else
begin
CAHBLTOOOI
=
CAHBLTOl1
;
end
end
CAHBLTlO1
:
begin
CAHBLTl11
=
"M2DONE"
;
if
(
CAHBLTIO0
[
3
]
)
begin
if
(
CAHBLTOl0
)
CAHBLTOOOI
=
CAHBLTIl1
;
else
begin
CAHBLTIl0
=
CAHBLTO11
;
if
(
CAHBLTlO0
)
CAHBLTOOOI
=
CAHBLTOl1
;
else
CAHBLTOOOI
=
CAHBLTlI1
;
end
end
else
if
(
CAHBLTIO0
[
0
]
)
begin
if
(
CAHBLTOI0
)
CAHBLTOOOI
=
CAHBLTI00
;
else
begin
CAHBLTIl0
=
CAHBLTO01
;
if
(
CAHBLTlO0
)
CAHBLTOOOI
=
CAHBLTO00
;
else
CAHBLTOOOI
=
CAHBLTll0
;
end
end
else
if
(
CAHBLTIO0
[
1
]
)
begin
if
(
CAHBLTII0
)
CAHBLTOOOI
=
CAHBLTl10
;
else
begin
CAHBLTIl0
=
CAHBLTI01
;
if
(
CAHBLTlO0
)
CAHBLTOOOI
=
CAHBLTI10
;
else
CAHBLTOOOI
=
CAHBLTO10
;
end
end
else
if
(
CAHBLTIO0
[
2
]
)
begin
if
(
CAHBLTlI0
)
CAHBLTOOOI
=
CAHBLTOI1
;
else
begin
CAHBLTIl0
=
CAHBLTl01
;
if
(
CAHBLTlO0
)
CAHBLTOOOI
=
CAHBLTlO1
;
else
CAHBLTOOOI
=
CAHBLTIO1
;
end
end
else
begin
CAHBLTOOOI
=
CAHBLTlO1
;
end
end
CAHBLTI10
:
begin
CAHBLTl11
=
"M1DONE"
;
if
(
CAHBLTIO0
[
2
]
)
begin
if
(
CAHBLTlI0
)
CAHBLTOOOI
=
CAHBLTOI1
;
else
begin
CAHBLTIl0
=
CAHBLTl01
;
if
(
CAHBLTlO0
)
CAHBLTOOOI
=
CAHBLTlO1
;
else
CAHBLTOOOI
=
CAHBLTIO1
;
end
end
else
if
(
CAHBLTIO0
[
3
]
)
begin
if
(
CAHBLTOl0
)
CAHBLTOOOI
=
CAHBLTIl1
;
else
begin
CAHBLTIl0
=
CAHBLTO11
;
if
(
CAHBLTlO0
)
CAHBLTOOOI
=
CAHBLTOl1
;
else
CAHBLTOOOI
=
CAHBLTlI1
;
end
end
else
if
(
CAHBLTIO0
[
0
]
)
begin
if
(
CAHBLTOI0
)
CAHBLTOOOI
=
CAHBLTI00
;
else
begin
CAHBLTIl0
=
CAHBLTO01
;
if
(
CAHBLTlO0
)
CAHBLTOOOI
=
CAHBLTO00
;
else
CAHBLTOOOI
=
CAHBLTll0
;
end
end
else
if
(
CAHBLTIO0
[
1
]
)
begin
if
(
CAHBLTII0
)
CAHBLTOOOI
=
CAHBLTl10
;
else
begin
CAHBLTIl0
=
CAHBLTI01
;
if
(
CAHBLTlO0
)
CAHBLTOOOI
=
CAHBLTI10
;
else
CAHBLTOOOI
=
CAHBLTO10
;
end
end
else
begin
CAHBLTOOOI
=
CAHBLTI10
;
end
end
CAHBLTO00
:
begin
CAHBLTl11
=
"M0DONE"
;
if
(
CAHBLTIO0
[
1
]
)
begin
if
(
CAHBLTII0
)
CAHBLTOOOI
=
CAHBLTl10
;
else
begin
CAHBLTIl0
=
CAHBLTI01
;
if
(
CAHBLTlO0
)
CAHBLTOOOI
=
CAHBLTI10
;
else
CAHBLTOOOI
=
CAHBLTO10
;
end
end
else
if
(
CAHBLTIO0
[
2
]
)
begin
if
(
CAHBLTlI0
)
CAHBLTOOOI
=
CAHBLTOI1
;
else
begin
CAHBLTIl0
=
CAHBLTl01
;
if
(
CAHBLTlO0
)
CAHBLTOOOI
=
CAHBLTlO1
;
else
CAHBLTOOOI
=
CAHBLTIO1
;
end
end
else
if
(
CAHBLTIO0
[
3
]
)
begin
if
(
CAHBLTOl0
)
CAHBLTOOOI
=
CAHBLTIl1
;
else
begin
CAHBLTIl0
=
CAHBLTO11
;
if
(
CAHBLTlO0
)
CAHBLTOOOI
=
CAHBLTOl1
;
else
CAHBLTOOOI
=
CAHBLTlI1
;
end
end
else
if
(
CAHBLTIO0
[
0
]
)
begin
if
(
CAHBLTOI0
)
CAHBLTOOOI
=
CAHBLTI00
;
else
begin
CAHBLTIl0
=
CAHBLTO01
;
if
(
CAHBLTlO0
)
CAHBLTOOOI
=
CAHBLTO00
;
else
CAHBLTOOOI
=
CAHBLTll0
;
end
end
else
begin
CAHBLTOOOI
=
CAHBLTO00
;
end
end
CAHBLTll0
:
begin
CAHBLTl11
=
"M0EXTEND"
;
CAHBLTIl0
=
CAHBLTO01
;
if
(
CAHBLTlO0
)
CAHBLTOOOI
=
CAHBLTO00
;
else
CAHBLTOOOI
=
CAHBLTll0
;
end
CAHBLTO10
:
begin
CAHBLTl11
=
"M1EXTEND"
;
CAHBLTIl0
=
CAHBLTI01
;
if
(
CAHBLTlO0
)
CAHBLTOOOI
=
CAHBLTI10
;
else
CAHBLTOOOI
=
CAHBLTO10
;
end
CAHBLTIO1
:
begin
CAHBLTl11
=
"M2EXTEND"
;
CAHBLTIl0
=
CAHBLTl01
;
if
(
CAHBLTlO0
)
CAHBLTOOOI
=
CAHBLTlO1
;
else
CAHBLTOOOI
=
CAHBLTIO1
;
end
CAHBLTlI1
:
begin
CAHBLTl11
=
"M3EXTEND"
;
CAHBLTIl0
=
CAHBLTO11
;
if
(
CAHBLTlO0
)
CAHBLTOOOI
=
CAHBLTOl1
;
else
CAHBLTOOOI
=
CAHBLTlI1
;
end
CAHBLTI00
:
begin
CAHBLTl11
=
"M0LOCK"
;
if
(
CAHBLTOI0
)
if
(
CAHBLTIO0
[
0
]
)
begin
CAHBLTIl0
=
CAHBLTO01
;
if
(
CAHBLTlO0
)
CAHBLTOOOI
=
CAHBLTI00
;
else
CAHBLTOOOI
=
CAHBLTl00
;
end
else
CAHBLTOOOI
=
CAHBLTI00
;
else
CAHBLTOOOI
=
CAHBLTO00
;
end
CAHBLTl00
:
begin
CAHBLTl11
=
"M0LOCKEXTEND"
;
CAHBLTIl0
=
CAHBLTO01
;
if
(
CAHBLTlO0
)
CAHBLTOOOI
=
CAHBLTI00
;
else
CAHBLTOOOI
=
CAHBLTl00
;
end
CAHBLTl10
:
begin
CAHBLTl11
=
"M1LOCK"
;
if
(
CAHBLTII0
)
if
(
CAHBLTIO0
[
1
]
)
begin
CAHBLTIl0
=
CAHBLTI01
;
if
(
CAHBLTlO0
)
CAHBLTOOOI
=
CAHBLTl10
;
else
CAHBLTOOOI
=
CAHBLTOO1
;
end
else
CAHBLTOOOI
=
CAHBLTl10
;
else
CAHBLTOOOI
=
CAHBLTI10
;
end
CAHBLTOO1
:
begin
CAHBLTl11
=
"M1LOCKEXTEND"
;
CAHBLTIl0
=
CAHBLTI01
;
if
(
CAHBLTlO0
)
CAHBLTOOOI
=
CAHBLTl10
;
else
CAHBLTOOOI
=
CAHBLTOO1
;
end
CAHBLTOI1
:
begin
CAHBLTl11
=
"M2LOCK"
;
if
(
CAHBLTlI0
)
if
(
CAHBLTIO0
[
2
]
)
begin
CAHBLTIl0
=
CAHBLTl01
;
if
(
CAHBLTlO0
)
CAHBLTOOOI
=
CAHBLTOI1
;
else
CAHBLTOOOI
=
CAHBLTII1
;
end
else
CAHBLTOOOI
=
CAHBLTOI1
;
else
CAHBLTOOOI
=
CAHBLTlO1
;
end
CAHBLTII1
:
begin
CAHBLTl11
=
"M2LOCKEXTEND"
;
CAHBLTIl0
=
CAHBLTl01
;
if
(
CAHBLTlO0
)
CAHBLTOOOI
=
CAHBLTOI1
;
else
CAHBLTOOOI
=
CAHBLTII1
;
end
CAHBLTIl1
:
begin
CAHBLTl11
=
"M3LOCK"
;
if
(
CAHBLTOl0
)
if
(
CAHBLTIO0
[
3
]
)
begin
CAHBLTIl0
=
CAHBLTO11
;
if
(
CAHBLTlO0
)
CAHBLTOOOI
=
CAHBLTIl1
;
else
CAHBLTOOOI
=
CAHBLTll1
;
end
else
CAHBLTOOOI
=
CAHBLTIl1
;
else
CAHBLTOOOI
=
CAHBLTOl1
;
end
CAHBLTll1
:
begin
CAHBLTl11
=
"M3LOCKEXTEND"
;
CAHBLTIl0
=
CAHBLTO11
;
if
(
CAHBLTlO0
)
CAHBLTOOOI
=
CAHBLTIl1
;
else
CAHBLTOOOI
=
CAHBLTll1
;
end
default
:
CAHBLTOOOI
=
CAHBLTOl1
;
endcase
end
always
@
(
posedge
HCLK
or
negedge
HRESETN
)
begin
if
(
!
HRESETN
)
CAHBLTIOOI
<=
CAHBLTOl1
;
else
CAHBLTIOOI
<=
CAHBLTOOOI
;
end
endmodule
