// Actel Corporation Proprietary and Confidential
// Copyright 2010 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:
// 10Feb10              Production Release Version 3.1
// SVN Revision Information:
// SVN $Revision: 17372 $
// SVN $Date: 2012-08-03 09:09:54 -0700 (Fri, 03 Aug 2012) $
`timescale 1ns/1ps
module
CAHBLTO
#
(
parameter
[
2
:
0
]
MEMSPACE
=
0
,
parameter
[
0
:
0
]
HADDR_SHG_CFG
=
1
,
parameter
[
15
:
0
]
CAHBLTI
=
0
,
parameter
[
16
:
0
]
CAHBLTl
=
(
2
**
17
)
-
1
)
(
input
[
31
:
0
]
CAHBLTOI,
input
CAHBLTII,
output
wire
[
16
:
0
]
CAHBLTlI,
output
wire
[
31
:
0
]
CAHBLTOl,
output
wire
CAHBLTIl
)
;
localparam
CAHBLTll
=
(
MEMSPACE
==
1
)
?
31
:
(
MEMSPACE
==
2
)
?
27
:
(
MEMSPACE
==
3
)
?
23
:
(
MEMSPACE
==
4
)
?
19
:
(
MEMSPACE
==
5
)
?
15
:
(
MEMSPACE
==
6
)
?
11
:
31
;
localparam
CAHBLTO0
=
16
'b
0000000000000001
;
localparam
CAHBLTI0
=
16
'b
0000000000000010
;
localparam
CAHBLTl0
=
16
'b
0000000000000100
;
localparam
CAHBLTO1
=
16
'b
0000000000001000
;
localparam
CAHBLTI1
=
16
'b
0000000000010000
;
localparam
CAHBLTl1
=
16
'b
0000000000100000
;
localparam
CAHBLTOOI
=
16
'b
0000000001000000
;
localparam
CAHBLTIOI
=
16
'b
0000000010000000
;
localparam
CAHBLTlOI
=
16
'b
0000000100000000
;
localparam
CAHBLTOII
=
16
'b
0000001000000000
;
localparam
CAHBLTIII
=
16
'b
0000010000000000
;
localparam
CAHBLTlII
=
16
'b
0000100000000000
;
localparam
CAHBLTOlI
=
16
'b
0001000000000000
;
localparam
CAHBLTIlI
=
16
'b
0010000000000000
;
localparam
CAHBLTllI
=
16
'b
0100000000000000
;
localparam
CAHBLTO0I
=
16
'b
1000000000000000
;
localparam
CAHBLTI0I
=
16
'b
0000000000000000
;
reg
[
15
:
0
]
CAHBLTl0I
;
reg
[
15
:
0
]
CAHBLTO1I
;
reg
CAHBLTI1I
;
reg
[
31
:
0
]
CAHBLTl1I
;
wire
[
16
:
0
]
CAHBLTOOl
;
wire
[
3
:
0
]
CAHBLTIOl
;
wire
CAHBLTlOl
;
wire
CAHBLTOIl
;
generate
begin
:
CAHBLTIIl
if
(
MEMSPACE
==
0
)
begin
:
CAHBLTlIl
assign
CAHBLTlOl
=
(
CAHBLTOI
[
31
]
==
1
'b
1
)
;
assign
CAHBLTOIl
=
(
CAHBLTOI
[
30
:
20
]
==
11
'h
000
)
;
assign
CAHBLTIOl
=
CAHBLTOI
[
19
:
16
]
;
always
@(*)
begin
CAHBLTl1I
[
31
:
0
]
=
CAHBLTOI
[
31
:
0
]
;
CAHBLTl0I
[
15
:
0
]
=
CAHBLTI0I
;
if
(
CAHBLTlOl
)
begin
CAHBLTI1I
=
1
'b
1
;
if
(
HADDR_SHG_CFG
==
0
)
begin
CAHBLTl1I
[
31
]
=
1
'b
0
;
end
else
begin
CAHBLTl1I
[
31
]
=
1
'b
1
;
end
end
else
if
(
CAHBLTOIl
)
begin
case
(
CAHBLTIOl
)
4
'h
0
:
begin
if
(
CAHBLTII
==
1
'b
0
)
begin
CAHBLTl0I
[
15
:
0
]
=
CAHBLTO0
;
end
else
begin
CAHBLTl1I
[
16
]
=
1
'b
1
;
CAHBLTl0I
[
15
:
0
]
=
CAHBLTI0
;
end
end
4
'h
1
:
begin
if
(
CAHBLTII
==
1
'b
0
)
begin
CAHBLTl0I
[
15
:
0
]
=
CAHBLTI0
;
end
else
begin
CAHBLTl1I
[
16
]
=
1
'b
0
;
CAHBLTl0I
[
15
:
0
]
=
CAHBLTO0
;
end
end
4
'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