Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
wr2rf-vme
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
wr2rf-vme
Commits
c538661b
Commit
c538661b
authored
Apr 27, 2020
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vtuCore: move clean_data function, remove unused package.
parent
5cdb9ff5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
88 deletions
+25
-88
vtuCore.vhd
dependencies/vtu/rtl/vtuCore.vhd
+25
-88
No files found.
dependencies/vtu/rtl/vtuCore.vhd
View file @
c538661b
----------------------------------------------------
--
-- Library Name : CTUasVTU
-- Unit Name : ctu_pckg
-- Unit Type : Package
--
------------------------------------------------------
------------------------------------------
------------------------------------------
-- Date : November 14, 2014
--
-- Author : G. Hagmann
--
-- Company : CERN BE-RF-FB
--
-- Description : CTU package
--
-- Changelog : 20161019 (1.1)
-- Modified the reduced or for proper synthesis
--
-- 20150227 (1.0)
-- Initial revision.
------------------------------------------
------------------------------------------
library
ieee
;
use
ieee
.
std_logic_1164
.
all
;
use
ieee
.
numeric_std
.
all
;
package
ctu_Pckg
is
constant
C_FirmwareVersionInt
:
integer
:
=
20170306
;
-- Firmware and Memory Map version codes
constant
C_FirmwareVersion
:
Std_logic_vector
(
31
downto
0
)
:
=
std_logic_vector
(
to_unsigned
(
C_FirmwareVersionInt
,
32
));
-- NVMem data size in 16b words
constant
c_nvMemCalibDataSize
:
Std_logic_vector
(
13
downto
0
)
:
=
"00"
&
X"004"
;
-- 4 words: rfPowerGain, rfPowerOffs, sync1IDelay, driveOutODelay
-- Function or_reduce
function
or_reduce
(
V
:
std_logic_vector
)
return
std_logic
;
-- Function clean_data
function
clean_data
(
V
:
std_logic_vector
(
7
downto
0
)
)
return
std_logic_vector
;
end
;
package
body
ctu_pckg
is
-- Function or_reduce
function
or_reduce
(
V
:
std_logic_vector
)
return
std_logic
is
variable
result
:
std_logic
;
begin
result
:
=
'0'
;
for
i
in
V
'range
loop
result
:
=
result
OR
V
(
i
);
end
loop
;
return
result
;
end
or_reduce
;
-- Function clean_data
-- Combinatorial. Search for the first '1' and removes other '1's.
function
clean_data
(
V
:
std_logic_vector
(
7
downto
0
)
)
return
std_logic_vector
is
begin
if
V
(
7
)
=
'1'
then
return
"10000000"
;
elsif
V
(
6
)
=
'1'
then
return
"01000000"
;
elsif
V
(
5
)
=
'1'
then
return
"00100000"
;
elsif
V
(
4
)
=
'1'
then
return
"00010000"
;
elsif
V
(
3
)
=
'1'
then
return
"00001000"
;
elsif
V
(
2
)
=
'1'
then
return
"00000100"
;
elsif
V
(
1
)
=
'1'
then
return
"00000010"
;
elsif
V
(
0
)
=
'1'
then
return
"00000001"
;
else
return
"00000000"
;
end
if
;
end
clean_data
;
end
;
----------------------------------------------------
----------------------------------------------------
--
--
-- Library Name : CTUasVTU
-- Library Name : CTUasVTU
...
@@ -519,7 +432,6 @@ end;
...
@@ -519,7 +432,6 @@ end;
library
ieee
;
library
ieee
;
use
ieee
.
STD_LOGIC_1164
.
all
;
use
ieee
.
STD_LOGIC_1164
.
all
;
use
ieee
.
NUMERIC_STD
.
all
;
use
ieee
.
NUMERIC_STD
.
all
;
use
work
.
ctu_pckg
.
all
;
entity
vtuDataShifter
is
entity
vtuDataShifter
is
generic
(
N
:
INTEGER
:
=
16
;
generic
(
N
:
INTEGER
:
=
16
;
...
@@ -572,6 +484,31 @@ architecture vtuDataShifter of vtuDataShifter is
...
@@ -572,6 +484,31 @@ architecture vtuDataShifter of vtuDataShifter is
Q
:
out
std_logic
Q
:
out
std_logic
);
);
end
component
;
end
component
;
-- Function clean_data
-- Combinatorial. Search for the first '1' and removes other '1's.
function
clean_data
(
V
:
std_logic_vector
(
7
downto
0
)
)
return
std_logic_vector
is
begin
if
V
(
7
)
=
'1'
then
return
"10000000"
;
elsif
V
(
6
)
=
'1'
then
return
"01000000"
;
elsif
V
(
5
)
=
'1'
then
return
"00100000"
;
elsif
V
(
4
)
=
'1'
then
return
"00010000"
;
elsif
V
(
3
)
=
'1'
then
return
"00001000"
;
elsif
V
(
2
)
=
'1'
then
return
"00000100"
;
elsif
V
(
1
)
=
'1'
then
return
"00000010"
;
elsif
V
(
0
)
=
'1'
then
return
"00000001"
;
else
return
"00000000"
;
end
if
;
end
clean_data
;
begin
begin
-- Detect the sync pulse.
-- Detect the sync pulse.
b_sync_pulse
:
block
b_sync_pulse
:
block
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment