Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 2cha
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
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
FMC DEL 1ns 2cha
Commits
8f0c84ef
Commit
8f0c84ef
authored
Aug 18, 2016
by
Jan Pospisil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
non-tabifying
parent
475932c2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
45 deletions
+45
-45
DacsController.vhd
hdl/ffpg/rtl/DacsController.vhd
+11
-11
ResetSyncer.vhd
hdl/ffpg/rtl/ResetSyncer.vhd
+34
-34
No files found.
hdl/ffpg/rtl/DacsController.vhd
View file @
8f0c84ef
...
...
@@ -24,17 +24,17 @@ end entity;
architecture
syn
of
DacsController
is
--! computes least possible width of the vector to store value X
-- http://stackoverflow.com/a/12751341/615627
function
log2
(
X
:
positive
)
return
natural
is
variable
Result
:
natural
;
begin
Result
:
=
0
;
while
(
2
**
Result
<
X
)
loop
Result
:
=
Result
+
1
;
end
loop
;
return
Result
;
end
function
;
--! computes least possible width of the vector to store value X
-- http://stackoverflow.com/a/12751341/615627
function
log2
(
X
:
positive
)
return
natural
is
variable
Result
:
natural
;
begin
Result
:
=
0
;
while
(
2
**
Result
<
X
)
loop
Result
:
=
Result
+
1
;
end
loop
;
return
Result
;
end
function
;
function
f_calculateSclkDivsel
(
ClkFrequency
,
DacFrequencyMax
:
positive
)
return
std_logic_vector
is
variable
Result
:
integer
;
...
...
hdl/ffpg/rtl/ResetSyncer.vhd
View file @
8f0c84ef
...
...
@@ -2,40 +2,40 @@ library ieee;
use
ieee
.
std_logic_1164
.
all
;
entity
ResetSyncer
is
generic
(
g_Length
:
integer
:
=
3
;
g_Inverted
:
boolean
:
=
FALSE
);
port
(
Clk_ik
:
in
std_logic
;
Reset_ira
:
in
std_logic
;
Reset_or
:
out
std_logic
);
generic
(
g_Length
:
integer
:
=
3
;
g_Inverted
:
boolean
:
=
FALSE
);
port
(
Clk_ik
:
in
std_logic
;
Reset_ira
:
in
std_logic
;
Reset_or
:
out
std_logic
);
end
entity
;
architecture
syn
of
ResetSyncer
is
function
if_sl
(
condition
:
boolean
;
pos
:
std_logic
;
neg
:
std_logic
)
return
std_logic
is
begin
if
condition
then
return
pos
;
else
return
neg
;
end
if
;
end
function
;
function
if_sl
(
condition
:
boolean
;
pos
:
std_logic
;
neg
:
std_logic
)
return
std_logic
is
begin
if
condition
then
return
pos
;
else
return
neg
;
end
if
;
end
function
;
attribute
ASYNC_REG
:
string
;
attribute
ASYNC_REG
:
string
;
attribute
KEEP
:
string
;
attribute
SHREG_EXTRACT
:
string
;
constant
c_Inversion
:
std_logic
:
=
if_sl
(
g_Inverted
,
'1'
,
'0'
);
constant
c_Inversion
:
std_logic
:
=
if_sl
(
g_Inverted
,
'1'
,
'0'
);
signal
ShiftRegister0
:
std_logic
:
=
(
'1'
xor
c_Inversion
);
signal
ShiftRegister1
:
std_logic
:
=
(
'1'
xor
c_Inversion
);
signal
ShiftRegister2
:
std_logic
:
=
(
'1'
xor
c_Inversion
);
signal
ShiftRegister0
:
std_logic
:
=
(
'1'
xor
c_Inversion
);
signal
ShiftRegister1
:
std_logic
:
=
(
'1'
xor
c_Inversion
);
signal
ShiftRegister2
:
std_logic
:
=
(
'1'
xor
c_Inversion
);
attribute
ASYNC_REG
of
ShiftRegister0
:
signal
is
"true"
;
attribute
ASYNC_REG
of
ShiftRegister1
:
signal
is
"true"
;
attribute
ASYNC_REG
of
ShiftRegister2
:
signal
is
"true"
;
attribute
ASYNC_REG
of
ShiftRegister0
:
signal
is
"true"
;
attribute
ASYNC_REG
of
ShiftRegister1
:
signal
is
"true"
;
attribute
ASYNC_REG
of
ShiftRegister2
:
signal
is
"true"
;
attribute
KEEP
of
ShiftRegister0
:
signal
is
"true"
;
attribute
KEEP
of
ShiftRegister1
:
signal
is
"true"
;
attribute
KEEP
of
ShiftRegister2
:
signal
is
"true"
;
...
...
@@ -45,18 +45,18 @@ architecture syn of ResetSyncer is
begin
pSyncer
:
process
(
Clk_ik
,
Reset_ira
)
begin
if
Reset_ira
=
(
'1'
xor
c_Inversion
)
then
ShiftRegister0
<=
(
'1'
xor
c_Inversion
);
ShiftRegister1
<=
(
'1'
xor
c_Inversion
);
ShiftRegister2
<=
(
'1'
xor
c_Inversion
);
elsif
rising_edge
(
Clk_ik
)
then
pSyncer
:
process
(
Clk_ik
,
Reset_ira
)
begin
if
Reset_ira
=
(
'1'
xor
c_Inversion
)
then
ShiftRegister0
<=
(
'1'
xor
c_Inversion
);
ShiftRegister1
<=
(
'1'
xor
c_Inversion
);
ShiftRegister2
<=
(
'1'
xor
c_Inversion
);
elsif
rising_edge
(
Clk_ik
)
then
ShiftRegister0
<=
(
'0'
xor
c_Inversion
);
ShiftRegister1
<=
ShiftRegister0
;
ShiftRegister2
<=
ShiftRegister1
;
end
if
;
end
process
;
Reset_or
<=
ShiftRegister2
;
end
if
;
end
process
;
Reset_or
<=
ShiftRegister2
;
end
architecture
;
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