Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
SPEC7
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Projects
SPEC7
Commits
df166074
Commit
df166074
authored
Aug 30, 2022
by
Pascal Bos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed the before-2000 <-> after-2000 bug.
parent
4871ea09
Pipeline
#3921
failed with stage
in 2 minutes and 6 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
wr_irigb_conv.vhd
hdl/top/spec7_ref_design/wr_irigb_conv.vhd
+14
-5
No files found.
hdl/top/spec7_ref_design/wr_irigb_conv.vhd
View file @
df166074
...
...
@@ -282,6 +282,8 @@ date_register : process (clk_i, rst_n_i) is
variable
remaining_days
:
unsigned
(
19
downto
0
);
variable
block_4_years
:
unsigned
(
39
downto
0
);
variable
all_rdy
:
std_logic_vector
(
4
downto
0
);
variable
before_2000
:
boolean
;
variable
years_buffer
:
unsigned
(
39
downto
0
);
begin
if
rst_n_i
=
'0'
then
seconds
<=
(
others
=>
'0'
);
...
...
@@ -292,7 +294,8 @@ begin
sbs
<=
(
others
=>
'0'
);
enable_bcd_conv
<=
'0'
;
remaining_days
:
=
(
others
=>
'0'
);
block_4_years
:
=
(
others
=>
'0'
);
block_4_years
:
=
(
others
=>
'0'
);
before_2000
:
=
false
;
all_rdy
:
=
(
others
=>
'0'
);
elsif
rising_edge
(
clk_i
)
then
if
divider_output_valids
(
0
)
=
'1'
then
--latch seconds
...
...
@@ -311,18 +314,24 @@ begin
remaining_days
:
=
unsigned
(
remainders
(
3
));
block_4_years
:
=
unsigned
(
quotients
(
3
));
if
remaining_days
<
365
then
years
<=
std_logic_vector
((
block_4_years
(
37
downto
0
)
&
"00"
)
-
1
-
30
)
;
years
_buffer
:
=
(
block_4_years
(
37
downto
0
)
&
"00"
)
-
1
;
days
<=
std_logic_vector
(
remaining_days
(
8
downto
0
)
+
1
);
elsif
remaining_days
<
730
then
years
<=
std_logic_vector
((
block_4_years
(
37
downto
0
)
&
"00"
)
+
0
-
30
)
;
years
_buffer
:
=
(
block_4_years
(
37
downto
0
)
&
"00"
)
+
0
;
days
<=
std_logic_vector
(
remaining_days
(
8
downto
0
)
-365
+
1
);
elsif
remaining_days
<
1095
then
years
<=
std_logic_vector
((
block_4_years
(
37
downto
0
)
&
"00"
)
+
1
-
30
)
;
years
_buffer
:
=
(
block_4_years
(
37
downto
0
)
&
"00"
)
+
1
;
days
<=
std_logic_vector
(
remaining_days
(
8
downto
0
)
-730
+
1
);
else
years
<=
std_logic_vector
((
block_4_years
(
37
downto
0
)
&
"00"
)
+
2
-
30
)
;
years
_buffer
:
=
(
block_4_years
(
37
downto
0
)
&
"00"
)
+
2
;
days
<=
std_logic_vector
(
remaining_days
(
8
downto
0
)
-1095
+
1
);
end
if
;
if
block_4_years
<=
7
then
years_buffer
:
=
years_buffer
+
70
;
else
years_buffer
:
=
years_buffer
-
30
;
end
if
;
years
<=
std_logic_vector
(
years_buffer
);
all_rdy
(
3
)
:
=
'1'
;
end
if
;
if
divider_output_valids
(
4
)
=
'1'
then
--latch sbs
...
...
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