Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Platform-independent core collection
Manage
Activity
Members
Labels
Plan
Issues
15
Issue boards
Milestones
Wiki
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
Platform-independent core collection
Commits
4730b4d1
Commit
4730b4d1
authored
6 years ago
by
Tomasz Wlostowski
Committed by
Dimitris Lampridis
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
gc_ds182x_interface: added internal PPS generator
parent
437e40ad
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/common/gc_ds182x_interface.vhd
+38
-10
38 additions, 10 deletions
modules/common/gc_ds182x_interface.vhd
modules/common/gencores_pkg.vhd
+2
-1
2 additions, 1 deletion
modules/common/gencores_pkg.vhd
with
40 additions
and
11 deletions
modules/common/gc_ds182x_interface.vhd
+
38
−
10
View file @
4730b4d1
...
...
@@ -36,7 +36,8 @@ use IEEE.NUMERIC_STD.all;
--=================================================================================================
entity
gc_ds182x_interface
is
generic
(
freq
:
integer
:
=
40
);
-- clk frequency in MHz
(
freq
:
integer
:
=
40
;
-- clk_i frequency in MHz
g_USE_INTERNAL_PPS
:
boolean
:
=
false
);
port
(
clk_i
:
in
std_logic
;
rst_n_i
:
in
std_logic
;
...
...
@@ -98,11 +99,38 @@ architecture rtl of gc_ds182x_interface is
signal
shifted_header
:
std_logic_vector
(
7
downto
0
);
signal
pre_init_p
:
std_logic
;
signal
pps_counter
:
unsigned
(
31
downto
0
);
signal
pps
:
std_logic
;
--=================================================================================================
-- architecture begin
--=================================================================================================
begin
gen_external_pps
:
if
not
g_USE_INTERNAL_PPS
generate
pps
<=
pps_p_i
;
end
generate
gen_external_pps
;
gen_internal_pps
:
if
g_USE_INTERNAL_PPS
generate
p_pps_gen
:
process
(
clk_i
)
begin
if
rising_edge
(
clk_i
)
then
if
rst_n_i
=
'0'
then
pps
<=
'0'
;
pps_counter
<=
(
others
=>
'0'
);
else
if
pps_counter
=
g_CLOCK_FREQ_KHZ
*
1000-1
then
pps
<=
'1'
;
pps_counter
<=
(
others
=>
'0'
);
else
pps
<=
'0'
;
pps_counter
<=
pps_counter
+
1
;
end
if
;
end
if
;
end
if
;
end
process
;
end
generate
gen_internal_pps
;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- Serial data line in tri-state, when not writing data out
onewire_b
<=
serial_id_out
when
i_serial_id_oe
=
'1'
else
'Z'
;
...
...
@@ -112,7 +140,7 @@ begin
pps_p_iDelay
:
process
(
clk_i
)
begin
if
rising_edge
(
clk_i
)
then
pps_p_d
<=
pps
_p_i
;
pps_p_d
<=
pps
;
end
if
;
end
process
;
...
...
@@ -133,48 +161,48 @@ begin
end
process
;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
op_fsm_states
:
process
(
state_op
,
pps
_p_i
,
crc_ok
)
op_fsm_states
:
process
(
state_op
,
pps
,
crc_ok
)
begin
nxt_state_op
<=
READ_ID_OP
;
case
state_op
is
when
READ_ID_OP
=>
if
pps
_p_i
=
'1'
and
crc_ok
=
'1'
then
if
pps
=
'1'
and
crc_ok
=
'1'
then
nxt_state_op
<=
CONV_OP1
;
else
nxt_state_op
<=
state_op
;
end
if
;
when
CONV_OP1
=>
if
pps
_p_i
=
'1'
then
if
pps
=
'1'
then
nxt_state_op
<=
SKIP_ROM_OP1
;
else
nxt_state_op
<=
state_op
;
end
if
;
when
SKIP_ROM_OP1
=>
if
pps
_p_i
=
'1'
then
if
pps
=
'1'
then
nxt_state_op
<=
READ_TEMP_OP
;
else
nxt_state_op
<=
state_op
;
end
if
;
when
READ_TEMP_OP
=>
if
pps
_p_i
=
'1'
then
if
pps
=
'1'
then
nxt_state_op
<=
SKIP_ROM_OP2
;
else
nxt_state_op
<=
state_op
;
end
if
;
when
SKIP_ROM_OP2
=>
if
pps
_p_i
=
'1'
then
if
pps
=
'1'
then
nxt_state_op
<=
CONV_OP2
;
else
nxt_state_op
<=
state_op
;
end
if
;
when
CONV_OP2
=>
if
pps
_p_i
=
'1'
then
if
pps
=
'1'
then
nxt_state_op
<=
SKIP_ROM_OP1
;
else
nxt_state_op
<=
state_op
;
...
...
@@ -184,7 +212,7 @@ begin
end
process
;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
op_fsm_outputs
:
process
(
state_op
,
state_cm
,
crc_ok
,
pps
_p_i
,
cm_only
)
op_fsm_outputs
:
process
(
state_op
,
state_cm
,
crc_ok
,
pps
,
cm_only
)
begin
header
<=
READ_ID_HEADER
;
bit_top
<=
ID_LGTH
;
...
...
This diff is collapsed.
Click to expand it.
modules/common/gencores_pkg.vhd
+
2
−
1
View file @
4730b4d1
...
...
@@ -547,7 +547,8 @@ package gencores_pkg is
------------------------------------------------------------------------------
component
gc_ds182x_interface
is
generic
(
freq
:
integer
:
=
40
);
(
freq
:
integer
:
=
40
;
g_USE_INTERNAL_PPS
:
boolean
:
=
false
);
port
(
clk_i
:
in
std_logic
;
rst_n_i
:
in
std_logic
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment